HL7 v2 DG1-1 (Set ID): Format, Values, and Testing Notes
DG1-1 is a single number, which is exactly why it gets overlooked — until a message with five diagnoses lands and three of them share the value "1" because a source system never bothered to increment it.
DG1-1 is a sequence number that identifies which repetition of the DG1 segment you're looking at within a message. The first DG1 in the message is 1, the second is 2, and so on — it exists so downstream systems can keep repeating diagnosis segments in order and reference a specific one without ambiguity.
What this field contains
Example
Set ID value of 1 marking this as the first (and in this example, only) DG1 repetition in the message.
Where this trips people up
The most common failure isn't a malformed value, it's a system that generates every DG1-1 as "1" regardless of how many diagnosis segments are actually in the message, because whoever built the interface assumed there'd only ever be one diagnosis. That works fine until a multi-diagnosis encounter comes through and the receiving application either overwrites earlier diagnoses or throws a duplicate-key error depending on how it keys off this field. Test with messages carrying at least three DG1 repetitions with properly incrementing values, and separately test what happens when a sending system violates that assumption.