DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Graph API for Entra ID (Azure AD) Object Management
  • Develop Microservices Using Azure Functions, API Management
  • Zero to AI Hero, Part 3: Unleashing the Power of Agents in Semantic Kernel
  • Exploration of Azure OpenAI

Trending

  • Artificial Intelligence, Real Consequences: Balancing Good vs Evil AI [Infographic]
  • Immutable Secrets Management: A Zero-Trust Approach to Sensitive Data in Containers
  • From Zero to Production: Best Practices for Scaling LLMs in the Enterprise
  • How to Practice TDD With Kotlin
  1. DZone
  2. Data Engineering
  3. Databases
  4. Sending HL7 Message to Azure FHIR API Using Mule

Sending HL7 Message to Azure FHIR API Using Mule

In this tutorial, we take a look at working with HL7 messages and sending them to the Azure API, as well as configuring the API for FHIR.

By 
Imran Aziz user avatar
Imran Aziz
DZone Core CORE ·
Jul. 07, 20 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
9.7K Views

Join the DZone community and get the full member experience.

Join For Free

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


Now the Service Bus has been created, we can create a Queue inside it.

Click on the Queue button to create Queue inside the Service Bus.

Click queue button


Fill up the required details for creating the Queue.

Create queue

A queue has been created inside the Service Bus.

Queue inside service bus

Creating the Azure API for FHIR

Again, click on create a resource and search for Azure API for FHIR as follows.


Create Azure API for FHIR


Click on Create button.

Create button


Select an appropriate subscription, resource group and enter the n.

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

Service bus


Once the Azure API for FHIR is created, you will see its endpoint as follows:

Endpoint

We need to assign the Read and Write Roles to Azure API for FHIR by clicking on the Access control (IAM).

Assign read and write roles


Click on Add button and add Read and Write roles to Azure API for FHIR as follows.

Add button



Configuring the Postman to Fetch Data From Azure API for FHIR

A detailed tutorial has been provided on below location.

https://docs.microsoft.com/en-gb/azure/healthcare-apis/access-fhir-postman-tutorial

In addition to this tutorial, the following are the things need to be documented:

The Tenant ID or Directory ID, Client ID, and Client Secret can be obtained after following the above tutorial and creating a new app registration.


azure API

Opinions expressed by DZone contributors are their own.

Related

  • Graph API for Entra ID (Azure AD) Object Management
  • Develop Microservices Using Azure Functions, API Management
  • Zero to AI Hero, Part 3: Unleashing the Power of Agents in Semantic Kernel
  • Exploration of Azure OpenAI

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!