PID: Patient identification
A patient in hospital wears a wristband: their name, their date of birth, and the number that hospital knows them by. PID is that wristband written down. Every other segment in the message is about the person this one identifies.
PID carries the identity of one patient: who they are, what identifiers the sending system knows them by, and the demographics that travel with those identifiers.
The shape of one line
required empty in this messageevery box is one | apart
Where PID appears
| Message | Segment order |
|---|---|
| ADT^A01 admit | MSH → EVN → PID → [PD1] → [{NK1}] → PV1 |
| ORU^R01 result | MSH → {PID → [PD1] → {OBR → {OBX}}} |
| SIU^S12 appointment | MSH → SCH → {PID → [PV1]} → {RGS → {AIS|AIG|AIL|AIP}} |
PID appears in 121 of the 202 message structures the standard defines.
A whole message
MSH|^~\&|EPIC|STJOSEPH|LABSYS|STJOSEPH|20240314093015||ADT^A01^ADT_A01|MSG00017|P|2.5.1 EVN||20240314093000 PID|1||1000345678^^^STJOSEPH^MR~453-22-9911^^^USA^SS||CARTWRIGHT^ELEANOR^MAY^^^^L||19510822|F||2106-3|41 ORCHARD LANE^APT 2B^PORTLAND^OR^97202^USA^H||^PRN^PH^^1^503^5550142|^WPN^PH^^1^503^5550188|eng|M|CHR|100034567800 PV1|1|I|3W^312^A^STJOSEPH||||1447312^OKONKWO^ADAEZE^^^^MD|||MED||||1|||1447312^OKONKWO^ADAEZE^^^^MD|I|V100034567|SELF|||||||||||||||||||SJ||A|||20240314093000
Every field
| SEQ | LEN | DT | OPT | RP/# | TBL# | ITEM# | Element name | Cardinality | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PID-1 | 4 | SI | O | 00104 | Set ID - PID | 0..1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | CX | B | 00105 | Patient ID deprecated | 0..1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | CX | R | Y | 00106 | Patient Identifier List | 1..* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | CX | B | Y | 00107 | Alternate Patient ID - PID deprecated | 0..* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | XPN | R | Y | 00108 | Patient Name | 1..* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | XPN | O | Y | 00109 | Mother’s Maiden Name | 0..* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | TS | O | 00110 | Date/Time of Birth | 0..1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PID-8 | 1 | IS | O | 0001 | 00111 | Administrative Sex | 0..1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | XPN | B | Y | 00112 | Patient Alias deprecated | 0..* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | CE | O | Y | 0005 | 00113 | Race | 0..* | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | XAD | O | Y | 00114 | Patient Address | 0..* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PID-12 | 4 | IS | B | 0289 | 00115 | County Code deprecated | 0..1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | XTN | O | Y | 00116 | Phone Number - Home | 0..* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | XTN | O | Y | 00117 | Phone Number - Business | 0..* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | CE | O | 0296 | 00118 | Primary Language | 0..1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | CE | O | 0002 | 00119 | Marital Status | 0..1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | CE | O | 0006 | 00120 | Religion | 0..1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | CX | O | 00121 | Patient Account Number | 0..1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PID-19 | 16 | ST | B | 00122 | SSN Number - Patient deprecated | 0..1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | DLN | B | 00123 | Driver's License Number - Patient deprecated | 0..1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | CX | O | Y | 00124 | Mother's Identifier | 0..* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | CE | O | Y | 0189 | 00125 | Ethnic Group | 0..* | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PID-23 | 250 | ST | O | 00126 | Birth Place | 0..1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PID-24 | 1 | ID | O | 0136 | 00127 | Multiple Birth Indicator | 0..1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PID-25 | 2 | NM | O | 00128 | Birth Order | 0..1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | CE | O | Y | 0171 | 00129 | Citizenship | 0..* | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | CE | O | 0172 | 00130 | Veterans Military Status | 0..1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | CE | B | 0212 | 00739 | Nationality deprecated | 0..1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | TS | O | 00740 | Patient Death Date and Time | 0..1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PID-30 | 1 | ID | O | 0136 | 00741 | Patient Death Indicator | 0..1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PID-31 | 1 | ID | O | 0136 | 01535 | Identity Unknown Indicator | 0..1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PID-32 | 20 | IS | O | Y | 0445 | 01536 | Identity Reliability Code | 0..* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | TS | O | 01537 | Last Update Date/Time | 0..1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | HD | O | 01538 | Last Update Facility | 0..1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | CE | C | 0446 | 01539 | Species Code | 0..1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | CE | C | 0447 | 01540 | Breed Code | 0..1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PID-37 | 80 | ST | O | 01541 | Strain | 0..1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | CE | O | 2 | 0429 | 01542 | Production Class Code | 0..2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | CWE | O | Y | 0171 | 01840 | Tribal Citizenship | 0..* | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Open this PID message in HL7 Studio
Field notes
PID-1Set ID - PID
Set ID numbers the PID segments within one message. It is 1 in almost every message you will see, because almost every message carries one patient. It becomes meaningful in the query responses and in ORU messages that batch several patients, where a receiver that ignores it will merge results across people.
Open PID-1 in HL7 StudioPID-3Patient Identifier List
The identifier list, and the field that causes the most integration work. It repeats, and each repetition is a CX carrying the identifier, the assigning authority in component 4, and the identifier type code in component 5. A sending system commonly puts its medical record number, a national identifier and an account-adjacent identifier in the same field, distinguished only by those two components. Match on the pair, never on the bare value in component 1: two hospitals will both issue an MRN of 1000345678 and they are not the same person.
Open PID-3 in HL7 StudioPID-5Patient Name
Patient name, repeating, with a name type code in component 7. L is the legal name and is the one to store as primary. A repetition typed A is an alias and D is a display name. Where a patient uses a name that differs from their legal one, v2.5.1 has no dedicated place for it, and the convention is a second repetition typed D. Systems that read only the first repetition will usually be right and occasionally, for the patients it matters most to, wrong.
Open PID-5 in HL7 StudioPID-7Date/Time of Birth
Date of birth, a TS. In practice it arrives as an eight-character date, but the data type permits a time and a timezone offset, and neonatal systems do send the time of birth. A parser that assumes exactly eight characters will fail on a newborn.
Open PID-7 in HL7 StudioPID-8Administrative Sex
Administrative sex, bound to table 0001. This is an administrative value, not a clinical or gender-identity one, and v2.5.1 offers no field for the others. Do not map it to FHIR Patient.gender and consider the question answered; gender identity belongs in an observation, and in later HL7 versions in dedicated segments.
Open PID-8 in HL7 StudioPID-11Patient Address
Patient address, repeating, with an address type in component 7. H is home, M is mailing, and they differ often enough that taking the first repetition gives you the wrong one for a meaningful share of patients.
Open PID-11 in HL7 StudioPID-13Phone Number - Home
Home phone number as an XTN. In v2.5.1 this field carries both the older free-text form and the newer structured components, and senders differ on which they populate. Read components 5 to 7 for country, area and local number when they are present, and fall back to component 1 when they are not.
Open PID-13 in HL7 StudioPID-18Patient Account Number
Patient account number, which ties this patient to a billing account. It is not the visit number and not the encounter identifier, though it is regularly mistaken for both. PV1-19 carries the visit number.
Open PID-18 in HL7 StudioPID-29Patient Death Date and Time
Patient death date and time, and PID-30 the death indicator. A message can carry a death date with the indicator empty, or the indicator set with no date. Treat either as an assertion of death and reconcile, because a receiving system that requires both will silently keep a deceased patient active.
Open PID-29 in HL7 Studio
Vendor behaviour
What follows describes patterns common to these systems' standard interfaces. Every installation is configured, so confirm against the interface specification for the site you are integrating with.
Epic
Epic populates PID-3 with several repetitions as a matter of course, typically the MRN under the facility assigning authority plus an enterprise-wide identifier, and the two are not interchangeable across affiliated hospitals. The identifier type code in component 5 is the reliable discriminator. Epic also sends PID-18 consistently, which makes it a usable account key where the receiving system needs one.
Cerner
Cerner installations commonly carry the person identifier and the encounter-scoped identifiers in separate repetitions of PID-3, with the assigning authority naming the source system inside the Millennium domain and not the hospital. Reading component 4 as though it names a facility gives misleading results on a Cerner feed.
Mapping to FHIR
PID maps to FHIR Patient, and the mapping is mostly clean because both are describing the same thing. The work is in PID-3: each repetition becomes one Patient.identifier, with the assigning authority becoming the identifier system and the type code becoming identifier.type. Getting that wrong collapses several identifiers into one and produces duplicate patients downstream.
| HL7 v2 | FHIR R4 | Note |
|---|---|---|
| PID-3 | Patient.identifier | one entry per repetition; assigning authority becomes the system |
| PID-5 | Patient.name | name type L becomes use=official |
| PID-7 | Patient.birthDate | truncate to a date unless the time is clinically needed |
| PID-8 | Patient.gender | administrative only; see the field note |
| PID-11 | Patient.address | address type maps to Address.use |
| PID-13, PID-14 | Patient.telecom | home and business, distinguished by use |
| PID-29, PID-30 | Patient.deceased[x] | date if present, otherwise the boolean |
Parsing pitfalls
An empty field and an explicitly null field are different
Two adjacent delimiters mean the sender said nothing about the field, and the receiver should leave whatever it already holds. A field containing two double quotes means the sender is asserting that the value is null, and the receiver should delete what it holds. Treating the second as the first is how a corrected record silently keeps its old value.
Repetition and components are read in the wrong order
The repetition separator binds more loosely than the component separator, so
A^B~C^Dis two repetitions of two components each, not one repetition of four. Splitting on^before~inverts the structure and is a common source of names appearing in address fields.Escape sequences inside a field
A literal delimiter inside a value arrives escaped:
\F\for the field separator,\S\for component,\T\for subcomponent,\R\for repetition and\E\for the escape character itself. A patient named O\S\Brien is not a two-component name. Unescape after splitting, never before.Segments end with a carriage return
HL7 v2 terminates a segment with
\r, not\nor\r\n. Text editors and HTTP tooling rewrite it freely, and a message that parses in a test fixture will fail against a conformant receiver if the terminator was normalised on the way in.Z-segments can appear anywhere PID does
A site-defined segment beginning with Z may sit between PID and the segment you expect next. A parser that goes by position instead of reading the segment identifier will misattribute the Z-segment content to PID.
Related
- PD1additional demographics that would not fit in PID
- PV1the visit this patient identity is attached to
- NK1next of kin and associated parties for the same patient
- MSHthe header whose sending facility scopes PID-3 assigning authorities
Message types carrying PID
PID appears in 121 message structures, belonging to 76 message types.