FHIR2 Release 1.2.0

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:

    @Component
    @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:

    org.openmrs.module.mygreatmodule.MyResourceProvider
    

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