The HL7 Delimiter Characters section lists the default delimiter characters that are normally used in HL7 messages. An HL7 message can choose to employ HL7 delimiter redefinitions in order to use different delimiter characters if the standard characters are not convenient to use.
In any HL7 message, the delimiter characters that the message is using are specified as the first field of the MSH segment. (Recall that every HL7 message must include an MSH segment, and that 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:
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:
Here, #, not |, is the delimiter character that separates one composite from another.