Reference·X12 837P·HI
X12 837P Reference

X12 837P HI Segment Guide: Fields, Format, and Testing Gotchas

Jul 27, 2026 · 6 min read

HI looks like a single segment but it's really a container for a whole list of diagnosis codes, each one wrapped in its own composite with a qualifier that says what role that diagnosis plays. Build a test file where the composites are out of order, or where the qualifier doesn't match the position, and the claim still parses fine — it just tells the payer the wrong condition was the reason for the visit.

Quick answer

HI (Health Care Diagnosis Code) is the segment in an 837P claim that carries the ICD-10-CM diagnosis codes tied to the claim. Each diagnosis sits in its own composite element within HI, made up of a qualifier that states the diagnosis type (principal, other, admitting, and so on) paired with the actual code value.

How the composite elements are structured

HI01
First diagnosis composite — always present — carries the principal diagnosis in most 837P claims
HI02-HI12
Additional diagnosis composites — repeat the same qualifier:code shape for secondary and other diagnoses, up to twelve total
ABK →
Principal ICD-10-CM Diagnosis — the qualifier marking the primary reason for the encounter — see the dedicated page below
ABF →
Other ICD-10-CM Diagnosis — the qualifier for secondary or additional diagnoses — see the dedicated page below
ABJ
Admitting Diagnosis — used in some claim contexts to record the diagnosis noted at admission, which may differ from the principal diagnosis

Example

Synthetic example Generated by Synthibase
HI*ABK:E119*ABF:I10*

ABK:E119 marks type 2 diabetes without complications as the principal diagnosis; ABF:I10 adds essential hypertension as a secondary diagnosis. Synthetic claim data.

Where this trips people up

Because every composite in HI shares the same qualifier:code shape, a test generator that just cycles through a code list without tracking which qualifier belongs in which position can produce a claim where a secondary condition ends up tagged as the principal diagnosis, or where two composites both claim to be principal. Nothing about the syntax flags this — the segment still validates — but downstream medical necessity and risk-adjustment logic reads the wrong diagnosis as the reason for the visit, and that's a much harder bug to trace back to its source.

What is X12 837P? Complete Format and Field Guide
How to Generate Synthetic X12 837 Test Data for EDI Go-Live Testing
Generate synthetic HI segments with correctly ordered diagnoses
Synthibase generates synthetic 837P claims with properly qualified HI composites — principal, secondary, and admitting diagnoses in the right order — no PHI, no mismatched qualifiers.
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.