Fast Healthcare Interoperability Resources (FHIR) Integration

(Matthew Vita) #31


I agree with your assessment (I’m a full time Java programmer and like the ecosystem :slight_smile: ). I’m just not sure how we’re going to easily distribute Java to our end users (e.g.: how can it be packaged into XAMPP?). If this can be figured out, I believe the OpenEMR PHP controller calling to HAPI would be a wonderful approach for FHIR!

I’m at work, but it looks like there’s a discussion about how to do this here:

The worst case scenario is that we have our end users install one additional program manually. I don’t think this is a bad thing at the end of the day.

Matthew Vita

(Brady Miller) #32

Hi Sena and Matthew,

The nice thing is that these decisions get to be decided by who does the work :slight_smile:
I like Matthews approach of keeping the connector class generic. Then could support HAPI mechanism if that is the route that the folks who do the work choose(and guessing a instruction set on installing/configuring HAPI should suffice). And if a developer decides to build a node.js solution in the future, then could just build it into the connector (note this was what Jerry did on CCDA stuff; rather than the ccda connector using the offsite mirth server, he redirected it to a local node.js instance).


(Matthew Vita) #33


Good thoughts!

I’m happy this conversation has started and whoever picks up the work has an idea to go about it.

Maybe I’ll be able to contribute to this once the cloud project is done!


(Matthew Vita) #34

For anyone interested in participating or watching, I’m working on generating realistic FHIR data from the NAMCS dataset. Once this is done, I am going to create a SMART on FHIR server and a simple API to export the data.

Although I am very focused on the cloud project (which is almost done!), I will be working on this here a few times a week: NAMCS FHIR Solution · Issue #1 · MatthewVita/fake-patient-web · GitHub

EDIT: I should mention that this data can be useful for testing when the OpenEMR FHIR integration project starts (mainly useful for the create and update operations because it has the relationships resolved).


(Matthew Vita) #35

I am certainly learning a LOT about the defacto FHIR viewer from HAPI FHIR. I’m using a Docker solution to run it locally:

Solution is hapi-fhir/hapi-fhir-jpaserver-example at master · jamesagnew/hapi-fhir · GitHub

Next step is to hook it up to a mock data provider…

(Matthew Vita) #36

Just so you all know, this thread/project is linked in the core roadmap:

If you’d like to, you can adjust the top post in the thread to be similar to the other linked projects. This is a great example: Intelligent Chart Summarization


Announcing New OpenEMR Administrators
(Jerry P) #37

Just thought I’d do a fyi here about a HAPI FHIR project i’ve been slowly creating and testing consisting of the following:

  1. Stu3
  2. Mysql
  3. Several Dao’s with entities.(too lazy to list)
    There are many resources out there that building up a solution is more project management than coding. This points out how well the HAPI FHIR is done.
    I had original intention to populate resources from live clinical data(seems so logical) but have since been reconsidering to maintaining server repository as separate mysql database with the user publishing from OpenEMR. With the ability to read/write to server database from OpenEMR it would be natural to create some php classes for handling data that is authorized to be public on the server. Could be as simple as a publish button in demographics where select items to be published would be written out to server database.
    Though I am a rusty Java developer and am far more comfortable in node/web apps, I think it would be a disservice to support any way other than the Java solution for many reason i’m sure most of you already know. The more I work with HAPI FHIR the more convinced I am it will be the fastest and easiest way to get going with FHIR.

Soon I hope to publish a project core somewhere(prob OpenEMR repositories) once I trim the unnecessary and thin down to something closer to production server. The way HAPI has been developed where possible configurations are many the real challenge is not hitting endpoints but getting to the EMR data. So far the database now totals around 40-50 tables.

(Matthew Vita) #38

Awesome! Thanks for the update

(Jerry P) #39

Well, i’ve spent many hour looking at all the various ways to implement. I have been able to set up several Java based production servers of HAPI JPA and SMART on FHIR. I’ve also developed/tested a Nodejs server with oauth2 and a couple profiles to companion with my ccda-server and I finally have convinced myself that a server to support OpenEMR is not a hindrance and just comes down to how we want to integrate to our work flows.

So I have begun to developed a Php solution with the idea that provider/user have a dashboard to manage FHIR. First phase is this PR: Phase 1 FHIR on PHP- Provider Client and implement classes. by sjpadgett · Pull Request #1422 · openemr/openemr · GitHub
All the necessary Stu3 schema are implemented by generated classes which I wrapper into classes for creation and parsing server resource responses with a companion class for collecting OpenEMR live data. A needed HTTP client class to speak to our/public server is included. Also, A good start of a dashboard app with a client controller class in integrated into demographics in this initial P.R.

Certainly need to get feedback on this start and please jump in and maybe pick up one or two resources to add to the resource class. Really, I see the development of the dashboard driving resource capabilities needed. I’m starting to get an oauth integrated but if someone were to develop a search method to search various FHIR servers and compile to serve up to dashboard then that would be a backbone issue gone.

I’m eager to get some help and feedback to continue on or not.

(R Magauran) #40

I am a true noobie and I am just beginning to get clarity re: FHIR and oauth2. It looks like it will be the direction MedEx heads towards also. If the community finds MedEx useful, it will be a nice way to fuel FHIR/oath2 development. Am I wrong to think that FHIR will really be a requirement to ensure openEMR can coexist in the future ecosystem of interconnected EHRs? If that’s true, how could FHIR development not be important?

(Brady Miller) #41

Yes, this update is huge news!

After I get medex integration work completed, plan to dive in and help @sjpadgett on this. And would be great to get other folks to help on this.

I added a up for grabs demo to @sjpadgett’s PR (you can see the link to it on the PR).

(Jerry P) #42

I am wondering if maybe this should be integrated with the Care Coordination Module instead of having a new/separate manager for publishing and importing FHIR resources. Do we have any idea how much the CCM is used in our install base?

(Brady Miller) #43

@sjpadgett , I think the use is pretty minimal and only in cases of MU certification. Would avoid the CCM if possible. If needed, could always build in a hook to it after things are more worked out.

(Jerry P) #44

Question: Should we auto update FHIR server from chart updates say new/edit encounter, medication, procedures save also sends to server if FHIR is turned on and patient has given permissions?

(Brady Miller) #45

I think this would be a neat feature to support and would make it a global option (in case, for example, the instance does not always have access to internet).
For this and other FHIR pushes (and pulls in future), would also work into openemr log via the newEvent() function (and in that can enter whether is was a success or failure; for example, if the auto push above did not work)

(Brady Miller) #46

@sjpadgett just brought in some more nice code on this here (nice examples of adding resources):

@sjpadgett, is there a list of required resources that we need to shoot for? If so, would be good to get a list going here, so others can chip in and join in on the FHIR bonanza :smile:

edit: per a prior message from Jerry, looks like a listing of resources are here:


(Jerry P) #47

Thanks @brady.miller, Here are some thoughts.

I suppose the easiest is to take a look at a public test server to see what others are testing. You can go here:

My goal is to get most of the informative resources that would cover our basic chart that is of use to patient or other providers. Medication Statement, Observation and Condition comes to mind(Patient, Encounters and Practitioner are mostly done). Remember when working a resource, end points to other resource may be required with that resource required to be already on the server, otherwise server will reject.

I’m thinking that support resources such as Organization, Practitioner and Location be auto created/updated from the dashboard to support other Profiles.(I’ve got this)

Another concern is coding systems( coding systems are closely tied to FHIR). We generally don’t record snomed that I can tell(I think even loading codes is optional) along with our encounter form is in need of updating to better support FHIR and Institutional with making it not so closely tied to billing for encounter status and disposition.

Once we have a working set of profiles and resources, we know how to set the conformance and capability statements for our implemented server.(I think we can also do that with the Dashboard provider client.).

I think we have a good start with a REST and HTTP class for clients, resource class and client endpoint class and i’m working on a library for auto sending resources from OpenEMR scripts such as appointments, encounters e.t.c, yet much too do.

(Jerry P) #48

My main initial goal for a provider client is to populate server with a close eye towards a capability for a provider report on a patient compiled from searches of other FHIR servers. Besides patient access, I believe this is a major goal of FHIR.

Question: Has anyone researched this capability who could enlighten us? If not, maybe somebody could take it on. I can do the search part but I have not had time to research the infrastructure of how this type of action takes place i.e how to get the registered server to search and more important, how is authorization for access handled. Does patient have to provide their access or is there some sort of provider access scheme? Unknowing minds want to know!

(Brady Miller) #49


Not sure how helpful this will be to us, but been learning about HAPI FHIR and how to set up server etc. Nicely, there is a HAPI FHIR docker. Here’s a docker-compose.yml script that I used to bring in HAPI FHIR, openemr(5.0.1), mysql, and phpmyadmin on a cloud instance (trying out google cloud so did this on a ubuntu instance there with just docker installed):

# admin/pass are default user/password credentials for openemr
# openemr is default mysql database
# openemr/openemr are default user/password credentials for mysql openemr database
version: '2.0'
    restart: always
    image: mysql
    command: ['mysqld','--character-set-server=utf8']
    restart: always
    image: bradymiller/hapi-fhir-jpaserver-example
    - 8080:8080
    restart: always
    image: openemr/openemr
    - 80:80
    - 443:443
      MYSQL_HOST: mysql
      MYSQL_ROOT_PASS: root
      MYSQL_USER: openemr
      MYSQL_PASS: openemr
      OE_USER: admin
      OE_PASS: pass
    - mysql
    - hapi-fhir
    restart: always
    image: phpmyadmin/phpmyadmin
    - 81:80
      PMA_HOST: mysql
    - mysql

Just to demonstrate that it works(already ‘published’ one patient from OpenEMR to HAPI FHIR), I’ll leave it up on the google cloud instance for awhile:
OpenEMR is at (admin/pass credentials)

And if just need a HAPI docker going locally without openemr and other stuff, then following docker-compose.yml script would suffice:

version: '2.0'
    restart: always
    image: bradymiller/hapi-fhir-jpaserver-example
    - 8080:8080

Note the hapi-fhir-jpaserver-example image is from my dockerhub (there appears to be no already built docker, so I built it and posted it to make it easier to use (and will plan to update it to most recent version every once in awhile)).


(Jerry P) #50

Tho docker has an environment setup for mysql but I believe you also need to config the jpa app config for mysql because default is derby. Check your mysql for the tables(about 20).