MuleSoft Technical Guides

HL7 Connector

User MuleSoft Integration Team
Calendar November 18, 2022

1) What is HL7:

HL7 stands for Health Level Seven International. HL7 is a set of international standards that are used to provide guidelines about the transfer and sharing of data between various healthcare providers. It is a nonprofit organization committed to offering a comprehensive framework and related standards for the exchange, integration, sharing, and retrieval of electronic health information, and “7” in the HL7 organization refers to layer 7 in the Open Systems Interconnection (OSI) reference Model. The application layer, or the Human-Computer Interaction layer, is the seventh layer in the OSI architecture and is where applications can access network services.

2) Why HL7?

Suppose there is a hospital named XYZ that wants patients’ data along with the tests performed on them. Efficiently securing their details and the comments provided by the doctor, that data can not be directly sent to the hospital as there will be a lot of confusion and the amount of data will be immense.

So, in this case, we have this standard named HL7 to provide a proper set of data of the patients in the form of an HL7 message.

3) FHIR:

In contrast to HL7, which only supports XML, the (FHIR)Fast Healthcare Interoperability Resources standard uses RESTful web services and open web technologies like XML, JSON, and RDF.

4) Prerequisites:

  • Anypoint Studio
  • Postman

5) HL7 Message Structure:

A hierarchical structure called an HL7 message is connected to a trigger event. An “incident in the real world of health care” that necessitates the transfer of data between systems” is what the HL7 standard refers to as a trigger event.

6) HL7 Message Types:

  • HL7 ADT (Admit, Discharge and Transfer)
  • HL7 ORM (Order Entry)
  • HL7 ORU (Observation Result)
  • HL7 MDM (Medical Document Management)
  • HL7 DFT (Detailed Financial Transactions)
  • HL7 BAR (Billing Account Record)
  • HL7 SIU (Scheduling Information Unsolicited)
  • HL7 RDS (Pharmacy/treatment Dispense)
  • HL7 RDE (Pharmacy/Treatment Encoded Order)
  • HL7 ACK (Acknowledgement Message)

6) HL7 ADT message (Admit, Discharge & Transfer):

HL7 ADT messages give crucial details regarding trigger occurrences and carrying patient personal data for HL7 communications (such as patient admission, discharge, transfer, registration, etc.). The PID (Patient Identification) segment, the PV1 (Patient Visit) segment, and on occasion, the IN1 (Insurance) segment are some of the most significant segments in the ADT message. Among all message kinds, ADT messages are among the most extensively used in HL7 processing.

ADT^A01 – Patient Admit/Visit

MSH|^~\&|ADT1|MCM|FINGER|MCM|198808181126|SECURITY|ADT^A01|MSG00001|P|2.3.1
EVN|A01|198808181123
PID|1||PATID1234^5^M11^ADT1^MR^MCM~123456789^^^USSSA^SS||
SMITH^WILLIAM^A^III||19610615|M||C|1200 N ELM STREET^^JERUSALEM^TN^99999?
1020|GL|(999)999?1212|(999)999?3333||S||PATID12345001^2^M10^ADT1^AN^A|
123456789|987654^NC
NK1|1|SMITH^OREGANO^K|WI^WIFE||||NK^NEXT OF KIN
PV1|1|I|2000^2012^01||||004777^CASTRO^FRANK^J.|||SUR||||ADM|A0

USE CASE 1:

We have data of an HL7(ADT_A01) message(An A01 event is sent due to a patient undergoing admission, which assigns the patient to a bed. It signals the beginning of a patient’s stay in a healthcare facility. Normally, this information is entered into the primary Patient Administration system and broadcast to the nursing units and ancillary systems. It includes short stays and John Doe admissions). The client must read the HL7 ADT_A01 message information into JSON format using the HL7 Read connector.

Implementation:

STEP 1: Create sample Mule project in Anypoint Studio.

STEP 2: Add following dependency in pom.xml.

<dependency>
        <groupId>com.mulesoft.connectors</groupId>
	<artifactId>mule-hl7-extension</artifactId>
	<version>4.2.10</version>
	<classifier>mule-plugin</classifier>
</dependency>

After adding this dependency HL7 EDI module will be visible under Mule Palette.

STEP 3: Create a flow and add a Read connector as shown below.

Step 4: Click on Add configuration of Read connector.

Step 5: Click on Add configuration and select document. Select schema definition field as  Edit inline and add ADT_A01.esl schema.

Step 5: Click on HL7 EDI[v.4.2.10] and then select HL7-schemas-4.1.16.jar ->ADT_A01.esl.

Note. There are two types of schema in HL7 (Normal schema and Lax schema). When we pass the message through Normal Schema then Message validates its value with schema and then it transforms the message into desired format In Lax schema every field is optional no validation occurs in the Lax schema.

Step 6: Add transform message and convert ADT_A01 message into JSON format.

Step 7: Open the Postman and enter the ADT_A01 message in the body and add required headers then send the Request.

After sending the Request, it will show the data in JSON format.

USE CASE 2:

The client has a requirement to Write the JSON format message information into HL7 ADT_A01 format by using the HL7 write connector.

Step1: The First Five steps are the same, but you should Write connector instead of using Read connector.

Step 7: Open the Postman and enter the JSON message in the body and add required headers then send the Request.

After sending the Request, it will show the data in ADT_A01 format.

Leave a comment

Your email address will not be published. Required fields are marked *