Segment Is Not Defined in This HL7v2 Version
A three-character segment ID was found that is not part of the standard segment dictionary for the version in MSH-12, and it is not a Z-segment.
HL7v2 · Warning
The error
Segment is not defined in this HL7v2 versionWhy it happens
A typo in the segment ID (for example PD1 mistyped as PD2), a segment introduced in a later HL7v2 version than the one declared, or a custom segment that was not named with the Z prefix.
How to fix it
Correct the segment ID, declare the proper version in MSH-12 if the segment is legitimately newer, or rename a truly custom segment to start with Z so it is treated as site-specific rather than unknown.
Example
The snippet below triggers the error:
MSH|^~\&|S|S|R|R|20240115||ADT^A01|M1|P|2.5
PD2|1||...The corrected version:
MSH|^~\&|S|S|R|R|20240115||ADT^A01|M1|P|2.5
PID|1||12345^^^H^MR||DOE^JOHNFrequently asked questions
What is the difference between an unknown segment and a Z-segment?
Z-segments (any segment ID starting with Z) are explicitly reserved for site-specific use, so the validator notes them rather than flagging them as errors. An unknown non-Z segment usually signals a typo or a version mismatch.
Related
- Open the HL7v2 Validator
- All validation errors
- Message Does Not Begin With an MSH Segment
- MSH-1 Field Separator Must Be Exactly One Character
- MSH-2 Encoding Characters Must Be Exactly 4 Characters
- Delimiter Characters Are Not Unique
- Required Segment Is Missing
- Required Field Is Missing or Empty
- Segment Appears More Times Than Allowed
- Invalid Message Type and Trigger Event Combination