Building an HL7 Network Client

Sending Messages

HL7 V 2.x communication utilizes pipe-messages to communicate. To send a message it must be in the form of a pipe-message in text. If you have a message object instead, save it to a pipe-message using SegmentStructureConverter.MessageToPipe.

Next, establish a standard TCP/IP connection to the server. In .NET, use the TcpClient.Connect method to do so.

If connecting is successful, proceed to actually sending the message.  Start by creating an instance of an HL7Response. Then call HL7Response.Send.  The HL7Response.Send method blocks until the transaction is completed. To check for the communication results, call HL7Response.IsFailureCode and HL7Response.TextMessage.

Now that the transaction is complete, close the TCP/IP connection (or reuse it for another transaction).

Note that the HL7Response automatically processes acknowledgment messages for you -- you do not need to do anything related to acknowledgment.

Topics

Overview

Working with HL7 messages

Building an HL7 Network Server

Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Imaging, Medical, and Document
Click or drag to resize