Stream: implementers
Topic: FHIR to HL7
Gachu A (Dec 10 2018 at 19:16):
Our project is already having a built in HL7 Message parsers which is being used for many clients, Now a new client is trying to use our product and they were able to send only FHIR JSon message, I am in need of parser(.NET c#) that transforms the incoming FHIR Json message to HL7.
Does the .NET HL7.FHIR can tranform FHIR to HL7, if so are there any sample codes, that can get me started?
Ewout Kramer (Dec 10 2018 at 19:21):
There is no easy "standard" functionality to translate HL7 v2 messages to HL7 FHIR (or vice versa). This has to do with the fact that translations between these two different standards requires understanding of localizations and specific usecases the message exchanges are made for. Also, there is an impendance mismatch between a messaging standard like v2 (where messages carry the meaning of events) and the RESTful interface of FHIR (assuming you are using that).
This does not mean that content of the one standard cannot be prudentially and partially be translated into the other, but you have to understand why you are doing it, and for which kind of exchange. Hence, there is no out-of-the-box functionality to translate one in the other.
Ewout Kramer (Dec 10 2018 at 19:28):
There is however a library for parsing and serializing HL7 v2 messages: https://www.nuget.org/packages/nHapi/. You can then map them to the HL7 FHIR model and use the FHIR .NET API (https://www.nuget.org/packages/Hl7.Fhir.STU3) parse and serialize FHIR. Also, the specification has suggested mappings between HL7 FHIR and HL7 v2 (and v3) on each "Mapping" tab in the FHIR Specification, e.g. here: http://hl7.org/fhir/observation-mappings.html
John Moehrke (Dec 10 2018 at 22:49):
There is a STREAM for #v2 to FHIR
Lloyd McKenzie (Dec 11 2018 at 02:09):
There are also mapping tabs on all resources and most have mappings to v2 elements (that represent 'typical' v2 - specific implementations may vary). You might also find this page in the spec helpful: http://build.fhir.org/comparison-v2.html
AbdulMalik Shakir (Dec 11 2018 at 05:54):
@Gachu A
"Our project is already having a built in HL7 Message parsers which is being used for many clients, Now a new client is trying to use our product and they were able to send only FHIR JSon message, I am in need of parser(.NET c#) that transforms the incoming FHIR Json message to HL7."
HL7 v2 and HL7 FHIR cover very broad domains. You may have a simpler mapping exercise if you limit your mapping of v2 to just the messages and message elements required by your application. Consider creating a content profile of your v2 message(s) and going from there. You will find a lot of what is in PID in Patient, OBX in Observation, etc. Trying to map all of v2 to FHIR would be like boiling the ocean. But mapping your specific implementation of v2 to FHIR would be relatively straightforward. I have a similar need and chose to reverse engineer my v2 message profile into a conceptual data model and then forward translate the CDM into FHIR. It's a repeatable process the requires detailed knowledge of v2 conformance profiling, UML modeling, and FHIR profiling. Implementing the results of the mapping requires additional FHIR implementation skills. You may want to seek experienced assistance. There are devils in the details.
John Silva (Dec 11 2018 at 10:48):
@Ewout Kramer - we do exactly this using both the toolkits you mention. @Lloyd McKenzie - yes, V2 mappings exist on each resource but they are very frequently missing from FHIR DataTypes. Many times when trying to map V2 messages you need to drill down to the FHIR DataTypes (e.g. Dosage, Timing, etc.) and there tends to be gaps. We've made our "best guesses" but it would be nice if there was more guidance here. (I also believe that the interface engine vendors tend to use these mappings as a guide for their 'standard' mappings.)
Lloyd McKenzie (Dec 11 2018 at 15:59):
@John Silva If there are places you think there should be mappings but aren't, feel free to submit a change request. (Or even better, submit a change request with the proposed mappings to add :))
John Silva (Dec 11 2018 at 16:06):
OK, I'll have to start entering change requests as I come upon them. (Of course what I suggest for mappings might not be what others think is appropriate or meets 'general use cases' but I suppose it could get the discussion started. E.g. the discussion about the Priority, e.g. as used in TQ1.9 field or the subcomponent of the TQ V2 data type.)
Hans Buitendijk (Dec 12 2018 at 17:59):
There is a project in progress to map V2 to FHIR (project statement can be found here: https://confluence.hl7.org/display/OO/2-To-FHIR). This is intended to yield a "definitive" mapping from an HL7 perspective on what V2 elements should be mapped to what FHIR elements, and as appropriate, create FHIR extensions to accommodate elements in V2 that are not in FHIR Core, but are known to be used in V2 messages. The initial focus is on V2 to FHIR. Anybody interested to join that effort, for notifications on meetings/etc., you can sign up to v2-to-fhir@lists.hl7.org. Additional discussions should occur the V2 to FHIR zulip stream (https://chat.fhir.org/#narrow/stream/32-v2-to.20FHIR).
Medi Harsini (Oct 05 2020 at 13:12):
Hi, I have got a FHIR server which requires to send HL V2 messages. Does anyone used anything similar to FHIR Mapper for the reverse pathway aka FHIR/Appointment to HL7/scheduling
Lloyd McKenzie (Oct 05 2020 at 14:00):
You might ask on #v2 to FHIR
Medi Harsini (Oct 05 2020 at 17:06):
Thanks @Lloyd McKenzie Thought it my be related to this stream but will do as advised.
Last updated: Apr 12 2022 at 19:14 UTC