DG1-3 in HL7 v2: A Field Guide to Diagnosis Code - ICD
DG1-3 is where most of the clinical and financial risk in the DG1 segment concentrates, because it's the field claims systems, quality measures, and clinical decision support all key off — and it's a composite field, not a plain string.
DG1-3 carries the actual diagnosis code using a coded element (CE) structure: the code itself, a text description, and the coding system it came from, separated by carets. A typical value looks like E11.9^Type 2 diabetes mellitus without complications^I10, where I10 identifies ICD-10 as the source vocabulary.
What this field contains
Example
The diagnosis code component broken into identifier, text, and coding system: E11.9^Type 2 diabetes mellitus without complications^I10.
Where this trips people up
A surprising number of interfaces only validate that DG1-3 is non-empty, not that the coding system sub-component matches an ICD-10 pattern or that the identifier is a code that actually exists in that vocabulary. That lets through values where someone pasted an ICD-9 code into an ICD-10 field, or left the coding system sub-component blank so the receiving system has to guess. It's worth building test cases around mismatched coding systems, missing sub-components, and codes with decimal points in unexpected places, since ICD-10 formatting rules trip up parsers that were only ever tested against tidy examples.