X12 837I Health Care Claim: Institutional Last updated: 2026-09-29
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.
At a glance
- Standard
- X12 HIPAA
- Implementation guide
005010X223A2- Functional group
HC(GS01)- Sent by
- Hospital or facility to payer or clearinghouse
- Responses
- 999, 277CA, 835
- ediFabric .NET template
TS837IinEdiFabric.Templates.Hipaa- OpenEDI definition
- View 837I in the spec library
837I structure
The 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 |
Sample 837I file
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~
The same 837I as JSON
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"
}
}Parse and validate an 837I file
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'
Generate an 837I file
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'
Complete ediFabric .NET example
A complete C# program for the X12 837I, built on TS837I in EdiFabric.Templates.Hipaa. The same code is in the ediFabric .NET examples on GitHub.
using EdiFabric.Framework.Readers;
using EdiFabric.Framework.Writers;
using EdiFabric.Templates.Hipaa5010;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using EdiFabric.Core.Model.Edi;
using EdiFabric.Core.Model.Edi.X12;
using EdiFabric.Examples.X12.Common;
namespace EdiFabric.Examples.X12.T837I
{
class Program
{
static void Main(string[] args)
{
SerialKey.Set(Common.SerialKey.Get());
Read();
Write();
}
///
/// Read Institutional Claim
///
static void Read()
{
var ediStream = File.OpenRead(Directory.GetCurrentDirectory() + @"\..\..\..\Files\Hipaa\InstitutionalClaim.txt");
List ediItems;
using (var ediReader = new X12Reader(ediStream, "EdiFabric.Templates.Hipaa"))
ediItems = ediReader.ReadToEnd().ToList();
var transactions = ediItems.OfType();
foreach (var transaction in transactions)
{
if (transaction.HasErrors)
{
// partially parsed
var errors = transaction.ErrorContext.Flatten();
}
}
}
///
/// Write Institutional Claim
///
static void Write()
{
var transaction = BuildInstitutionalClaim("987654");
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);
}
var ediString = stream.LoadToString();
}
}
///
/// Build institutional claim.
/// Original from http://www.x12.org/examples/005010X223/institutional/837-institutional-claim/
/// The patient is a different person than the subscriber. The payer is a commercial health insurance company.
/// Scenario:
/// PRIMARY PAYER SUBSCRIBER: John T Doe
/// SUBSCRIBER ADDRESS: 125 City Avenue, Centerville, PA 17111
/// SEX: M
/// DOB: 11/11/1926
/// MEDICARE INSURANCE ID#: 030005074A
/// PAYER ID #: 00435
/// PATIENT: Same as Primary Subscriber
/// DESTINATION PAYER: Medicare B
/// SUBMITTER: Jones Hospital
/// EDI#: 12345
/// RECEIVER: Medicare
/// EDI#: 00120
/// BILLING PROVIDER: Jones Hospital
/// NPI: 9876540809
/// TIN: 567891234
/// MEDICARE PROVIDER: #330127
/// ADDRESS: 225 Main Street Barkley Building, Centerville, PA 17111
/// ATTENDING PHYSICIAN: John J Jones
/// UPIN #: B99937
/// PATIENT ACCOUNT NUMBER: 756048Q
/// DATE OF ADMISSION: 09/11/96
/// STATEMENT PERIOD DATE: 09/11/96 - 09/11/96
/// PLACE OF SERVICE: Inpatient Hospital
/// Occurrence Codes and Dates:
/// A1 11/11/26
/// A2 11/01/91
/// B1 11/11/26
/// B2 01/01/87
/// Condition Codes: 09
/// Value Codes: A2 $15.31
/// PRINCIPAL DIAGNOSIS CODE: 366.9
/// SECONDARY DIAGNOSIS CODES:
/// 401.9
/// 794.31
/// NUMBER OF COVERED DAYS: 1
/// SERVICES:
/// INSTITUTIONAL SERVICES RENDERED:
/// REVENUE CODE: 0305 HCPCS Procedure Code: 85025 Unit: 1 Price $13.39
/// REVENUE CODE: 0730 HCPCS Procedure Code: 93005 Unit: 1 Price: $76.54
/// TOTAL CHARGES: $89.93
/// SECONDARY PAYER SUBSCRIBER: Jane S Doe(wife)
/// SUBSCRIBER ADDRESS: 125 City Avenue, Centerville, PA 17111
/// SEX: F
/// DOB: 12/11/1927
/// STATE TEACHERS ID#: 222004433
/// PAYER ID #: 1135
///
static TS837I BuildInstitutionalClaim(string controlNumber)
{
var result = new TS837I();
// ST TRANSACTION SET HEADER
result.ST = new ST();
result.ST.TransactionSetIdentifierCode_01 = "837";
result.ST.TransactionSetControlNumber_02 = controlNumber.PadLeft(9, '0');
result.ST.ImplementationConventionPreference_03 = "005010X223A2";
// BHT BEGINNING OF HIERARCHICAL TRANSACTION
result.BHT_BeginningOfHierarchicalTransaction = new BHT_BeginningOfHierarchicalTransaction_8();
result.BHT_BeginningOfHierarchicalTransaction.HierarchicalStructureCode_01 = "0019";
result.BHT_BeginningOfHierarchicalTransaction.TransactionSetPurposeCode_02 = "00";
result.BHT_BeginningOfHierarchicalTransaction.SubmitterTransactionIdentifier_03 = "0123";
result.BHT_BeginningOfHierarchicalTransaction.TransactionSetCreationDate_04 = "19960918";
result.BHT_BeginningOfHierarchicalTransaction.TransactionSetCreationTime_05 = "0932";
result.BHT_BeginningOfHierarchicalTransaction.TransactionTypeCode_06 = "CH";
// Occurrence of NM1 Loops in any order
result.AllNM1 = new All_NM1_837I_6();
// Begin 1000A Loop SUBMITTER NAME
result.AllNM1.Loop1000A = new Loop_1000A_837I();
// NM1 SUBMITTER NAME
result.AllNM1.Loop1000A.NM1_SubmitterName = new NM1_InformationReceiverName_4();
result.AllNM1.Loop1000A.NM1_SubmitterName.EntityIdentifierCode_01 = "41";
result.AllNM1.Loop1000A.NM1_SubmitterName.EntityTypeQualifier_02 = "2";
result.AllNM1.Loop1000A.NM1_SubmitterName.ResponseContactLastorOrganizationName_03 = "JONES HOSPITAL";
result.AllNM1.Loop1000A.NM1_SubmitterName.IdentificationCodeQualifier_08 = "46";
result.AllNM1.Loop1000A.NM1_SubmitterName.ResponseContactIdentifier_09 = "12345";
// Repeating PER Patient information
result.AllNM1.Loop1000A.PER_SubmitterEDIContactInformation = new List();
// PER SUBMITTER EDI CONTACT INFORMATION
var per1 = new PER_BillingProviderContactInformation();
per1.ContactFunctionCode_01 = "IC";
per1.ResponseContactName_02 = "JANE DOE";
per1.CommunicationNumberQualifier_03 = "TE";
per1.ResponseContactCommunicationNumber_04 = "9005555555";
result.AllNM1.Loop1000A.PER_SubmitterEDIContactInformation.Add(per1);
// End 1000A Loop
// Begin 1000B Loop RECEIVER NAME
result.AllNM1.Loop1000B = new Loop_1000B_837I();
// NM1 RECEIVER NAME
result.AllNM1.Loop1000B.NM1_ReceiverName = new NM1_ReceiverName();
result.AllNM1.Loop1000B.NM1_ReceiverName.EntityIdentifierCode_01 = "40";
result.AllNM1.Loop1000B.NM1_ReceiverName.EntityTypeQualifier_02 = "2";
result.AllNM1.Loop1000B.NM1_ReceiverName.ResponseContactLastorOrganizationName_03 = "MEDICARE";
result.AllNM1.Loop1000B.NM1_ReceiverName.IdentificationCodeQualifier_08 = "46";
result.AllNM1.Loop1000B.NM1_ReceiverName.ResponseContactIdentifier_09 = "00120";
// End 1000B Loop
// Repeating 2000A Loops
result.Loop2000A = new List();
// Begin 2000A Loop BILLING PROVIDER
var loop2000A = new Loop_2000A_837I();
// HL BILLING PROVIDER HIERARCHICAL LEVEL
loop2000A.HL_BillingProviderHierarchicalLevel = new HL_BillingProviderHierarchicalLevel();
loop2000A.HL_BillingProviderHierarchicalLevel.HierarchicalIDNumber_01 = "1";
loop2000A.HL_BillingProviderHierarchicalLevel.HierarchicalLevelCode_03 = "20";
loop2000A.HL_BillingProviderHierarchicalLevel.HierarchicalChildCode_04 = "1";
// PRV BILLING PROVIDER SPECIALTY
loop2000A.PRV_BillingProviderSpecialtyInformation = new PRV_BillingProviderSpecialtyInformation();
loop2000A.PRV_BillingProviderSpecialtyInformation.ProviderCode_01 = "BI";
loop2000A.PRV_BillingProviderSpecialtyInformation.ReferenceIdentificationQualifier_02 = "PXC";
loop2000A.PRV_BillingProviderSpecialtyInformation.ProviderTaxonomyCode_03 = "203BA0200N";
// Occurrence of NM1 Loops in any order
loop2000A.AllNM1 = new All_NM1_837I();
// Begin 2010AA Loop BILLING PROVIDER NAME
loop2000A.AllNM1.Loop2010AA = new Loop_2010AA_837I();
// NM1 BILLING PROVIDER NAME INCLUDING NATIONAL PROVIDER ID
loop2000A.AllNM1.Loop2010AA.NM1_BillingProviderName = new NM1_BillingProviderName_3();
loop2000A.AllNM1.Loop2010AA.NM1_BillingProviderName.EntityIdentifierCode_01 = "85";
loop2000A.AllNM1.Loop2010AA.NM1_BillingProviderName.EntityTypeQualifier_02 = "2";
loop2000A.AllNM1.Loop2010AA.NM1_BillingProviderName.ResponseContactLastorOrganizationName_03 = "JONES HOSPITAL";
loop2000A.AllNM1.Loop2010AA.NM1_BillingProviderName.IdentificationCodeQualifier_08 = "XX";
loop2000A.AllNM1.Loop2010AA.NM1_BillingProviderName.ResponseContactIdentifier_09 = "9876540809";
// N3 BILLING PROVIDER ADDRESS
loop2000A.AllNM1.Loop2010AA.N3_BillingProviderAddress = new N3_AdditionalPatientInformationContactAddress();
loop2000A.AllNM1.Loop2010AA.N3_BillingProviderAddress.ResponseContactAddressLine_01 = "225 MAIN STREET BARKLEY BUILDING";
// N4 BILLING PROVIDER LOCATION
loop2000A.AllNM1.Loop2010AA.N4_BillingProviderCity_State_ZIPCode = new N4_AdditionalPatientInformationContactCity();
loop2000A.AllNM1.Loop2010AA.N4_BillingProviderCity_State_ZIPCode.AdditionalPatientInformationContactCityName_01 = "CENTERVILLE";
loop2000A.AllNM1.Loop2010AA.N4_BillingProviderCity_State_ZIPCode.AdditionalPatientInformationContactStateCode_02 = "PA";
loop2000A.AllNM1.Loop2010AA.N4_BillingProviderCity_State_ZIPCode.AdditionalPatientInformationContactPostalZoneorZIPCode_03 = "17111";
// REF BILLING PROVIDER TAX IDENTIFICATION NUMBER
loop2000A.AllNM1.Loop2010AA.REF_BillingProviderTaxIdentification = new REF_BillingProviderTaxIdentification_2();
loop2000A.AllNM1.Loop2010AA.REF_BillingProviderTaxIdentification.ReferenceIdentificationQualifier_01 = "EI";
loop2000A.AllNM1.Loop2010AA.REF_BillingProviderTaxIdentification.MemberGrouporPolicyNumber_02 = "567891234";
// Repeating PER billing provider contact information
loop2000A.AllNM1.Loop2010AA.PER_BillingProviderContactInformation = new List();
// PER BILLING PROVIDER CONTACT INFORMATION
var per2 = new PER_BillingProviderContactInformation();
per2.ContactFunctionCode_01 = "IC";
per2.ResponseContactName_02 = "CONNIE";
per2.CommunicationNumberQualifier_03 = "TE";
per2.ResponseContactCommunicationNumber_04 = "3055551234";
loop2000A.AllNM1.Loop2010AA.PER_BillingProviderContactInformation.Add(per2);
// End 2010AA Loop
// Repeating 2000B Loops
loop2000A.Loop2000B = new List();
// Begin 2000B Loop SUBSCRIBER HL LOOP
var loop2000B = new Loop_2000B_837I();
// HL SUBSCRIBER HIERARCHICAL LEVEL
loop2000B.HL_SubscriberHierarchicalLevel = new HL_SubscriberHierarchicalLevel();
loop2000B.HL_SubscriberHierarchicalLevel.HierarchicalIDNumber_01 = "2";
loop2000B.HL_SubscriberHierarchicalLevel.HierarchicalParentIDNumber_02 = "1";
loop2000B.HL_SubscriberHierarchicalLevel.HierarchicalLevelCode_03 = "22";
loop2000B.HL_SubscriberHierarchicalLevel.HierarchicalChildCode_04 = "0";
// SBR SUBSCRIBER INFORMATION
loop2000B.SBR_SubscriberInformation = new SBR_SubscriberInformation_2();
loop2000B.SBR_SubscriberInformation.PayerResponsibilitySequenceNumberCode_01 = "P";
loop2000B.SBR_SubscriberInformation.IndividualRelationshipCode_02 = "18";
loop2000B.SBR_SubscriberInformation.ClaimFilingIndicatorCode_09 = "MB";
// Occurrence of NM1 Loops in any order
loop2000B.AllNM1 = new All_NM1_837I_2();
// Begin 2010BA Loop SUBSCRIBER NAME LOOP
loop2000B.AllNM1.Loop2010BA = new Loop_2010BA_837I();
// NM1 SUBSCRIBER NAME
loop2000B.AllNM1.Loop2010BA.NM1_SubscriberName = new NM1_SubscriberName_5();
loop2000B.AllNM1.Loop2010BA.NM1_SubscriberName.EntityIdentifierCode_01 = "IL";
loop2000B.AllNM1.Loop2010BA.NM1_SubscriberName.EntityTypeQualifier_02 = "1";
loop2000B.AllNM1.Loop2010BA.NM1_SubscriberName.ResponseContactLastorOrganizationName_03 = "DOE";
loop2000B.AllNM1.Loop2010BA.NM1_SubscriberName.ResponseContactFirstName_04 = "JOHN";
loop2000B.AllNM1.Loop2010BA.NM1_SubscriberName.ResponseContactMiddleName_05 = "T";
loop2000B.AllNM1.Loop2010BA.NM1_SubscriberName.IdentificationCodeQualifier_08 = "MI";
loop2000B.AllNM1.Loop2010BA.NM1_SubscriberName.ResponseContactIdentifier_09 = "030005074A";
// N3 SUBSCRIBER ADDRESS
loop2000B.AllNM1.Loop2010BA.N3_SubscriberAddress = new N3_AdditionalPatientInformationContactAddress();
loop2000B.AllNM1.Loop2010BA.N3_SubscriberAddress.ResponseContactAddressLine_01 = "125 CITY AVENUE";
// N4 SUBSCRIBER LOCATION
loop2000B.AllNM1.Loop2010BA.N4_SubscriberCity_State_ZIPCode = new N4_AdditionalPatientInformationContactCity();
loop2000B.AllNM1.Loop2010BA.N4_SubscriberCity_State_ZIPCode.AdditionalPatientInformationContactCityName_01 = "CENTERVILLE";
loop2000B.AllNM1.Loop2010BA.N4_SubscriberCity_State_ZIPCode.AdditionalPatientInformationContactStateCode_02 = "PA";
loop2000B.AllNM1.Loop2010BA.N4_SubscriberCity_State_ZIPCode.AdditionalPatientInformationContactPostalZoneorZIPCode_03 = "17111";
// DMG SUBSCRIBER DEMOGRAPHIC INFORMATION
loop2000B.AllNM1.Loop2010BA.DMG_SubscriberDemographicInformation = new DMG_PatientDemographicInformation();
loop2000B.AllNM1.Loop2010BA.DMG_SubscriberDemographicInformation.DateTimePeriodFormatQualifier_01 = "D8";
loop2000B.AllNM1.Loop2010BA.DMG_SubscriberDemographicInformation.DependentBirthDate_02 = "19261111";
loop2000B.AllNM1.Loop2010BA.DMG_SubscriberDemographicInformation.DependentGenderCode_03 = "M";
// End 2010BA Loop
// Begin 2010BB Loop PAYER NAME LOOP
loop2000B.AllNM1.Loop2010BB = new Loop_2010BB_837I();
// NM1 PAYER NAME
loop2000B.AllNM1.Loop2010BB.NM1_PayerName = new NM1_OtherPayerName();
loop2000B.AllNM1.Loop2010BB.NM1_PayerName.EntityIdentifierCode_01 = "PR";
loop2000B.AllNM1.Loop2010BB.NM1_PayerName.EntityTypeQualifier_02 = "2";
loop2000B.AllNM1.Loop2010BB.NM1_PayerName.ResponseContactLastorOrganizationName_03 = "MEDICARE B";
loop2000B.AllNM1.Loop2010BB.NM1_PayerName.IdentificationCodeQualifier_08 = "PI";
loop2000B.AllNM1.Loop2010BB.NM1_PayerName.ResponseContactIdentifier_09 = "00435";
// Occurrence of REF Segments in any order
loop2000B.AllNM1.Loop2010BB.AllREF = new All_REF_837I_3();
// REF BILLING PROVIDER SECONDARY IDENTIFICATION
loop2000B.AllNM1.Loop2010BB.AllREF.REF_BillingProviderSecondaryIdentification = new REF_BillingProviderSecondaryIdentification();
loop2000B.AllNM1.Loop2010BB.AllREF.REF_BillingProviderSecondaryIdentification.ReferenceIdentificationQualifier_01 = "G2";
loop2000B.AllNM1.Loop2010BB.AllREF.REF_BillingProviderSecondaryIdentification.MemberGrouporPolicyNumber_02 = "330127";
// End 2010BB Loop
// Repeating 2300 Loops
loop2000B.Loop2300 = new List();
// Begin 2300 Loop CLAIM INFORMATION
var loop2300 = new Loop_2300_837I();
// CLM CLAIM LEVEL INFORMATION
loop2300.CLM_ClaimInformation = new CLM_ClaimInformation_2();
loop2300.CLM_ClaimInformation.PatientControlNumber_01 = "756048Q";
loop2300.CLM_ClaimInformation.TotalClaimChargeAmount_02 = "89.93";
loop2300.CLM_ClaimInformation.NonInstitutionalClaimTypeCode_04 = "14:A:1";
loop2300.CLM_ClaimInformation.HealthCareServiceLocationInformation_05 = new C023_HealthCareServiceLocationInformation_3();
loop2300.CLM_ClaimInformation.HealthCareServiceLocationInformation_05.FacilityTypeCode_01 = "A";
loop2300.CLM_ClaimInformation.ProviderorSupplierSignatureIndicator_06 = "Y";
loop2300.CLM_ClaimInformation.AssignmentorPlanParticipationCode_07 = "Y";
// Occurrence of DTP Segments in any order
loop2300.AllDTP = new All_DTP_837I();
// DTP STATEMENT DATES
loop2300.AllDTP.DTP_StatementDates = new DTP_StatementDates();
loop2300.AllDTP.DTP_StatementDates.DateTimeQualifier_01 = "434";
loop2300.AllDTP.DTP_StatementDates.DateTimePeriodFormatQualifier_02 = "RD8";
loop2300.AllDTP.DTP_StatementDates.DateTimePeriod_03 = "19960911";
// CL1 INSTITUTIONAL CLAIM CODE
loop2300.CL1_InstitutionalClaimCode = new CL1_InstitutionalClaimCode();
loop2300.CL1_InstitutionalClaimCode.AdmissionTypeCode_01 = "3";
loop2300.CL1_InstitutionalClaimCode.PatientStatusCode_03 = "01";
// Occurrence of HI Segments in any order
loop2300.AllHI = new All_HI_837I();
// HI PRINCIPAL DIAGNOSIS CODES
loop2300.AllHI.HI_PrincipalDiagnosis = new HI_PrincipalDiagnosis();
loop2300.AllHI.HI_PrincipalDiagnosis.HealthCareCodeInformation_01 = new C022_HealthCareCodeInformation_8();
loop2300.AllHI.HI_PrincipalDiagnosis.HealthCareCodeInformation_01.CodeListQualifierCode_01 = "BK";
loop2300.AllHI.HI_PrincipalDiagnosis.HealthCareCodeInformation_01.IndustryCode_02 = "3669";
// Repeatable HI Other Diagnostics
loop2300.AllHI.HI_OtherDiagnosisInformation = new List();
// HI OTHER DIAGNOSIS INFORMATION
var hi1 = new HI_OtherDiagnosisInformation();
hi1.HealthCareCodeInformation_01 = new C022_HealthCareCodeInformation_4();
hi1.HealthCareCodeInformation_01.CodeListQualifierCode_01 = "BF";
hi1.HealthCareCodeInformation_01.IndustryCode_02 = "4019";
hi1.HealthCareCodeInformation_02 = new C022_HealthCareCodeInformation_4();
hi1.HealthCareCodeInformation_02.CodeListQualifierCode_01 = "BF";
hi1.HealthCareCodeInformation_02.IndustryCode_02 = "79431";
loop2300.AllHI.HI_OtherDiagnosisInformation.Add(hi1);
// Repeatable HI Occurrence Information
loop2300.AllHI.HI_OccurrenceInformation = new List();
// HI OCCURRENCE INFORMATION
var hi3 = new HI_OccurrenceInformation();
hi3.HealthCareCodeInformation_01 = new C022_HealthCareCodeInformation_6();
hi3.HealthCareCodeInformation_01.CodeListQualifierCode_01 = "BH";
hi3.HealthCareCodeInformation_01.IndustryCode_02 = "A1";
hi3.HealthCareCodeInformation_01.DateTimePeriodFormatQualifier_03 = "D8";
hi3.HealthCareCodeInformation_01.DateTimePeriod_04 = "19261111";
hi3.HealthCareCodeInformation_02 = new C022_HealthCareCodeInformation_6();
hi3.HealthCareCodeInformation_02.CodeListQualifierCode_01 = "BH";
hi3.HealthCareCodeInformation_02.IndustryCode_02 = "A2";
hi3.HealthCareCodeInformation_02.DateTimePeriodFormatQualifier_03 = "D8";
hi3.HealthCareCodeInformation_02.DateTimePeriod_04 = "19911101";
hi3.HealthCareCodeInformation_03 = new C022_HealthCareCodeInformation_6();
hi3.HealthCareCodeInformation_03 = new C022_HealthCareCodeInformation_6();
hi3.HealthCareCodeInformation_03.CodeListQualifierCode_01 = "BH";
hi3.HealthCareCodeInformation_03.IndustryCode_02 = "B1";
hi3.HealthCareCodeInformation_03.DateTimePeriodFormatQualifier_03 = "D8";
hi3.HealthCareCodeInformation_03.DateTimePeriod_04 = "19261111";
hi3.HealthCareCodeInformation_04 = new C022_HealthCareCodeInformation_6();
hi3.HealthCareCodeInformation_04.CodeListQualifierCode_01 = "BH";
hi3.HealthCareCodeInformation_04.IndustryCode_02 = "B2";
hi3.HealthCareCodeInformation_04.DateTimePeriodFormatQualifier_03 = "D8";
hi3.HealthCareCodeInformation_04.DateTimePeriod_04 = "19870101";
loop2300.AllHI.HI_OccurrenceInformation.Add(hi3);
// Repeatable HI Value Information
loop2300.AllHI.HI_ValueInformation = new List();
// HI VALUE INFORMATION
var hi7 = new HI_ValueInformation();
hi7.HealthCareCodeInformation_01 = new C022_HealthCareCodeInformation_7();
hi7.HealthCareCodeInformation_01.CodeListQualifierCode_01 = "BE";
hi7.HealthCareCodeInformation_01.IndustryCode_02 = "A2";
hi7.HealthCareCodeInformation_01.MonetaryAmount_05 = "15.31";
loop2300.AllHI.HI_ValueInformation.Add(hi7);
// Repeatable HI Condition Information
loop2300.AllHI.HI_ConditionInformation = new List();
// HI CONDITION INFORMATION
var hi8 = new HI_ConditionInformation();
hi8.HealthCareCodeInformation_01 = new C022_HealthCareCodeInformation_13();
hi8.HealthCareCodeInformation_01.CodeListQualifierCode_01 = "BG";
hi8.HealthCareCodeInformation_01.IndustryCode_02 = "09";
loop2300.AllHI.HI_ConditionInformation.Add(hi8);
// Occurrence of NM1 Loops in any order
loop2300.AllNM1 = new All_NM1_837I_3();
// Begin 2310A Loop ATTENDING PROVIDER NAME
loop2300.AllNM1.Loop2310A = new Loop_2310A_837I();
// NM1 ATTENDING PROVIDER
loop2300.AllNM1.Loop2310A.NM1_AttendingProviderName = new NM1_AttendingProviderName();
loop2300.AllNM1.Loop2310A.NM1_AttendingProviderName.EntityIdentifierCode_01 = "71";
loop2300.AllNM1.Loop2310A.NM1_AttendingProviderName.EntityTypeQualifier_02 = "1";
loop2300.AllNM1.Loop2310A.NM1_AttendingProviderName.ResponseContactLastorOrganizationName_03 = "JONES";
loop2300.AllNM1.Loop2310A.NM1_AttendingProviderName.ResponseContactFirstName_04 = "JOHN";
loop2300.AllNM1.Loop2310A.NM1_AttendingProviderName.ResponseContactMiddleName_05 = "J";
// Repeating REF Secondary Identification
loop2300.AllNM1.Loop2310A.REF_AttendingProviderSecondaryIdentification = new List();
// REF ATTENDING PROVIDER SECONDARY IDENTIFICATION
var ref1 = new REF_AssistantSurgeonSecondaryIdentification();
ref1.ReferenceIdentificationQualifier_01 = "1G";
ref1.MemberGrouporPolicyNumber_02 = "B99937";
loop2300.AllNM1.Loop2310A.REF_AttendingProviderSecondaryIdentification.Add(ref1);
// End 2310A Loop
// Repeating 2320 Loops
loop2300.Loop2320 = new List();
// Begin 2320 Loop OTHER SUBSCRIBER INFORMATION
var loop2320 = new Loop_2320_837I();
// SBR OTHER SUBSCRIBER INFORMATION
loop2320.SBR_OtherSubscriberInformation = new SBR_OtherSubscriberInformation_2();
loop2320.SBR_OtherSubscriberInformation.PayerResponsibilitySequenceNumberCode_01 = "S";
loop2320.SBR_OtherSubscriberInformation.IndividualRelationshipCode_02 = "01";
loop2320.SBR_OtherSubscriberInformation.InsuredGrouporPolicyNumber_03 = "351630";
loop2320.SBR_OtherSubscriberInformation.OtherInsuredGroupName_04 = "STATE TEACHERS";
loop2320.SBR_OtherSubscriberInformation.ClaimFilingIndicatorCode_09 = "CI";
// OI OTHER INSURANCE COVERAGE INFORMATION
loop2320.OI_OtherInsuranceCoverageInformation = new OI_OtherInsuranceCoverageInformation_2();
loop2320.OI_OtherInsuranceCoverageInformation.BenefitsAssignmentCertificationIndicator_03 = "Y";
loop2320.OI_OtherInsuranceCoverageInformation.ReleaseofInformationCode_06 = "Y";
// Occurrence of NM1 Loops in any order
loop2320.AllNM1 = new All_NM1_837I_4();
// Begin 2330A Loop OTHER SUBSCRIBER NAME
loop2320.AllNM1.Loop2330A = new Loop_2330A_837I();
// NM1 OTHER SUBSCRIBER NAME
loop2320.AllNM1.Loop2330A.NM1_OtherSubscriberName = new NM1_OtherSubscriberName();
loop2320.AllNM1.Loop2330A.NM1_OtherSubscriberName.EntityIdentifierCode_01 = "IL";
loop2320.AllNM1.Loop2330A.NM1_OtherSubscriberName.EntityTypeQualifier_02 = "1";
loop2320.AllNM1.Loop2330A.NM1_OtherSubscriberName.ResponseContactLastorOrganizationName_03 = "DOE";
loop2320.AllNM1.Loop2330A.NM1_OtherSubscriberName.ResponseContactFirstName_04 = "JANE";
loop2320.AllNM1.Loop2330A.NM1_OtherSubscriberName.ResponseContactMiddleName_05 = "S";
loop2320.AllNM1.Loop2330A.NM1_OtherSubscriberName.IdentificationCodeQualifier_08 = "MI";
loop2320.AllNM1.Loop2330A.NM1_OtherSubscriberName.ResponseContactIdentifier_09 = "222004433";
// N3 OTHER SUBSCRIBER ADDRESS
loop2320.AllNM1.Loop2330A.N3_OtherSubscriberAddress = new N3_AdditionalPatientInformationContactAddress();
loop2320.AllNM1.Loop2330A.N3_OtherSubscriberAddress.ResponseContactAddressLine_01 = "125 CITY AVENUE";
// N4 OTHER SUBSCRIBER CITY, STATE, ZIP CODE
loop2320.AllNM1.Loop2330A.N4_OtherSubscriberCity_State_ZIPCode = new N4_AdditionalPatientInformationContactCity();
loop2320.AllNM1.Loop2330A.N4_OtherSubscriberCity_State_ZIPCode.AdditionalPatientInformationContactCityName_01 = "CENTERVILLE";
loop2320.AllNM1.Loop2330A.N4_OtherSubscriberCity_State_ZIPCode.AdditionalPatientInformationContactStateCode_02 = "PA";
loop2320.AllNM1.Loop2330A.N4_OtherSubscriberCity_State_ZIPCode.AdditionalPatientInformationContactPostalZoneorZIPCode_03 = "17111";
// End 2330A Loop
// Begin 2330B Loop OTHER PAYER NAME
loop2320.AllNM1.Loop2330B = new Loop_2330B_837I();
// NM1 OTHER PAYER NAME
loop2320.AllNM1.Loop2330B.NM1_OtherPayerName = new NM1_OtherPayerName();
loop2320.AllNM1.Loop2330B.NM1_OtherPayerName.EntityIdentifierCode_01 = "PR";
loop2320.AllNM1.Loop2330B.NM1_OtherPayerName.EntityTypeQualifier_02 = "2";
loop2320.AllNM1.Loop2330B.NM1_OtherPayerName.ResponseContactLastorOrganizationName_03 = "STATE TEACHERS";
loop2320.AllNM1.Loop2330B.NM1_OtherPayerName.IdentificationCodeQualifier_08 = "PI";
loop2320.AllNM1.Loop2330B.NM1_OtherPayerName.ResponseContactIdentifier_09 = "1135";
// End 2330B Loop
// End 2320 Loop
loop2300.Loop2320.Add(loop2320);
// Repeating 2400 Loops
loop2300.Loop2400 = new List();
// Begin 2400 Loop 1 SERVICE LINE
var loop24001 = new Loop_2400_837I();
// LX SERVICE LINE COUNTER
loop24001.LX_ServiceLineNumber = new LX_HeaderNumber();
loop24001.LX_ServiceLineNumber.AssignedNumber_01 = "1";
// SV2 INSTITUTIONAL SERVICE
loop24001.SV2_InstitutionalServiceLine = new SV2_InstitutionalServiceLine();
loop24001.SV2_InstitutionalServiceLine.ServiceLineRevenueCode_01 = "0305";
loop24001.SV2_InstitutionalServiceLine.CompositeMedicalProcedureIdentifier_02 = new C003_CompositeMedicalProcedureIdentifier_8();
loop24001.SV2_InstitutionalServiceLine.CompositeMedicalProcedureIdentifier_02.ProductorServiceIDQualifier_01 = "HC";
loop24001.SV2_InstitutionalServiceLine.CompositeMedicalProcedureIdentifier_02.ProcedureCode_02 = "85025";
loop24001.SV2_InstitutionalServiceLine.LineItemChargeAmount_03 = "13.39";
loop24001.SV2_InstitutionalServiceLine.UnitorBasisforMeasurementCode_04 = "UN";
loop24001.SV2_InstitutionalServiceLine.ServiceUnitCount_05 = "1";
// DTP DATE - SERVICE DATES
loop24001.DTP_Date_ServiceDate = new DTP_ClaimLevelServiceDate();
loop24001.DTP_Date_ServiceDate.DateTimeQualifier_01 = "472";
loop24001.DTP_Date_ServiceDate.DateTimePeriodFormatQualifier_02 = "D8";
loop24001.DTP_Date_ServiceDate.DateTimePeriod_03 = "19960911";
// End 2400 Loop 1
loop2300.Loop2400.Add(loop24001);
// Begin 2400 Loop 2 SERVICE LINE
var loop24002 = new Loop_2400_837I();
// LX SERVICE LINE COUNTER
loop24002.LX_ServiceLineNumber = new LX_HeaderNumber();
loop24002.LX_ServiceLineNumber.AssignedNumber_01 = "2";
// SV2 INSTITUTIONAL SERVICE
loop24002.SV2_InstitutionalServiceLine = new SV2_InstitutionalServiceLine();
loop24002.SV2_InstitutionalServiceLine.ServiceLineRevenueCode_01 = "0730";
loop24002.SV2_InstitutionalServiceLine.CompositeMedicalProcedureIdentifier_02 = new C003_CompositeMedicalProcedureIdentifier_8();
loop24002.SV2_InstitutionalServiceLine.CompositeMedicalProcedureIdentifier_02.ProductorServiceIDQualifier_01 = "HC";
loop24002.SV2_InstitutionalServiceLine.CompositeMedicalProcedureIdentifier_02.ProcedureCode_02 = "93005";
loop24002.SV2_InstitutionalServiceLine.LineItemChargeAmount_03 = "76.54";
loop24002.SV2_InstitutionalServiceLine.UnitorBasisforMeasurementCode_04 = "UN";
loop24002.SV2_InstitutionalServiceLine.ServiceUnitCount_05 = "3";
// DTP DATE - SERVICE DATES
loop24002.DTP_Date_ServiceDate = new DTP_ClaimLevelServiceDate();
loop24002.DTP_Date_ServiceDate.DateTimeQualifier_01 = "472";
loop24002.DTP_Date_ServiceDate.DateTimePeriodFormatQualifier_02 = "D8";
loop24002.DTP_Date_ServiceDate.DateTimePeriod_03 = "19960911";
// End 2400 Loop 2
loop2300.Loop2400.Add(loop24002);
// End 2300 Loop
loop2000B.Loop2300.Add(loop2300);
// End 2000B Loop
loop2000A.Loop2000B.Add(loop2000B);
// End 2000A Loop
result.Loop2000A.Add(loop2000A);
return result;
}
}
}More operations in ediFabric .NET
837I questions
What is the difference between the 837I and the UB-04?
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.
How many service lines can an 837I claim have?
Up to 999 service lines (loop 2400) per claim. Each line is an SV2 segment with a revenue code, charge and units.
Where are the diagnosis and procedure codes in an 837I?
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.
How do I parse and generate X12 837I files in .NET, Python, Java and C?
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.
Resources
Parse your first X12 837I in five minutes
The Community plan is free forever and needs no credit card. It includes ediFabric .NET, Native and Cloud with one serial key.
Sign up free Validate EDI files free