Reference·HL7 v2·DG1
HL7 v2 Reference

HL7 v2 DG1 Explained: Structure, Fields, and Common Mistakes

Jul 27, 2026 · 6 min read

DG1 looks like a throwaway segment until a claims team calls asking why a patient shows three "final" diagnoses with no admitting diagnosis anywhere in the chart. The segment carries the clinical story that billing, quality reporting, and clinical decision support all lean on, and most of the damage happens in fields nobody bothers to validate.

Quick answer

DG1 (Diagnosis) is the repeating HL7 v2 segment that carries a patient's diagnosis codes, descriptions, and classification within ADT and other trigger events. A message can carry many DG1 segments — one admitting diagnosis, several working diagnoses, and a final diagnosis are common in a single encounter — so testing has to cover ordering, the DG1-6 type code, and whether the ICD code component actually resolves to a real code.

The fields that actually matter in practice

DG1-1 →
Set ID — numbers each repeating DG1 within the message, starting at 1
DG1-3 →
Diagnosis Code - ICD — the coded value itself, built as code^text^coding system
DG1-4 →
Diagnosis Description — free-text label for the diagnosis, often duplicating the text sub-component of DG1-3
DG1-5 →
Diagnosis Date/Time — when the diagnosis was recorded or established, not the encounter date
DG1-6 →
Diagnosis Type — A, W, or F — admitting, working, or final diagnosis
DG1-15 →
Diagnosis Priority — ranks diagnoses when a patient has more than one active diagnosis, primary usually being 1

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 final diagnosis of type 2 diabetes, ranked as the patient's primary diagnosis. Every value here is synthetic.

Where this trips people up

Teams building test messages usually populate one DG1 with a tidy ICD-10 code and move on, then discover in production that real encounters send four or five DG1 repetitions with mixed admitting, working, and final types arriving out of order over the course of a stay. If your test data never exercises multiple DG1 repetitions with different DG1-6 values, you won't catch the bug where a receiving system overwrites the admitting diagnosis instead of appending a new one. It's also worth checking whether DG1-4 and the text component inside DG1-3 are allowed to disagree — some source systems populate them independently, and a naive parser that only reads one of the two will silently drop information the other field carried correctly.

How to Reduce Claim Denials Through Better Pre-Submission Testing
HL7 ADT Messages: A01 through A08 Explained
Test DG1 handling without touching real patient charts
Synthibase generates HL7 v2 messages with realistic, correctly structured DG1 repetitions — multiple diagnosis types, valid ICD-10 mappings, and edge cases — so you can validate your pipeline before a real diagnosis code exposes the gap.
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.