Reference·DG1 Segment·DG1-5
HL7 v2 Reference

Understanding HL7 v2 DG1-5: Diagnosis Date/Time in Practice

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

DG1-5 gets treated as an afterthought copy of the admission date, but it's supposed to record when the diagnosis itself was established — a distinction that matters once you're reconciling a diagnosis timeline against a multi-day inpatient stay.

Quick answer

DG1-5 is a timestamp recording when the diagnosis was established or recorded, formatted as an HL7 date/time value such as YYYYMMDDHHMM. It is not the encounter date and doesn't have to match DG1-1's ordering — a working diagnosis added on day three of a stay should carry day three's timestamp, not the admission date.

What this field contains

Format
YYYYMMDD[HHMM[SS]] — a date, optionally extended with time down to seconds
Meaning
When diagnosed — the moment the diagnosis was established, not when the encounter began
Optional precision
Time zone offset — can be appended, though many source systems omit it and assume local time

Example

Synthetic example Generated by Synthibase
DG1|1||E11.9^Type 2 diabetes mellitus without complications^I10|Type 2 diabetes mellitus without complications|202607250830|F||||||||1

A diagnosis timestamped 08:30 on July 25, 2026 — recorded, in this scenario, the morning after the patient was admitted.

Where this trips people up

Because this field is easy to leave blank without triggering a validation error, plenty of production messages carry no DG1-5 at all, and systems that assume a timestamp will always be present end up sorting diagnoses arbitrarily or crashing on a null date parse. It's also worth testing partial-precision values — a date with no time component — since some parsers assume full HHMM precision and mishandle a bare YYYYMMDD. If your organization exchanges messages across time zones, confirm whether the offset is expected and what happens to a value that omits it.

HL7 v2 DG1 Explained: Structure, Fields, and Common Mistakes
Regression Testing for EHR Upgrades: A Complete Guide
How to Write EDI Test Cases That Actually Catch Go-Live Failures
Test timestamp edge cases without guessing
Synthibase generates DG1 test data with varied date/time precision, missing timestamps, and timezone edge cases so you can confirm your parsing logic holds up.
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.