Class MinLowerLayerProtocol

java.lang.Object
ca.uhn.hl7v2.llp.LowerLayerProtocol
ca.uhn.hl7v2.llp.MinLowerLayerProtocol

Implements the "Minimal Lower Layer Protocol" from the HL7 Implementation Guide, Appendix C. In other words, provides a reader and a writer that can be used to communicate with a server that uses the minimal LLP.

Note:

The MLLP Block is framed by single-byte values. The characters transmitted within the MLLP Block have to be encoded in such a way that the HL7 Content does not conflict with the byte values used for framing. Some multi-byte character encodings (e.g. UTF-16, UTF-32) may result in byte values equal to the MLLP framing characters or byte values lower than 0x1F, resulting in errors. These character encodings are therefore not supported by MLLP. MLLP supports all single-byte character encodings (e.g. iso-8859-x, cp1252) as well as UTF-8 and Shift_JIS. The byte values used by UTF-8 do not conflict with the byte values used for MLLP framing.

HAPI still tries to support UTF-16 and UTF-32 as best as possible. To be able to detect per-message encoding information in MSH-18 with these encodings, corresponding byte order marks (BOMs) are expected at the beginning of the message payload (i.e. AFTER the MLLP start byte) to be able to decode the message in order to read the MSH-18 field. This scheme is also followed when the MinLLPWriter sends out UTF-16 or UTF-32-encoded MLLP messages unless omitBOM is explicitly set to true.

In general, it is NOT recommended to use UTF-16 or UTF-32.

Author:
Bryan Tripp, Christian Ohr
See Also: