X12 837I Health Care Claim: Institutional

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
TS837I in EdiFabric.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
STTransaction Set HeaderRequired1
BHTBeginning of Hierarchical TransactionRequired1
Any orderThe loops below can appear in any orderRequired1
Loop 1000ASubmitter NameRequired1
NM1Submitter NameRequired1
PERSubmitter EDI Contact InformationRequired2
Loop 1000BReceiver NameRequired1
NM1Receiver NameRequired1
Loop 2000ABilling Provider Hierarchical LevelRequired>1
HLBilling Provider Hierarchical LevelRequired1
PRVBilling Provider Specialty InformationSituational1
CURForeign Currency InformationSituational1
Any orderThe loops below can appear in any orderRequired1
Loop 2010AABilling Provider NameRequired1
NM1Billing Provider NameRequired1
N3Billing Provider AddressRequired1
N4Billing Provider City State ZIP CodeRequired1
REFBilling Provider Tax IdentificationRequired1
PERBilling Provider Contact InformationSituational2
Loop 2010ABPay Address NameSituational1
NM1Pay Address NameRequired1
N3Pay to Address ADDRESSRequired1
N4Pay Address City State ZIP CodeRequired1
Loop 2010ACPay to Plan NameSituational1
NM1Pay to Plan NameRequired1
N3Pay to Plan AddressRequired1
N4Pay to Plan City State Zip CodeRequired1
Any orderThe loops below can appear in any orderRequired1
REFPay to Plan Secondary IdentificationSituational1
REFPay to Tax Identification NumberRequired1
Loop 2000BSubscriber Hierarchical LevelRequired>1
HLSubscriber Hierarchical LevelRequired1
SBRSubscriber InformationRequired1
Any orderThe loops below can appear in any orderRequired1
Loop 2010BASubscriber NameRequired1
NM1Subscriber NameRequired1
N3Subscriber AddressSituational1
N4Subscriber City State ZIP CodeSituational1
DMGSubscriber Demographic InformationSituational1
Any orderThe loops below can appear in any orderSituational1
REFSubscriber Secondary IdentificationSituational1
REFPropertyand Casualty Claim NumberSituational1
Loop 2010BBPayer NameRequired1
NM1Payer NameRequired1
N3Payer AddressSituational1
N4Payer City State ZIP CodeSituational1
Any orderThe loops below can appear in any orderSituational1
REFPayer Secondary IdentificationSituational3
REFBilling Provider Secondary IdentificationSituational1
Loop 2300Claim InformationSituational100
CLMClaim InformationRequired1
Any orderThe loops below can appear in any orderRequired1
DTPDischarge HourSituational1
DTPStatement DatesRequired1
DTPAdmission Date HourSituational1
DTPDate Repricer Received DateSituational1
CL1Institutional Claim CodeRequired1
PWKClaim Supplemental InformationSituational10
CN1Contract InformationSituational1
AMTPatient Estimated Amount DueSituational1
Any orderThe loops below can appear in any orderSituational1
REFService Authorization Exception CodeSituational1
REFReferral NumberSituational1
REFPrior AuthorizationSituational1
REFPayer Claim Control NumberSituational1
REFRepriced Claim NumberSituational1
REFAdjusted Repriced Claim NumberSituational1
REFInvestigational Device Exemption NumberSituational5
REFClaim Identifier for Transmission IntermediariesSituational1
REFAuto Accident StateSituational1
REFMedical Record NumberSituational1
REFDemonstration Project IdentifierSituational1
REFPeer Review Organization PRO Approval NumberSituational1
K3File InformationSituational10
Any orderThe loops below can appear in any orderSituational1
NTEClaim NoteSituational10
NTEBilling NoteSituational1
CRCEPSDT ReferralSituational1
Any orderThe loops below can appear in any orderRequired1
HIPrincipal DiagnosisRequired1
HIAdmitting DiagnosisSituational1
HIPatient Reason for VisitSituational1
HIExternal Causeof InjurySituational1
HIDiagnosis Related Group DRG InformationSituational1
HIOther Diagnosis InformationSituational2
HIPrincipal Procedure InformationSituational1
HIOther Procedure InformationSituational2
HIOccurrence Span InformationSituational2
HIOccurrence InformationSituational2
HIValue InformationSituational2
HICondition InformationSituational2
HITreatment Code InformationSituational2
HCPClaim Pricing Repricing InformationSituational1
Any orderThe loops below can appear in any orderSituational1
Loop 2310AAttending Provider NameSituational1
NM1Attending Provider NameRequired1
PRVAttending Provider Specialty InformationSituational1
REFAttending Provider Secondary IdentificationSituational4
Loop 2310BOperating Physician NameSituational1
NM1Operating Physician NameRequired1
REFOperating Physician Secondary IdentificationSituational4
Loop 2310COther Operating Physician NameSituational1
NM1Other Operating Physician NameRequired1
REFOther Operating Physician Secondary IdentificationSituational4
Loop 2310DRendering Provider NameSituational1
NM1Rendering Provider NameRequired1
REFRendering Provider Secondary IdentificationSituational4
Loop 2310EService Facility Location NameSituational1
NM1Service Facility Location NameRequired1
N3Service Facility Location AddressRequired1
N4Service Facility Location City State ZIPRequired1
REFService Facility Secondary IdentificationSituational3
Loop 2310FReferring Provider NameSituational1
NM1Referring Provider NameRequired1
REFReferring Provider Secondary IdentificationSituational3
Loop 2320Other Subscriber InformationSituational10
SBROther Subscriber InformationRequired1
CASClaim Level AdjustmentsSituational5
Any orderThe loops below can appear in any orderSituational1
AMTCoordinationof Benefits COB Payer Paid AmountSituational1
AMTRemaining Patient LiabilitySituational1
AMTCoordinationof Benefits COB Total Non AmountSituational1
OIOther Insurance Coverage InformationRequired1
MIAInpatient Adjudication InformationSituational1
MOAOutpatient Adjudication InformationSituational1
Any orderThe loops below can appear in any orderRequired1
Loop 2330AOther Subscriber NameRequired1
NM1Other Subscriber NameRequired1
N3Other Subscriber AddressSituational1
N4Other Subscriber City State ZIP CodeSituational1
REFOther Subscriber Secondary InformationSituational2
Loop 2330BOther Payer NameRequired1
NM1Other Payer NameRequired1
N3Other Payer AddressSituational1
N4Other Payer City State ZIP CodeSituational1
DTPClaim Check or Remittance DateSituational1
Any orderThe loops below can appear in any orderSituational1
REFOther Payer Secondary IdentifierSituational2
REFOther Payer Prior Authorization NumberSituational1
REFOther Payer Referral NumberSituational1
REFOther Payer Claim Adjustment IndicatorSituational1
REFOther Payer Claim Control NumberSituational1
Loop 2330COther Payer Attending ProviderSituational1
NM1Other Payer Attending ProviderRequired1
REFOther Payer Attending Provider Secondary IdentificationRequired4
Loop 2330DOther Payer Operating PhysicianSituational1
NM1Other Payer Operating PhysicianRequired1
REFOther Payer Operating Physician Secondary IdentificationRequired4
Loop 2330EOther Payer Other Operating PhysicianSituational1
NM1Other Payer Other Operating PhysicianRequired1
REFOther Payer Other Operating Physician Secondary IdentificationRequired4
Loop 2330FOther Payer Service Facility LocationSituational1
NM1Other Payer Service Facility LocationRequired1
REFOther Payer Service Facility Location Secondary IdentificationRequired3
Loop 2330GOther Payer Rendering Provider NameSituational1
NM1Other Payer Rendering Provider NameRequired1
REFOther Payer Rendering Provider Secondary IdentifierRequired4
Loop 2330HOther Payer Referring ProviderSituational1
NM1Other Payer Referring ProviderRequired1
REFOther Payer Referring Provider Secondary IdentificationRequired3
Loop 2330IOther Payer Billing ProviderSituational1
NM1Other Payer Billing ProviderRequired1
REFOther Payer Billing Provider Secondary IdentifierRequired2
Loop 2400Service Line NumberRequired999
LXService Line NumberRequired1
SV2Institutional Service LineRequired1
PWKLine Supplemental InformationSituational10
DTPDate Service DateSituational1
Any orderThe loops below can appear in any orderSituational1
REFLine Item Control NumberSituational1
REFRepriced Line Item Reference NumberSituational1
REFAdjusted Repriced Line Item Reference NumberSituational1
Any orderThe loops below can appear in any orderSituational1
AMTService Tax AmountSituational1
AMTFacility Tax AmountSituational1
NTEThird Party Organization NotesSituational1
HCPLine Pricing Repricing InformationSituational1
Loop 2410Drug IdentificationSituational1
LINDrug IdentificationRequired1
CTPDrug QuantityRequired1
REFPrescriptionor Compound Drug Association NumberSituational1
Any orderThe loops below can appear in any orderSituational1
Loop 2420AOperating Physician NameSituational1
NM1Operating Physician NameRequired1
REFOperating Physician Secondary IdentificationSituational20
Loop 2420BOther Operating Physician NameSituational1
NM1Other Operating Physician NameRequired1
REFOther Operating Physician Secondary IdentificationSituational20
Loop 2420CRendering Provider NameSituational1
NM1Rendering Provider NameRequired1
REFRendering Provider Secondary IdentificationSituational20
Loop 2420DReferring Provider NameSituational1
NM1Referring Provider NameRequired1
REFReferring Provider Secondary IdentificationSituational20
Loop 2430Line Adjudication InformationSituational15
SVDLine Adjudication InformationRequired1
CASLine AdjustmentSituational5
DTPLine Checkor Remittance DateRequired1
AMTRemaining Patient LiabilitySituational1
Loop 2000CPatient Hierarchical LevelSituational>1
HLPatient Hierarchical LevelRequired1
PATPatient InformationRequired1
Loop 2010CAPatient NameRequired1
NM1Patient NameRequired1
N3Patient AddressRequired1
N4Patient City State ZIP CodeRequired1
DMGPatient Demographic InformationRequired1
Any orderThe loops below can appear in any orderSituational1
REFPropertyand Casualty Claim NumberSituational1
REFPropertyand Casualty Patient IdentifierSituational1
Loop 2300Claim InformationRequired100
CLMClaim InformationRequired1
Any orderThe loops below can appear in any orderRequired1
DTPDischarge HourSituational1
DTPStatement DatesRequired1
DTPAdmission Date HourSituational1
DTPDate Repricer Received DateSituational1
CL1Institutional Claim CodeRequired1
PWKClaim Supplemental InformationSituational10
CN1Contract InformationSituational1
AMTPatient Estimated Amount DueSituational1
Any orderThe loops below can appear in any orderSituational1
REFService Authorization Exception CodeSituational1
REFReferral NumberSituational1
REFPrior AuthorizationSituational1
REFPayer Claim Control NumberSituational1
REFRepriced Claim NumberSituational1
REFAdjusted Repriced Claim NumberSituational1
REFInvestigational Device Exemption NumberSituational5
REFClaim Identifier for Transmission IntermediariesSituational1
REFAuto Accident StateSituational1
REFMedical Record NumberSituational1
REFDemonstration Project IdentifierSituational1
REFPeer Review Organization PRO Approval NumberSituational1
K3File InformationSituational10
Any orderThe loops below can appear in any orderSituational1
NTEClaim NoteSituational10
NTEBilling NoteSituational1
CRCEPSDT ReferralSituational1
Any orderThe loops below can appear in any orderRequired1
HIPrincipal DiagnosisRequired1
HIAdmitting DiagnosisSituational1
HIPatient Reason for VisitSituational1
HIExternal Causeof InjurySituational1
HIDiagnosis Related Group DRG InformationSituational1
HIOther Diagnosis InformationSituational2
HIPrincipal Procedure InformationSituational1
HIOther Procedure InformationSituational2
HIOccurrence Span InformationSituational2
HIOccurrence InformationSituational2
HIValue InformationSituational2
HICondition InformationSituational2
HITreatment Code InformationSituational2
HCPClaim Pricing Repricing InformationSituational1
Any orderThe loops below can appear in any orderSituational1
Loop 2310AAttending Provider NameSituational1
NM1Attending Provider NameRequired1
PRVAttending Provider Specialty InformationSituational1
REFAttending Provider Secondary IdentificationSituational4
Loop 2310BOperating Physician NameSituational1
NM1Operating Physician NameRequired1
REFOperating Physician Secondary IdentificationSituational4
Loop 2310COther Operating Physician NameSituational1
NM1Other Operating Physician NameRequired1
REFOther Operating Physician Secondary IdentificationSituational4
Loop 2310DRendering Provider NameSituational1
NM1Rendering Provider NameRequired1
REFRendering Provider Secondary IdentificationSituational4
Loop 2310EService Facility Location NameSituational1
NM1Service Facility Location NameRequired1
N3Service Facility Location AddressRequired1
N4Service Facility Location City State ZIPRequired1
REFService Facility Secondary IdentificationSituational3
Loop 2310FReferring Provider NameSituational1
NM1Referring Provider NameRequired1
REFReferring Provider Secondary IdentificationSituational3
Loop 2320Other Subscriber InformationSituational10
SBROther Subscriber InformationRequired1
CASClaim Level AdjustmentsSituational5
Any orderThe loops below can appear in any orderSituational1
AMTCoordinationof Benefits COB Payer Paid AmountSituational1
AMTRemaining Patient LiabilitySituational1
AMTCoordinationof Benefits COB Total Non AmountSituational1
OIOther Insurance Coverage InformationRequired1
MIAInpatient Adjudication InformationSituational1
MOAOutpatient Adjudication InformationSituational1
Any orderThe loops below can appear in any orderRequired1
Loop 2330AOther Subscriber NameRequired1
NM1Other Subscriber NameRequired1
N3Other Subscriber AddressSituational1
N4Other Subscriber City State ZIP CodeSituational1
REFOther Subscriber Secondary InformationSituational2
Loop 2330BOther Payer NameRequired1
NM1Other Payer NameRequired1
N3Other Payer AddressSituational1
N4Other Payer City State ZIP CodeSituational1
DTPClaim Check or Remittance DateSituational1
Any orderThe loops below can appear in any orderSituational1
REFOther Payer Secondary IdentifierSituational2
REFOther Payer Prior Authorization NumberSituational1
REFOther Payer Referral NumberSituational1
REFOther Payer Claim Adjustment IndicatorSituational1
REFOther Payer Claim Control NumberSituational1
Loop 2330COther Payer Attending ProviderSituational1
NM1Other Payer Attending ProviderRequired1
REFOther Payer Attending Provider Secondary IdentificationRequired4
Loop 2330DOther Payer Operating PhysicianSituational1
NM1Other Payer Operating PhysicianRequired1
REFOther Payer Operating Physician Secondary IdentificationRequired4
Loop 2330EOther Payer Other Operating PhysicianSituational1
NM1Other Payer Other Operating PhysicianRequired1
REFOther Payer Other Operating Physician Secondary IdentificationRequired4
Loop 2330FOther Payer Service Facility LocationSituational1
NM1Other Payer Service Facility LocationRequired1
REFOther Payer Service Facility Location Secondary IdentificationRequired3
Loop 2330GOther Payer Rendering Provider NameSituational1
NM1Other Payer Rendering Provider NameRequired1
REFOther Payer Rendering Provider Secondary IdentifierRequired4
Loop 2330HOther Payer Referring ProviderSituational1
NM1Other Payer Referring ProviderRequired1
REFOther Payer Referring Provider Secondary IdentificationRequired3
Loop 2330IOther Payer Billing ProviderSituational1
NM1Other Payer Billing ProviderRequired1
REFOther Payer Billing Provider Secondary IdentifierRequired2
Loop 2400Service Line NumberRequired999
LXService Line NumberRequired1
SV2Institutional Service LineRequired1
PWKLine Supplemental InformationSituational10
DTPDate Service DateSituational1
Any orderThe loops below can appear in any orderSituational1
REFLine Item Control NumberSituational1
REFRepriced Line Item Reference NumberSituational1
REFAdjusted Repriced Line Item Reference NumberSituational1
Any orderThe loops below can appear in any orderSituational1
AMTService Tax AmountSituational1
AMTFacility Tax AmountSituational1
NTEThird Party Organization NotesSituational1
HCPLine Pricing Repricing InformationSituational1
Loop 2410Drug IdentificationSituational1
LINDrug IdentificationRequired1
CTPDrug QuantityRequired1
REFPrescriptionor Compound Drug Association NumberSituational1
Any orderThe loops below can appear in any orderSituational1
Loop 2420AOperating Physician NameSituational1
NM1Operating Physician NameRequired1
REFOperating Physician Secondary IdentificationSituational20
Loop 2420BOther Operating Physician NameSituational1
NM1Other Operating Physician NameRequired1
REFOther Operating Physician Secondary IdentificationSituational20
Loop 2420CRendering Provider NameSituational1
NM1Rendering Provider NameRequired1
REFRendering Provider Secondary IdentificationSituational20
Loop 2420DReferring Provider NameSituational1
NM1Referring Provider NameRequired1
REFReferring Provider Secondary IdentificationSituational20
Loop 2430Line Adjudication InformationSituational15
SVDLine Adjudication InformationRequired1
CASLine AdjustmentSituational5
DTPLine Checkor Remittance DateRequired1
AMTRemaining Patient LiabilitySituational1
SETransaction Set TrailerRequired1

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.

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'

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.

Related transactions

Parse your first 837I in five minutes

The Community plan is free forever and needs no credit card. It includes ediFabric .NET, Native and Cloud.