Stream: hapi
Topic: Multiple FHIR versions support on same datasource
Keerthivasan Ramanathan (Jul 16 2020 at 13:31):
Hi, we are planning to setup STU3 and R4 FHIR versions on top of a single datasource? is that possible? Do we have to run two HAPI FHIR server instances for each version?
Keerthivasan Ramanathan (Jul 17 2020 at 02:05):
Can someone guide me here? Can elastic search can be used as database for storing FHIR resources? We are looking for several options for implementing. I would like to understand the views from the community. Please help with your knowledge
Vibin_chander (Jul 17 2020 at 06:24):
@Keerthivasan Ramanathan One suggestion is to understand the HAPI DB config. Try replicating the same.
Keerthivasan Ramanathan (Jul 17 2020 at 12:07):
Hi Vibin, I just saw the db schema in the HAPI fhir documentation. I could understand that they store all the resources in a single table.
Keerthivasan Ramanathan (Jul 17 2020 at 12:08):
Can a single HAPI FHIR server support multiple FHIR versions?
Keerthivasan Ramanathan (Jul 17 2020 at 12:08):
Thanks Vibin for your response
Keerthivasan Ramanathan (Jul 22 2020 at 07:33):
I understood that we have to stand up a separate hapi fhir jpa server for each version of FHIR. I have to support both STU3 and R4. What is the recommended approach? we cannot store in two different databases. I think running two instance of HAPI FHIR server on top of same data source should help. I would like to hear from the others.
Keerthivasan Ramanathan (Jul 22 2020 at 08:15):
ping @Grahame Grieve @James Agnew Sorry to pull you in. Please provide your recommendations.
Jens Villadsen (Jul 22 2020 at 08:57):
The architecture of HAPI currently does not support concurrent versions out of the box. It utterly depends on what you are trying to achieve
Umberto Cappellini (Jul 22 2020 at 09:40):
There's a Converter interceptor to convert between FHIR versions on the fly: VersionedApiConverterInterceptor.
Here's the related docs: https://hapifhir.io/hapi-fhir/docs/model/converter.html
Not sure how good it is (configuration and performance-wise), though.
Keerthivasan Ramanathan (Jul 22 2020 at 09:42):
Yeah, I completely understand it. Can we run two hapi fhir server to support two different versions (STU3 and R4) on top of a single database? Is there any problems with that? we don't want to keep the huge data replicated. Hope it makes sense now
Keerthivasan Ramanathan (Jul 22 2020 at 09:43):
Thanks, @Jens Villadsen
Keerthivasan Ramanathan (Jul 22 2020 at 09:43):
Thanks @Umberto Cappellini , this is amazing to know about it. I will check it out
Keerthivasan Ramanathan (Aug 02 2020 at 11:00):
@Umberto Cappellini Is there any example usage for VersionedApiConverterInterceptor? I just read the java docs. Do we have to extend this class and override the method? May i ask for some reference examples? It will be helpful to understand it well.
Umberto Cappellini (Aug 03 2020 at 15:23):
@Keerthivasan Ramanathan
Looking at the code of the interceptor:
https://github.com/jamesagnew/hapi-fhir/blob/60f16dd91d757131dbdef83359e0b8f02c323248/hapi-fhir-converter/src/main/java/ca/uhn/hapi/converters/server/VersionedApiConverterInterceptor.java
the client specifies the desired FHIR version in the "accept" header as follows: Accept: application/fhir+json; fhirVersion=4.0
The interceptor converts all the resources contained in the ResponseDetails to the desired FHIR version. You configure the interceptor as you do for all other interceptors in the initialize method of the server.
Didn't use it myself though, not sure how good the conversions are.
Keerthivasan Ramanathan (Aug 03 2020 at 15:25):
Wow, that's amazing :sunglasses:
Keerthivasan Ramanathan (Aug 03 2020 at 15:25):
I'll check that and give an update. Thank you so much
Last updated: Apr 12 2022 at 19:14 UTC