The HL7 Delimiter Characters shown in the table below lists the default delimiter characters that are normally used in HL7 messages.
An HL7 message can choose to employ HL7 delimiter redefinitions.
If the standard characters are not convenient to use, the HL7 message can use different delimiter characters.
In any HL7 message, the delimiter characters used by the message are specified as the first field of the MSH segment.
Recall that every HL7 message must include an MSH segment. Further, the MSH segment must be the first segment of the message.
If the message is using the default delimiter characters, the MSH segment of the message starts with the following:
MSH|^~\&
The characters immediately following MSH indicate the delimiter characters in use in this message. They are, in order:
- The delimiter character that separates one composite from another (the default is |);
- The delimiter character that separates one sub-composite from another (default ^);
- The delimiter character that separates repeating fields (default ~);
- The delimiter character that specifies the start or end of an escape sequence (default \);
- The delimiter character that separates one sub-sub-composite from another (default &).
If an incoming HL7 message uses different delimiter characters, these first five characters of the MSH segment define the delimiter characters that are used. For example:
MSH#^~\&
Here, #, not |, is the delimiter character that separates one composite from another.
HL7 Delimiter Characters
This section describes delimiter characters in more detail, how to use escape characters to include a delimiter character as part of a composite, and how to define new HL7 delimiter characters.
The following table lists the default delimiter characters used in HL7:
Character | Purpose |
---|---|
0x0D | Marks the end of each segment. |
| | Composite delimiter. |
^ | Sub-composite delimiter. |
& | Sub-sub-composite delimiter. |
~ | Separates repeating fields. |
\ | Escape character. |
Over 120 different HL7 segments are available for use in HL7 messages to communicate health data. For further details on the HL7 message structure, including in depth information on segments, composites and delimiters, visit iNTERFACEWARE’s comprehensive guide to HL7.
Looking for professional advice? Iguana is the leading HL7 integration engine on the market, trusted globally for 20+ years. To learn more about HL7 data exchange, contact one of our integration engine experts today.