HL7 v2 PID-8 (Administrative Sex): Format, Values, and Testing Notes
Most integrations are built and tested assuming PID-8 only ever contains M or F — until an upstream feed sends O, U, A, or N and the message gets silently rejected or mis-mapped downstream.
PID-8 is the eighth field of the HL7 v2 PID segment — it carries the patient’s administrative sex as a coded value, used for demographic and billing purposes across ADT, ORU, and other message types.
Valid code values
Example
The 8th field (F) marks the patient as female. Synthetic patient — not a real person.
Where this trips people up
Systems built to expect only M or F will reject or mis-map O/U/A/N values coming from upstream feeds. This is exactly the kind of edge case that passes a happy-path test suite and then fails on real go-live data — worth testing explicitly before launch, not discovering in production.