FHIR2 Release 1.2.0

Today the FHIR Squad has (finally) released version 1.2.0 of the FHIR2 module. This is the culmination of quite a bit of work since our last release in October 2020. We’ve had 77 commits from 15 contributors.

New Features:

  • Added support for Immunization Resource, stored in the Obs table using CIEL’s Immunization History (1421) structure. Note that Immunization is currently supported in R4 only.
  • Numerous enhancements and enrichments for the data models for orders (ServiceRequest / MedicationRequest)
  • Support for creating Encounter and Visits via the FHIR API
  • Support for setting the system field for OMRS identifiers
  • Support for PostgreSQL
  • Initial support for custom ResourceProviders defined in modules outside the FHIR module


  • FHIR module will now continue to work as modules are loaded or removed from the EHR

Thank you very much to @mksd, @iamsr, @dkayiwa, @mozzy, @theanandankit, @corneliouzbett, @pmanko, @medhavi, and @dedrickt as well as to the rest of the FHIR Squad!


Congratulations to the entire team.

Great news and thanks @ibacher for leading this super important work :+1:

Thanks @ibacher and team! This is so cool! :slight_smile:

That’s great @ibacher !!

I hope you saw my Wiki edits to correct the FHIR Resource Mapping URLs to include [/R3 or /R4] and make reference to FHIR Release number page that you recommended. I logged in today to ask you about the status of some of the Resource’s support, as the mapping documentation is a mix of FHIR and FHIR2 module releases. I was going to ask about Immunization - and saw your release message… thanks!

I hope I can include your new OMOD into the Reference Application that we have installed.


@keithduddy Thanks! I’ve got to make some updates to the Wiki too for this. Please let me know if you run into any issues getting this working in your version of the RefApp!

Slight addendum, I’ve released 1.2.1 to cover an issue identified by @moshon.

1 Like

Will do, @ibacher. We have some work time sheduled on our OpenMRS install and FHIR interop in the next week or two.

I might have been looking in (and editing) the wrong pages: (Mapped FHIR Resources - Projects - OpenMRS Wiki), as I don’t see Immunization or Visit added to the list. Is this still work in progress?

Also, I noted that according to the Wiki individual resource mapping pages: MedicationRequest Resource - Projects - OpenMRS Wiki and MedicationStatement Resource - Projects - OpenMRS Wiki are only supported by the old FHIR Module, even though you mention enhancements to MedicationRequest in your release notes.

A Wiki search reveals your recent page update here (which I assume reflects the releases you mention in this thread): OpenMRS FHIR Module - Projects - OpenMRS Wiki, but the pages about individual Resource Mappings I mention above have not been updated to reflect your new work. Perhaps these pages should be either removed, or updated, as I was trying to use them as a definitive list and set of mapping instructions, and they are neither complete (e.g. Immunization, and Visit) or up to date (e.g. MedicationRequest as mentioned above).

I’d like to help by synchronising your summary of all resources mapped with the individual Resource Mapping pages, however, I’m not in a position to provide example JSON resources or the mapping tables from OpenMRS Data Model Elements and FHIR Resource Elements that appear on pages like Person Resource - Projects - OpenMRS Wiki

Can you suggest a way forward that helps people find the most up-to-date FHIR resource request and/or mapping details in the Wiki. I think I have identified the right page above, but was lead down a bit of a rabbit hole by reading the individual mapping pages, which are out of date.

cheers, Keith

Hi again @ibacher and @dkayiwa,

I have been floundering a bit with our previous install of OpenMRS, even to get the new UI not to crash, given that we did some ignorant configuration before installing all the modules.

I’m living in a modelling and architecture world these days, and my Java/WebApp skills are very rusty, so hopelly my implementation partner @herbertsural will have more success. He is trying to get a new install going using the Standalone version, so that we can get everything consistent again, and then we’ll re-try FHIR invocations with the 1.2.0 version module, hopefully with more success, or useful bug reports, rather than just more questions…

Thanks for all your help so far! Keith and Herbert

You are new to the community but already contributing. So, thank you so much! :slight_smile:

Yes, it’s still a work in progress. I primarily update the landing page (https://om.rs/fhir); the mapping pages, unfortunately, I haven’t kept as up-to-date.

Questions are also useful. In the past, I’ve tried to turn questions I see frequently into documentation opportunities. For example, I haven’t prioritised the mapping pages because I wasn’t sure anyone was using them or found them useful, but now that I know someone does, I’ll actually make an effort to ensure they are up-to-date.

So, please keep the questions, bug reports, and success stories (if any) coming.

1 Like

One thing worth mentioning that the APIs supported by the FHIR module are documented in the FHIR Capability statement, which can be found at https://qa-refapp.openmrs.org/openmrs/ws/fhir2/R4/metadata?_format=json (or on a similar URL for a local install). Of course, these don’t explain how they correlate to the OpenMRS data model.

OK Cool. Thanks Ian. I can see your edits coming through on some of mapping pages now!


In the process of releasing FHIR2 version 1.2.2, which is mostly a minor tweak to address FM2-421. However, 1.2.2 should also be somewhat smaller (36 MB instead of 52 MB) and uses HAPI 5.4.0.

1 Like

@ibacher this is great any plans for EpisodeOfCare to be added. or this is going to be one of those as a custom in any other module.

How does one use this option of custom ResourceProviders in a custom module?? Otherwise. Thanks

I have basically the same answer now I had on Slack a few months ago:

I’m not overly familiar with OMRS programs, so I’m hesitant to try to define the mappings myself. We can always add them in if someone can figure out what the mappings to FHIR needs to be. Something like the OpenMRS <-> FHIR Mapping from Patient Resource - Projects - OpenMRS Wiki would be ideal. And, of course, we’ll need some developer time to actually implement things. I’m happy to help out with this, but it’s not something I can do on my own.

So the mechanism isn’t widely tested or anything but, roughly speaking, the process looks something like this:

  1. Create a module that depends on the FHIR2 module

  2. Inside your new module, create an IResourceProvider instance that looks something like this:

    @R4Provider // or @R3Provider as appropriate
    public class MyResourceProvider implements IResourceProvider {
        // actually implementtion of the resource provider
        // see the HAPI FHIR docs here: https://hapifhir.io/hapi-fhir/docs/server_plain/resource_providers.html
  3. Create a file in src/main/resources/META-INF/services called ca.uhn.fhir.rest.server.IResourceProvider with a single line like this:


    (Basically, we just use the standard Java Service Provider Interface plus Spring).