POCT   >   Data format HL7
HL7 Messages

Technical background of the HL7 data format.


LabComm & LabDriver use the HL7 data format to exchange information. This is the most widely used data exchange format in the healthcare industry. It is the defacto standard in hospitals and the healthcare industry in most countries. HL7 is a ratified standard ANSI standard which has been developed over a long period of time.

What is HL7?

Health Level Seven is a standard for sharing clinical and administrative data in hospitals and between health care providers. Health Level Seven is one of several American National Standards Institute (ANSI) standards

HL7 Version 2.3

The version 2.3 was approved as an ANSI Standard in 1997. Version 3 of HL7 has now been released but the LabComm and LabDriver systems use version 2.3 as this version supports all the clinical data fields that LabComm and LabDriver require, is more compact than version 3 and is more widely used. 

LabComm supports the following types of messages, which can be divided into Results, Queries and Orders


  • Results, unsolicited
  • Results in response to a query
  • Orders, to be sent to an analyser
  • Queries, both to an analyser and to a host.

Message Structure

An HL7 message consists of data fields that are of variable length and separated by a field separator character. Rules describe how the various data types are encoded within a field and when an individual field may be repeated. Data fields are combined into logical groupings called segments. Segments are separated by segment separator characters. Each segment begins with a three-character literal value that identifies it within a message. Segments may be defined as required or optional and may be permitted to repeat. Individual data fields are found in the message by their position within their associated segments.

The hierarchy of the structure is as follows:

  • Message

o Segment (Some are repeatable) 

  • Fields (Some are repeatable)

• Components

o Subcomponents


The LabDriver / LabComm uses the HL7 messaging components below.


MSH – Message Header – This is a required segment in all HL7 messages and defines how the message is constructed i.e. the version of HL7, the field separators and encoding characters, the message type, the sender and receiver, etc.


PID – Patient Identification – Identifies the individual patient demographics


OBR – Observation Reporting – This segment serves as the report header and identifies the observation set and relevant ordering information. When a set of observations are ordered, the order message contains the necessary OBR segment. Observations can be collected and reported without an antecedent order (this is an unsolicited message). When observations are reported, the report message also includes one or more OBR segments. So, the OBR segment is like a turn-around document. Some fields in the OBR segment apply only to the ordering message and some to the reporting message.


OBX – Observation Results – This segment is used to transmit a single observation or observation fragment. It represents the smallest indivisible unit of a report. It carries information about the observations in report messages. The OBX can also be part of an observation order.

Within the HL7 message the following are the deliminators, field separators and repetition separators.


Message Delimiters

The following delimiters are included in the HL7 format:
Delimiter Suggested Value Encoding Character Position Usage
Segment Terminator <cr> (hex 0D) - Terminates a segment record. This value cannot be changed by implementors.

Field Separator | - Separates two adjacent data fields within a segment. It also separates the segment ID from the first data field in each segment.
Component Separator ^ 1 Separates adjacent components of data fields where allowed.
Subcomponent Separator & 4 Separates adjacent subcomponents of data fields where allowed. If there are no subcomponents, this character may be omitted.

Repetition Separator ~ 2 Separates multiple occurrences of a field where allowed.
Escape Character \ 3 Escape character for use with any field represented by an ST, TX or FT data type, or for use with the data (fourth) component of the ED data type. If no escape characters are used in a message, this character may be omitted. However, it must be present if subcomponents are used in the message.

LabComm supports the following types of messages.



Test orders, to be sent to the analyser, should be of the type ORM^O01 The structure of these messages is as follows:





LabComm supports queries of the type QRY^R02. The structure of these messages is as follows:


Results, unsolicited


Result messages not related to a pending query, i.e. no matching query has been received or the query has timed out, are sent as ORU^R01 messages. The structure of these messages is as follows.


Results, response to query


Result messages related to a pending query are sent as ORF^R04 messages. The structure of these messages is as follows.


The information on the HL7 data format is supplied for reference only. The use of LabComm with the LabDriver system does not require any knowledge of HL7 since the files are  automatically processed by the LabDriver system