Friday, April 17, 2009

Sending HL7 Messages using MLLP

What is MLLP ?
The Minimal Lower Layer Protocol (MLLP) is the most common mechanism for exchanging the HL7 data. MLLP uses the TCP/IP protocol to transfer the data in continuous stream of bytes. MLLP delimiters is used to recognize the start and the end of message,

The structure of an MLLP message is given below
<SB> + <Message> + <EB> + <CR>

<SB> = Start Block. Messages are prefixed with start byte
<Message> = HL7 Message
<EB> = End Block. Messages are terminated with end byte
<CR> = Carriage Return


Default hexadecimal values of MLLP delimiters
<SB> = 0x0B (VT)
<EB> = 0x1C (FS)
<CR> =Carriage Return

Types of MLLP connection
There are two types of MLLP connection
1. Permanent Connection : In this case, only one connection is used to exchange all the messages between two endpoints.

2. Transient Connection : In this mode a new socket is created for each message. When a message is sent the sender waits for the ACK and once it is received socket is closed.