For this demonstration I am using the following statement as requirement:
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 section ‘Creating HL7 Formatted Data with an Orchestration’ of HL7 v2 Developer Guide
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".
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:
HL7_ADT_A03_MultiPart(*)=ADT_A03_XML(*);
Note: You can’t set the value of message type property in the assignment shape as it is read only value.
The sample, CreatingHL7MsgWithOrchestration, built around the scenario discussed in this article can be downloaded from the MSDN Code Gallery .
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.
The sample XML instance for ADT A03 with name 'Body_ADT^A03.xml' is available as part of the code download in folder 'TestInstance'.
Read suggested related topics:
Maheshkumar S Tiwari edited Revision 12. Comment: minor edit and formatting
Steef-Jan Wiggers edited Revision 11. Comment: Formatting
Steef-Jan Wiggers edited Revision 10. Comment: Removed duplicate heading
Steef-Jan Wiggers edited Revision 9. Comment: Removed duplicate heading
Steef-Jan Wiggers edited Revision 8. Comment: Added text to picture
Steef-Jan Wiggers edited Revision 7. Comment: Added text to pictures
Steef-Jan Wiggers edited Revision 6. Comment: Added resource links
Steef-Jan Wiggers edited Revision 3. Comment: Minor edit
Rohit.Sharma edited Original. Comment: Updating code download link
Thanks.It was helful to me.