|
Repeating and Optional SegmentsIn the message definition, each segment can be either mandatory or optional. Each message starts with a MSH segment that is always mandatory (required). When you receive a HL7 message, you parse the MSH first to determine what message it is. Another example of a mandatory field is PID (Patient identification). Without patient identification data, messages like ADT^A04 (Register Patient) do not have any relevance. Some segments, such as AL1 (allergies), are optional because patients may or may not have allergies. The example message under the Messages section consists of MSH, EVN, PID, NK1 and PV1. According to the HL7 (version 2.2) definition, the MSH, EVN, PID and PV1 segments are required in an ADT^A04 message and the NK1 segment is optional. DG1, PR1 and AL1 are also optional segments that could be in this message but are not present.
Segments in HL7 messages can also be repeating. For example, NK1 (Next of Kin/Associated Parties) will repeat several times if a person has several next of kin relationships. In the example below, the NK1 segment repeats two times:
|