Reference·PID Segment·PID-7
HL7 v2 Reference

Understanding HL7 v2 PID-7: Date/Time of Birth in Practice

Jul 27, 2026 · 4 min read
← PID-6 PID-9 →

PID-7 looks like a simple date field until two systems disagree on precision — one sending an 8-digit date and another expecting a full timestamp — and every downstream age calculation or eligibility check quietly starts producing wrong answers.

Quick answer

PID-7 is the seventh field of the HL7 v2 PID segment — it carries the patient’s date and, optionally, time of birth in HL7’s standard timestamp format.

What this field contains

YYYYMMDD
Date-only precision (the most common format seen in ADT feeds)
YYYYMMDDHHMMSS
Full timestamp precision, used when birth time matters (e.g. newborns)

Example

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

19870314 in PID-7 is a date-only value representing March 14, 1987. Synthetic patient — not a real person.

Where this trips people up

Some source systems send date-only precision while a receiving application expects a full timestamp and pads or truncates incorrectly, shifting the parsed date by a day depending on timezone handling. This is especially costly for newborn ADT feeds, where the birth time in PID-7 is clinically meaningful, not just a formatting detail.

HL7 v2 PID Segment Guide: Fields, Format, and Testing Gotchas
How to Write EDI Test Cases That Actually Catch Go-Live Failures
Regression Testing for EHR Upgrades: A Complete Guide
Generate every date-of-birth precision variant
Synthibase generates PID-7 values across the precision formats real feeds actually send, so date-handling bugs surface in testing instead of production.
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.