Reference·PID Segment·PID-22
HL7 v2 Reference

PID-22 in HL7 v2: A Field Guide to Ethnic Group

Jul 27, 2026 · 4 min read
← PID-19

PID-22 (Ethnic Group) and PID-10 (Race) are frequently confused by developers who assume one field covers both concepts, and an integration that maps ethnicity data into the race field, or vice versa, will quietly corrupt demographic reporting without throwing a single error.

Quick answer

PID-22 is the twenty-second field of the HL7 v2 PID segment — it carries a coded value representing the patient’s ethnic group, most commonly a Hispanic-or-Latino designation, distinct from the race values carried in PID-10.

Valid code values

H
Hispanic or Latino
N
Not Hispanic or Latino
U
Unknown

Example

Synthetic example Generated by Synthibase
PID|1||847213609^^^HOSP^MR||GARCIA^ELENA^MARIE||19870314|F|||482 OAK ST^^DENVER^CO^80202||3035550142||||2106-3|||||||H

H in PID-22 records the patient as Hispanic or Latino, a separate data point from the race code carried earlier in PID-10. Synthetic patient — not a real person.

Where this trips people up

Because PID-10 and PID-22 are both demographic classification fields sitting a few positions apart in the segment, it is a common implementation error to map ethnicity values into the race field or leave PID-22 unmapped entirely. The bug rarely surfaces in functional testing — it shows up later as skewed or missing categories in public-health and quality-reporting output.

HL7 v2 PID Segment Guide: Fields, Format, and Testing Gotchas
Healthcare API Testing Guide: FHIR and X12
How to Build a Synthetic Patient Registry for Healthcare Testing
Test race and ethnicity fields independently
Synthibase generates synthetic patients with distinct, correctly-mapped race and ethnicity values, so reporting pipelines get tested against clean data before real demographic reporting is at stake.
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.