Reference·HL7 v2·PID
HL7 v2 Reference

HL7 v2 PID Segment Guide: Fields, Format, and Testing Gotchas

Jul 27, 2026 · 6 min read

The PID segment is the one every interface engineer ends up memorizing — it carries the core demographic identity of a patient and shows up in nearly every HL7 v2 message type, from ADT to ORU to SIU. Get it wrong and patient matching breaks quietly, not loudly.

Quick answer

PID (Patient Identification) is the HL7 v2 segment that carries a patient’s demographic identity — identifiers, name, date of birth, sex, and address — and typically appears as the second or third segment in a message, right after MSH.

The fields that actually matter in practice

PID-3 →
Patient Identifier List — the MRN — almost everything else keys off this field
PID-5 →
Patient Name — Last^First^Middle — formatting mismatches here break patient matching
PID-7 →
Date/Time of Birth — format drift (YYYYMMDD vs. full timestamp) is a common go-live error
PID-8 →
Administrative Sex — M/F/O/U/A/N — see the dedicated field guide below
PID-11 →
Patient Address — a repeating field — some systems only read the first repetition
PID-18 →
Patient Account Number — often the billing-system key, distinct from PID-3

Example

Synthetic example Generated by Synthibase
PID|1||847213609^^^HOSP^MR~55219847^^^HOSP^AN||GARCIA^ELENA^M||19870314|F|||482 OAK ST^^DENVER^CO^80202||3035550142|||M||847213609|

Synthetic patient — not a real person.

Where this trips people up

PID-3 supports multiple repeating identifiers (MRN, account number, etc.) separated by a ~. Teams that only parse the first repetition silently drop the rest — which shows up downstream as "missing" data that was actually there in the message all along.

How to Build a Synthetic Patient Registry for Healthcare Testing
HL7 ADT Messages: A01 through A08 Explained
Generate synthetic PID segments in seconds
Synthibase generates realistic HL7 v2 messages from a synthetic patient registry — every field, every code value, zero PHI.
Start free trial →
This page is written independently by Synthibase for testing and informational purposes. It is not an official publication of HL7 International or X12/Washington Publishing Company, and is not a substitute for reviewing the official standard or your trading partner's companion guide. See our Terms of Service for full legal terms.