Importing bundles on FHIR!

Introduction

As I learn more about the current OpenEMR architecture and attempt to finalize personal work on a simple quick docker setup, I found that it is not possible to push FHIR Bundle resources into OpenEMR.

The Bundle upload endpoint is usually a POST to the root API endpoint. From looking at the current FHIR implementation that would be POST ``http://localhost/apis/default/fhir. I am going to implement as much as I can for my own usage, but I would like to start a general conversation about what a production implementation should look like.

The Benefit of an Import Endpoint

  • Being able to push Bundles to a FHIR endpoint would allow for a standard method to import patient data. How? One of my future work will revolve around building a general purpose import tool based on my prior work on HL7 interfaces. Meaning, eventually, I hope to be able to build a translation layer separate from OpenEMR that can handle direct SQL queries to other stores of patient data and push such data into OpenEMR when migrating future users off legacy systems.
  • Test Data standardization by allowing the autoimport of Synthea datasets into OpenEMR without having to deal with raw test data in SQL format.
  • Meeting full compliance with the FHIR specification. The spirit of FHIR is to make patient records portable and that includes the import and export of patient data. I will be reviewing the FHIR spec to try an be as faithful to the standard as possible.

The Risk of an Import Endpoint

  • The main one I am thinking about is the security risk of opening the POST route on the fhir endpoint. Arbitrary data should not be pushed through. The good news is that I can follow the current implementation for handling authentication in OpenEMR. I will need to look at how services are expected to do the OAuth flow for things such as SMART on FHIR and create an example in my autoimport tool.
  • Other risks???

Conclusion

I am going to be implementing the import facility for the FHIR API internally. However, I would like feedback to build a checklist to adapt this feature for incorporation into upstream OpenEMR. There are a few items you currently allow import of so I could reuse some of those facilities (more research on the codebase pending). What am I missing in terms of patient data import?