Real Time FHIR® to OMOP Transformation
This part of the OMOP Journey, we reflect before attempting to challenge Scylla on how fortunate we are that InterSystems OMOP transform is built on the Bulk FHIR Export as the source payload. This opens up hands off interoperability with the InterSystems OMOP transform across several FHIR® vendors, this time with the Google Cloud Healthcare API.
Google Cloud Healthcare API FHIR® Export
GCP FHIR® Datastores support bulk fhir import/export from the cli or api, the premise is simple and the docs are over exhaustive, we'll save a model the trouble of training on it again and link it if interested. The more valuable thing to understand of the heading of this paragraph is the implementation of the bulk fhir export standard itself.
Important differentiators with Google's implementation of the FHIR® Export are namely, Resource Change Notification via Pub/Sub and the ability to specify incremental exports.
Real Time? ⏲
Yes! Ill die on this sword I guess. Its not only my rap handle, but the mechanics are definitely there to back a good technical argument to be able to say...
"As a new Organization gets created to FHIR, we transform it, and add it to the InterSystems OMOP CDM in the same stroke as a care_site/location."
Walkthrough
Trying to make this short and to the point and encapsulates how a pub/sub notification coupled with a cloud function can glue these two solutions together and automate your OMOP ingestion at a granular level.
Step One: Wire Up InterSystems OMOP to AWS Bucket
This step is becoming a repetitive in posts in this community, so I will go warp speed through the steps.
- Procure AWS S3 Bucket
- Launch InterSystems OMOP, Add Bucket Configuration
- Eject Policy from InterSystems OMOP Deployment
- Apply Policy to the AWS S3 Bucket
I dunno, the steps and image seemed to work out better in my head, but maybe not. Here are the docs and here is a more in depth way to get this taken care of in this series with better examples.
Step Two: Add Pub/Sub Target in Google Cloud Healthcare API
As mentioned previous, a foundational piece to making this work is the super great feature that notifies on Resource changes in the data store. You will find this option on setup in the dialog and is also available post configuration. I typically like to check both options to have as much data in the notification as possible to play with. For instance with Deletes, you can include the deleted resource in the notification as well, really great for EMPI solutions.
Step Three: Cloud Function ⭐
The cloud function puts in the work, and the SOW for that looks a little bit like this.
Listen for FHIR resource change pub/sub notifications of type Organization on the create method, and export the data store incrementally from the time the event fired. Since the export function only supports a GCS target, read in the created export and create fhir export zip file that zips the ndjson files into the root of the zip file and push the created zip file to an aws bucket.
Re-stating the second feature that makes this especially great, is the ability to export from an specific date and time, meaning we do not need to export the entire dataset. For this we will use the time we received the event, tack a minute or so on it, in hopes the export, import and transform steps will be smaller and of course, more timely.
Step Four: What is Happening right now? 🔥
To split what is going on, lets inspect the real time processing with some screenshots at each point.
FHIR Organization Created
Pub/Sub Event is Published
Cloud Function Receives Resource Event from Subscription
Cloud Function Exports the FHIR Store GCS
Cloud Function Creates ZIP from GCS and Pushes to AWS
InterSystems OMOP Transforms FHIR to OMOP
Organization Available as Care Site in CDM
When did that FHIR Resource get transformed to the CDM ?
Step Four: Validation Fun ✔
Fun with OBS and Not so Much fun with Audio
In Conclusion
Did something similar last year at MIT Grand Hack, using the same design pattern, but with Questionairre/Response resource and Gemini in the middle of things.
Gemini FHIR Agent MIT Grand Hack