LINKMED® Interface Tutorial: HL7 Basic
2.1 Message Construction

Special characters are used when developing a message. They are as follows: Segment Terminator, Field Separator, Component Separator, Subcomponent Separator, Repetition Separator, and Escape Character. These encoding HL7 delimiters are placed in the OUTBOUND message automatically by the LINKTools® Dynamic Mapper.

The Segment Terminator is always a carriage return. The other delimiters are defined in the Field Separator and the Encoding Field that are found in the Message Segment Header (MSH).
The Field Separator is ( | ). This character is in the Field Separator field in the MSH segment. The Field Separator separates two data fields that are adjacent to each other in the segment. It also separates the Segment ID from the first data field segment.
The Component Separator (^) is the first character in the Encoding Character field in the MSH segment. This character is used to separate adjacent components of some data fields.
The Repetition Separator (~) is the second character in the Encoding Character field in the MSH segment. This is used in some data fields to separate multiple occurrences of a field, and is only used where specifically authorized.
The Escape Character (\) is the third character in the Encoding Character field in the MSH segment. This field is optional.
The Subcomponent Separator (&) is used to separate adjacent subcomponents of some data fields. This separator is the fourth character in the Encoding Character field in the MSH segment.

Example :

MSH|^~\&|LINKMED|LINKLPZI|RMS||200204150926||ADT^A04|CHPFOPUP|P|2.3|<CR>

Each message is defined in special notation that lists the segment IDs in the order they would appear in the message.
Braces { } indicate one or more repetitions of the enclosed group of segments.
Brackets [ ] show that the enclosed group of segments is optional. If a group of segments is optional and may repeat it should be enclosed in brackets first and then braces, [{ }].

Example:

MSH..[{SFT}]..[UAC]..EVN..PID..[PD1]..[{ARV}]..[{ROL}]..[{NK1}]..PV1..[PV2]..[{ARV}]..[{ROL}]..[{DB1}]..
[{OBX}]..[{AL1}]..{{DG1}]..[DRG][{PR1}]..[{ROL}]..[{GT1}]..[{IN1}]..[IN2]..[{IN3}]..[{ROL}]..
[ACC]..[UB1]..[UB2]..[PDA]



| HL7 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |