Build Health Care Claim EDI (X12 837)
Skill: Convert a patient encounter into an X12 837 health care claim
Region: United States
Category: Health Care EDI (HIPAA X12 5010)
Does: Takes a provider's patient-encounter and billing data and assembles the ASC X12N 837 Health Care Claim EDI transaction — the HIPAA-mandated electronic format providers send to payers (and clearinghouses) to bill professional, institutional, or dental services.
Spec: ASC X12 005010 — 837P 005010X222A1 (Professional) · 837I 005010X223A2 (Institutional) · 837D 005010X224A2 (Dental)
837 is mandated under HIPAA for electronic claims and is governed by the X12 Technical Report Type 3 (TR3 / Implementation Guide) for the variant. Loop/segment IDs below are the standard 5010 structure; the TR3 is the authority for usage, situational rules, and code sets — always validate against the correct variant's TR3. Trading partners also impose companion guides (payer-specific) on top of the TR3.
Transaction envelope
ISA Interchange Control Header (authorization, sender/receiver IDs, control no.)
GS Functional Group Header (HC = health care claim, version 005010X222A1)
ST Transaction Set Header (837)
BHT Beginning of Hierarchical Transaction
... loops below ...
SE Transaction Set Trailer (segment count, control no.)
GE Functional Group Trailer
IEA Interchange Control Trailer
ISA/IEA and GS/GE are the interchange/group envelopes; ST/SE wraps one 837. Element separator, sub-element separator, and segment terminator are declared in ISA.
Hierarchical loop structure (837P)
1000A Submitter Name (NM1·41) + PER contact
1000B Receiver Name (NM1·40)
2000A Billing Provider HL (PRV taxonomy, CUR)
2010AA Billing Provider Name/Address (NM1·85, N3/N4, REF EIN/NPI)
2010AB Pay-to Address (situational)
2000B Subscriber HL (SBR — payer responsibility, group)
2010BA Subscriber Name (NM1·IL) + DMG demographics
2010BB Payer Name (NM1·PR)
2000C Patient HL (only if patient ≠ subscriber)
2300 CLAIM (CLM, DTP dates, HI diagnosis codes)
2310x Rendering / Service-facility / Referring providers
2320 Other subscriber / COB (AMT, OI, CAS prior-payer adjustments)
2400 SERVICE LINE (LX, SV1 procedure+charge, DTP, REF)
837I uses revenue codes + bill type (CLM/SV2); 837D uses dental (SV3) — same envelope, different service-line and code sets.
Key segments
| Segment | Carries |
|---|---|
BHT |
claim or encounter purpose, originator app, creation date/time |
NM1 |
a named entity — qualifier sets the role (85 billing, IL subscriber, PR payer, 82 rendering) + NPI |
SBR |
payer responsibility sequence (P/S/T), relationship, group/plan |
CLM |
claim ID, total charge, place of service, provider signature/assignment indicators |
HI |
diagnosis codes (ICD-10-CM, pointer order matters) |
SV1 |
professional service: HCPCS/CPT procedure + modifiers, line charge, units, diagnosis pointers |
DTP |
service / admission / accident dates |
REF |
identifiers (EIN, prior auth, claim control number) |
Data rules
- NPI (10-digit National Provider Identifier) identifies providers; the subscriber/patient carry the member ID; payer carries the Payer ID.
- Diagnosis = ICD-10-CM in
HI; procedures = CPT/HCPCS with modifiers inSV1(837P) — line-level diagnosis pointers map each service line to theHIdiagnoses by position. - Claim charge (
CLM02) must equal the sum of the service-line charges (SV1line amounts) within the claim. - Coordination of benefits (secondary claims) carries the prior payer's adjustments in
CASand paid amount inAMTwithin loop 2320/2430; balances must reconcile to the prior payer's 835. SEsegment count must equal the actual number of segments fromSTtoSEinclusive; control numbers inISA/IEA,GS/GE,ST/SEmust match their trailers.
Worked example (837P, one office visit — skeleton)
ISA*00* *00* *ZZ*SUBMITTERID *ZZ*PAYERID *250531*1200*^*00501*000000001*0*P*:~
GS*HC*SUBMITTERID*PAYERID*20250531*1200*1*X*005010X222A1~
ST*837*0001*005010X222A1~
BHT*0019*00*REF123*20250531*1200*CH~
NM1*41*2*ACME BILLING*****46*SUBMITTERID~
NM1*40*2*BCBS*****46*PAYERID~
HL*1**20*1~
NM1*85*2*FAMILY CLINIC PA*****XX*1234567893~ (Billing provider, NPI)
HL*2*1*22*0~
SBR*P*18*******CI~
NM1*IL*1*DOE*JANE****MI*MEMBER123~ (Subscriber/member)
NM1*PR*2*BCBS*****PI*PAYERID~
CLM*PATCTL001*125***11:B:1*Y*A*Y*Y~ (Claim, total charge 125.00, POS 11)
HI*ABK:J0190~ (ICD-10-CM diagnosis)
LX*1~
SV1*HC:99213*125*UN*1***1~ (CPT 99213, charge 125.00, dx pointer 1)
DTP*472*D8*20250531~ (service date)
SE*16*0001~
GE*1*1~
IEA*1*000000001~
(Single line charge 125.00 = CLM02 total; SE count = number of segments ST…SE.)
Validation checklist
- Correct variant TR3 used (837P
X222A1/ 837IX223A2/ 837DX224A2) + payer companion guide -
ISA/GS/STenvelope IDs, version, and control numbers match their trailers;SEsegment count correct - Billing/rendering provider NPIs present; subscriber member ID and payer ID correct
- Diagnoses are ICD-10-CM (
HI); services are CPT/HCPCS with valid modifiers (SV1) - Diagnosis pointers on each service line reference existing
HIpositions - Claim charge = Σ service-line charges; units and dates present
- COB/secondary claims carry prior-payer
CAS/AMTreconciling to the 835 - Delimiters consistent; file passes a 5010 X12/HIPAA validator before transmission
Last updated: 2026-05-31 — verify the exact loop/segment usage, situational rules, and code sets against the current ASC X12 005010 TR3 for the 837 variant (P/I/D) and the payer's companion guide before use.