X12 837D Health Care Claim: Dental Last updated: 2026-09-29

The 837D is the HIPAA transaction a dental practice or its billing service sends to a dental payer to bill for dental services. It carries the same information as the ADA dental claim form.

Compared with the 837P it adds tooth-level detail: the TOO segment identifies the tooth number and surfaces for each procedure, and DN1/DN2 carry orthodontic and tooth status information.

At a glance

Standard
X12 HIPAA
Implementation guide
005010X224A2
Functional group
HC (GS01)
Sent by
Dental provider or billing service to dental payer
Responses
999, 277CA, 835
ediFabric .NET template
TS837D in EdiFabric.Templates.Hipaa
OpenEDI definition
View 837D in the spec library

837D structure

The full X12 837D layout from its OpenEDI definition, the same model ediFabric uses to parse, validate and generate it: 53 loops and 254 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
Any orderThe loops below can appear in any orderRequired1
REFBilling Provider Tax IdentificationRequired1
REFBilling Provider UPIN License InformationSituational2
PERBilling Provider Contact InformationSituational2
Loop 2010ABPay Address NameSituational1
NM1Pay Address NameRequired1
N3Pay 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 Plan 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 orderSituational1
DTPDate AccidentSituational1
DTPDate Appliance PlacementSituational1
DTPDate Service DateSituational1
DTPDate Repricer Received DateSituational1
DN1Orthodontic Total Monthsof TreatmentSituational1
DN2Tooth StatusSituational35
PWKClaim Supplemental InformationSituational10
CN1Contract InformationSituational1
AMTPatient Amount PaidSituational1
Any orderThe loops below can appear in any orderSituational1
REFPredetermination IdentificationSituational1
REFService Authorization Exception CodeSituational1
REFPayer Claim Control NumberSituational1
REFReferral NumberSituational1
REFPrior AuthorizationSituational1
REFRepriced Claim NumberSituational1
REFAdjusted Repriced Claim NumberSituational1
REFClaim Identifier for Transmission IntermediariesSituational1
K3File InformationSituational10
NTEClaim NoteSituational5
HIHealth Care Diagnosis CodeSituational1
HCPClaim Pricing Repricing InformationSituational1
Any orderThe loops below can appear in any orderSituational1
Loop 2310AReferring Provider NameSituational2
NM1Referring Provider NameRequired1
PRVReferring Provider Specialty InformationSituational1
REFReferring Provider Secondary IdentificationSituational3
Loop 2310BRendering Provider NameSituational1
NM1Rendering Provider NameRequired1
PRVRendering Provider Specialty InformationRequired1
REFRendering Provider Secondary IdentificationSituational4
Loop 2310CService Facility Location NameSituational1
NM1Service Facility Location NameRequired1
N3Service Facility Location AddressRequired1
N4Service Facility Location City State Zip CodeRequired1
REFService Facility Location Secondary IdentificationSituational3
Loop 2310DAssistant Surgeon NameSituational1
NM1Assistant Surgeon NameRequired1
PRVAssistant Surgeon Specialty InformationRequired1
REFAssistant Surgeon Secondary IdentificationSituational4
Loop 2310ESupervising Provider NameSituational1
NM1Supervising Provider NameRequired1
REFSupervising Provider Secondary IdentificationSituational4
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
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 IdentificationSituational2
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 IdentifierSituational3
REFOther Payer Prior Authorization NumberSituational1
REFOther Payer Referral NumberSituational1
REFOther Payer Claim Adjustment IndicatorSituational1
REFOther Payer Predetermination IdentificationSituational1
REFOther Payer Claim Control NumberSituational1
Loop 2330COther Payer Referring ProviderSituational2
NM1Other Payer Referring ProviderRequired1
REFOther Payer Referring Provider Secondary IdentificationRequired3
Loop 2330DOther Payer Rendering ProviderSituational1
NM1Other Payer Rendering ProviderRequired1
REFOther Payer Rendering Provider Secondary IdentificationRequired3
Loop 2330EOther Payer Supervising ProviderSituational1
NM1Other Payer Supervising ProviderRequired1
REFOther Payer Supervising Provider IdentificationRequired3
Loop 2330FOther Payer Billing ProviderSituational1
NM1Other Payer Billing ProviderRequired1
REFOther Payer Billing Provider Secondary IdentificationRequired2
Loop 2330GOther Payer Service Facility LocationSituational1
NM1Other Payer Service Facility LocationRequired1
REFOther Payer Service Facility Location Secondary IdentificationRequired3
Loop 2330HOther Payer Assistant SurgeonSituational1
NM1Other Payer Assistant SurgeonRequired1
REFOther Payer Assistant Surgeon Secondary IdentifierRequired3
Loop 2400Service Line NumberRequired50
LXService Line NumberRequired1
SV3Dental ServiceRequired1
TOOTooth InformationSituational32
Any orderThe loops below can appear in any orderSituational1
DTPDate Service DateSituational1
DTPDate Prior PlacementSituational1
DTPDate Appliance PlacementSituational1
DTPDate ReplacementSituational1
DTPDate Treatment StartSituational1
DTPDate Treatment CompletionSituational1
CN1Contract InformationSituational1
Any orderThe loops below can appear in any orderSituational1
REFService Predetermination IdentificationSituational5
REFPrior AuthorizationSituational5
REFLine Item Control NumberSituational1
REFRepriced Claim NumberSituational1
REFAdjusted Repriced Claim NumberSituational1
REFReferral NumberSituational5
AMTSales Tax AmountSituational1
K3File InformationSituational10
HCPLine Pricing Repricing InformationSituational1
Any orderThe loops below can appear in any orderSituational1
Loop 2420ARendering Provider NameSituational1
NM1Rendering Provider NameRequired1
PRVRendering Provider Specialty InformationRequired1
REFRendering Provider Secondary IdentificationSituational20
Loop 2420BAssistant Surgeon NameSituational1
NM1Assistant Surgeon NameRequired1
PRVAssistant Surgeon Specialty InformationSituational1
REFAssistant Surgeon Secondary IdentificationSituational20
Loop 2420CSupervising Provider NameSituational1
NM1Supervising Provider NameRequired1
REFSupervising Provider Secondary IdentificationSituational20
Loop 2420DService Facility Location NameSituational1
NM1Service Facility Location NameRequired1
N3Service Facility Location AddressRequired1
N4Service Facility Location City State ZIP CodeRequired1
REFService Facility Location 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 orderSituational1
DTPDate AccidentSituational1
DTPDate Appliance PlacementSituational1
DTPDate Service DateSituational1
DTPDate Repricer Received DateSituational1
DN1Orthodontic Total Monthsof TreatmentSituational1
DN2Tooth StatusSituational35
PWKClaim Supplemental InformationSituational10
CN1Contract InformationSituational1
AMTPatient Amount PaidSituational1
Any orderThe loops below can appear in any orderSituational1
REFPredetermination IdentificationSituational1
REFService Authorization Exception CodeSituational1
REFPayer Claim Control NumberSituational1
REFReferral NumberSituational1
REFPrior AuthorizationSituational1
REFRepriced Claim NumberSituational1
REFAdjusted Repriced Claim NumberSituational1
REFClaim Identifier for Transmission IntermediariesSituational1
K3File InformationSituational10
NTEClaim NoteSituational5
HIHealth Care Diagnosis CodeSituational1
HCPClaim Pricing Repricing InformationSituational1
Any orderThe loops below can appear in any orderSituational1
Loop 2310AReferring Provider NameSituational2
NM1Referring Provider NameRequired1
PRVReferring Provider Specialty InformationSituational1
REFReferring Provider Secondary IdentificationSituational3
Loop 2310BRendering Provider NameSituational1
NM1Rendering Provider NameRequired1
PRVRendering Provider Specialty InformationRequired1
REFRendering Provider Secondary IdentificationSituational4
Loop 2310CService Facility Location NameSituational1
NM1Service Facility Location NameRequired1
N3Service Facility Location AddressRequired1
N4Service Facility Location City State Zip CodeRequired1
REFService Facility Location Secondary IdentificationSituational3
Loop 2310DAssistant Surgeon NameSituational1
NM1Assistant Surgeon NameRequired1
PRVAssistant Surgeon Specialty InformationRequired1
REFAssistant Surgeon Secondary IdentificationSituational4
Loop 2310ESupervising Provider NameSituational1
NM1Supervising Provider NameRequired1
REFSupervising Provider Secondary IdentificationSituational4
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
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 IdentificationSituational2
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 IdentifierSituational3
REFOther Payer Prior Authorization NumberSituational1
REFOther Payer Referral NumberSituational1
REFOther Payer Claim Adjustment IndicatorSituational1
REFOther Payer Predetermination IdentificationSituational1
REFOther Payer Claim Control NumberSituational1
Loop 2330COther Payer Referring ProviderSituational2
NM1Other Payer Referring ProviderRequired1
REFOther Payer Referring Provider Secondary IdentificationRequired3
Loop 2330DOther Payer Rendering ProviderSituational1
NM1Other Payer Rendering ProviderRequired1
REFOther Payer Rendering Provider Secondary IdentificationRequired3
Loop 2330EOther Payer Supervising ProviderSituational1
NM1Other Payer Supervising ProviderRequired1
REFOther Payer Supervising Provider IdentificationRequired3
Loop 2330FOther Payer Billing ProviderSituational1
NM1Other Payer Billing ProviderRequired1
REFOther Payer Billing Provider Secondary IdentificationRequired2
Loop 2330GOther Payer Service Facility LocationSituational1
NM1Other Payer Service Facility LocationRequired1
REFOther Payer Service Facility Location Secondary IdentificationRequired3
Loop 2330HOther Payer Assistant SurgeonSituational1
NM1Other Payer Assistant SurgeonRequired1
REFOther Payer Assistant Surgeon Secondary IdentifierRequired3
Loop 2400Service Line NumberRequired50
LXService Line NumberRequired1
SV3Dental ServiceRequired1
TOOTooth InformationSituational32
Any orderThe loops below can appear in any orderSituational1
DTPDate Service DateSituational1
DTPDate Prior PlacementSituational1
DTPDate Appliance PlacementSituational1
DTPDate ReplacementSituational1
DTPDate Treatment StartSituational1
DTPDate Treatment CompletionSituational1
CN1Contract InformationSituational1
Any orderThe loops below can appear in any orderSituational1
REFService Predetermination IdentificationSituational5
REFPrior AuthorizationSituational5
REFLine Item Control NumberSituational1
REFRepriced Claim NumberSituational1
REFAdjusted Repriced Claim NumberSituational1
REFReferral NumberSituational5
AMTSales Tax AmountSituational1
K3File InformationSituational10
HCPLine Pricing Repricing InformationSituational1
Any orderThe loops below can appear in any orderSituational1
Loop 2420ARendering Provider NameSituational1
NM1Rendering Provider NameRequired1
PRVRendering Provider Specialty InformationRequired1
REFRendering Provider Secondary IdentificationSituational20
Loop 2420BAssistant Surgeon NameSituational1
NM1Assistant Surgeon NameRequired1
PRVAssistant Surgeon Specialty InformationSituational1
REFAssistant Surgeon Secondary IdentificationSituational20
Loop 2420CSupervising Provider NameSituational1
NM1Supervising Provider NameRequired1
REFSupervising Provider Secondary IdentificationSituational20
Loop 2420DService Facility Location NameSituational1
NM1Service Facility Location NameRequired1
N3Service Facility Location AddressRequired1
N4Service Facility Location City State ZIP CodeRequired1
REFService Facility Location Secondary IdentificationSituational20
Loop 2430Line Adjudication InformationSituational15
SVDLine Adjudication InformationRequired1
CASLine AdjustmentSituational5
DTPLine Checkor Remittance DateRequired1
AMTRemaining Patient LiabilitySituational1
SETransaction Set TrailerRequired1

Sample 837D file

A dental claim with CDT procedure codes and tooth information on the 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*005010X224A2~
ST*837*3456*005010X224A2~
BHT*0019*00*0123*20061123*1023*CH~
NM1*41*2*PREMIER BILLING SERVICE*****46*TGJ23~
PER*IC*JERRY*TE*7176149999~
NM1*40*2*INSURANCE COMPANY XYZ*****46*66783JJT~
HL*1**20*1~
NM1*85*2*DENTAL ASSOCIATES*****XX*1234567890~
N3*234 SEAWAY ST~
N4*MIAMI*FL*33111~
REF*EI*587654321~
HL*2*1*22*1~
SBR*P********CI~
NM1*IL*1*SMITH*JANE****MI*111223333~
NM1*PR*2*INSURANCE COMPANY XYZ*****PI*66783JJT~
HL*3*2*23*0~
PAT*19~
NM1*QC*1*SMITH*TED~
N3*236 N MAIN ST~
N4*MIAMI*FL*33413~
DMG*D8*19920501*M~
CLM*26403774*150***11:B:1*Y*A*Y*I~
DTP*472*D8*20061029~
REF*D9*17312345600006351~
NM1*82*1*KILDARE*BEN****XX*9876543210~
PRV*PE*PXC*1223G0001X~
LX*1~
SV3*AD:D2150*100****1~
TOO*JP*12*M:O~
LX*2~
SV3*AD:D1110*50****1~
SE*31*3456~
GE*1*101~
IEA*1*000000101~

The same 837D 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": "3456",
    "ImplementationConventionPreference_03": "005010X224A2"
  },
  "BHT_BeginningOfHierarchicalTransaction": {
    "HierarchicalStructureCode_01": "0019",
    "TransactionSetPurposeCode_02": "00",
    "SubmitterTransactionIdentifier_03": "0123",
    "TransactionSetCreationDate_04": "20061123",
    "TransactionSetCreationTime_05": "1023",
    "TransactionTypeCode_06": "CH"
  },
  "AllNM1": {
    "Loop1000A": {
      "NM1_SubmitterName": {
        "EntityIdentifierCode_01": "41",
        "EntityTypeQualifier_02": "2",
        "ResponseContactLastorOrganizationName_03": "PREMIER BILLING SERVICE",
        "IdentificationCodeQualifier_08": "46",
        "ResponseContactIdentifier_09": "TGJ23"
      },
      "PER_SubmitterEDIContactInformation": [
        {
          "ContactFunctionCode_01": "IC",
          "ResponseContactName_02": "JERRY",
          "CommunicationNumberQualifier_03": "TE",
          "ResponseContactCommunicationNumber_04": "7176149999"
        }
      ]
    },
    "Loop1000B": {
      "NM1_ReceiverName": {
        "EntityIdentifierCode_01": "40",
        "EntityTypeQualifier_02": "2",
        "ResponseContactLastorOrganizationName_03": "INSURANCE COMPANY XYZ",
        "IdentificationCodeQualifier_08": "46",
        "ResponseContactIdentifier_09": "66783JJT"
      }
    }
  },
  "Loop2000A": [
    {
      "HL_BillingProviderHierarchicalLevel": {
        "HierarchicalIDNumber_01": "1",
        "HierarchicalLevelCode_03": "20",
        "HierarchicalChildCode_04": "1"
      },
      "AllNM1": {
        "Loop2010AA": {
          "NM1_BillingProviderName": {
            "EntityIdentifierCode_01": "85",
            "EntityTypeQualifier_02": "2",
            "ResponseContactLastorOrganizationName_03": "DENTAL ASSOCIATES",
            "IdentificationCodeQualifier_08": "XX",
            "ResponseContactIdentifier_09": "1234567890"
          },
          "N3_BillingProviderAddress": {
            "ResponseContactAddressLine_01": "234 SEAWAY ST"
          },
          "N4_BillingProviderCity_State_ZIPCode": {
            "AdditionalPatientInformationContactCityName_01": "MIAMI",
            "AdditionalPatientInformationContactStateCode_02": "FL",
            "AdditionalPatientInformationContactPostalZoneorZIPCode_03": "33111"
          },
          "AllREF": {
            "REF_BillingProviderTaxIdentification": {
              "ReferenceIdentificationQualifier_01": "EI",
              "MemberGrouporPolicyNumber_02": "587654321"
            }
          }
        }
      },
      "Loop2000B": [
        {
          "HL_SubscriberHierarchicalLevel": {
            "HierarchicalIDNumber_01": "2",
            "HierarchicalParentIDNumber_02": "1",
            "HierarchicalLevelCode_03": "22",
            "HierarchicalChildCode_04": "1"
          },
          "SBR_SubscriberInformation": {
            "PayerResponsibilitySequenceNumberCode_01": "P",
            "ClaimFilingIndicatorCode_09": "CI"
          },
          "AllNM1": {
            "Loop2010BA": {
              "NM1_SubscriberName": {
                "EntityIdentifierCode_01": "IL",
                "EntityTypeQualifier_02": "1",
                "ResponseContactLastorOrganizationName_03": "SMITH",
                "ResponseContactFirstName_04": "JANE",
                "IdentificationCodeQualifier_08": "MI",
                "ResponseContactIdentifier_09": "111223333"
              }
            },
            "Loop2010BB": {
              "NM1_PayerName": {
                "EntityIdentifierCode_01": "PR",
                "EntityTypeQualifier_02": "2",
                "ResponseContactLastorOrganizationName_03": "INSURANCE COMPANY XYZ",
                "IdentificationCodeQualifier_08": "PI",
                "ResponseContactIdentifier_09": "66783JJT"
              }
            }
          },
          "Loop2000C": [
            {
              "HL_PatientHierarchicalLevel": {
                "HierarchicalIDNumber_01": "3",
                "HierarchicalParentIDNumber_02": "2",
                "HierarchicalLevelCode_03": "23",
                "HierarchicalChildCode_04": "0"
              },
              "PAT_PatientInformation": {
                "IndividualRelationshipCode_01": "19"
              },
              "Loop2010CA": {
                "NM1_PatientName": {
                  "EntityIdentifierCode_01": "QC",
                  "EntityTypeQualifier_02": "1",
                  "ResponseContactLastorOrganizationName_03": "SMITH",
                  "ResponseContactFirstName_04": "TED"
                },
                "N3_PatientAddress": {
                  "ResponseContactAddressLine_01": "236 N MAIN ST"
                },
                "N4_PatientCity_State_ZIPCode": {
                  "AdditionalPatientInformationContactCityName_01": "MIAMI",
                  "AdditionalPatientInformationContactStateCode_02": "FL",
                  "AdditionalPatientInformationContactPostalZoneorZIPCode_03": "33413"
                },
                "DMG_PatientDemographicInformation": {
                  "DateTimePeriodFormatQualifier_01": "D8",
                  "DependentBirthDate_02": "19920501",
                  "DependentGenderCode_03": "M"
                }
              },
              "Loop2300": [
                {
                  "CLM_ClaimInformation": {
                    "PatientControlNumber_01": "26403774",
                    "TotalClaimChargeAmount_02": "150",
                    "HealthCareServiceLocationInformation_05": {
                      "FacilityTypeCode_01": "11",
                      "FacilityCodeQualifier_02": "B",
                      "ClaimFrequencyTypeCode_03": "1"
                    },
                    "ProviderorSupplierSignatureIndicator_06": "Y",
                    "AssignmentorPlanParticipationCode_07": "A",
                    "BenefitsAssignmentCertificationIndicator_08": "Y",
                    "ReleaseofInformationCode_09": "I"
                  },
                  "AllDTP": {
                    "DTP_Date_ServiceDate": {
                      "DateTimeQualifier_01": "472",
                      "DateTimePeriodFormatQualifier_02": "D8",
                      "DateTimePeriod_03": "20061029"
                    }
                  },
                  "AllREF": {
                    "REF_ClaimIdentifierForTransmissionIntermediaries": {
                      "ReferenceIdentificationQualifier_01": "D9",
                      "MemberGrouporPolicyNumber_02": "17312345600006351"
                    }
                  },
                  "AllNM1": {
                    "Loop2310B": {
                      "NM1_RenderingProviderName": {
                        "EntityIdentifierCode_01": "82",
                        "EntityTypeQualifier_02": "1",
                        "ResponseContactLastorOrganizationName_03": "KILDARE",
                        "ResponseContactFirstName_04": "BEN",
                        "IdentificationCodeQualifier_08": "XX",
                        "ResponseContactIdentifier_09": "9876543210"
                      },
                      "PRV_RenderingProviderSpecialtyInformation": {
                        "ProviderCode_01": "PE",
                        "ReferenceIdentificationQualifier_02": "PXC",
                        "ProviderTaxonomyCode_03": "1223G0001X"
                      }
                    }
                  },
                  "Loop2400": [
                    {
                      "LX_ServiceLineNumber": {
                        "AssignedNumber_01": "1"
                      },
                      "SV3_DentalService": {
                        "CompositeMedicalProcedureIdentifier_01": {
                          "ProductorServiceIDQualifier_01": "AD",
                          "ProcedureCode_02": "D2150"
                        },
                        "LineItemChargeAmount_02": "100",
                        "ProcedureCount_06": "1"
                      },
                      "TOO_ToothInformation": [
                        {
                          "CodeListQualifierCode_01": "JP",
                          "ToothCode_02": "12",
                          "ToothSurface_03": {
                            "ToothSurfaceCode_01": "M",
                            "ToothSurfaceCode_02": "O"
                          }
                        }
                      ]
                    },
                    {
                      "LX_ServiceLineNumber": {
                        "AssignedNumber_01": "2"
                      },
                      "SV3_DentalService": {
                        "CompositeMedicalProcedureIdentifier_01": {
                          "ProductorServiceIDQualifier_01": "AD",
                          "ProcedureCode_02": "D1110"
                        },
                        "LineItemChargeAmount_02": "50",
                        "ProcedureCount_06": "1"
                      }
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "SE": {
    "NumberofIncludedSegments_01": "31",
    "TransactionSetControlNumber_02": "3456"
  }
}

Parse and validate an 837D 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\DentalClaim.txt"))
using (var reader = new X12Reader(stream, "EdiFabric.Templates.Hipaa"))
{
    var items = await reader.ReadToEndAsync();
    foreach (var transaction in items.OfType<TS837D>())
    {
        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("DentalClaim.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("DentalClaim.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("DentalClaim.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 '@DentalClaim.txt'

Generate an 837D file

Populate a TS837D object in .NET, or pass JSON in the shape shown above to ediFabric Native or ediFabric Cloud, and get a valid 837D file back.

using EdiFabric.Templates.Hipaa5010;

License.SetSerial("YOUR_SERIAL_KEY");

var transaction = new TS837D();

//  ST TRANSACTION SET HEADER
transaction.ST = new ST();
transaction.ST.TransactionSetIdentifierCode_01 = "837";
transaction.ST.TransactionSetControlNumber_02 = "0001";
transaction.ST.ImplementationConventionPreference_03 = "005010X224A2";

//  BHT TRANSACTION SET HIERARCHY AND CONTROL INFORMATION
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 = "20061123";
transaction.BHT_BeginningOfHierarchicalTransaction.TransactionSetCreationTime_05 = "1023";
transaction.BHT_BeginningOfHierarchicalTransaction.TransactionTypeCode_06 = "CH";

//  Occurrence of NM1 Loops in any order
transaction.AllNM1 = new All_NM1_837D_6();

//  Begin 1000A Loop SUBMITTER NAME
transaction.AllNM1.Loop1000A = new Loop_1000A_837D();

// ... 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", "005010X224A2"));
        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("DentalClaim.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("DentalClaim.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("DentalClaim.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 '@DentalClaim.json' \
-o 'DentalClaim.txt'

Complete ediFabric .NET example

A complete C# program for the X12 837D, built on TS837D 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.T837D
{
    class Program
    {
        static void Main(string[] args)
        {
            SerialKey.Set(Common.SerialKey.Get());
            Read();
            Write();
        }

        ///
        /// Read Dental Claim
        ///
        static void Read()
        {
            var ediStream = File.OpenRead(Directory.GetCurrentDirectory() + @"\..\..\..\Files\Hipaa\DentalClaim.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 Dental Claim
        ///
        static void Write()
        {
            var transaction = BuildDentalClaim("3456");

            using (var stream = new MemoryStream())
            {
                using (var writer = new X12Writer(stream))
                {
                    writer.Write(SegmentBuilders.BuildIsa("1"));
                    writer.Write(SegmentBuilders.BuildGs("1", "SENDER1", "RECEIVER1", "005010X224A2"));
                    writer.Write(transaction);
                }

                var ediString = stream.LoadToString();
            }
        }

        ///
        /// Build dental claim.
        /// Original from http://www.x12.org/examples/005010X224/commercial-health-insurance/
        /// The patient is a different person than the subscriber. The payer is a commercial health insurance company.
        /// Scenario:
        /// SUBSCRIBER: Jane Smith
        /// KEY INSURANCE COMPANY ID #: SSN
        /// SSN: 111-22-3333
        /// PATIENT: Ted Smith
        /// PATIENT ADDRESS: 236 N.Main St., Miami, Fl, 33413
        /// SEX: M
        /// DOB: 05/01/1992
        /// PATIENT RELATIONSHIP: Child
        /// DESTINATION PAYER: Insurance Company XYZ
        /// RECEIVER: Insurance Company XYZ
        /// ETIN#: 66783JJT
        /// SUBMITTER: Premier Billing Service
        /// ETIN#: TGJ23
        /// BILLING PROVIDER: Dental Associates
        /// NPI: 1234567890
        /// TIN: 587654321
        /// ADDRESS: 234 Seaway St., Miami, FL, 33111
        /// RENDERING PROVIDER: Dr.Ben Kildare
        /// NPI: 9876543210
        /// PATIENT ACCOUNT NUMBER: 2-640-3774
        /// DOS: 20061029
        /// POS= Office
        /// SERVICES RENDERED: Two surface amalgam on tooth #12 (mesial and occlusal surfaces) and prophy.
        /// CHARGES: amalgam = $100.00, prophy = $50.00.
        /// ELECTRONIC ROUTE: VAN submits claim on behalf of billing provider (submitter) to Insurance Company XYZ (receiver).
        /// VAN CLAIM IDENTIFICATION NUMBER: 17312345600006351.
        ///
        static TS837D BuildDentalClaim(string controlNumber)
        {
            var result = new TS837D();

            //  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 = "005010X224A2";

            //  BHT TRANSACTION SET HIERARCHY AND CONTROL INFORMATION
            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 = "20061123";
            result.BHT_BeginningOfHierarchicalTransaction.TransactionSetCreationTime_05 = "1023";
            result.BHT_BeginningOfHierarchicalTransaction.TransactionTypeCode_06 = "CH";

            //  Occurrence of NM1 Loops in any order
            result.AllNM1 = new All_NM1_837D_6();

            //  Begin 1000A Loop SUBMITTER NAME
            result.AllNM1.Loop1000A = new Loop_1000A_837D();

            //  NM1 SUBMITTER
            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 = "PREMIER BILLING SERVICE";
            result.AllNM1.Loop1000A.NM1_SubmitterName.IdentificationCodeQualifier_08 = "46";
            result.AllNM1.Loop1000A.NM1_SubmitterName.ResponseContactIdentifier_09 = "TGJ23";

            //  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 = "JERRY";
            per1.CommunicationNumberQualifier_03 = "TE";
            per1.ResponseContactCommunicationNumber_04 = "7176149999";
            result.AllNM1.Loop1000A.PER_SubmitterEDIContactInformation.Add(per1);

            //  End 1000A Loop

            //  Begin 1000B Loop RECEIVER NAME
            result.AllNM1.Loop1000B = new Loop_1000B_837D();

            //  NM1 RECEIVER
            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 = "INSURANCE COMPANY XYZ";
            result.AllNM1.Loop1000B.NM1_ReceiverName.IdentificationCodeQualifier_08 = "46";
            result.AllNM1.Loop1000B.NM1_ReceiverName.ResponseContactIdentifier_09 = "66783JJT";

            //  End 1000B Loop

            //  Repeating 2000A Loops
            result.Loop2000A = new List();

            //  Begin 2000A Loop BILLING PROVIDER
            var loop2000A = new Loop_2000A_837D();

            //  HIERARCHAL LEVEL 1
            loop2000A.HL_BillingProviderHierarchicalLevel = new HL_BillingProviderHierarchicalLevel();
            loop2000A.HL_BillingProviderHierarchicalLevel.HierarchicalIDNumber_01 = "1";
            loop2000A.HL_BillingProviderHierarchicalLevel.HierarchicalLevelCode_03 = "20";
            loop2000A.HL_BillingProviderHierarchicalLevel.HierarchicalChildCode_04 = "1";

            //  Occurrence of NM1 Loops in any order
            loop2000A.AllNM1 = new All_NM1_837D();

            //  Begin 2010AA Loop BILLING PROVIDER NAME
            loop2000A.AllNM1.Loop2010AA = new Loop_2010AA_837D();

            //  NM1 BILLING PROVIDER NAME
            loop2000A.AllNM1.Loop2010AA.NM1_BillingProviderName = new NM1_BillingProviderName_2();
            loop2000A.AllNM1.Loop2010AA.NM1_BillingProviderName.EntityIdentifierCode_01 = "85";
            loop2000A.AllNM1.Loop2010AA.NM1_BillingProviderName.EntityTypeQualifier_02 = "2";
            loop2000A.AllNM1.Loop2010AA.NM1_BillingProviderName.ResponseContactLastorOrganizationName_03 = "DENTAL ASSOCIATES";
            loop2000A.AllNM1.Loop2010AA.NM1_BillingProviderName.IdentificationCodeQualifier_08 = "XX";
            loop2000A.AllNM1.Loop2010AA.NM1_BillingProviderName.ResponseContactIdentifier_09 = "1234567890";

            //  N3 BILLING PROVIDER ADDRESS
            loop2000A.AllNM1.Loop2010AA.N3_BillingProviderAddress = new N3_AdditionalPatientInformationContactAddress();
            loop2000A.AllNM1.Loop2010AA.N3_BillingProviderAddress.ResponseContactAddressLine_01 = "234 SEAWAY ST";

            //  N4 BILLING PROVIDER LOCATION
            loop2000A.AllNM1.Loop2010AA.N4_BillingProviderCity_State_ZIPCode = new N4_AdditionalPatientInformationContactCity();
            loop2000A.AllNM1.Loop2010AA.N4_BillingProviderCity_State_ZIPCode.AdditionalPatientInformationContactCityName_01 = "MIAMI";
            loop2000A.AllNM1.Loop2010AA.N4_BillingProviderCity_State_ZIPCode.AdditionalPatientInformationContactStateCode_02 = "FL";
            loop2000A.AllNM1.Loop2010AA.N4_BillingProviderCity_State_ZIPCode.AdditionalPatientInformationContactPostalZoneorZIPCode_03 = "33111";

            //  Occurrence of REF Segments in any order
            loop2000A.AllNM1.Loop2010AA.AllREF = new All_REF_837D_8();

            //  REF BILLING PROVIDER'S TAX IDENTIFICATION
            loop2000A.AllNM1.Loop2010AA.AllREF.REF_BillingProviderTaxIdentification = new REF_BillingProviderTaxIdentification();
            loop2000A.AllNM1.Loop2010AA.AllREF.REF_BillingProviderTaxIdentification.ReferenceIdentificationQualifier_01 = "EI";
            loop2000A.AllNM1.Loop2010AA.AllREF.REF_BillingProviderTaxIdentification.MemberGrouporPolicyNumber_02 = "587654321";

            //  Repeating PER billing provider contact information
            loop2000A.AllNM1.Loop2010AA.PER_BillingProviderContactInformation = new List();

            //  End 2010AA Loop

            //  Repeating 2000B Loops
            loop2000A.Loop2000B = new List();

            //  Begin 2000B Loop SUBSCRIBER HL LOOP
            var loop2000B = new Loop_2000B_837D();

            //  HIERARCHAL LEVEL 2
            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 = "1";

            //  SBR SUBSCRIBER INFORMATION
            loop2000B.SBR_SubscriberInformation = new SBR_SubscriberInformation();
            loop2000B.SBR_SubscriberInformation.PayerResponsibilitySequenceNumberCode_01 = "P";
            loop2000B.SBR_SubscriberInformation.ClaimFilingIndicatorCode_09 = "CI";

            //  Occurrence of NM1 Loops in any order
            loop2000B.AllNM1 = new All_NM1_837D_2();

            //  Begin 2010BA Loop SUBSCRIBER NAME LOOP
            loop2000B.AllNM1.Loop2010BA = new Loop_2010BA_837D();

            //  NM1 SUBSCRIBER'S 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 = "SMITH";
            loop2000B.AllNM1.Loop2010BA.NM1_SubscriberName.ResponseContactFirstName_04 = "JANE";
            loop2000B.AllNM1.Loop2010BA.NM1_SubscriberName.IdentificationCodeQualifier_08 = "MI";
            loop2000B.AllNM1.Loop2010BA.NM1_SubscriberName.ResponseContactIdentifier_09 = "111223333";

            //  End 2010BA Loop

            //  Begin 2010BB Loop PAYER NAME LOOP
            loop2000B.AllNM1.Loop2010BB = new Loop_2010BB_837D();

            //  NM1 PAYER'S 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 = "INSURANCE COMPANY XYZ";
            loop2000B.AllNM1.Loop2010BB.NM1_PayerName.IdentificationCodeQualifier_08 = "PI";
            loop2000B.AllNM1.Loop2010BB.NM1_PayerName.ResponseContactIdentifier_09 = "66783JJT";

            //  End 2010BB Loop

            //  Repeating 2000C Loops
            loop2000B.Loop2000C = new List();

            //  Begin 2000C Loop PATIENT'S HL LOOP
            var loop2000C = new Loop_2000C_837D();

            //  HIERARCHAL LEVEL 3
            loop2000C.HL_PatientHierarchicalLevel = new HL_DependentLevel();
            loop2000C.HL_PatientHierarchicalLevel.HierarchicalIDNumber_01 = "3";
            loop2000C.HL_PatientHierarchicalLevel.HierarchicalParentIDNumber_02 = "2";
            loop2000C.HL_PatientHierarchicalLevel.HierarchicalLevelCode_03 = "23";
            loop2000C.HL_PatientHierarchicalLevel.HierarchicalChildCode_04 = "0";

            //  PAT PATIENT INFORMATION
            loop2000C.PAT_PatientInformation = new PAT_PatientInformation_2();
            loop2000C.PAT_PatientInformation.IndividualRelationshipCode_01 = "19";

            //  Begin 2010CA Loop PATIENT
            loop2000C.Loop2010CA = new Loop_2010CA_837D();

            //  NM1 PATIENT'S NAME
            loop2000C.Loop2010CA.NM1_PatientName = new NM1_PatientName_3();
            loop2000C.Loop2010CA.NM1_PatientName.EntityIdentifierCode_01 = "QC";
            loop2000C.Loop2010CA.NM1_PatientName.EntityTypeQualifier_02 = "1";
            loop2000C.Loop2010CA.NM1_PatientName.ResponseContactLastorOrganizationName_03 = "SMITH";
            loop2000C.Loop2010CA.NM1_PatientName.ResponseContactFirstName_04 = "TED";

            //  N3 PATIENT'S ADDRESS
            loop2000C.Loop2010CA.N3_PatientAddress = new N3_AdditionalPatientInformationContactAddress();
            loop2000C.Loop2010CA.N3_PatientAddress.ResponseContactAddressLine_01 = "236 N MAIN ST";

            //  N4 PATIENT'S CITY
            loop2000C.Loop2010CA.N4_PatientCity_State_ZIPCode = new N4_AdditionalPatientInformationContactCity();
            loop2000C.Loop2010CA.N4_PatientCity_State_ZIPCode.AdditionalPatientInformationContactCityName_01 = "MIAMI";
            loop2000C.Loop2010CA.N4_PatientCity_State_ZIPCode.AdditionalPatientInformationContactStateCode_02 = "FL";
            loop2000C.Loop2010CA.N4_PatientCity_State_ZIPCode.AdditionalPatientInformationContactPostalZoneorZIPCode_03 = "33413";

            //  DMG PATIENT DEMOGRAPHIC INFORMATION
            loop2000C.Loop2010CA.DMG_PatientDemographicInformation = new DMG_PatientDemographicInformation();
            loop2000C.Loop2010CA.DMG_PatientDemographicInformation.DateTimePeriodFormatQualifier_01 = "D8";
            loop2000C.Loop2010CA.DMG_PatientDemographicInformation.DependentBirthDate_02 = "19920501";
            loop2000C.Loop2010CA.DMG_PatientDemographicInformation.DependentGenderCode_03 = "M";

            //  End 2010CA Loop

            //  Repeating 2300 Loops
            loop2000C.Loop2300 = new List();

            //  Begin 2300 Loop CLAIM
            var loop2300 = new Loop_2300_837D();

            //  CLM HEALTH CLAIM INFORMATION
            loop2300.CLM_ClaimInformation = new CLM_ClaimInformation();
            loop2300.CLM_ClaimInformation.PatientControlNumber_01 = "26403774";
            loop2300.CLM_ClaimInformation.TotalClaimChargeAmount_02 = "150";
            loop2300.CLM_ClaimInformation.HealthCareServiceLocationInformation_05 = new C023_HealthCareServiceLocationInformation_2();
            loop2300.CLM_ClaimInformation.HealthCareServiceLocationInformation_05.FacilityTypeCode_01 = "11";
            loop2300.CLM_ClaimInformation.HealthCareServiceLocationInformation_05.FacilityCodeQualifier_02 = "B";
            loop2300.CLM_ClaimInformation.HealthCareServiceLocationInformation_05.ClaimFrequencyTypeCode_03 = "1";
            loop2300.CLM_ClaimInformation.ProviderorSupplierSignatureIndicator_06 = "Y";
            loop2300.CLM_ClaimInformation.AssignmentorPlanParticipationCode_07 = "A";
            loop2300.CLM_ClaimInformation.BenefitsAssignmentCertificationIndicator_08 = "Y";
            loop2300.CLM_ClaimInformation.ReleaseofInformationCode_09 = "I";

            //  Occurrence of DTP Segments in any order
            loop2300.AllDTP = new All_DTP_837D_2();

            //  DTP DATE - SERVICE DATE
            loop2300.AllDTP.DTP_Date_ServiceDate = new DTP_ClaimLevelServiceDate();
            loop2300.AllDTP.DTP_Date_ServiceDate.DateTimeQualifier_01 = "472";
            loop2300.AllDTP.DTP_Date_ServiceDate.DateTimePeriodFormatQualifier_02 = "D8";
            loop2300.AllDTP.DTP_Date_ServiceDate.DateTimePeriod_03 = "20061029";

            //  Occurrence of REF Segments in any order
            loop2300.AllREF = new All_REF_837D_6();

            //  REF VAN CLAIM NUMBER
            loop2300.AllREF.REF_ClaimIdentifierForTransmissionIntermediaries = new REF_ClaimIdentificationNumberForClearinghousesAndOtherTransmissionIntermediaries();
            loop2300.AllREF.REF_ClaimIdentifierForTransmissionIntermediaries.ReferenceIdentificationQualifier_01 = "D9";
            loop2300.AllREF.REF_ClaimIdentifierForTransmissionIntermediaries.MemberGrouporPolicyNumber_02 = "17312345600006351";

            //  Occurrence of NM1 Loops in any order
            loop2300.AllNM1 = new All_NM1_837D_3();

            //  Begin 2310B Loop RENDERING PROVIDER
            loop2300.AllNM1.Loop2310B = new Loop_2310B_837D();

            //  NM1 RENDERING PROVIDER’S NAME
            loop2300.AllNM1.Loop2310B.NM1_RenderingProviderName = new NM1_RenderingProviderName();
            loop2300.AllNM1.Loop2310B.NM1_RenderingProviderName.EntityIdentifierCode_01 = "82";
            loop2300.AllNM1.Loop2310B.NM1_RenderingProviderName.EntityTypeQualifier_02 = "1";
            loop2300.AllNM1.Loop2310B.NM1_RenderingProviderName.ResponseContactLastorOrganizationName_03 = "KILDARE";
            loop2300.AllNM1.Loop2310B.NM1_RenderingProviderName.ResponseContactFirstName_04 = "BEN";
            loop2300.AllNM1.Loop2310B.NM1_RenderingProviderName.IdentificationCodeQualifier_08 = "XX";
            loop2300.AllNM1.Loop2310B.NM1_RenderingProviderName.ResponseContactIdentifier_09 = "9876543210";

            loop2300.AllNM1.Loop2310B.PRV_RenderingProviderSpecialtyInformation = new PRV_RenderingProviderSpecialtyInformation();
            loop2300.AllNM1.Loop2310B.PRV_RenderingProviderSpecialtyInformation.ProviderCode_01 = "PE";
            loop2300.AllNM1.Loop2310B.PRV_RenderingProviderSpecialtyInformation.ReferenceIdentificationQualifier_02 = "PXC";
            loop2300.AllNM1.Loop2310B.PRV_RenderingProviderSpecialtyInformation.ProviderTaxonomyCode_03 = "1223G0001X";

            //  End 2310B Loop

            //  Repeating 2400 Loops
            loop2300.Loop2400 = new List();

            //  Begin 2400 Loop 1 SERVICE LINE
            var loop24001 = new Loop_2400_837D();

            //  LX SERVICE LINE NUMBER
            loop24001.LX_ServiceLineNumber = new LX_HeaderNumber();
            loop24001.LX_ServiceLineNumber.AssignedNumber_01 = "1";

            //  SV3 DENTAL SERVICE
            loop24001.SV3_DentalService = new SV3_DentalService();
            loop24001.SV3_DentalService.CompositeMedicalProcedureIdentifier_01 = new C003_CompositeMedicalProcedureIdentifier_11();
            loop24001.SV3_DentalService.CompositeMedicalProcedureIdentifier_01.ProductorServiceIDQualifier_01 = "AD";
            loop24001.SV3_DentalService.CompositeMedicalProcedureIdentifier_01.ProcedureCode_02 = "D2150";
            loop24001.SV3_DentalService.LineItemChargeAmount_02 = "100";
            loop24001.SV3_DentalService.ProcedureCount_06 = "1";

            //  Repeating TOO
            loop24001.TOO_ToothInformation = new List();

            //  TOO TOOTH NUMBER/SURFACES
            var too = new TOO_ToothInformation();
            too.CodeListQualifierCode_01 = "JP";
            too.ToothCode_02 = "12";
            too.ToothSurface_03 = new C005_ToothSurface();
            too.ToothSurface_03.ToothSurfaceCode_01 = "M";
            too.ToothSurface_03.ToothSurfaceCode_02 = "O";
            loop24001.TOO_ToothInformation.Add(too);

            //  End 2400 Loop 1
            loop2300.Loop2400.Add(loop24001);

            //  Begin 2400 Loop 2 SERVICE LINE
            var loop24002 = new Loop_2400_837D();

            //  LX SERVICE LINE NUMBER
            loop24002.LX_ServiceLineNumber = new LX_HeaderNumber();
            loop24002.LX_ServiceLineNumber.AssignedNumber_01 = "2";

            //  SV3 DENTAL SERVICE
            loop24002.SV3_DentalService = new SV3_DentalService();
            loop24002.SV3_DentalService.CompositeMedicalProcedureIdentifier_01 = new C003_CompositeMedicalProcedureIdentifier_11();
            loop24002.SV3_DentalService.CompositeMedicalProcedureIdentifier_01.ProductorServiceIDQualifier_01 = "AD";
            loop24002.SV3_DentalService.CompositeMedicalProcedureIdentifier_01.ProcedureCode_02 = "D1110";
            loop24002.SV3_DentalService.LineItemChargeAmount_02 = "50";
            loop24002.SV3_DentalService.ProcedureCount_06 = "1";

            //  End 2400 Loop 2
            loop2300.Loop2400.Add(loop24002);

            //  End 2300 Loop
            loop2000C.Loop2300.Add(loop2300);

            //  End 2000C Loop
            loop2000B.Loop2000C.Add(loop2000C);

            //  End 2000B Loop
            loop2000A.Loop2000B.Add(loop2000B);

            //  End 2000A Loop
            result.Loop2000A.Add(loop2000A);

            return result;
        }
    }
}

More operations in ediFabric .NET

837D questions

How does the 837D identify teeth and surfaces?

Each service line (loop 2400) can repeat the TOO segment. TOO02 holds the tooth number from the ADA Universal/National Tooth Designation System and TOO03 the tooth surfaces, such as M, O, D, B or L.

Which procedure codes does an 837D use?

Dental procedures are reported with CDT codes in the SV3 segment, qualified with AD (American Dental Association codes).

Is the 837D answered like the 837P?

Yes. The payer returns a 999 for syntax, a 277CA for claim acceptance and an 835 with the payment.

How do I parse and generate X12 837D files in .NET, Python, Java and C?

In .NET, install EdiFabric and EdiFabric.Templates.Hipaa, read the file with X12Reader into TS837D objects and write them back with X12Writer. From Python, Java or C, use ediFabric Native, which converts 837D 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 837D 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