Required Segment Is Missing
The message structure for this type and trigger event (for example ADT^A01) declares a segment as Required, but it does not appear in the message. PID, PV1, and EVN are common offenders.
HL7v2 · Error
The error
Required segment PID is missing from the messageWhy it happens
A sending system that omits demographics, a filtered or stripped-down message, or a structure mismatch (the message claims to be ADT^A01 but was built for a different event).
How to fix it
Add the missing required segment with at least its required fields populated. Confirm the message type in MSH-9 actually matches the structure you intend to send. The exact required-segment list depends on the HL7v2 version in MSH-12.
Example
The snippet below triggers the error:
MSH|^~\&|SENDAPP|SENDFAC|RCVAPP|RCVFAC|20240115||ADT^A01|MSG001|P|2.5
EVN|A01|20240115
PV1|1|IThe corrected version:
MSH|^~\&|SENDAPP|SENDFAC|RCVAPP|RCVFAC|20240115||ADT^A01|MSG001|P|2.5
EVN|A01|20240115
PID|1||12345^^^HOSP^MR||DOE^JOHN||19800101|M
PV1|1|IFrequently asked questions
How do I know which segments are required for my message?
Required segments are defined per message structure (message type plus trigger event) for each HL7v2 version. The validator resolves the structure from MSH-9 and MSH-12 and lists every Required segment that is missing.
Can a segment be required in one version but optional in another?
Yes. Segment usage changes across HL7v2 versions. Always validate against the version declared in MSH-12 rather than a generic ruleset.
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 Field Is Missing or Empty
- Segment Appears More Times Than Allowed
- Segment Is Not Defined in This HL7v2 Version
- Invalid Message Type and Trigger Event Combination