My Experience Upgrading to HAPI Release 4.0 (part 1)

0
18

"

I’m in the process of upgrading FHIR Microservices that have been developed using HAPI on FHIR 3.6 to HAPI on FHIR 4.0.  I thought I’d share some of my experiences with the HAPI on FHIR community.

There’s really about 8 key steps I had to go through, each of which took just a minute or so.

  1. Changing hapi.server.version in my pom.xml to 4.0.1
  2. Second, change the name of hapi-fhir-utiltities in my pom.xml file to org.hl7.fhir.utilities
  3. Replace all instances of org.hl7.instance.model with org.hl7.fhir.dstu2.model
  4. Undo some of the above by replacing org.hl7.fhir.dstu2.model.api with org.hl7.fhir.instance.model.api.
  5. Replace some uses of  org.hl7.fhir.dstu2.model.TemporalPrecisionEnum
    with ca.uhn.fhir.model.api.TemporalPrecisionEnum
  6. Change calls to getServerConformance(HttpServletRequest) to support instead getServerConformance(HttpServletRequest, RequestDetails)
  7. Eliminate calls to ServerConformanceProvider.initializeOperations() for some of my delegated conformance providers (I have a converter stack that implements STU3 and R4 FHIR APIs over top of a DSTU2 native implementation, it delegates some calls).
  8. Upgrade from Spring-Boot 1.5.6 to 2.1.1

Along the way I had some other issues to address

  1. Change some of my patched converter code to deal with API changes and R4 final changes
    1. Change import org.hl7.fhir.instance.utils.ToolingExtensions to org.hl7.fhir.dstu2.utils.ToolingExtensions 
    2. Remove references to context for various resources
    3. Clean up some other mintor changes in converters
  2. Rework my integration with Spring Cloud Sleuth so that I could use release 2.0 (required since I upgraded Spring Boot).  This wasn’t FHIR related work, but was essential for the Microservice tracing stack.  Mostly I got to delete a lot of code, and just figure out how to configure a couple of key things.
  3. Change an import for LocalServerPort (necessitated by changes to Spring version changes).

All in all, the process has so far been fairly painless for dealing with a framework that has a little bit more than 10,000 lines of code (not counting about  50K lines of version converters which are hand patched).  It’s taken me about 2 days to get my framework to pass all unit tests, and 90% of that was in the “other issues” space (which means you won’t likely have to deal with it).  Next up, I’ll be applying the upgraded framework to a half-dozen and more microservices to get them to run.  I’ll let you know how that goes when I get done with it.  If all goes well, the rest of it should take me little more than a day.

     Keith



My Experience Upgrading to HAPI Release 4.0 (part 1)