This demo shows how incoming messages of different formats (HL7, XML, or CDA) can be transformed into SDA and ultimately sent out via a FHIR® server Interop operation.
DockerFile
— script for building a Docker containerInstaller.xml
— installer manifest for setting up an IRIS instanceFHIRStarter_Export.xml
— all the classes required for an FHIRStarter productionISCPATIENTtoFHIR.xml
— schema for an XML file
ISC/ISCPATIENTtoFHIR.xml
— sample XML fileISC/EpicCCDA21toFHIR.xml
— sample CDA fileISC/HL7toFHIR.HL7
— sample HL7 fileISC/PatientsCSVtoFHIR.csv
— sample CSV fileISC/In
— folder for dropping test filesREADME.md
— instructions to set up the code sample
-
Clone this repository:
git clone
. -
Open the Terminal or command prompt window and change the directory to
FHIRStarterDemo
. -
Execute the Docker Build command by running the following command. Note that the period at the end is required.
docker build -t irishealth-fhirstarter-demo:1.0 .
-
Execute the Docker Run command by running the following:
docker run -d --hostname FHIRStarter -p 52773:52773 --init -v $PWD/ISC:/tmp/ISC --name FHIRStarter irishealth-fhirstarter-demo:1.0
-
Clone the repository into your mgr and rename the folder to 'fhir-starter-demo'
-
Start your IRISHealth instance and compile the InstallerBase.cls and Installer.cls under src/cls/Demo
-
Open IRISHealth terminal and run these commands
- do ##class(%SYSTEM.OBJ).load("PATH/Installer.xml")
- do ##class(Demo.Installer).Install()
-
Compile the FoundationPRoduction under src/cls/FHIRDEMOPKG
-
Open management portal, change the namespace to FHIRDEMO, and go to productions to check if all the services are there
- If at any point somethings goes wrong and you're getting an error where file already exist, go to configuration --> Local Databases --> Delete FHIRDEMO --> Tick both boxes
- If you need to change the webserver port to avoid port conflict, the argument format is NEWPORT:CURRENTPORT. For example, to switch to port 51773, you would set the parameter to 51773:52733.
- The hostname flag sets the server name of the container instance to FHIRStarter, which matches how the FHIR components are installed. If you change this to something else, you will need to adjust it per the Post Installation Notes, specifically #1.
- The production makes use of file drops, so you must map a folder to the Docker container. For this example, the path to the container folder is
$PWD/ISC
.
To verify you have installed succesfully:
-
Open the Management Portal, using SuperUser for username and SYS for password. Open the FHIRStarter production and check that all components are active and that none of them have errors.
-
Check the file path referenced in the file services within the FHIRStarter production.
- Go to Interoperability > Configure > System Default Settings.
- Edit the Inbound file service path if needed.
- Click the System Default Setting FilePath, and confirm the Setting Value is the drive you mounted during the
Docker Run
execution. - Make sure to click Save once you have made your changes.
-
Make sure all folders and sub-folders you have mapped to the Docker container have the correct read and write privileges set; otherwise, the file adapters will not be able to delete your test files after processing them.
Take a look at the FHIRStarter
sample, which contains the following files:
ISC/ISCPATIENTtoFHIR.xml
— sample XML fileISC/EpicCCDA21toFHIR.xml
— sample CDA fileISC/HL7toFHIR.HL7
— sample HL7 file to be converted into FHIRISC/PatientsCSVtoFHIR.csv
— sample CSV file
Drop one sample file into the mapped folder and see that it is picked up and processed. Navigate to Interoperability > View > Message. If it works, you should receive a successful FHIR response in the message trace.
Note that the PatientsCSVtoFHIR
sample file has 200 patients to convert into FHIR resources. This can take up to 60 seconds depending on the system resources available to the demonstration instance.
Look at FHIRPlace sample, which contains the following files:
ISC/HL7toFHIR.HL7
— sample HL7 file to be converted into FHIRISC/HL7v2_ORU_R01.hl7
— sample HL7 fileISC/MRNFlatFile.txt
— sample flat file with single MRN
To test it:
- Drop
HL7toFHIR.HL7
into the input folder to add a FHIR resource to the EMREmulatorFHIRR4 FHIR endpoint. The Service Registry entryEMREmulatorFHIRR4
points to the/fhirstarter/r4
FHIR endpoint. If you have already droppedHL7toFHIR.HL7
into the input folder for the FHIRStarter demonstration, skip this step. - Drop either
HL7v2_ORU_R01.hl7
orMRNFlatFile.txt
into the input folder to trigger the external FHIR data collection based on a patient MRN.
The .hl7 message includes an MRN value in the list of patient identifiers that gets extracted by theHL7v2.MRNExtractor
. The .txt file is picked up by a simple Record Map definition in the demonstration. Both of these MRN input values are handed off to the PatientRecordCollector BPL.
The PatientRecordCollector BPL supports multi-step orchestration. To see how it works, complete the following steps:
- Delete any existing resources in the local
/fhirplace/r4
endpoint for the MRN from the input file. This assures there is no accidental duplication of data inside the FHIR repository. - Call out to an external FHIR endpoint labeled
EMREmulatorFHIRR4
. In this demonstration, that Service Registry points to the FHIRStarter endpoint/fhirstarter/r4
. There are two calls to this endpoint:
- First, ask the endpoint, "Do you have a patient that matches the input MRN?".
- If a patient is found, the second call is a
GET $everything
against the FHIR Patient resource. This returns a searchset bundle that needs to be flipped to be saved into the InterSystems IRIS for Health™ FHIR Repository.
- Send the 'searchset' bundle to the BundleFlip BPL. This component makes two major changes to the bundle.
- Change the type of bundle from searchset to transaction and update the necessary subfields to reflect this change.
- Change all the URL references to resources from
/<RESOURCE>/<ID>
to UUID values. Note that the/<RESOURCE>/<ID>
values in the bundle will reflect the external endpoint resource IDs and need to be replaced in InterSystems IRIS for Health 2020.4 and earlier. Changing these references to UUIDs ensures that the InterSystems IRIS for Health FHIR code maintains the bundle's integrity when it is submitted to the local FHIR endpoint.
- Submit the bundle to the local FHIR endpoint,
/fhirplace/r4
.
After you are done with this sample, you can enter the following commands to stop any containers that may still be running and remove them:
docker-compose stop
docker-compose rm
This is particularly helpful if you have other demos running on the same machine.
You can also watch the Converting Legacy Data to HL7 FHIR R4 in InterSystems IRIS for Health video to see this demo in action and learn more about this functionality.