MLLP.Envelope (mllp v0.9.4)
Helper functions encoding and decoding MLLP-framed messages.
Below is an example of an MLLP-framed HL7 payload. Note the <SB>, <CR>, and <EB> characters.
<SB>
MSH|^~\\&|MegaReg|XYZHospC|SuperOE|XYZImgCtr|20060529090131-0500||ADT^A01^ADT_A01|01052901|P|2.5<CR>
EVN||200605290901||||200605290900<CR>
PID|||56782445^^^UAReg^PI||KLEINSAMPLE^BARRY^Q^JR||19620910|M||||||||||0105I30001^^^99DEF^AN<CR>
PV1||I|W^389^1^UABH^^^^3||||12345^MORGAN^REX^J^^^MD^0010^UAMC^L||6|||||A0<CR>
OBX|1|NM|^Body Height||1.80|m^Meter^ISO+|||||F<CR>
OBX|2|NM|^Body Weight||79|kg^Kilogram^ISO+|||||F<CR>
AL1|1||^ASPIRIN<CR>
DG1|1||786.50^CHEST PAIN, UNSPECIFIED^I9|||A<CR>
<EB><CR>
Link to this section Summary
Functions
The MLLP Carriage Return character. In documentation it is often represented as <CR>
.
The cr
is a single-byte character with the ASCII value 0x0D. This character
may appear as "\r" in text editors.
The MLLP End-Block character. In documentation it is often represented as <EB>
.
The eb
is a single-byte character with the ASCII value 0x1C. This character is
also know as "FS (File Separator)" and may appear as ^\
in text editors.
In MLLP, each message ends with eb
and cr
. The eb_cr
is just a simple concatenation of eb
and cr
.
The MLLP Start-Block character. In documentation it is often represented as <SB>
.
The sb
is a single-byte character with the ASCII value 0x0B. This character is
also know as "VT (Vertical Tab)" and may appear as \\v
or ^K
in text editors.
Unwraps an MLLP encoded message
Wraps a string message in the MLLP start-of-block and end-of-block characters
Link to this section Functions
The MLLP Carriage Return character. In documentation it is often represented as <CR>
.
The cr
is a single-byte character with the ASCII value 0x0D. This character
may appear as "\r" in text editors.
Examples
iex> MLLP.Envelope.eb
<<28>>
The MLLP End-Block character. In documentation it is often represented as <EB>
.
The eb
is a single-byte character with the ASCII value 0x1C. This character is
also know as "FS (File Separator)" and may appear as ^\
in text editors.
Examples
iex> MLLP.Envelope.eb
<<28>>
eb_cr()
In MLLP, each message ends with eb
and cr
. The eb_cr
is just a simple concatenation of eb
and cr
.
Examples
iex> MLLP.Envelope.eb_cr
<<28, 13>>
The MLLP Start-Block character. In documentation it is often represented as <SB>
.
The sb
is a single-byte character with the ASCII value 0x0B. This character is
also know as "VT (Vertical Tab)" and may appear as \\v
or ^K
in text editors.
Examples
iex> MLLP.Envelope.sb
""
unwrap_message(wrapped_message)
Specs
Unwraps an MLLP encoded message
Example: iex> MLLP.Envelope.unwrap_message <<11, 104, 105, 28, 13>> "hi"
wrap_message(message)
Specs
Wraps a string message in the MLLP start-of-block and end-of-block characters
Example: iex> MLLP.Envelope.wrap_message "hi" <<11, 104, 105, 28, 13>>