A Bluetooth oximeter measures oxygen saturation, critical in monitoring newborn babies since low oxygen saturation can be a sign of a congenital heart defect. A smart device using an app called Health@Home can configure a FHIR Observation resource and send it into InterSystems IRIS for Health™ for processing. In this exercise, you will modify an existing FHIR® server to monitor incoming FHIR data from a smart device connected to a Bluetooth oximeter. This exercise simulates the output of this application through a rudimentary front-end application that sends the equivalent FHIR resource.
InterSystems IRIS for Health acts as a decision support tool, sending an HL7 v2 scheduling request to an application to schedule a follow-up appointment to screen for heart defects if the oxygen levels fall beneath a certain level.
The application receiving this request is part of a legacy hospital system that still operates using the HL7 v2.3 messaging protocol, so it cannot receive a FHIR resource directly. Using InterSystems IRIS for Health, you will construct an HL7 v2.3 scheduling message (SIU_S12) and send it on to this scheduling system.
If you would like to view the incoming JSON payload representing the FHIR Observation resource, open test_data.json
. This exercise will only be dealing with a subsection of this message representing the actual value of the observation, which looks like this:
"subject": { "reference": "Patient/example" }, "effectiveDateTime": "2014-12-05T09:30:10+01:00", "valueQuantity": { "value": 95, "unit": "%", "system": "http://unitsofmeasure.org", "code": "%" },
As you can see, the measure of oxygen saturation can be found in the value
attribute of the valueQuantity
field. For the purpose of simplicity, this exercise does not include steps to link an incoming observation resource to a patient record, substituting Patient/example
instead. A real implementation would need to link incoming resources to an existing patient record before it could send a useful message to the scheduling application.
Throughout this exercise, if you would like to see what the finished application looks like, just navigate to Interoperability > List > Productions and open Solution.FoundationProduction
.
For a visual overview of this exercise and more details about the rationale behind the steps, watch this video:
It is recommended that you use the InterSystems IRIS for Health development sandbox for this exercise. However, if you would prefer to do it locally, you can use a preconfigured Docker image by cloning the GitHub repository. Instructions for each path are below.
cd /home/project/shared
git clone https://github.com/intersystems/Samples-FHIR-Oximeter-Devices
cd Samples-FHIR-Oximeter-Devices
do $system.OBJ.Load("/home/project/shared/Samples-FHIR-Oximeter-Devices/Setup.cls","ck")
do ##class(Setup).setUpLearningLab()
. Note that this step will take a while, as it is creating and installing a FHIR server.R4FHIRNAMESPACE
.
git clone https://github.com/intersystems/Samples-FHIR-Oximeter-Devices
cd Samples-FHIR-Oximeter-Devices
docker-compose up -d
http://localhost:52773/csp/sys/UtilHome.csp
.R4FHIRNAMESPACE
.Before implementing FHIR resource processing, we first need to configure the message type of the outgoing HL7 message that will be sent to the downstream scheduling application. This will involve configuring an outbound operation that will send the data.
To_Scheduling
OperationDemo.FoundationProduction
. If you are doing this exercise using a Docker container, you will have to start the production by clicking the Start button; otherwise, the production should already be running.HS.FHIRServer.Interop.Service
receives incoming REST requests and passes them onto Demo.FHIRBPL
, the business process that you will be completing in this exercise. This process passes requests onto HS.FHIRServer.Interop.Operation
, which communicates to the underlying FHIR server and then returns the response message to the upstream components.R4FHIRNAMESPACE
production.To_Scheduling
/home/project/shared/Samples-FHIR-Oximeter-Devices/Out/
It should look like this:
In this section, you will update the existing business process for this production to check oxygen saturation levels. A BPL business process is a graphical tool used in designing decision logic that processes incoming messages in InterSystems IRIS for Health. In this exercise, we have already created a stump BPL that takes in a FHIR request and forwards it onto a FHIR operation for processing. This allows normal REST operations to flow through the production unencumbered.
This BPL has also has implemented some ObjectScript code, the native programming language built into InterSystems IRIS for Health. This code unpacks the FHIR payload from the incoming request and exposes the oxygen saturation value in a locally accessible variable named context.O2Sat.
To_Scheduling
Demo.FHIRBPL
business process by navigating to Home > Interoperability > List > Business Processes > Demo.FHIRBPL and clicking Open. To start, you will add decision logic to this BPL to interpret the value of the oxygen saturation and decide whether or not to send a scheduling request for a follow-up appointment. While keeping the Code
activity selected, add an if
activity (Add Activity > If).Check O2 Levels
and set the Condition field to the following: context.O2Sat && (context.O2Sat < 90)
context.O2Sat
variable is defined. Recall that any FHIR resource with any HTTP method can pass through this production. The code block
activity above filters out irrelevant messages and only sets the context.O2Sat
variable if the FHIR resource type and method are correct.if
activity will also return false
if the oxygen saturation from the incoming FHIR resource is greater than 90%.if
activity automatically comes with a join
activity as well as a true
arrow. The true
arrow leads to the series of activities to perform should the condition field in the if
activity returns true
. While selecting the true
line, add a Transform
activity. Call it Transform to Send
and set Data Transformation Class to Demo.FromFhirObsToSIUS12
, a data transformation built into this exercise. You can explore this data transformation by clicking DTL Editor.context
. In a real application, this source field would likely reference the FHIR resource so that the data transformation could access its properties quickly. However, in this exercise, we are not including this step.context.Schedule
, a local variable, so that we can store the HL7 message before sending it.Transform
activity should look like this:To_Scheduling
operation to send the HL7 message you just created to the hospital’s scheduling system. With the Transform to Send
activity still selected, add a call
activity (Add Activity > Call).To Scheduling Service
.To_Scheduling
, the name of the business operation we created earlier.EnsLib.HL7.Message
, and click Request Builder to open it. The Request Builder closely resembles the data transformation wizard, as both are graphical tools for instantiating and populating message objects using the properties of the local process context.Schedule
field (in the context
section of the Source message) over to the callrequest
field in the Target message. This will set the request message to the value of the context.Schedule
property that you set in the data transformation.if
activity to the triangular join activity to set the path, should the condition in the if
clause be false. This tells the process to do nothing at all before the true
and false
paths converge in the join
activity.
In this step, you will use a rudimentary front-end web application to send observation resources into the production you created. Depending on the oxygen levels recorded in the outgoing message, your service will either send the message to a scheduling service or simply log them in your database.
/shared/Samples-FHIR-Oximeter
. Right-click app.html
and select Open With > Preview.localhost:52773
and clear the Send Over SLL check box./csp/healthshare/fhirnamespace/fhir/r4/Observation
. This is the REST endpoint that receives FHIR Observation resources. A POST request carrying a JSON payload will create a new observation in the FHIR resource repository.To_Scheduling
operation you set earlier will write a file to the /Out
directory when oxygen levels fall below 90%.To give you the best possible experience, this site uses cookies and by continuing to use the site you agree that we can save them on your device.