How to convert HL7 v2.x message to FHIR JSON?

前端 未结 3 714
小鲜肉
小鲜肉 2020-12-30 15:01

I am trying to convert HL7 v2.x message to FHIR JSON using java or python. But I am not able to find any solution. Is there any way to achieve this?

I found that FHI

3条回答
  •  无人及你
    2020-12-30 15:04

    You can convert HL7 to FHIR JSON in Java using Apache Camel. Camel supports both formats:

    • HL7 dataformat - uses HAPI HL7
    • FHIR dataformat - uses HAPI FHIR

    The exact implementation depends on how you're receiving and sending the HL7 and FHIR; but broadly speaking, you would write a Camel route which unmarshals from HL7 using the HL7 dataformat component, then transforms the data into a target FHIR Java object by mapping the source to target fields using a custom class (you would need to write this, but see below for a starting point), and then marshals the data out to JSON using the FHIR dataformat. For example:

    from("file:/input/directory")
        .unmarshal().hl7() // convert from HL7 text format to Java object
        .process(new PatientProcessor()) // map source to target fields
        .marshal().fhirJson() // serialise out to FHIR JSON format
        .to("file:/output/directory");
    

    The processor in the middle is where your transformation/mapping class goes.

    There is a fully worked example in Camel's unit tests, showing how to convert from HL7 to FHIR. See:

    • JUnit Test - Hl7v2PatientToFhirPatientIntegrationTest
    • Example transformation - PatientProcessor

提交回复
热议问题