Stream: hapi
Topic: Big changes coming in HAPI 5
James Agnew (Mar 17 2020 at 15:18):
Hi All,
A quick announcement that we have decided to do a major version bump for the upcoming (Labrador) release scheduled for May 2020.
There are currently 3 changes, all of which have potential implications for implementers:
- We are going to be switching from Gson to Jackson for JSON serialization in HAPI FHIR's JSON parser. This move brings 3 benefits:
- The Jackson-based FHIR parser is roughly 5% faster in parsing than the Gson one was (not a huge difference, but not nothing)
- Jackson reports line numbers when it finds problems, and we will be surfacing those to end users
- Jackson's pretty printing is way more compact and usable than Gson's (way fewer useless empty lines, trust me it's really nice)
- The Convertor library has been refactored so that conversion between versions lower than R5 have been broken out into separate classes. The actual conversion logic is unchanged, but we no longer rely on a massive monolith converter class that brings IDEs to its knees. Shoutout to @Mark Iantorno for his work on this (Mark automated this task, so most of the work was actually building a java parser).
- The IValidationSupport interface which is used to supply conformance artifacts and terminology services to the validation engine is being completely redesigned. This has honestly been a massively painful change to implement, but in doing so we are paving the way for integration with remote terminology servers (e.g. HAPI FHIR CDR that links to Ontoserver for validation anyone?) and NPM based FHIR package support. The new interface is available here if anyone wants to look into that particular crystal ball: https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/IValidationSupport.java
I mention this now because we're about to abandon the current 4.3.0-SNAPSHOT builds and bump to 5.0.0-SNAPSHOT, probably within the next 24 hours.
Ps- Hope everyone is safe and healthy. This is week 2 of work-from-home for my team and I think I'm finally learning to not completely hate it. :)
James Agnew (Mar 17 2020 at 16:42):
Oh, one other benefit to the use of Jackson that I didn't mention- Jackson is a super extensible parser, with lots of plugins to things other than JSON. Technically this move should pave the way to an easier implementation of Bson support, Protobuf/Avro support, etc. No guarantees on these things of course since they haven't been investigated at all, but I think they are realistic at some point.
James Agnew (Mar 17 2020 at 22:01):
And finally.. if anyone would like to see the new pretty printing in action: http://hapi.fhir.org/baseR4/Observation
(Feedback welcome, it's actually super-configurable in Jackson so we could make the indenting level, array-joining, and other stuff tunable if there was interest!)
Josh Collins (Mar 18 2020 at 12:33):
@James Agnew Does it sound 'right' that jpaserver-starter would fail to startup when pointed to 5.0.0-snapshot due to 'No bean named 'myInstanceValidatorR4' available'? I'm guessing that is just lagging behind the core changes?
James Agnew (Mar 18 2020 at 13:29):
Definitely expected. If you want to check out the prerelease HAPI FHIR, there is a branch in the JPA starter project you can use: rel_5_0_0
Roman Rodnin (Apr 02 2020 at 04:53):
I've noticed that DefaultProfileValidationSuupport doesn't implement the validateCodeInValueSet method from IValidationSupport interface. Why so?
James Agnew (Apr 02 2020 at 09:53):
@Roman Rodnin that method was moved to InMemoryTerminologyServerValidationSupport
, so you need to include both of these classes in a chain now.
Jens Villadsen (Apr 17 2020 at 09:28):
@James Agnew iIs 5.0.0 still expected to be released around mid of May?
James Agnew (Apr 17 2020 at 09:35):
Yup, we're still on track for the may release.
Last updated: Apr 12 2022 at 19:14 UTC