In this article, we will cover the HL7 Delete Segment Component and HL7 Encoding Transformer. This article continues from Part 2, located here.
HL7 Delete Segment Component
Working with instances of HAPI message objects, this component deletes a segment from an HL7 message. If your HL7 message is not a HAPI message object, you must use the HL7 Encoding Transformer to convert it before it passes through the Delete Segment component.
HL7 Encoding Transformer
This transformer allows you to convert an HL7 message to and from the following formats:
HAPI Message Object.
When configuring this transformer, you define the HL7 message encoding for the output message only. The transformer automatically detects the format of the incoming message and applies the conversion accordingly. You can use this transformer as a building block in your flow or as a Global Element, which you define once and then reference from your building blocks.
The below Mule project explains how to delete a segment from an inbound message and change the format from ER7 to XML. Here are the steps to configure this flow:
Place the HL7 MLLP in the source area and HL7 Delete Segment, HL7 Encoding transformer and Logger in the process area.
Inbound message snapshot of ADT_A01 message:
Configuration of the HL7 Delete segment component; we will delete the EVN segment placed in between the MSH and PID segments:
Configuration of the HL7 Encoding Transformer component; we will change the format from ER7 to XML:
Launch the project in debug mode.
Send the above ADT_A01 message from the HL7 interface client.
After passing the HL7 Delete segment, the EVN segment is deleted:
After passing the HL7 Encoding Transformer component, the format has been changed from ER7 to XML:
Logged XML payload in console:
Find more details on MuleSoft Healthcare Toolkit here.
This article will be continued in Part 4, coming soon.