This article presents a workable solution for using the BTAHL72XSendPipeline in an orchestration to create HL7 flat-file message.

Scenario for this Article

For this demonstration I am using the following statement as requirement:

  • The XML message confirming to the ADT A03 version 2.3.1 need to be picked up from the network share path.
  • The HL7 formatted flat file for ADT A03 need to be dropped at destination network share path.

As the input to the BTAHL72XSendPipeline need to be a multi-part message having 3 parts (MSHSegment, BodySegments, ZSegments) so an orchestration need to be created to create the multi-part message and to assign the content to these message parts.

Note: To know how to create HL7 formatted multipart message you can refer to the sectionCreating HL7 Formatted Data with an Orchestration’ of HL7 v2 Developer Guide

The following orchestration depicts the flow of message in orchestration:

Picture 1. Orchestration Flow.

You might get the following while executing the send pipeline in orchestration:

Exception thrown from: segment 2, progress 5

Inner exception: There was a failure executing pipeline "BTAHL72XPipelines.BTAHL72XSendPipeline". Error details: "Body schema is missing".

This error detail is little misleading as the multi-part message is having the message body part with name BodySegments. This error can be caused if the message type property for multi-part message is not available in the context of the message. To overcome this problem you need to copy the context value from incoming message to multi-part message in the assignment shape while creating the multi-part message as in above orchestration the following expression has been used in the assignment shape:


Note: You can’t set the value of message type property in the assignment shape as it is read only value.

Download the Sample

The sample, CreatingHL7MsgWithOrchestration, built around the scenario discussed in this article can be downloaded from the MSDN Code Gallery .

Configure the BizTalk Server Application

Create a receive port and receive location while configuring the receive location use the XMLReceive pipeline so that the message type get promoted.

Picture 2. Configuring the receive location.

Create a send port and use the PassThruTransmit as Send pipeline.

Picture 3. Configuring the receive location.

Configure the orchestration to use the above receive port and send port.

Picture 4. Configure the orchestration.

Test the Solution

The sample XML instance for ADT A03 with name 'Body_ADT^A03.xml' is available as part of the code download in folder 'TestInstance'.

  • Start the send port.
  • Start the orchestration.
  • Enable the receive location.

Drop the sample instance at folder location being polled by receive location. The HL7 formatted flat file message should be available at the send port.

See Also

Read suggested related topics:

Another important place to find a huge amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.