Publish data from OpenEMR

(Ahsan Alam) #1


I’m fairly new with OpenEMR. I’m trying to build an external integration platform that can ingest data from various sources such as OpenEMR.

I’ve setup an OpenEMR environment already. I’m trying to understand if there is a best practice (or an out-of-box solution) to systematically publish data from OpenEMR. For example, if I want to publish encounter data systematically (without the a user clicking a button), can I configure OpenEMR to do it or do I need to build something custom?

It seems FHIR module allows users to publish data, but not call an endpoint systematically.

Any information would be helpful. My preference would be FHIR; but I’m open.


(Daniel) #2

When you say “publish” do you mean ‘generate a report’. If so, there are native reports that come with OpenEMR and you can also create reports using dataTables so you can print them in PDF or .CSV

(Ahsan Alam) #3

No, it’s not reports. It’s ability to export data depending on some changes. For example, I can export a patient data as soon as the data is changed. The export can be in FHIR, XML or any other format.

I would like to avoid polling the APIs to extract data. I hope it makes sense

(Ralf Lukner MD PhD) #4

So to do this, what you want to do is implement triggers in your MySQL database that stores your patient data.

Here is a tutorial:

This is just part of the MySQL capability. These triggers can do pretty much anything your heart desires in terms of populating a “to be published” table.

Then you will want to implement an export as part of the trigger to get the desired output file from the “to be published” table of data. Specifically, you will want to implement a SELECT … INTO OUTFILE Statement

Here is how you do that:

Of course, there are countless other ways to “publish” the data. OpenEMR has an API that you can enable and use to retrieve data. You can also create many types of connections to the database and its “to be published” table of data that is created from triggers whenever there is an insert, update, etc.


(Ahsan Alam) #5

Thank you Ralf for your input. I suspected MySQL trigger is probably the way to go for me. I will probably use trigger+publishing agent concepts to keep OpenEMR decoupled from my integration layer.

I was trying to see if a publishing module (similar to Atom feed in OpenMRS/Bhamni) is in the roadmap.