Reference·PID Segment·PID-19
HL7 v2 Reference

Testing HL7 v2 PID-19: What SSN Number - Patient Actually Needs to Handle

Jul 27, 2026 · 4 min read
← PID-18 PID-22 →

PID-19 is one of the highest-risk fields in the entire PID segment to get wrong in a test environment, because unlike most demographic fields, a real social security number dropped into a lower environment is a direct compliance and identity-theft exposure, not just a data-quality issue.

Quick answer

PID-19 is the nineteenth field of the HL7 v2 PID segment — it carries the patient’s social security number, sent either with or without dashes depending on the source system’s formatting convention.

What this field contains

123-45-6789
Dashed format, common in legacy feeds
123456789
Unformatted 9-digit numeric string

Example

Synthetic example Generated by Synthibase
PID|1||847213609^^^HOSP^MR||GARCIA^ELENA^MARIE||19870314|F|||482 OAK ST^^DENVER^CO^80202||3035550142|||M||847213609|123-45-6789

PID-19 carries a synthetic, dashed-format SSN. Synthetic patient — not a real person; this number is not a valid or assigned SSN.

Where this trips people up

Some source systems send SSNs with dashes and others send nine bare digits, so a field-length or format validator tuned to one convention will reject valid values from the other. More critically, teams sometimes copy real production SSNs into test environments to "make testing realistic" — which is exactly the kind of PHI exposure that synthetic test data exists to eliminate.

HL7 v2 PID Segment Guide: Fields, Format, and Testing Gotchas
PHI vs Synthetic Data: What's the Legal Difference?
How to Build a HIPAA-Compliant Test Environment
Never test with real SSNs again
Synthibase generates realistic, properly-formatted synthetic SSNs for PID-19 that are guaranteed not to belong to a real person, removing the temptation to copy production data into test.
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.