HL7 PID Segment: Patient Identification
The HL7 PID segment (Patient Identification) carries the patient’s demographic and identification data. It appears in virtually every HL7 v2 message type — ADT, ORM, ORU, SIU, DFT, and more. Correct PID mapping is critical for patient matching and record linkage across systems.
PID Field Reference
Section titled “PID Field Reference”| Seq | Name | Type | Opt | Description |
|---|---|---|---|---|
PID-1 | Set ID | SI | O | Sequence number (usually 1) |
PID-2 | Patient ID (External) | CX | W | Withdrawn in v2.3.1 — use PID-3 |
★ PID-3 | Patient Identifier List | CX | R | MRN and all identifiers (repeating) |
| Primary matching key. Must include assigning authority (CX.4) and identifier type (CX.5). Repeat for multiple identifiers (MRN, EMPI, account number). | ||||
PID-4 | Alternate Patient ID | CX | W | Withdrawn — use PID-3 |
★ PID-5 | Patient Name | XPN | R | Family^Given^Middle^Suffix^Prefix |
| XPN data type. Can repeat for legal name, alias, maiden name. XPN.7 indicates name type (L=Legal, A=Alias, M=Maiden). | ||||
PID-6 | Mother's Maiden Name | XPN | O | Used for identity verification |
★ PID-7 | Date/Time of Birth | TS | O | YYYYMMDD format |
| Critical for patient matching. Some systems send YYYYMMDDHHMMSS — receiving systems should handle both formats. | ||||
★ PID-8 | Administrative Sex | IS | O | M, F, O, U, A, N |
PID-9 | Patient Alias | XPN | W | Withdrawn in v2.5 |
PID-10 | Race | CE | O | HL7 table 0005 |
★ PID-11 | Patient Address | XAD | O | Street^City^State^Zip^Country |
PID-12 | County Code | IS | W | Withdrawn — use PID-11 |
★ PID-13 | Phone (Home) | XTN | O | Home phone number |
★ PID-14 | Phone (Business) | XTN | O | Work phone number |
PID-15 | Primary Language | CE | O | Preferred language |
PID-16 | Marital Status | CE | O | HL7 table 0002 |
PID-17 | Religion | CE | O | HL7 table 0006 |
★ PID-18 | Patient Account Number | CX | O | Visit/encounter account |
| Often used as a secondary matching key. Maps to the encounter/visit-level account in the receiving system. | ||||
PID-19 | SSN (Patient) | ST | W | Withdrawn — use PID-3 |
| Still populated by many legacy systems. Modern implementations should use PID-3 with identifier type SS. | ||||
PID-20 | Driver's License | DLN | W | Withdrawn in v2.5 |
PID-21 | Mother's Identifier | CX | O | Links newborn to mother |
PID-22 | Ethnic Group | CE | O | HL7 table 0189 |
PID-23 | Birth Place | ST | O | City/state of birth |
PID-24 | Multiple Birth Indicator | ID | O | Y/N for twins, triplets |
PID-25 | Birth Order | NM | O | 1, 2, 3 for multiples |
PID-26 | Citizenship | CE | O | Country of citizenship |
PID-27 | Veterans Status | CE | O | Military veteran indicator |
PID-28 | Nationality | CE | W | Withdrawn in v2.5 |
PID-29 | Patient Death Date | TS | O | Date and time of death |
PID-30 | Patient Death Indicator | ID | O | Y/N |
PID-31 | Identity Unknown | ID | O | Y if patient cannot be identified |
PID-32 | Identity Reliability | IS | O | AL (alias), UA (unknown), IT (temp) |
PID-33 | Last Update Date | TS | O | When PID data was last modified |
PID-34 | Last Update Facility | HD | O | Facility that last updated the record |
PID-35 | Taxonomic Classification | CE | O | Species code (veterinary) |
PID-36 | Breed Code | CE | O | Breed (veterinary) |
PID-37 | Strain | ST | O | Strain (veterinary) |
PID-38 | Production Class | CE | O | Production class (veterinary) |
PID-39 | Tribal Citizenship | CWE | O | Added in v2.6 |
★ PID-3 R MRN and all identifiers (repeating)
Primary matching key. Must include assigning authority (CX.4) and identifier type (CX.5). Repeat for multiple identifiers (MRN, EMPI, account number).
★ PID-5 R Family^Given^Middle^Suffix^Prefix
XPN data type. Can repeat for legal name, alias, maiden name. XPN.7 indicates name type (L=Legal, A=Alias, M=Maiden).
★ PID-7 O YYYYMMDD format
Critical for patient matching. Some systems send YYYYMMDDHHMMSS — receiving systems should handle both formats.
★ PID-18 O Visit/encounter account
Often used as a secondary matching key. Maps to the encounter/visit-level account in the receiving system.
PID-19 W Withdrawn — use PID-3
Still populated by many legacy systems. Modern implementations should use PID-3 with identifier type SS.
R = Required, O = Optional, C = Conditional, W = Withdrawn (backward compatibility only)
PID-3: Patient Identifier List (Critical Field)
Section titled “PID-3: Patient Identifier List (Critical Field)”PID-3 is the most important field in the PID segment. It carries a repeating list of patient identifiers, each with its assigning authority and identifier type:
PID|||MRN12345^^^MAIN_HOSP^MR~SSN987654321^^^SSA^SS~ENT00567^^^MAIN_HOSP^AN||...PID-3 Components
Section titled “PID-3 Components”| Component | Name | Example |
|---|---|---|
| CX.1 | ID Number | MRN12345 |
| CX.2 | Check Digit | (optional) |
| CX.3 | Check Digit Scheme | (optional) |
| CX.4 | Assigning Authority | MAIN_HOSP |
| CX.5 | Identifier Type | MR (Medical Record Number) |
| CX.6 | Assigning Facility | (optional) |
Common Identifier Types (CX.5)
Section titled “Common Identifier Types (CX.5)”| Code | Meaning |
|---|---|
| MR | Medical Record Number |
| AN | Account Number |
| SS | Social Security Number |
| PI | Patient Internal Identifier |
| PT | Patient External Identifier |
| DL | Driver’s License |
| MA | Medicaid Number |
| MC | Medicare Number |
| NPI | National Provider Identifier |
| VN | Visit Number |
Assigning Authority
Section titled “Assigning Authority”The assigning authority (CX.4) identifies which system or facility assigned the identifier. In a multi-facility health system, a patient may have different MRNs at each facility:
MRN12345^^^HOSP_A^MR~MRN67890^^^HOSP_B^MR~EMPI99999^^^ENTERPRISE^PIThe receiving system must know which assigning authority’s MRN to use for patient matching in its own database.
PID-5: Patient Name
Section titled “PID-5: Patient Name”The XPN (Extended Person Name) data type structures the patient’s name:
DOE^JOHN^ALEXANDER^III^DR^PHD| Component | Name | Example |
|---|---|---|
| XPN.1 | Family Name | DOE |
| XPN.2 | Given Name | JOHN |
| XPN.3 | Middle Name | ALEXANDER |
| XPN.4 | Suffix | III |
| XPN.5 | Prefix | DR |
| XPN.6 | Degree | PHD |
| XPN.7 | Name Type | L (Legal), A (Alias), M (Maiden) |
PID-5 can repeat — for example, legal name followed by alias:
DOE^JOHN^A^^^||~DOE^JACK^^^^A||PID-8: Administrative Sex Codes
Section titled “PID-8: Administrative Sex Codes”| Code | Meaning |
|---|---|
| M | Male |
| F | Female |
| O | Other |
| U | Unknown |
| A | Ambiguous |
| N | Not applicable |
Key Implementation Considerations
Section titled “Key Implementation Considerations”Patient Matching Pitfalls
Section titled “Patient Matching Pitfalls”The most common PID-related integration errors:
- Wrong assigning authority: Mapping the wrong MRN when multiple facilities share an interface
- Missing identifier type: Not populating CX.5, leaving receiving systems unable to classify the identifier
- Name format mismatches: Sending “JOHN A” in the given name field vs separate given and middle components
- Date format inconsistency: Some systems send DOB as YYYYMMDD, others as YYYYMMDDHHMMSS
- SSN in PID-19 vs PID-3: Withdrawn field PID-19 is still populated by many legacy systems; modern implementations should use PID-3 with identifier type SS
Multi-Facility MRN Handling
Section titled “Multi-Facility MRN Handling”In health systems with multiple facilities, each facility may assign its own MRN. The enterprise master patient index (EMPI) assigns a global identifier that links facility-specific MRNs together. PID-3 should contain both:
- The facility-specific MRN (for local system matching)
- The EMPI identifier (for cross-facility correlation)
Demographic Updates (ADT^A08 / A31)
Section titled “Demographic Updates (ADT^A08 / A31)”When patient demographics change, the source system sends an ADT message with the updated PID segment. Receiving systems must:
- Match on PID-3 identifiers to find the existing patient record
- Update only the fields that changed (some systems send the full PID regardless)
- Maintain audit history of demographic changes
- Handle name changes carefully (marriage, legal name change) without creating duplicate records