Public/Get-SfConfig.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<#
    .SYNOPSIS
    Queries salesforce for configuration from the ecc_Settings_Public__c object.

    .DESCRIPTION
    Used to get the FHIR URL configured for the Salesforce org

    .INPUTS
    None. You cannot pipe objects to Get-SfConfig.

    .OUTPUTS
    A PSCustomObject that contains all the settings from the phecc__ecc_Settings_Public__c custom settings

    .EXAMPLE
    PS> (Get-SfConfig).phecc__FHIRURL__c

    .LINK
    Set-Config

    .NOTES
    Assumes config is initialized for org access.
#>

function Get-SfConfig {

    [CmdletBinding()]
    [OutputType([PSCustomObject])]
    param()

    begin {
        Write-Verbose "[$($MyInvocation.MyCommand.Name)] Function started"
    }

    end {
        Write-Verbose "[$($MyInvocation.MyCommand.Name)] Complete"
    }

    process {
        Write-Debug "[$($MyInvocation.MyCommand.Name)] PSBoundParameters: $($PSBoundParameters | Out-String)"
        Invoke-SfQuery "SELECT Id,phecc__FHIRURL__c,phecc__FHIR_Tenant__c,phecc__HSDP_eCC_Group_Id__c,phecc__HSDP_IDM_URL__c,phecc__HSDP_Logout_URL__c,phecc__HSDP_Managing_Org_Id__c,phecc__HSDP_Observation_Named_Credential__c,phecc__HSDP_Page_Size__c,phecc__Initial_Patient_Batch_Size__c,phecc__Installation_Status__c,phecc__isClinicalContentOrg__c,phecc__isObservationOutboundEnabled__c,phecc__isPatientEncounterInboundEnabled__c,phecc__isProduction__c,phecc__isSSOEnabled__c,phecc__Organization_Id__c,phecc__Organization_Name__c,phecc__PASSWORD_MGMT_URL__c FROM phecc__ecc_Settings_Public__c"
    }
}