HL7 v2 IN2-2 (Insured's Social Security Number): Format, Values, and Testing Notes
IN2-2 is a plain text field with zero validation built in, which means the difference between safe test data and a compliance incident comes down entirely to discipline in your data generator.
IN2-2 holds the Social Security Number of the insured party as a simple string, typically formatted as three digits, a dash, two digits, a dash, four digits. HL7 itself imposes no structural validation on the content, so anything from a properly formatted number to a blank field to free text can appear here depending on how the sending system was built.
What this field contains
Example
IN2-2 carries 000-45-6789 - an obviously fake SSN pattern using the invalid 000 area-number prefix, safe for use in any shared test environment.
Where this trips people up
Two mistakes show up constantly. The first is generating SSNs that are structurally valid and therefore indistinguishable from a real person's number - a real compliance exposure if that test data ever leaks into a shared environment or log file. The second is the opposite problem: leaving IN2-2 blank across every synthetic record because it feels safer, which means any parsing, masking, or redaction logic your system has for this field never actually runs against populated data until it hits production.