Skip to content

Commit

Permalink
Merge pull request #27 from SergeyMi37/master
Browse files Browse the repository at this point in the history
  • Loading branch information
evshvarov authored Feb 27, 2024
2 parents cb79b3e + c1a234a commit 9e06c98
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
22 changes: 18 additions & 4 deletions module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
<Document name="fhir-server.ZPM">
<Module>
<Name>fhir-server</Name>
<Version>1.3.2</Version>
<Version>1.3.3</Version>
<Description>InterSystems FHIR Server with a demo frontend</Description>
<Keywords>FHIR,Server</Keywords>
<Packaging>module</Packaging>
<Default Name="name" Value="FHIRSERVER" />
<Default Name="Webapp" Value="/fhir/r4" />
<Default Name="AddTestData" Value="1" />
<SourcesRoot>src</SourcesRoot>
<Invokes>
<Invoke Class="fhirtemplate.Setup" Method="SetupFHIRServer" Phase="Activate" When="After" ></Invoke>
<Invoke Class="fhirtemplate.Setup" Method="SetupFHIRServer" Phase="Activate" When="After" >
<Arg>${name}</Arg>
<Arg>${Webapp}</Arg>
<Arg>${AddTestData}</Arg>
</Invoke>
</Invokes>
<Resource Name="fhirtemplate.PKG"/>
<Resource Name="User.PKG"/>
Expand All @@ -22,6 +29,13 @@
Recurse="1"
CookiePath="/fhirUI"
/>
</Module>
</Document>
<AfterInstallMessage>
&#13;You can change the default settings
&#13;Name - to alter created/modified namespace (now/default FHIRSERVER)
&#13;AddTestData - import some test data to the FHIR server, otherwise don't
&#13;Webapp - provide the name for the web application to expose R4 API. /fhir/r4 is by default
&#13;USER>zpm "install fhir-server -Dzpm.name=ALTERFHIRSERVER -Dzpm.Webapp=/fhir/r7 -Dzpm.AddTestData=0"
</AfterInstallMessage>
</Module>
</Document>
</Export>
18 changes: 10 additions & 8 deletions src/fhirtemplate/Setup.cls
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Class fhirtemplate.Setup
{

ClassMethod SetupFHIRServer(ns) As %Status
ClassMethod SetupFHIRServer(ns="FHIRSERVER",appKey="/fhir/r4",testLoad=1) As %Status
{
set ns=$g(ns,$namespace)
set ns="FHIRSERVER"
set st=$$$OK
Write !,"=== Initialization with parameters: Namespace: "_ns_", Webapp: "_appKey_", AddTestData: "_testLoad,!
zn "HSLIB"
set namespace=ns
Set appKey = "/fhir/r4"
;Set appKey = "/fhir/r4"
Set strategyClass = "HS.FHIRServer.Storage.Json.InteractionsStrategy"
set metadataPackages = $lb("[email protected]")
Set metadataConfigKey = "HL7v40"
Expand All @@ -32,10 +32,12 @@ ClassMethod SetupFHIRServer(ns) As %Status
set config.DebugMode = 4
do strategy.SaveServiceConfigData(config)

set dir=$System.Util.ManagerDirectory()_"test-data-fhir"
write !," ====== Load test data in "_ns_" from "_dir
set st=##class(HS.FHIRServer.Tools.DataLoader).SubmitResourceFiles(dir, "FHIRServer", appKey)
if 'st write $System.Status.GetErrorText(st)
if testLoad {
set dir=$System.Util.ManagerDirectory()_"test-data-fhir"
write !," ====== Load test data in "_ns_" from "_dir
set st=##class(HS.FHIRServer.Tools.DataLoader).SubmitResourceFiles(dir, "FHIRServer", appKey)
if 'st write $System.Status.GetErrorText(st)
}
quit st
}

Expand Down

0 comments on commit 9e06c98

Please sign in to comment.