generated from intersystems-community/objectscript-docker-template
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from SylvainGuilbaud/sql
sql
- Loading branch information
Showing
5 changed files
with
46 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,10 @@ | ||
zn "USER" | ||
zpm "load /home/irisowner/irisdev/ -v":1:1 | ||
zpm "install fhir-portal" | ||
halt | ||
/// the below is not important anymore. | ||
|
||
zn "HSLIB" | ||
set namespace="FHIRSERVER" | ||
|
||
Set appKey = "/fhir/r4" | ||
Set strategyClass = "HS.FHIRServer.Storage.Json.InteractionsStrategy" | ||
set metadataPackages = $lb("[email protected]") | ||
set importdir="/opt/irisapp/src" | ||
|
||
//Install a Foundation namespace and change to it | ||
//Do ##class(HS.HC.Util.Installer).InstallFoundation(namespace) | ||
Do ##class(HS.Util.Installer.Foundation).Install(namespace) | ||
|
||
zn namespace | ||
|
||
// Install elements that are required for a FHIR-enabled namespace | ||
Do ##class(HS.FHIRServer.Installer).InstallNamespace() | ||
|
||
// Install an instance of a FHIR Service into the current namespace | ||
Do ##class(HS.FHIRServer.Installer).InstallInstance(appKey, strategyClass, metadataPackages) | ||
|
||
// Configure FHIR Service instance to accept unauthenticated requests | ||
set strategy = ##class(HS.FHIRServer.API.InteractionsStrategy).GetStrategyForEndpoint(appKey) | ||
set config = strategy.GetServiceConfigData() | ||
set config.DebugMode = 4 | ||
do strategy.SaveServiceConfigData(config) | ||
|
||
zw ##class(HS.FHIRServer.Tools.DataLoader).SubmitResourceFiles("/opt/irisapp/fhirdata/", "FHIRServer", appKey) | ||
|
||
do $System.OBJ.LoadDir("/opt/irisapp/src","ck",,1) | ||
//zpm "install fhir-portal" | ||
halt | ||
zn "USER" | ||
zpm "load /home/irisowner/irisdev/ -v" | ||
// After FHIRSERVER creation | ||
// need to add User.SQLvar.cls in FHIRSERVER | ||
// in order to be able to run SQL queries | ||
// with JSON functions | ||
zn "FHIRSERVER" | ||
do $System.OBJ.LoadDir("/home/irisowner/irisdev/src/User","ck",,1) | ||
#; zpm "install fhir-portal" | ||
halt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,45 @@ | ||
/* Select all Observation of Patient/1 */ | ||
/* Select all Patients */ | ||
SELECT | ||
* | ||
FROM HSFHIR_X0001_S.Patient; | ||
/* Select all Observation of Patient/4 */ | ||
SELECT | ||
* FROM HSFHIR_X0001_S.Observation | ||
where patient = 'Patient/4'; | ||
/* Select all Observation of Patient/4 with lonic code 718-7 (Hemoglobin [Mass/volume] in Blood)*/ | ||
SELECT | ||
* | ||
FROM HSFHIR_I0001_S.Observation | ||
where patient = 'Patient/1' ; | ||
FROM HSFHIR_X0001_S.Observation | ||
where patient = 'Patient/4' and code [ '718-7'; | ||
|
||
/* Select all Observation of Patient/1 with lonic code 718-7 (Hemoglobin [Mass/volume] in Blood)*/ | ||
/* Get detail of the Observation/81 */ | ||
SELECT | ||
* | ||
FROM HSFHIR_I0001_S.Observation | ||
where patient = 'Patient/1' and code [ '718-7'; | ||
FROM HSFHIR_X0001_R.Rsrc where Key = 'Observation/81'; | ||
|
||
/* Get detail of the observation/16 */ | ||
/* Get valueQuantity of the Observation/81 */ | ||
SELECT | ||
* | ||
FROM HSFHIR_I0001_R.Rsrc where Key = 'Observation/16'; | ||
|
||
/* Get valueQuantity of the observation/16 */ | ||
SELECT | ||
ID, Key, ResourceString, | ||
GetJSON(ResourceString,'valueQuantity') as valueQuantity | ||
FROM HSFHIR_I0001_R.Rsrc where Key = 'Observation/16'; | ||
ID | ||
, Key | ||
, ResourceString | ||
, GetJSON(ResourceString,'valueQuantity') as valueQuantity | ||
FROM HSFHIR_X0001_R.Rsrc where Key = 'Observation/81'; | ||
|
||
/* Get value of valueQuantity of the observation/16 */ | ||
/* Get value of valueQuantity of the Observation/81 */ | ||
SELECT | ||
ID, Key, ResourceString, | ||
GetJSON(ResourceString,'valueQuantity') as valueQuantity, | ||
GetProp(GetJSON(ResourceString,'valueQuantity'),'value') as value | ||
FROM HSFHIR_I0001_R.Rsrc where Key = 'Observation/16'; | ||
ID | ||
, Key | ||
, ResourceString | ||
, GetJSON(ResourceString,'valueQuantity') as valueQuantity | ||
, GetProp(GetJSON(ResourceString,'valueQuantity'),'value') as value | ||
FROM HSFHIR_X0001_R.Rsrc where Key = 'Observation/81'; | ||
|
||
/* An complexe example */ | ||
SELECT | ||
ID, Key, ResourceString, | ||
GetJSON(ResourceString,'code') as code, | ||
GetJSON(GetJSON(ResourceString,'code'),'coding') as coding, | ||
GetAtJSON(GetJSON(GetJSON(ResourceString,'code'),'coding'),0) as coding1, | ||
GetJSON(GetAtJSON(GetJSON(GetJSON(ResourceString,'code'),'coding'),0),'display') as display, | ||
GetProp(GetJSON(GetAtJSON(GetJSON(GetJSON(ResourceString,'code'),'coding'),0),'display'),'display') as value | ||
FROM HSFHIR_I0001_R.Rsrc where Key = 'Observation/16'; | ||
ID, Key, ResourceString | ||
, GetJSON(ResourceString,'code') as code | ||
, GetJSON(GetJSON(ResourceString,'code'),'coding') as coding | ||
, GetAtJSON(GetJSON(GetJSON(ResourceString,'code'),'coding'),0) as coding1 | ||
, GetJSON(GetAtJSON(GetJSON(GetJSON(ResourceString,'code'),'coding'),0),'display') as display | ||
, GetProp(GetJSON(GetAtJSON(GetJSON(GetJSON(ResourceString,'code'),'coding'),0),'display'),'display') as value | ||
FROM HSFHIR_X0001_R.Rsrc where Key = 'Observation/81'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters