-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathInstaller.xml
184 lines (158 loc) · 6.15 KB
/
Installer.xml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="IRIS" version="26" zv="IRIS for Windows (x86-64) 2021.1 (Build 194U)" ts="2021-04-16 18:41:54">
<Class name="Demo.Installer">
<IncludeCode>%occInclude</IncludeCode>
<Super>Demo.InstallerBase</Super>
<TimeChanged>65850,67290.561166</TimeChanged>
<TimeCreated>65430,5608.648608</TimeCreated>
<XData name="Install">
<XMLNamespace>INSTALLER</XMLNamespace>
<Data><![CDATA[
<Manifest>
<Var Name="iscusrPwd" Value="iscdemo" />
<User Username="iscusr" PasswordVar="iscusrPwd" Roles="%All" Enabled="1" />
<!-- Create the HS_Services user here to prevent "Change Password" flag from being turned on -->
<Var Name="HS_ServicesPwd" Value="HS_Services" />
<User Username="HS_Services" PasswordVar="HS_ServicesPwd" Roles="%All" Enabled="1" />
<Namespace Name="FHIRDEMO" Create="yes" Code="FHIRDEMO" Data="FHIRDEMO">
<Log Text="Creating FHIRDEMO Database" Level="0"/>
<Configuration>
<Database Name="FHIRDEMO" Create="yes" Dir="${MGRDIR}/FHIRDEMO" MountAtStartup="1" MountRequired="1" Resource="%DB_FHIRDEMO"/>
</Configuration>
</Namespace>
<Namespace Name="HSLIB" Create="no">
<Log Text="Installing Foundation" Level="0"/>
<Invoke Class="HS.Util.Installer.Foundation" Method = "Install" CheckStatus="true">
<Arg Value="FHIRDEMO"/>
</Invoke>
</Namespace>
<Namespace Name="FHIRDEMO" Create="no" Code="FHIRDEMO" Data="FHIRDEMO">
<Log Text="Import XML Schemas" Level="0"/>
<Invoke Class="EnsLib.EDI.XML.SchemaXSD" Method="Import" CheckStatus="true">
<Arg Value="${ISC_PACKAGE_INSTALLDIR}/mgr/ISCPATIENTtoFHIR.xsd"/>
</Invoke>
<Log Text="Importing FHIRStarter Export" Level="0"/>
<Import File='${ISC_PACKAGE_INSTALLDIR}/mgr/FHIRStarter_Export.xml' Flags="cuk" Recurse="true" />
<!-- Install elements required for FHIR-enabled namespace -->
<Log Text="FHIR Enabling FHIRDEMO namespace" Level="0"/>
<Invoke Class="HS.FHIRServer.Installer" Method="InstallNamespace" CheckStatus="false">
</Invoke>
<!-- Install an instance of a FHIR Service into the current namespace for FHIRSTARTER-->
<Log Text="Installing FHIR Service into FHIRDEMO for FHIRSTARTER" Level="0"/>
<Invoke Class="HS.FHIRServer.Installer" Method="InstallInstance" CheckStatus="false">
<Arg Value="/fhirstarter/r4"/>
<Arg Value="HS.FHIRServer.Storage.Json.InteractionsStrategy"/>
<Arg Value="HL7v40"/>
<Arg Value=""/>
<Arg Value=""/>
<Arg Value="0"/>
</Invoke>
<!-- Install an instance of a FHIR Service into the current namespace for FHIRPLACE-->
<Log Text="Installing FHIR Service into FHIRDEMO for FHIRPLACE" Level="0"/>
<Invoke Class="HS.FHIRServer.Installer" Method="InstallInstance" CheckStatus="false">
<Arg Value="/fhirplace/r4"/>
<Arg Value="HS.FHIRServer.Storage.Json.InteractionsStrategy"/>
<Arg Value="HL7v40"/>
<Arg Value=""/>
<Arg Value=""/>
<Arg Value="0"/>
</Invoke>
<Production Name="FHIRDEMOPKG.FoundationProduction" AutoStart="1" />
</Namespace>
<Namespace Name="%SYS" Create="no">
<!-- Instantiate the Service Registry entry required for FHIRPLACE-->
<Log Text="Initializing Service Registry entry in FHIRDEMO for FHIRPLACE" Level="0"/>
<Invoke Class="Demo.Installer" Method="AddServiceRegistryEntry" CheckStatus="true">
</Invoke>
</Namespace>
</Manifest>
]]></Data>
</XData>
</Class>
<Class name="Demo.InstallerBase">
<Abstract>1</Abstract>
<TimeChanged>65850,59388.478964</TimeChanged>
<TimeCreated>65848,46953.919264</TimeCreated>
<Method name="Setup">
<Description>
This method must always be here</Description>
<Internal>1</Internal>
<ClassMethod>1</ClassMethod>
<CodeMode>objectgenerator</CodeMode>
<FormalSpec><![CDATA[&pVars,pLogLevel:%Integer=0,pInstaller:%Installer.Installer]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[ Quit ##class(%Installer.Manifest).%Generate(%compiledclass, %code, "Install")
]]></Implementation>
</Method>
<Method name="Install">
<Description>
This method is called by a RUN instruction inside your Dockerfile or VM script. It will
use environment variables to further parameterize this Setup.</Description>
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
#dim pVars
#dim tStatus As %Status
#dim tLogLevel As %Integer = 3
Try {
// Initialize any variables we want to pass to the installer
Set pVars("GLOBALBUFFERS") = 4096
Set pVars("ROUTINEBUFFERS") = 512
Set pVars("ISC_PACKAGE_INSTALLDIR") = "/usr/irissys/"
Set tStatus = ..Setup(.pVars,tLogLevel)
DO ##class(HS.SDA3.Container).ExportXMLSchemaAPI("/tmp/HS.SDA3.xsd", 0)
SET tStatus = ##class(EnsLib.EDI.XML.SchemaXSD).Import("/tmp/HS.SDA3.xsd")
}
Catch (oException) {
Set tStatus = oException.AsStatus()
}
/// This terminates this process with a exit value for the operating system so that
/// Docker can know if everything worked fine or not.
If $System.Status.IsError(tStatus)
{
Do $System.Status.DisplayError(tStatus) // Show error message before exiting
Do $zu(4,$j,1) // exit status 1
}
Else
{
Do $zu(4,$j,0) // exit status 0
}
]]></Implementation>
</Method>
<Method name="AddServiceRegistryEntry">
<Description>
This method is called by the Installer Manifest to add a Service Registry entry to the FHIRStarter namespace</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
#dim tStatus As %Status
//Save current namespace and then switch to "FHIRDEMO"
Set tStartingNamespace = $NAMESPACE
Set $NAMESPACE = "FHIRDEMO"
Try {
// Initialize Service Registry Entry
Set tRegEntry = ##Class(HS.Registry.Service.HTTP).%New()
Set tRegEntry.Name = "EMREmulatorFHIRR4"
Set tRegEntry.Type = "HTTP"
Set tRegEntry.Host = "localhost"
Set tRegEntry.Port = $GET(^%SYS("WebServer","Port"))
Set tRegEntry.URL = "/fhirstarter/r4"
Set tRegEntry.HTTPCredentialsConfig = "HS_Services"
Set tStatus = tRegEntry.%Save()
}
Catch (oException) {
Set tStatus = oException.AsStatus()
}
//Switch back to original namespace
Set $NAMESPACE = tStartingNamespace
Quit tStatus
]]></Implementation>
</Method>
<XData name="Install">
<XMLNamespace>INSTALLER</XMLNamespace>
<Data><![CDATA[
<Manifest>
</Manifest>
]]></Data>
</XData>
</Class>
</Export>