How BTAHL7 Routes Messages
Microsoft BizTalk Accelerator for HL7 (BTAHL7) leverages the message processing capabilities of Microsoft BizTalk Server, but also extends it in several ways that are specific to HL7 messaging requirements.
Routing overview
HL7 receives messages from a Line of Business (LOB) system, and may receive them using the MLLP adapter. The LOB system connects to MLLP adapter on BizTalk Server over a TCP port, and then sends messages to the MLLP adapter.
In BizTalk Server 2013 R2 and older versions, the HL7 MLLP receive transport adapter waits for the remote LOB system to connect to MLLP. Once the remote LOB system connects, the LOB system sends the messages using MLLP to the BizTalk Server. Specifically:
- The remote LOB system connects to the MLLP adapter on the local BizTalk Server using a TCP port
- The BTA4HL7 receive location with MLLP Adapter accepts the connection
- The remote LOB system delivers one or more messages
- The remote LOB system disconnects
In BizTalk Server 2016 and newer versions, the connection to the LOB system is initiated by the MLLP adapter, and then the LOB system pushes messages to the MLLP receive. In other words, the remote LOB system waits for the connection before sending messagings to MLLP. Specifically:
- The local BizTalk Server connects to the remote LOB system using a TCP port
- The BTA4HL7 receive location with MLLP adapter initiates the connection
- The remote LOB system delivers one or more messages
- The remote LOB system disconnects
For backwards-compatibility, you can use the original default behavior where the remote LOB system initiates the connections. This option is configurable in the MLLP receive location properties.
Once the HL7 message is received, it is then submitted to an HL7 receive pipeline. Within this pipeline, the HL7 disassembler will parse the message, and will validate the message according to the appropriate schema definition and validation configuration. At this point, an HL7 acknowledgment message may be generated (success or error), according to the validity of the message and the relevant acknowledgment configuration. From here, the pipeline will submit the message instance and optional acknowledgment to the MessageBox database for further processing and routing.
Once a message instance arrives in the MessageBox database, BizTalk Server checks filter-based subscriptions and routes the message to one or more send ports (possibly MLLP ports) through an HL7 send pipeline. The send pipeline may validate the message instances according to the appropriate schema definition and validation configuration. In addition to validation, it is possible to override certain field values in the MSH segment of the outgoing message. This override ability is especially useful if multiple ports have subscribed to a message and each receiving application has unique expectations within the MSH segment values.
Of course, all of the other BizTalk Server send and receive port capabilities will be available to HL7 messages, along with some capabilities that may be unique to the selected port type, such as MLLP send-port parameters. An example of the relevant BizTalk Server capabilities would be the ability to apply a transformation map to an outbound message.
How Routing Works
The BizTalk Accelerator for HL7 routes HL7 message instances according to subscriptions that the MessageBox database manages. These subscriptions use filters that you define for each send port. Example filters might include routing based on receive port ID and/or HL7 message type (ADT^A03, for example) and/or sending application (MSH3.1 value).
In addition to setting up BizTalk Server subscriptions, you need to perform some HL7-specific messaging configuration that will affect HL7 message instances as BizTalk Server routes them. This additional configuration enables you to apply unique HL7 validation rules, automatic generation of acknowledgments, and the ability to override MSH values. BTAHL7 applies this configuration at the party level. You need to define parties within BizTalk Explorer and perform the related HL7 configuration within BTAHL7 Configuration Explorer.
To apply unique HL7 messaging configuration (for example, validation or MSH overrides) to multiple send ports that subscribe to a message, you need to create associations between parties and send ports. You configure party-to-send port associations as party properties within BizTalk Explorer.
If you do not need to route HL7 messages to multiple send ports, or apply unique HL7 processing configuration to multiple send ports, you can eliminate the step of associating parties with send ports. In this case, BTAHL7 associates the party with its HL7 messaging configuration through the receiving application field in the HL7 message (MSH 3.1). This situation is most likely to occur in an HL7 interrogative (request/response) message exchange.