This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
How to customize the InterSystems IRIS FHIR Repository - Samples
What's new in this version
Since last Friday we had an issue building with intersystemsdc/irishealth-community:latest. After switching back to intersystemsdc/irishealth-community:2023.2-zpm, the build succeeds again.
I have been told the issue will be fixed in 2024.1, so we have to be patient for a while before we can switch back to latest!
Thanks to Evgeny Shvarov for his help!
Customizing Your InterSystems FHIR Repo Sample
This repository provides sample code that shows how you can customize the InterSystems IRIS for Health FHIR Repository.
It was originally created along with a presentation delivered at InterSystems Global Summit 2023.
Why customize InterSystems IRIS for Health FHIR Repository
The InterSystems IRIS for Health FHIR Repository is a world class FHIR Repository, and in more than 80% of the cases the out-of-the-box capabilities will be sufficient
When you need extra capabilities, it is easy to extend.
hese are a number of examples of why you would customize your InterSystems IRIS for Health FHIR Repository:
You may need to enforce additional constraints, to for example improve data quality
You may want to cleanse or enrich resources before these are stored
You may want to enrich resources before these are returned
You do want to customize your CapabilityStatement to reflect the exact capabilities.
In this repo we have addresses the following use cases:
By default, the InterSystems IRIS for Health FHIR Repository assigns an incrementing sequence number to each resource instance, which is good enough in many cases. We show you how to replace that with a GUID
FHIR uses Identifiers to uniquely identify FHIR Resources. We have implemented code that ensures that the same identifier cannot be reused for another resource instance.
This repo shows various things you can do to enrich resources before these are returned, specifically:
Reference.display is defined as “Plain text narrative that identifies the resource in addition to the resource reference.”. This repo adds some code in which we add a display value for each reference, so that external systems / users get more information about referenced resources without having to read that resource.
Resource.text is defined as “A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it “clinically safe” for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.” We have provided a structure that you can use to dynamically populate Resource.txt using plain Objectscript or Python code, or using a Jinja2 template.
The FHIR specification defines Resource oproperties in a certain order. At the same time json has no defined property order. During development and testing I found it of great help to re-order json proerties as defined in the specification (resourceType, id, meta, text, extension).
In HL7 FHIR, resources use Reference properties to link to other resources. Just like in Relational Databases, it makes sense that a FHIR Repository ensures Referential Integrity for those references. For example, when you create an Observation with a reference to a specific Patient resource, the FHIR Repository should first ensure that this Patient resource exists. Turning this around, it should also not be possible to delete a resource while there are still other resources that depend on it! In this repo, we have implemented:
Referential Integrity for create, update and delete
Processing of logical and conditional references by adding the literal reference.
This repo can be run using docker compose:
After starting, you can access the following URLs: