Written and maintained by CASRAI Editorial Board
Last updated
The HL7 `PID` segment (Patient Identification segment) is the foundational patient demographic and identity segment defined in Chapter 3 (Patient Administration) of the HL7 Version 2.x messaging standard. Across virtually every patient-centric HL7 v2 message type—including Admission, Discharge, and Transfer (`ADT`), Order (`ORM`/`OMG`), Observation Result (`ORU`), Scheduling (`SIU`), Immunization (`VXU`), and Financial (`DFT`) feeds—the `PID` segment immediately follows the message header (`MSH` and optional `EVN`) to establish Enterprise Master Patient Index (EMPI) linkage during patient registration, laboratory result routing, and clinical trial data integration.
What Is the HL7 PID Segment? Core Fields (`PID-1` Through `PID-30`) Explained
In HL7 v2.5.1 through v2.8.2, the `PID` segment contains up to 39 pipe-delimited (`|`) fields, of which fields `PID-1` through `PID-30` carry the core demographic, identity, and mortality attributes used in hospital interface engines and HL7 parsers:
| Seq | Field Name | HL7 v2 Data Type | Opt / Rep | HL7 Table & Operational Usage Notes |
|---|---|---|---|---|
PID-1 |
Set ID – PID | SI (Sequence ID) |
O / N | 1-based sequence integer (`1`, `2`, …) when multiple `PID` segments appear in a message |
PID-2 |
Patient ID (External) | CX |
B / N | Deprecated / Backward Compatibility Only (v2.4+): Replaced by repeating `PID-3` |
PID-3 |
Patient Identifier List | CX (Extended Composite ID) |
R / Y | Required & Repeating (`~`): Carries MRN (`MR`), EMPI (`PI`), SSN, Driver’s License (`DL`), and Clinical Trial Subject ID (`RI`) per HL7 Table 0203 |
PID-4 |
Alternate Patient ID | CX |
B / Y | Deprecated (v2.4+): Consolidated into `PID-3` repetitions |
PID-5 |
Patient Name | XPN (Extended Person Name) |
R / Y | Required & Repeating: `Family^Given^Middle^Suffix^Prefix^Degree^NameTypeCode` (Table 0200: `L` Legal, `A` Alias, `M` Maiden, `B` Birth) |
PID-6 |
Mother’s Maiden Name | XPN |
O / Y | Used as a secondary biometric/demographic discriminator in EMPI probabilistic matching |
PID-7 |
Date/Time of Birth | DTM (or TS) |
O / N | Format `YYYYMMDD` or `YYYYMMDDHHMMSS` (time of birth critical for neonatal ICU & twin matching) |
PID-8 |
Administrative Sex | IS |
O / N | HL7 Table 0001: `F` (Female), `M` (Male), `O` (Other), `U` (Unknown), `A` (Ambiguous), `N` (Not applicable) |
PID-10 |
Race | CWE (or CE) |
O / Y | Repeating coded element using CDC Race and Ethnicity Code Set (CDCREC, HL7 Table 0005, e.g., `2106-3` White, `2054-5` Black or African American) |
PID-11 |
Patient Address | XAD (Extended Address) |
O / Y | `Street1^Street2^City^State^Zip^Country^AddressType` (Table 0190: `H` Home, `M` Mailing, `B` Business, `C` Current/Temporary) |
PID-13 |
Phone Number – Home | XTN (Extended Telecom) |
O / Y | Repeating telecom structure carrying telephone, mobile (`CP`), and email (`NET^Internet`) |
PID-18 |
Patient Account Number | CX |
O / N | Visit-specific or episode-specific billing account / HAR number (distinct from lifetime MRN in `PID-3`) |
PID-19 |
SSN Number – Patient | ST |
B / N | Deprecated for security/HIPAA reasons: Modern interfaces omit SSN or pass via `PID-3` with type `SS` only when required by law |
PID-22 |
Ethnic Group | CWE (or CE) |
O / Y | HL7 Table 0189 / OMB CDCREC codes (`2135-2` Hispanic or Latino, `2186-5` Not Hispanic or Latino) |
PID-24 / 25 |
Multiple Birth Indicator & Order | ID / NM |
O / N | `PID-24` (`Y`/`N` Table 0136) and `PID-25` (`1`, `2`, …) prevent newborn twin/triplet EMPI collisions when `PID-5` (`BABYBOY`) and `PID-7` match |
PID-29 / 30 |
Patient Death Date/Time & Indicator | DTM / ID |
O / N | `PID-29` records timestamp of death; `PID-30` (`Y`/`N`) flags deceased status |
Composite Data Types Inside `PID-3` (`CX`) and `PID-5` (`XPN`) with Annotated Example
Why did HL7 v2.4+ deprecate `PID-2`, `PID-4`, and `PID-19` in favor of a single repeating field (`PID-3`)? Because a patient in an integrated health system simultaneously possesses a hospital Medical Record Number (`MR`), an Enterprise Master Patient Index UUID (`PI`), a health plan Member ID (`MA`/`MC`), and—if enrolled in a clinical study—a Clinical Trial Subject ID (`RI`). By using the tilde (`~`) repetition delimiter inside `PID-3` with the `CX` (Extended Composite ID with Check Digit) data type, a single field unambiguously tags the assigning authority and identifier type of every ID:
- `CX.1` (ID Number): The identifier string (e.g., `MRN884120`).
- `CX.4` (Assigning Authority — `HD`): Subcomponents `NamespaceID&UniversalID(OID)&UniversalIDType(ISO)` identifying which hospital or trial issued the ID.
- `CX.5` (Identifier Type Code — HL7 Table 0203): `MR` (Medical Record Number), `PI` (Patient Internal Identifier), `PT` (Patient External Identifier), `AN` (Account Number), `RI` (Generalized Resource / Research Subject Identifier), `DL` (Driver’s License), `SS` (Social Security Number).
Annotated HL7 v2.5.1 `PID` Segment Example
PID|1||MRN884120^^^METRO_HOSP&2.16.840.1.113883.3.999&ISO^MR~SUBJ-0419^^^NCT05512345&2.16.840.1.113883.3.888&ISO^RI||GARCIA^ELENA^SOFIA^^DR^^L~MARTINEZ^ELENA^^^^^M|LOPEZ|198104150830|F||2106-3^White^CDCREC|450 BROOKLINE AVE^APT 4B^BOSTON^MA^02215^USA^H||^PRN^PH^^^617^5550199~^NET^Internet^[email protected]|||||ACT99201442||||2135-2^Hispanic or Latino^CDCREC||N||||||N
- `PID-3`: Two tilde-separated (`~`) identifiers: (1) Hospital MRN `MRN884120` assigned by `METRO_HOSP` (`CX.5 = MR`), and (2) Clinical Trial Subject ID `SUBJ-0419` assigned by protocol `NCT05512345` (`CX.5 = RI`).
- `PID-5`: Two tilde-separated (`~`) `XPN` names: Legal name (`XPN.7 = L`) `Dr. Elena Sofia Garcia` and Maiden name (`XPN.7 = M`) `Elena Martinez`.
- `PID-6`: Mother’s maiden surname `LOPEZ`.
- `PID-7` & `PID-8`: Born `1981-04-15` at `08:30` (`198104150830`), Administrative Sex `F`.
- `PID-10` & `PID-22`: OMB/CDC Race (`2106-3` White) and Ethnic Group (`2135-2` Hispanic or Latino).
- `PID-13`: Repeating `XTN` containing primary residence phone (`(617) 555-0199`) and email address (`NET^Internet`).
HL7 v2 `PID` Segment to HL7 FHIR R4 `Patient` Resource Mapping
When an integration engine or clinical data repository converts HL7 v2 feeds into HL7 FHIR resources, the HL7 v2-to-FHIR Implementation Guide maps `PID` fields to the FHIR R4 `Patient` resource (and `Account` resource for `PID-18`) as follows:
| HL7 v2 `PID` Field | HL7 FHIR R4 `Patient` Element | Transformation & ValueSet Translation Rules |
|---|---|---|
PID-3 (`CX[]`) |
Patient.identifier[] (`Identifier`) |
`CX.1` $to$ `value`; `CX.4.2` OID $to$ `system` (`urn:oid:…`); `CX.5` $to$ `type.coding` (`http://terminology.hl7.org/CodeSystem/v2-0203`) |
PID-5 (`XPN[]`) |
Patient.name[] (`HumanName`) |
`XPN.1` $to$ `family`; `[XPN.2, XPN.3]` $to$ `given[]`; `XPN.4` $to$ `suffix[]`; `XPN.5` $to$ `prefix[]`; `XPN.7` (`L`/`A`/`M`) $to$ `use` (`official`/`nickname`/`maiden`) |
PID-6 (`XPN`) |
Extension patient-mothersMaidenName |
`XPN.1.1` mapped to `valueString` on `http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName` |
PID-7 (`DTM`) |
Patient.birthDate (`date`) |
Reformats `YYYYMMDD` to ISO-8601 `YYYY-MM-DD`; if `HHMMSS` present, attaches `patient-birthTime` (`valueDateTime`) extension |
PID-8 (`IS`) |
Patient.gender (`code`) |
Maps Table 0001 `M` $to$ `male`, `F` $to$ `female`, `O`/`A` $to$ `other`, `U`/`N` $to$ `unknown` |
PID-10 / 22 (`CWE`) |
US Core us-core-race & us-core-ethnicity |
Maps CDCREC codes into `ombCategory` and `detailed` sub-extensions required by ONC USCDI |
PID-11 (`XAD[]`) |
Patient.address[] (`Address`) |
`XAD.1`/`2` $to$ `line[]`; `XAD.3` $to$ `city`; `XAD.4` $to$ `state`; `XAD.5` $to$ `postalCode`; `XAD.6` $to$ `country` |
PID-13 / 14 (`XTN[]`) |
Patient.telecom[] (`ContactPoint`) |
Maps `XTN.3` (`PH`/`CP`/`FX`/`Internet`) to `system` (`phone`/`fax`/`email`) and `XTN.2` (`PRN`/`WPN`) to `use` (`home`/`work`/`mobile`) |
PID-24 / 25 |
Patient.multipleBirth[x] |
If `PID-25` integer present $to$ `multipleBirthInteger`; else `PID-24` (`Y`/`N`) $to$ `multipleBirthBoolean` |
PID-29 / 30 |
Patient.deceased[x] |
If `PID-29` timestamp present $to$ `deceasedDateTime`; else `PID-30` (`Y`/`N`) $to$ `deceasedBoolean` |
HIPAA Safe Harbor De-Identification (45 CFR § 164.514(b)) and Clinical Trial `PID` Scrubbing
In clinical research data warehousing and secondary real-world data (RWD) pipelines, the `PID` segment is the primary locus of Protected Health Information (PHI). Of the 18 HIPAA Safe Harbor identifiers defined in 45 CFR § 164.514(b)(2), the majority map directly to `PID` fields: Names (`PID-5`, `PID-6`), Geographic subdivisions smaller than a state (`PID-11.1–11.3`, and `PID-11.5` ZIP code beyond the first 3 digits), Month and Day of Birth or Age > 89 (`PID-7`), Death Date month/day (`PID-29`), Telephone/Fax/Email (`PID-13`, `PID-14`), SSN (`PID-19` / `PID-3` `SS`), Medical Record Numbers (`PID-3` `MR`), and Account Numbers (`PID-18`).
Before routing HL7 v2 `ORU^R01` laboratory messages from a hospital interface engine to a clinical trial Electronic Data Capture (EDC) system or central biobank, outbound interface filters execute an automated `PID` pseudonymization transform: stripping `PID-5`, `PID-6`, `PID-11`, `PID-13`, `PID-18`, and `PID-19`, truncating `PID-7` to birth year (`YYYY`), and retaining only the study-specific Research Subject Identifier repetition (`PID-3` where `CX.5 = RI`) matched via the site’s protected linkage table.
Frequently Asked Questions
What is the HL7 PID segment?
The HL7 `PID` (Patient Identification) segment is the primary demographic and identity segment in HL7 Version 2 (`v2.x`) clinical messages (including `ADT`, `ORM`, `ORU`, `SIU`, `DFT`, and `VXU`). Defined in Chapter 3 of the HL7 v2 standard, the `PID` segment carries the patient’s repeating identifier list in `PID-3` (Medical Record Number, Enterprise Master Patient Index ID, and Research Subject ID using the `CX` data type), legal and alias names in `PID-5` (`XPN`), date/time of birth in `PID-7` (`DTM`), administrative sex in `PID-8`, race and ethnicity in `PID-10` and `PID-22`, address in `PID-11` (`XAD`), telecom in `PID-13`/`PID-14` (`XTN`), and billing account number in `PID-18`.
Sources
- HL7 International. HL7 Messaging Standard Version 2.5.1 / 2.8.2 — Chapter 3: Patient Administration (PID — Patient Identification Segment).
- HL7 International. HL7 Version 2 to FHIR Implementation Guide — ConceptMap: PID Segment to Patient Resource.
- Electronic Code of Federal Regulations (eCFR). 45 CFR § 164.514(b)(2) — HIPAA Safe Harbor De-Identification Standard.







