The 837I is the HIPAA transaction hospitals, skilled nursing facilities, home health agencies and other institutions use to bill payers. It is the electronic version of the UB-04 (CMS-1450) form.
Institutional claims carry facility information that professional claims do not: the CL1 segment with admission type, source and discharge status, revenue codes on each SV2 service line, and HI segments for the principal and admitting diagnosis, procedures, condition, occurrence and value codes.
005010X223A2HC (GS01)TS837I in EdiFabric.Templates.HipaaThe full X12 837I layout from its OpenEDI definition, the same model ediFabric uses to parse, validate and generate it: 59 loops and 273 segment positions, in file order. Loops are shaded and their segments indented; Max use is how many times a segment or loop may repeat.
| Segment / loop | Name | Usage | Max use |
|---|---|---|---|
ST | Transaction Set Header | Required | 1 |
BHT | Beginning of Hierarchical Transaction | Required | 1 |
| Any order | The loops below can appear in any order | Required | 1 |
| Loop 1000A | Submitter Name | Required | 1 |
NM1 | Submitter Name | Required | 1 |
PER | Submitter EDI Contact Information | Required | 2 |
| Loop 1000B | Receiver Name | Required | 1 |
NM1 | Receiver Name | Required | 1 |
| Loop 2000A | Billing Provider Hierarchical Level | Required | >1 |
HL | Billing Provider Hierarchical Level | Required | 1 |
PRV | Billing Provider Specialty Information | Situational | 1 |
CUR | Foreign Currency Information | Situational | 1 |
| Any order | The loops below can appear in any order | Required | 1 |
| Loop 2010AA | Billing Provider Name | Required | 1 |
NM1 | Billing Provider Name | Required | 1 |
N3 | Billing Provider Address | Required | 1 |
N4 | Billing Provider City State ZIP Code | Required | 1 |
REF | Billing Provider Tax Identification | Required | 1 |
PER | Billing Provider Contact Information | Situational | 2 |
| Loop 2010AB | Pay Address Name | Situational | 1 |
NM1 | Pay Address Name | Required | 1 |
N3 | Pay to Address ADDRESS | Required | 1 |
N4 | Pay Address City State ZIP Code | Required | 1 |
| Loop 2010AC | Pay to Plan Name | Situational | 1 |
NM1 | Pay to Plan Name | Required | 1 |
N3 | Pay to Plan Address | Required | 1 |
N4 | Pay to Plan City State Zip Code | Required | 1 |
| Any order | The loops below can appear in any order | Required | 1 |
REF | Pay to Plan Secondary Identification | Situational | 1 |
REF | Pay to Tax Identification Number | Required | 1 |
| Loop 2000B | Subscriber Hierarchical Level | Required | >1 |
HL | Subscriber Hierarchical Level | Required | 1 |
SBR | Subscriber Information | Required | 1 |
| Any order | The loops below can appear in any order | Required | 1 |
| Loop 2010BA | Subscriber Name | Required | 1 |
NM1 | Subscriber Name | Required | 1 |
N3 | Subscriber Address | Situational | 1 |
N4 | Subscriber City State ZIP Code | Situational | 1 |
DMG | Subscriber Demographic Information | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Subscriber Secondary Identification | Situational | 1 |
REF | Propertyand Casualty Claim Number | Situational | 1 |
| Loop 2010BB | Payer Name | Required | 1 |
NM1 | Payer Name | Required | 1 |
N3 | Payer Address | Situational | 1 |
N4 | Payer City State ZIP Code | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Payer Secondary Identification | Situational | 3 |
REF | Billing Provider Secondary Identification | Situational | 1 |
| Loop 2300 | Claim Information | Situational | 100 |
CLM | Claim Information | Required | 1 |
| Any order | The loops below can appear in any order | Required | 1 |
DTP | Discharge Hour | Situational | 1 |
DTP | Statement Dates | Required | 1 |
DTP | Admission Date Hour | Situational | 1 |
DTP | Date Repricer Received Date | Situational | 1 |
CL1 | Institutional Claim Code | Required | 1 |
PWK | Claim Supplemental Information | Situational | 10 |
CN1 | Contract Information | Situational | 1 |
AMT | Patient Estimated Amount Due | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Service Authorization Exception Code | Situational | 1 |
REF | Referral Number | Situational | 1 |
REF | Prior Authorization | Situational | 1 |
REF | Payer Claim Control Number | Situational | 1 |
REF | Repriced Claim Number | Situational | 1 |
REF | Adjusted Repriced Claim Number | Situational | 1 |
REF | Investigational Device Exemption Number | Situational | 5 |
REF | Claim Identifier for Transmission Intermediaries | Situational | 1 |
REF | Auto Accident State | Situational | 1 |
REF | Medical Record Number | Situational | 1 |
REF | Demonstration Project Identifier | Situational | 1 |
REF | Peer Review Organization PRO Approval Number | Situational | 1 |
K3 | File Information | Situational | 10 |
| Any order | The loops below can appear in any order | Situational | 1 |
NTE | Claim Note | Situational | 10 |
NTE | Billing Note | Situational | 1 |
CRC | EPSDT Referral | Situational | 1 |
| Any order | The loops below can appear in any order | Required | 1 |
HI | Principal Diagnosis | Required | 1 |
HI | Admitting Diagnosis | Situational | 1 |
HI | Patient Reason for Visit | Situational | 1 |
HI | External Causeof Injury | Situational | 1 |
HI | Diagnosis Related Group DRG Information | Situational | 1 |
HI | Other Diagnosis Information | Situational | 2 |
HI | Principal Procedure Information | Situational | 1 |
HI | Other Procedure Information | Situational | 2 |
HI | Occurrence Span Information | Situational | 2 |
HI | Occurrence Information | Situational | 2 |
HI | Value Information | Situational | 2 |
HI | Condition Information | Situational | 2 |
HI | Treatment Code Information | Situational | 2 |
HCP | Claim Pricing Repricing Information | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
| Loop 2310A | Attending Provider Name | Situational | 1 |
NM1 | Attending Provider Name | Required | 1 |
PRV | Attending Provider Specialty Information | Situational | 1 |
REF | Attending Provider Secondary Identification | Situational | 4 |
| Loop 2310B | Operating Physician Name | Situational | 1 |
NM1 | Operating Physician Name | Required | 1 |
REF | Operating Physician Secondary Identification | Situational | 4 |
| Loop 2310C | Other Operating Physician Name | Situational | 1 |
NM1 | Other Operating Physician Name | Required | 1 |
REF | Other Operating Physician Secondary Identification | Situational | 4 |
| Loop 2310D | Rendering Provider Name | Situational | 1 |
NM1 | Rendering Provider Name | Required | 1 |
REF | Rendering Provider Secondary Identification | Situational | 4 |
| Loop 2310E | Service Facility Location Name | Situational | 1 |
NM1 | Service Facility Location Name | Required | 1 |
N3 | Service Facility Location Address | Required | 1 |
N4 | Service Facility Location City State ZIP | Required | 1 |
REF | Service Facility Secondary Identification | Situational | 3 |
| Loop 2310F | Referring Provider Name | Situational | 1 |
NM1 | Referring Provider Name | Required | 1 |
REF | Referring Provider Secondary Identification | Situational | 3 |
| Loop 2320 | Other Subscriber Information | Situational | 10 |
SBR | Other Subscriber Information | Required | 1 |
CAS | Claim Level Adjustments | Situational | 5 |
| Any order | The loops below can appear in any order | Situational | 1 |
AMT | Coordinationof Benefits COB Payer Paid Amount | Situational | 1 |
AMT | Remaining Patient Liability | Situational | 1 |
AMT | Coordinationof Benefits COB Total Non Amount | Situational | 1 |
OI | Other Insurance Coverage Information | Required | 1 |
MIA | Inpatient Adjudication Information | Situational | 1 |
MOA | Outpatient Adjudication Information | Situational | 1 |
| Any order | The loops below can appear in any order | Required | 1 |
| Loop 2330A | Other Subscriber Name | Required | 1 |
NM1 | Other Subscriber Name | Required | 1 |
N3 | Other Subscriber Address | Situational | 1 |
N4 | Other Subscriber City State ZIP Code | Situational | 1 |
REF | Other Subscriber Secondary Information | Situational | 2 |
| Loop 2330B | Other Payer Name | Required | 1 |
NM1 | Other Payer Name | Required | 1 |
N3 | Other Payer Address | Situational | 1 |
N4 | Other Payer City State ZIP Code | Situational | 1 |
DTP | Claim Check or Remittance Date | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Other Payer Secondary Identifier | Situational | 2 |
REF | Other Payer Prior Authorization Number | Situational | 1 |
REF | Other Payer Referral Number | Situational | 1 |
REF | Other Payer Claim Adjustment Indicator | Situational | 1 |
REF | Other Payer Claim Control Number | Situational | 1 |
| Loop 2330C | Other Payer Attending Provider | Situational | 1 |
NM1 | Other Payer Attending Provider | Required | 1 |
REF | Other Payer Attending Provider Secondary Identification | Required | 4 |
| Loop 2330D | Other Payer Operating Physician | Situational | 1 |
NM1 | Other Payer Operating Physician | Required | 1 |
REF | Other Payer Operating Physician Secondary Identification | Required | 4 |
| Loop 2330E | Other Payer Other Operating Physician | Situational | 1 |
NM1 | Other Payer Other Operating Physician | Required | 1 |
REF | Other Payer Other Operating Physician Secondary Identification | Required | 4 |
| Loop 2330F | Other Payer Service Facility Location | Situational | 1 |
NM1 | Other Payer Service Facility Location | Required | 1 |
REF | Other Payer Service Facility Location Secondary Identification | Required | 3 |
| Loop 2330G | Other Payer Rendering Provider Name | Situational | 1 |
NM1 | Other Payer Rendering Provider Name | Required | 1 |
REF | Other Payer Rendering Provider Secondary Identifier | Required | 4 |
| Loop 2330H | Other Payer Referring Provider | Situational | 1 |
NM1 | Other Payer Referring Provider | Required | 1 |
REF | Other Payer Referring Provider Secondary Identification | Required | 3 |
| Loop 2330I | Other Payer Billing Provider | Situational | 1 |
NM1 | Other Payer Billing Provider | Required | 1 |
REF | Other Payer Billing Provider Secondary Identifier | Required | 2 |
| Loop 2400 | Service Line Number | Required | 999 |
LX | Service Line Number | Required | 1 |
SV2 | Institutional Service Line | Required | 1 |
PWK | Line Supplemental Information | Situational | 10 |
DTP | Date Service Date | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Line Item Control Number | Situational | 1 |
REF | Repriced Line Item Reference Number | Situational | 1 |
REF | Adjusted Repriced Line Item Reference Number | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
AMT | Service Tax Amount | Situational | 1 |
AMT | Facility Tax Amount | Situational | 1 |
NTE | Third Party Organization Notes | Situational | 1 |
HCP | Line Pricing Repricing Information | Situational | 1 |
| Loop 2410 | Drug Identification | Situational | 1 |
LIN | Drug Identification | Required | 1 |
CTP | Drug Quantity | Required | 1 |
REF | Prescriptionor Compound Drug Association Number | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
| Loop 2420A | Operating Physician Name | Situational | 1 |
NM1 | Operating Physician Name | Required | 1 |
REF | Operating Physician Secondary Identification | Situational | 20 |
| Loop 2420B | Other Operating Physician Name | Situational | 1 |
NM1 | Other Operating Physician Name | Required | 1 |
REF | Other Operating Physician Secondary Identification | Situational | 20 |
| Loop 2420C | Rendering Provider Name | Situational | 1 |
NM1 | Rendering Provider Name | Required | 1 |
REF | Rendering Provider Secondary Identification | Situational | 20 |
| Loop 2420D | Referring Provider Name | Situational | 1 |
NM1 | Referring Provider Name | Required | 1 |
REF | Referring Provider Secondary Identification | Situational | 20 |
| Loop 2430 | Line Adjudication Information | Situational | 15 |
SVD | Line Adjudication Information | Required | 1 |
CAS | Line Adjustment | Situational | 5 |
DTP | Line Checkor Remittance Date | Required | 1 |
AMT | Remaining Patient Liability | Situational | 1 |
| Loop 2000C | Patient Hierarchical Level | Situational | >1 |
HL | Patient Hierarchical Level | Required | 1 |
PAT | Patient Information | Required | 1 |
| Loop 2010CA | Patient Name | Required | 1 |
NM1 | Patient Name | Required | 1 |
N3 | Patient Address | Required | 1 |
N4 | Patient City State ZIP Code | Required | 1 |
DMG | Patient Demographic Information | Required | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Propertyand Casualty Claim Number | Situational | 1 |
REF | Propertyand Casualty Patient Identifier | Situational | 1 |
| Loop 2300 | Claim Information | Required | 100 |
CLM | Claim Information | Required | 1 |
| Any order | The loops below can appear in any order | Required | 1 |
DTP | Discharge Hour | Situational | 1 |
DTP | Statement Dates | Required | 1 |
DTP | Admission Date Hour | Situational | 1 |
DTP | Date Repricer Received Date | Situational | 1 |
CL1 | Institutional Claim Code | Required | 1 |
PWK | Claim Supplemental Information | Situational | 10 |
CN1 | Contract Information | Situational | 1 |
AMT | Patient Estimated Amount Due | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Service Authorization Exception Code | Situational | 1 |
REF | Referral Number | Situational | 1 |
REF | Prior Authorization | Situational | 1 |
REF | Payer Claim Control Number | Situational | 1 |
REF | Repriced Claim Number | Situational | 1 |
REF | Adjusted Repriced Claim Number | Situational | 1 |
REF | Investigational Device Exemption Number | Situational | 5 |
REF | Claim Identifier for Transmission Intermediaries | Situational | 1 |
REF | Auto Accident State | Situational | 1 |
REF | Medical Record Number | Situational | 1 |
REF | Demonstration Project Identifier | Situational | 1 |
REF | Peer Review Organization PRO Approval Number | Situational | 1 |
K3 | File Information | Situational | 10 |
| Any order | The loops below can appear in any order | Situational | 1 |
NTE | Claim Note | Situational | 10 |
NTE | Billing Note | Situational | 1 |
CRC | EPSDT Referral | Situational | 1 |
| Any order | The loops below can appear in any order | Required | 1 |
HI | Principal Diagnosis | Required | 1 |
HI | Admitting Diagnosis | Situational | 1 |
HI | Patient Reason for Visit | Situational | 1 |
HI | External Causeof Injury | Situational | 1 |
HI | Diagnosis Related Group DRG Information | Situational | 1 |
HI | Other Diagnosis Information | Situational | 2 |
HI | Principal Procedure Information | Situational | 1 |
HI | Other Procedure Information | Situational | 2 |
HI | Occurrence Span Information | Situational | 2 |
HI | Occurrence Information | Situational | 2 |
HI | Value Information | Situational | 2 |
HI | Condition Information | Situational | 2 |
HI | Treatment Code Information | Situational | 2 |
HCP | Claim Pricing Repricing Information | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
| Loop 2310A | Attending Provider Name | Situational | 1 |
NM1 | Attending Provider Name | Required | 1 |
PRV | Attending Provider Specialty Information | Situational | 1 |
REF | Attending Provider Secondary Identification | Situational | 4 |
| Loop 2310B | Operating Physician Name | Situational | 1 |
NM1 | Operating Physician Name | Required | 1 |
REF | Operating Physician Secondary Identification | Situational | 4 |
| Loop 2310C | Other Operating Physician Name | Situational | 1 |
NM1 | Other Operating Physician Name | Required | 1 |
REF | Other Operating Physician Secondary Identification | Situational | 4 |
| Loop 2310D | Rendering Provider Name | Situational | 1 |
NM1 | Rendering Provider Name | Required | 1 |
REF | Rendering Provider Secondary Identification | Situational | 4 |
| Loop 2310E | Service Facility Location Name | Situational | 1 |
NM1 | Service Facility Location Name | Required | 1 |
N3 | Service Facility Location Address | Required | 1 |
N4 | Service Facility Location City State ZIP | Required | 1 |
REF | Service Facility Secondary Identification | Situational | 3 |
| Loop 2310F | Referring Provider Name | Situational | 1 |
NM1 | Referring Provider Name | Required | 1 |
REF | Referring Provider Secondary Identification | Situational | 3 |
| Loop 2320 | Other Subscriber Information | Situational | 10 |
SBR | Other Subscriber Information | Required | 1 |
CAS | Claim Level Adjustments | Situational | 5 |
| Any order | The loops below can appear in any order | Situational | 1 |
AMT | Coordinationof Benefits COB Payer Paid Amount | Situational | 1 |
AMT | Remaining Patient Liability | Situational | 1 |
AMT | Coordinationof Benefits COB Total Non Amount | Situational | 1 |
OI | Other Insurance Coverage Information | Required | 1 |
MIA | Inpatient Adjudication Information | Situational | 1 |
MOA | Outpatient Adjudication Information | Situational | 1 |
| Any order | The loops below can appear in any order | Required | 1 |
| Loop 2330A | Other Subscriber Name | Required | 1 |
NM1 | Other Subscriber Name | Required | 1 |
N3 | Other Subscriber Address | Situational | 1 |
N4 | Other Subscriber City State ZIP Code | Situational | 1 |
REF | Other Subscriber Secondary Information | Situational | 2 |
| Loop 2330B | Other Payer Name | Required | 1 |
NM1 | Other Payer Name | Required | 1 |
N3 | Other Payer Address | Situational | 1 |
N4 | Other Payer City State ZIP Code | Situational | 1 |
DTP | Claim Check or Remittance Date | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Other Payer Secondary Identifier | Situational | 2 |
REF | Other Payer Prior Authorization Number | Situational | 1 |
REF | Other Payer Referral Number | Situational | 1 |
REF | Other Payer Claim Adjustment Indicator | Situational | 1 |
REF | Other Payer Claim Control Number | Situational | 1 |
| Loop 2330C | Other Payer Attending Provider | Situational | 1 |
NM1 | Other Payer Attending Provider | Required | 1 |
REF | Other Payer Attending Provider Secondary Identification | Required | 4 |
| Loop 2330D | Other Payer Operating Physician | Situational | 1 |
NM1 | Other Payer Operating Physician | Required | 1 |
REF | Other Payer Operating Physician Secondary Identification | Required | 4 |
| Loop 2330E | Other Payer Other Operating Physician | Situational | 1 |
NM1 | Other Payer Other Operating Physician | Required | 1 |
REF | Other Payer Other Operating Physician Secondary Identification | Required | 4 |
| Loop 2330F | Other Payer Service Facility Location | Situational | 1 |
NM1 | Other Payer Service Facility Location | Required | 1 |
REF | Other Payer Service Facility Location Secondary Identification | Required | 3 |
| Loop 2330G | Other Payer Rendering Provider Name | Situational | 1 |
NM1 | Other Payer Rendering Provider Name | Required | 1 |
REF | Other Payer Rendering Provider Secondary Identifier | Required | 4 |
| Loop 2330H | Other Payer Referring Provider | Situational | 1 |
NM1 | Other Payer Referring Provider | Required | 1 |
REF | Other Payer Referring Provider Secondary Identification | Required | 3 |
| Loop 2330I | Other Payer Billing Provider | Situational | 1 |
NM1 | Other Payer Billing Provider | Required | 1 |
REF | Other Payer Billing Provider Secondary Identifier | Required | 2 |
| Loop 2400 | Service Line Number | Required | 999 |
LX | Service Line Number | Required | 1 |
SV2 | Institutional Service Line | Required | 1 |
PWK | Line Supplemental Information | Situational | 10 |
DTP | Date Service Date | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
REF | Line Item Control Number | Situational | 1 |
REF | Repriced Line Item Reference Number | Situational | 1 |
REF | Adjusted Repriced Line Item Reference Number | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
AMT | Service Tax Amount | Situational | 1 |
AMT | Facility Tax Amount | Situational | 1 |
NTE | Third Party Organization Notes | Situational | 1 |
HCP | Line Pricing Repricing Information | Situational | 1 |
| Loop 2410 | Drug Identification | Situational | 1 |
LIN | Drug Identification | Required | 1 |
CTP | Drug Quantity | Required | 1 |
REF | Prescriptionor Compound Drug Association Number | Situational | 1 |
| Any order | The loops below can appear in any order | Situational | 1 |
| Loop 2420A | Operating Physician Name | Situational | 1 |
NM1 | Operating Physician Name | Required | 1 |
REF | Operating Physician Secondary Identification | Situational | 20 |
| Loop 2420B | Other Operating Physician Name | Situational | 1 |
NM1 | Other Operating Physician Name | Required | 1 |
REF | Other Operating Physician Secondary Identification | Situational | 20 |
| Loop 2420C | Rendering Provider Name | Situational | 1 |
NM1 | Rendering Provider Name | Required | 1 |
REF | Rendering Provider Secondary Identification | Situational | 20 |
| Loop 2420D | Referring Provider Name | Situational | 1 |
NM1 | Referring Provider Name | Required | 1 |
REF | Referring Provider Secondary Identification | Situational | 20 |
| Loop 2430 | Line Adjudication Information | Situational | 15 |
SVD | Line Adjudication Information | Required | 1 |
CAS | Line Adjustment | Situational | 5 |
DTP | Line Checkor Remittance Date | Required | 1 |
AMT | Remaining Patient Liability | Situational | 1 |
SE | Transaction Set Trailer | Required | 1 |
Usage follows the 005010X223A2 implementation guide: Required segments must be sent, Situational ones only when the guide's condition applies. Trading partners often add their own rules in companion guides - ediFabric templates can be adjusted to match. Open the element-level definition in the EdiNation spec library.
An inpatient claim with admission details, diagnosis codes and revenue-coded service lines. Paste it into EdiNation to see every element named and validated.
ISA*00* *00* *ZZ*1234567 *ZZ*11111 *170508*1141*^*00501*000000101*1*P*:~ GS*HC*XXXXXXX*XXXXX*20170617*1741*101*X*005010X223A2~ ST*837*987654*005010X223A2~ BHT*0019*00*0123*19960918*0932*CH~ NM1*41*2*JONES HOSPITAL*****46*12345~ PER*IC*JANE DOE*TE*9005555555~ NM1*40*2*MEDICARE*****46*00120~ HL*1**20*1~ PRV*BI*PXC*203BA0200N~ NM1*85*2*JONES HOSPITAL*****XX*9876540809~ N3*225 MAIN STREET BARKLEY BUILDING~ N4*CENTERVILLE*PA*17111~ REF*EI*567891234~ PER*IC*CONNIE*TE*3055551234~ HL*2*1*22*0~ SBR*P*18*******MB~ NM1*IL*1*DOE*JOHN*T***MI*030005074A~ N3*125 CITY AVENUE~ N4*CENTERVILLE*PA*17111~ DMG*D8*19261111*M~ NM1*PR*2*MEDICARE B*****PI*00435~ REF*G2*330127~ CLM*756048Q*89.93**14:A:1*A*Y*Y~ DTP*434*RD8*19960911~ CL1*3**01~ HI*BK:3669~ HI*BF:4019*BF:79431~ HI*BH:A1:D8:19261111*BH:A2:D8:19911101*BH:B1:D8:19261111*BH:B2:D8:19870101~ HI*BE:A2:::15.31~ HI*BG:09~ NM1*71*1*JONES*JOHN*J~ REF*1G*B99937~ SBR*S*01*351630*STATE TEACHERS*****CI~ OI***Y***Y~ NM1*IL*1*DOE*JANE*S***MI*222004433~ N3*125 CITY AVENUE~ N4*CENTERVILLE*PA*17111~ NM1*PR*2*STATE TEACHERS*****PI*1135~ LX*1~ SV2*0305*HC:85025*13.39*UN*1~ DTP*472*D8*19960911~ LX*2~ SV2*0730*HC:93005*76.54*UN*3~ DTP*472*D8*19960911~ SE*43*987654~ GE*1*101~ IEA*1*000000101~
ediFabric turns every loop, segment and element into a named field. This is the transaction from the sample, in the JSON that ediFabric Native and Cloud return and accept.
{
"ST": {
"TransactionSetIdentifierCode_01": "837",
"TransactionSetControlNumber_02": "987654",
"ImplementationConventionPreference_03": "005010X223A2"
},
"BHT_BeginningOfHierarchicalTransaction": {
"HierarchicalStructureCode_01": "0019",
"TransactionSetPurposeCode_02": "00",
"SubmitterTransactionIdentifier_03": "0123",
"TransactionSetCreationDate_04": "19960918",
"TransactionSetCreationTime_05": "0932",
"TransactionTypeCode_06": "CH"
},
"AllNM1": {
"Loop1000A": {
"NM1_SubmitterName": {
"EntityIdentifierCode_01": "41",
"EntityTypeQualifier_02": "2",
"ResponseContactLastorOrganizationName_03": "JONES HOSPITAL",
"IdentificationCodeQualifier_08": "46",
"ResponseContactIdentifier_09": "12345"
},
"PER_SubmitterEDIContactInformation": [
{
"ContactFunctionCode_01": "IC",
"ResponseContactName_02": "JANE DOE",
"CommunicationNumberQualifier_03": "TE",
"ResponseContactCommunicationNumber_04": "9005555555"
}
]
},
"Loop1000B": {
"NM1_ReceiverName": {
"EntityIdentifierCode_01": "40",
"EntityTypeQualifier_02": "2",
"ResponseContactLastorOrganizationName_03": "MEDICARE",
"IdentificationCodeQualifier_08": "46",
"ResponseContactIdentifier_09": "00120"
}
}
},
"Loop2000A": [
{
"HL_BillingProviderHierarchicalLevel": {
"HierarchicalIDNumber_01": "1",
"HierarchicalLevelCode_03": "20",
"HierarchicalChildCode_04": "1"
},
"PRV_BillingProviderSpecialtyInformation": {
"ProviderCode_01": "BI",
"ReferenceIdentificationQualifier_02": "PXC",
"ProviderTaxonomyCode_03": "203BA0200N"
},
"AllNM1": {
"Loop2010AA": {
"NM1_BillingProviderName": {
"EntityIdentifierCode_01": "85",
"EntityTypeQualifier_02": "2",
"ResponseContactLastorOrganizationName_03": "JONES HOSPITAL",
"IdentificationCodeQualifier_08": "XX",
"ResponseContactIdentifier_09": "9876540809"
},
"N3_BillingProviderAddress": {
"ResponseContactAddressLine_01": "225 MAIN STREET BARKLEY BUILDING"
},
"N4_BillingProviderCity_State_ZIPCode": {
"AdditionalPatientInformationContactCityName_01": "CENTERVILLE",
"AdditionalPatientInformationContactStateCode_02": "PA",
"AdditionalPatientInformationContactPostalZoneorZIPCode_03": "17111"
},
"REF_BillingProviderTaxIdentification": {
"ReferenceIdentificationQualifier_01": "EI",
"MemberGrouporPolicyNumber_02": "567891234"
},
"PER_BillingProviderContactInformation": [
{
"ContactFunctionCode_01": "IC",
"ResponseContactName_02": "CONNIE",
"CommunicationNumberQualifier_03": "TE",
"ResponseContactCommunicationNumber_04": "3055551234"
}
]
}
},
"Loop2000B": [
{
"HL_SubscriberHierarchicalLevel": {
"HierarchicalIDNumber_01": "2",
"HierarchicalParentIDNumber_02": "1",
"HierarchicalLevelCode_03": "22",
"HierarchicalChildCode_04": "0"
},
"SBR_SubscriberInformation": {
"PayerResponsibilitySequenceNumberCode_01": "P",
"IndividualRelationshipCode_02": "18",
"ClaimFilingIndicatorCode_09": "MB"
},
"AllNM1": {
"Loop2010BA": {
"NM1_SubscriberName": {
"EntityIdentifierCode_01": "IL",
"EntityTypeQualifier_02": "1",
"ResponseContactLastorOrganizationName_03": "DOE",
"ResponseContactFirstName_04": "JOHN",
"ResponseContactMiddleName_05": "T",
"IdentificationCodeQualifier_08": "MI",
"ResponseContactIdentifier_09": "030005074A"
},
"N3_SubscriberAddress": {
"ResponseContactAddressLine_01": "125 CITY AVENUE"
},
"N4_SubscriberCity_State_ZIPCode": {
"AdditionalPatientInformationContactCityName_01": "CENTERVILLE",
"AdditionalPatientInformationContactStateCode_02": "PA",
"AdditionalPatientInformationContactPostalZoneorZIPCode_03": "17111"
},
"DMG_SubscriberDemographicInformation": {
"DateTimePeriodFormatQualifier_01": "D8",
"DependentBirthDate_02": "19261111",
"DependentGenderCode_03": "M"
}
},
"Loop2010BB": {
"NM1_PayerName": {
"EntityIdentifierCode_01": "PR",
"EntityTypeQualifier_02": "2",
"ResponseContactLastorOrganizationName_03": "MEDICARE B",
"IdentificationCodeQualifier_08": "PI",
"ResponseContactIdentifier_09": "00435"
},
"AllREF": {
"REF_BillingProviderSecondaryIdentification": {
"ReferenceIdentificationQualifier_01": "G2",
"MemberGrouporPolicyNumber_02": "330127"
}
}
}
},
"Loop2300": [
{
"CLM_ClaimInformation": {
"PatientControlNumber_01": "756048Q",
"TotalClaimChargeAmount_02": "89.93",
"NonInstitutionalClaimTypeCode_04": "14:A:1",
"HealthCareServiceLocationInformation_05": {
"FacilityTypeCode_01": "A"
},
"ProviderorSupplierSignatureIndicator_06": "Y",
"AssignmentorPlanParticipationCode_07": "Y"
},
"AllDTP": {
"DTP_StatementDates": {
"DateTimeQualifier_01": "434",
"DateTimePeriodFormatQualifier_02": "RD8",
"DateTimePeriod_03": "19960911"
}
},
"CL1_InstitutionalClaimCode": {
"AdmissionTypeCode_01": "3",
"PatientStatusCode_03": "01"
},
"AllHI": {
"HI_PrincipalDiagnosis": {
"HealthCareCodeInformation_01": {
"CodeListQualifierCode_01": "BK",
"IndustryCode_02": "3669"
}
},
"HI_OtherDiagnosisInformation": [
{
"HealthCareCodeInformation_01": {
"CodeListQualifierCode_01": "BF",
"IndustryCode_02": "4019"
},
"HealthCareCodeInformation_02": {
"CodeListQualifierCode_01": "BF",
"IndustryCode_02": "79431"
}
}
],
"HI_OccurrenceInformation": [
{
"HealthCareCodeInformation_01": {
"CodeListQualifierCode_01": "BH",
"IndustryCode_02": "A1",
"DateTimePeriodFormatQualifier_03": "D8",
"DateTimePeriod_04": "19261111"
},
"HealthCareCodeInformation_02": {
"CodeListQualifierCode_01": "BH",
"IndustryCode_02": "A2",
"DateTimePeriodFormatQualifier_03": "D8",
"DateTimePeriod_04": "19911101"
},
"HealthCareCodeInformation_03": {
"CodeListQualifierCode_01": "BH",
"IndustryCode_02": "B1",
"DateTimePeriodFormatQualifier_03": "D8",
"DateTimePeriod_04": "19261111"
},
"HealthCareCodeInformation_04": {
"CodeListQualifierCode_01": "BH",
"IndustryCode_02": "B2",
"DateTimePeriodFormatQualifier_03": "D8",
"DateTimePeriod_04": "19870101"
}
}
],
"HI_ValueInformation": [
{
"HealthCareCodeInformation_01": {
"CodeListQualifierCode_01": "BE",
"IndustryCode_02": "A2",
"MonetaryAmount_05": "15.31"
}
}
],
"HI_ConditionInformation": [
{
"HealthCareCodeInformation_01": {
"CodeListQualifierCode_01": "BG",
"IndustryCode_02": "09"
}
}
]
},
"AllNM1": {
"Loop2310A": {
"NM1_AttendingProviderName": {
"EntityIdentifierCode_01": "71",
"EntityTypeQualifier_02": "1",
"ResponseContactLastorOrganizationName_03": "JONES",
"ResponseContactFirstName_04": "JOHN",
"ResponseContactMiddleName_05": "J"
},
"REF_AttendingProviderSecondaryIdentification": [
{
"ReferenceIdentificationQualifier_01": "1G",
"MemberGrouporPolicyNumber_02": "B99937"
}
]
}
},
"Loop2320": [
{
"SBR_OtherSubscriberInformation": {
"PayerResponsibilitySequenceNumberCode_01": "S",
"IndividualRelationshipCode_02": "01",
"InsuredGrouporPolicyNumber_03": "351630",
"OtherInsuredGroupName_04": "STATE TEACHERS",
"ClaimFilingIndicatorCode_09": "CI"
},
"OI_OtherInsuranceCoverageInformation": {
"BenefitsAssignmentCertificationIndicator_03": "Y",
"ReleaseofInformationCode_06": "Y"
},
"AllNM1": {
"Loop2330A": {
"NM1_OtherSubscriberName": {
"EntityIdentifierCode_01": "IL",
"EntityTypeQualifier_02": "1",
"ResponseContactLastorOrganizationName_03": "DOE",
"ResponseContactFirstName_04": "JANE",
"ResponseContactMiddleName_05": "S",
"IdentificationCodeQualifier_08": "MI",
"ResponseContactIdentifier_09": "222004433"
},
"N3_OtherSubscriberAddress": {
"ResponseContactAddressLine_01": "125 CITY AVENUE"
},
"N4_OtherSubscriberCity_State_ZIPCode": {
"AdditionalPatientInformationContactCityName_01": "CENTERVILLE",
"AdditionalPatientInformationContactStateCode_02": "PA",
"AdditionalPatientInformationContactPostalZoneorZIPCode_03": "17111"
}
},
"Loop2330B": {
"NM1_OtherPayerName": {
"EntityIdentifierCode_01": "PR",
"EntityTypeQualifier_02": "2",
"ResponseContactLastorOrganizationName_03": "STATE TEACHERS",
"IdentificationCodeQualifier_08": "PI",
"ResponseContactIdentifier_09": "1135"
}
}
}
}
],
"Loop2400": [
{
"LX_ServiceLineNumber": {
"AssignedNumber_01": "1"
},
"SV2_InstitutionalServiceLine": {
"ServiceLineRevenueCode_01": "0305",
"CompositeMedicalProcedureIdentifier_02": {
"ProductorServiceIDQualifier_01": "HC",
"ProcedureCode_02": "85025"
},
"LineItemChargeAmount_03": "13.39",
"UnitorBasisforMeasurementCode_04": "UN",
"ServiceUnitCount_05": "1"
},
"DTP_Date_ServiceDate": {
"DateTimeQualifier_01": "472",
"DateTimePeriodFormatQualifier_02": "D8",
"DateTimePeriod_03": "19960911"
}
},
{
"LX_ServiceLineNumber": {
"AssignedNumber_01": "2"
},
"SV2_InstitutionalServiceLine": {
"ServiceLineRevenueCode_01": "0730",
"CompositeMedicalProcedureIdentifier_02": {
"ProductorServiceIDQualifier_01": "HC",
"ProcedureCode_02": "93005"
},
"LineItemChargeAmount_03": "76.54",
"UnitorBasisforMeasurementCode_04": "UN",
"ServiceUnitCount_05": "3"
},
"DTP_Date_ServiceDate": {
"DateTimeQualifier_01": "472",
"DateTimePeriodFormatQualifier_02": "D8",
"DateTimePeriod_03": "19960911"
}
}
]
}
]
}
]
}
],
"SE": {
"NumberofIncludedSegments_01": "43",
"TransactionSetControlNumber_02": "987654"
}
}Read the file into typed objects with ediFabric .NET, convert it to JSON in process with the ediFabric Native bindings for Python, Java and C, or post it to the ediFabric Cloud REST API from any language.
using EdiFabric.Templates.Hipaa5010; License.SetSerial("YOUR_SERIAL_KEY"); using (var stream = File.OpenRead(@"C:\edi\InstitutionalClaim.txt")) using (var reader = new X12Reader(stream, "EdiFabric.Templates.Hipaa")) { var items = await reader.ReadToEndAsync(); foreach (var transaction in items.OfType<TS837I>()) { if (transaction.IsValid(out MessageErrorContext errors)) Console.WriteLine($"{transaction.ST.TransactionSetControlNumber_02} is valid"); else Console.WriteLine(string.Join(Environment.NewLine, errors.Flatten())); } }
import json import edifabric_x12 as ef serial = "YOUR_SERIAL_KEY" ef.load_library() ef.set_serial(serial) ef.set_map(json.dumps({"default": serial, "maps": {}})) edi = open("InstitutionalClaim.txt", "rb").read() output, offset = ef.parse(edi, ef.ParseMode.JSON_VALIDATE) transactions = output[:offset] report = json.loads(output[offset:]) print(report["errors_count"])
import com.edifabric.nativex12.EdiFabricX12; import com.edifabric.nativex12.ParseMode; import com.edifabric.nativex12.ParseResult; String serial = "YOUR_SERIAL_KEY"; EdiFabricX12.loadLibrary(); EdiFabricX12.setSerial(serial); EdiFabricX12.setMap("{\"default\":\"" + serial + "\",\"maps\":{}}"); String edi = Files.readString(Path.of("InstitutionalClaim.txt")); ParseResult result = EdiFabricX12.parse(edi, ParseMode.JSON_VALIDATE); System.out.println(result.getTransactions()); System.out.println(result.getReport());
#include "edifabric_x12.h" const char *serial = "YOUR_SERIAL_KEY"; ef_parse_result result; if (ef_load_library(NULL) != 0) return 1; ef_set_serial(serial); ef_set_map("{\"default\":\"YOUR_SERIAL_KEY\",\"maps\":{}}"); char *edi = read_file("InstitutionalClaim.txt", NULL); /* helper in example_all_functions.c */ if (ef_parse(edi, EF_PARSE_JSON_VALIDATE, NULL, &result) == 0) { /* transactions = output[0 .. offset), report = output[offset .. length) */ fwrite(result.output.data, 1, (size_t)result.output.length, stdout); ef_free(result.output.data); }
curl -X POST 'https://api.edination.com/v2/x12/read' \ -H 'Ocp-Apim-Subscription-Key: YOUR_SERIAL_KEY' \ -H 'Content-Type: application/octet-stream' \ --data-binary '@InstitutionalClaim.txt'
Populate a TS837I object in .NET, or pass JSON in the shape shown above to ediFabric Native or ediFabric Cloud, and get a valid 837I file back.
using EdiFabric.Templates.Hipaa5010; License.SetSerial("YOUR_SERIAL_KEY"); var transaction = new TS837I(); // ST TRANSACTION SET HEADER transaction.ST = new ST(); transaction.ST.TransactionSetIdentifierCode_01 = "837"; transaction.ST.TransactionSetControlNumber_02 = "0001"; transaction.ST.ImplementationConventionPreference_03 = "005010X223A2"; // BHT BEGINNING OF HIERARCHICAL TRANSACTION transaction.BHT_BeginningOfHierarchicalTransaction = new BHT_BeginningOfHierarchicalTransaction_8(); transaction.BHT_BeginningOfHierarchicalTransaction.HierarchicalStructureCode_01 = "0019"; transaction.BHT_BeginningOfHierarchicalTransaction.TransactionSetPurposeCode_02 = "00"; transaction.BHT_BeginningOfHierarchicalTransaction.SubmitterTransactionIdentifier_03 = "0123"; transaction.BHT_BeginningOfHierarchicalTransaction.TransactionSetCreationDate_04 = "19960918"; transaction.BHT_BeginningOfHierarchicalTransaction.TransactionSetCreationTime_05 = "0932"; transaction.BHT_BeginningOfHierarchicalTransaction.TransactionTypeCode_06 = "CH"; // Occurrence of NM1 Loops in any order transaction.AllNM1 = new All_NM1_837I_6(); // Begin 1000A Loop SUBMITTER NAME transaction.AllNM1.Loop1000A = new Loop_1000A_837I(); // ... set the remaining loops and segments the same way // SegmentBuilders is in the Common project of the example repository using (var stream = new MemoryStream()) { using (var writer = new X12Writer(stream)) { writer.Write(SegmentBuilders.BuildIsa("1")); writer.Write(SegmentBuilders.BuildGs("1", "SENDER1", "RECEIVER1", "005010X223A2")); writer.Write(transaction); } Console.WriteLine(Encoding.UTF8.GetString(stream.ToArray())); }
import json import edifabric_x12 as ef serial = "YOUR_SERIAL_KEY" ef.load_library() ef.set_serial(serial) ef.set_map(json.dumps({"default": serial, "maps": {}})) # the transactions JSON returned by ef.parse, edited or produced by your application transactions = open("InstitutionalClaim.json", "rb").read() edi = ef.build(transactions, postfix="\r\n") print(edi)
import com.edifabric.nativex12.EdiFabricX12; String serial = "YOUR_SERIAL_KEY"; EdiFabricX12.loadLibrary(); EdiFabricX12.setSerial(serial); EdiFabricX12.setMap("{\"default\":\"" + serial + "\",\"maps\":{}}"); // the transactions JSON returned by parse, edited or produced by your application String transactions = Files.readString(Path.of("InstitutionalClaim.json")); String edi = EdiFabricX12.build(transactions, "\r\n"); System.out.println(edi);
#include "edifabric_x12.h" ef_buffer edi; if (ef_load_library(NULL) != 0) return 1; ef_set_serial("YOUR_SERIAL_KEY"); ef_set_map("{\"default\":\"YOUR_SERIAL_KEY\",\"maps\":{}}"); /* the transactions JSON returned by ef_parse, edited or produced by your application */ char *transactions = read_file("InstitutionalClaim.json", NULL); if (ef_build(transactions, "\r\n", &edi) == 0) { fwrite(edi.data, 1, (size_t)edi.length, stdout); ef_free(edi.data); }
# the JSON returned by /read, edited or produced by your application curl -X POST 'https://api.edination.com/v2/x12/write' \ -H 'Ocp-Apim-Subscription-Key: YOUR_SERIAL_KEY' \ -H 'Content-Type: application/json' \ --data-binary '@InstitutionalClaim.json' \ -o 'InstitutionalClaim.txt'
They carry the same data. The UB-04 (CMS-1450) is the paper form, the 837I (005010X223A2) is the HIPAA EDI format that replaces it for electronic submission.
Up to 999 service lines (loop 2400) per claim. Each line is an SV2 segment with a revenue code, charge and units.
In the HI segments of loop 2300: principal diagnosis (ABK), admitting diagnosis (ABJ), other diagnoses (ABF) and ICD-10-PCS procedures (BBR, BBQ), together with condition, occurrence and value codes.
In .NET, install EdiFabric and EdiFabric.Templates.Hipaa, read the file with X12Reader into TS837I objects and write them back with X12Writer. From Python, Java or C, use ediFabric Native, which converts 837I files to JSON and JSON back to X12 inside your process. From any other language, post the file to the ediFabric Cloud REST API.