HL7 Separator Characters
September 24th, 2007 by Sonal Patel
Posted in HL7 Messaging, HL7 Standard
In HL7 messaging, the separator characters are also known as the message delimiters or special encoding characters. The following are the HL7 recommended values:
Segment terminator
| Field separator, aka pipe
^ Component separator, aka hat
& Sub-component separator
~ Field repeat separator
\ Escape character
The segment separator is not negotiable. It is always a carriage return
The MSH is the first segment of all HL7 messages (except HL7 batch messages). The field separator is presented as the 4th character in the message and it also represents the first field of the MSH segment. Since the first field of the MSH is typically only a pipe,’|', counting MSH fields becomes tricky. Field 2 of the MSH (MSH-2) contains the other separator characters in this order: component, field repeat, escape, and sub-component.
Thus, the following is an example of the beginning of an HL7 message:
MSH|^~\&|…
The delimiter values used in the MSH segment are supposed to be the delimiter values used throughout the entire message. Encoding HL7 messages in this manner allows an application parser to simply use the special characters in the MSH to parse the message. However, beware that many application parsers just use hard coded values and ignore MSH-1 (Field Separator) and MSH-2 (Encoding Characters).
Last 5 posts by Sonal Patel
- The Benefits of Improving Your Healthcare Billing Operations - January 8th, 2008
- HL7 Messages in Healthcare Billing Environments - January 4th, 2008
- Radiology Workflow - Integrated - December 20th, 2007
- Placer Order Number vs. Filler Order Number - September 28th, 2007
- HL7 Separator Characters - September 24th, 2007

(3 votes, average: 4 out of 5)




Could someone tell me if I can use sub-component separotor like FirstName&&&&^LastName&&&^MiddleName&&&&.
The trend that I observed is &’s at the end of each subocomponent is trimmed and the output is FirstName^LastName^MiddleName.
If I have Firts&&Name, the &’s are ‘not’ truncated.
Thanks in advance,
Murali
I am new to HL7. EDU-2 “academic degree” is IS with max len 10 and the column RP/# is empty in 15.4.3. However, I have seen messages like
EDU|1|BA^BACHELOR OF ARTS^HL70360|…
Is this legal? If not, what is the right way to encode the same information?
Thanks.