Skip to content

Commit 4ad0651

Browse files
authored
Merge pull request #35 from ecotterr/master
Allow JsonAdvSql configuration to be made during ZPM install
2 parents a788fcd + 27e2e0f commit 4ad0651

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

module.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
<Default Name="name" Value="FHIRSERVER" />
1212
<Default Name="Webapp" Value="/fhir/r4" />
1313
<Default Name="AddTestData" Value="1" />
14+
<Default Name="InteractionsStrategy" Value="Json" />
1415
<SourcesRoot>src</SourcesRoot>
1516
<Invokes>
1617
<Invoke Class="fhirtemplate.Setup" Method="SetupFHIRServer" Phase="Activate" When="After" >
1718
<Arg>${name}</Arg>
1819
<Arg>${Webapp}</Arg>
1920
<Arg>${AddTestData}</Arg>
21+
<Arg>${InteractionsStrategy}</Arg>
2022
</Invoke>
2123
</Invokes>
2224
<Resource Name="fhirtemplate.PKG"/>
@@ -36,7 +38,8 @@
3638
&#13;Name - to alter created/modified namespace (now/default FHIRSERVER)
3739
&#13;AddTestData - import some test data to the FHIR server, otherwise don't
3840
&#13;Webapp - provide the name for the web application to expose R4 API. /fhir/r4 is by default
39-
&#13;USER>zpm "install fhir-server -Dzpm.name=ALTERFHIRSERVER -Dzpm.Webapp=/fhir/r7 -Dzpm.AddTestData=0"
41+
&#13;InteractionsStrategy - defines the FHIR Search and Operations available. JsonAdvSql is more performant and offers more search parameters, operations, and OAuth scope support.
42+
&#13;USER>zpm "install fhir-server -Dzpm.name=ALTERFHIRSERVER -Dzpm.InteractionsStrategy=JsonAdvSql -Dzpm.Webapp=/fhir/r7 -Dzpm.AddTestData=0"
4043
</AfterInstallMessage>
4144
</Module>
4245
</Document>

src/FHIR/utils.cls

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
Class FHIR.utils
22
{
33

4-
ClassMethod install(NAMESPACE As %String = "FHIRDEMO") As %Status
4+
ClassMethod install(NAMESPACE As %String = "FHIRDEMO", interactionsStrategy As %String(VALUELIST=",Json,JsonAdvSql") = "Json") As %Status
55
{
66
set sc = $$$OK
77
set ns = $NAMESPACE
88
zn "HSLIB"
99
Set appKey = "/"_$zcvt(NAMESPACE,"l")_"/fhir/r4"
10-
Set strategyClass = "HS.FHIRServer.Storage.Json.InteractionsStrategy"
10+
if interactionsStrategy = "Json" {
11+
set strategyClass = "HS.FHIRServer.Storage.Json.InteractionsStrategy"
12+
} elseif interactionsStrategy = "JsonAdvSql" {
13+
set strategyClass = "HS.FHIRServer.Storage.JsonAdvSQL.InteractionsStrategy"
14+
}
1115
Set metadataConfigKey = "HL7v40"
1216

1317
//Install a Foundation namespace and change to it

src/fhirtemplate/Setup.cls

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
Class fhirtemplate.Setup
22
{
33

4-
ClassMethod SetupFHIRServer(ns="FHIRSERVER",appKey="/fhir/r4",testLoad=1) As %Status
4+
ClassMethod SetupFHIRServer(ns = "FHIRSERVER", appKey = "/fhir/r4", testLoad = 1, interactionsStrategy As %String(VALUELIST=",Json,JsonAdvSql") = "Json") As %Status
55
{
66
set st=$$$OK
77
Write !,"=== Initialization with parameters: Namespace: "_ns_", Webapp: "_appKey_", AddTestData: "_testLoad,!
88
zn "HSLIB"
99
set namespace=ns
1010
;Set appKey = "/fhir/r4"
11-
Set strategyClass = "HS.FHIRServer.Storage.Json.InteractionsStrategy"
11+
if interactionsStrategy = "Json" {
12+
set strategyClass = "HS.FHIRServer.Storage.Json.InteractionsStrategy"
13+
} elseif interactionsStrategy = "JsonAdvSql" {
14+
set strategyClass = "HS.FHIRServer.Storage.JsonAdvSQL.InteractionsStrategy"
15+
}
1216
set metadataPackages = $lb("[email protected]")
1317
Set metadataConfigKey = "HL7v40"
1418
;set importdir="/opt/irisapp/src"
@@ -46,7 +50,7 @@ ClassMethod LoadPatientData(path, namespace, appKey) As %Status
4650
quit ##class(HS.FHIRServer.Tools.DataLoader).SubmitResourceFiles(path, namespace, appKey)
4751
}
4852

49-
ClassMethod AddApp(ns={$namespace}) As %Status
53+
ClassMethod AddApp(ns = {$namespace}) As %Status
5054
{
5155
set namespace=ns
5256
zn "%SYS"

0 commit comments

Comments
 (0)