This document demonstrates how to:

  • Work with HL7 messages
  • Sending HL7 message to Azure API for FHIR
  • Configuring the Azure Service bus
  • Configuring Azure API for FHIR

Technologies Used:

  • Azure Service Bus (use of ACK and NACK Mule3 connectors)
  • Azure API for FHIR
  • Anypoint Studio Mule3 Runtime
  • HL7 EDI Connector from Anypoint Connectors Update Site

Architecture

Alternative

  1. HAPI Test Panel sends the message to MuleSoft.
  2. MuleSoft sends the same message to Azure Service Bus Queue.
  3. MuleSoft reads the message from Azure Service Bus Queue and sends it to Azure API for FHIR appropriately after converting it to FHIR format.

Configuring HAPI Test Panel

Clicking the Test -> ‘Populate TestPanel with Sample Message and Connections’. It will create a localhost connection.

Populate TestPanel

Populate the port number on which the HL7 Mule Connector is configured to run.

HAPI Test Panel Configuration

Mule3 HL7 MLLP Connector

Detailed Implementation and Commentary on the implementation flow.

Implementation flow

Once the HL7 message sent from HAPI Test Panel, it will be received on the HL7 MLLP Listener as shown in the above ‘test-healthcareFlow’ flow.

In the first flow i.e. ‘test-healthcareFlow’ is then further checking whether the element that we need to work upon inside the HL7 message is present in the HL7 message or not. The above choice router is checking if the HL7 message contains the PID or not. If we won’t get the PID inside HL7 message, the NACK i.e. negative acknowledgment will be sent back to HAPI Test Panel.

No errors

If the choice router gets the PID inside HL7 message, HL7 message will be sent to Microsoft Azure Service Bus and a success acknowledge will be sent to HAPI.

Success message

NOTE: Creating the Microsoft Azure Service Bus and Queue is described below in separate section.

In the second flow i.e. ‘test-healthcareFlow1’, Microsoft Azure Service Bus (Streaming) connector is consuming the previously saved message in queue. The message would be in HL7 format and we first need to transform it to XML format. This transformation is done through out of the box Mule3 HL7 Encoding Transformer component.

We further need to transform the resultant XML into JSON before sending it to Azure API for FHIR because Azure API for FHIR only takes the JSON as input.

NOTE: Creating the Azure API for FHIR is described below in separate section.

Once the JSON message sent to Azure API for FHIR, we can check it via Postman.

NOTE: Configuring the Postman to fetch data from Azure API for FHIR is described below in separate section.

Creating the Microsoft Azure Service Bus and Queue

After login into the Azure Portal, click on create a resource as follows.

Create a resource

Search Service Bus as follows and click on it.

Service bus

Click on Create button.

Create

Select an appropriate subscription, resource group and enter the name of Service Bus.

Click Review + Create button to review and create the Service Bus.

Review + create

After creating the Service Bus, we need to enable Shared access policies. Click on the Shared access policies inside the newly created Service Bus and add RootManagedSharedAccessKey. It’s a default access policy and we just need to add it to the Service Bus.

Added to service bus

Here you will see all the connection details that need to enter while connecting the Mule3 flow to this Service Bus.

Connection details

#integration #azure service bus #mule 3 #azure api #hl7 messages

Sending HL7 Message to Azure FHIR API Using Mule
3.65 GEEK