# EDI X12 837P Professional Health Care Claim Parser & Validator
> Instant sub-5ms parsing of ANSI X12 837P (5010X222A1) professional medical claims into structured JSON with full Hierarchical Loop (HL) resolution.

- **Canonical URL:** https://stanzaapi.com/tools/x12-parser/transaction/837p-professional-claim
- **Governing Standard:** ANSI ASC X12 Standards (005010) (Accredited Standards Committee X12 / HIPAA 5010)
- **Latency:** <3ms Edge
- **Privacy:** In-memory execution only (zero data stored or logged)

## Technical Overview & Governing Rules
The ANSI X12 837P transaction set is mandated under HIPAA for submitting professional health care claims and billing encounters from physicians, clinics, and medical groups to commercial payers and Medicare/Medicaid.

Hierarchical Level (HL) loops structure the interchange into Billing Provider (HL*20), Subscriber (HL*22), and Dependent/Patient (HL*23) hierarchies.

The parser extracts CLM segments (claim control number, monetary charge totals, place of service), HI diagnosis codes (ICD-10-CM), and SV1 service lines with CPT/HCPCS procedure codes, modifiers, units, and line item charges.

## Specification Matrix
| Segment | Description | Key Elements Extracted | Usage |
| --- | --- | --- | --- |
| BHT | Beginning of Hierarchical Transaction | BHT03 (Claim Reference), BHT04 (Creation Date), BHT06 (Claim Type) | Mandatory header |
| HL | Hierarchical Level | HL01 (ID), HL02 (Parent ID), HL03 (Level Code: 20/22/23) | Loop control |
| NM1 | Individual or Organizational Name | NM101 (85=Billing, IL=Insured, QC=Patient), NM103 (Last), NM109 (NPI/ID) | Entity identification |
| CLM | Health Care Claim | CLM01 (Patient Account #), CLM02 (Total Charge), CLM05 (Facility Code) | Claim header |
| HI | Health Care Information Codes | HI01-1 (BK: ICD-10 Principal Diagnosis), HI02-1 (BF: Secondary) | Clinical diagnosis |
| SV1 | Professional Service Line | SV101 (HC:CPT Code:Mod), SV102 (Charge), SV103 (UN), SV104 (Units) | Itemized billing |

## Standard JSON Response Model
```json
{
  "transactionSet": "837",
  "implementationGuide": "005010X222A1",
  "billingProvider": {
    "name": "ACME MEDICAL GROUP",
    "npi": "1982739485",
    "taxId": "123456789"
  },
  "subscriber": {
    "id": "W987654321",
    "lastName": "JOHNSON",
    "firstName": "ALICE",
    "payerId": "PAYER01"
  },
  "claims": [
    {
      "claimSubmitterId": "CLM2026-001",
      "totalClaimChargeAmount": 245,
      "placeOfService": "11",
      "diagnoses": [
        {
          "code": "M54.5",
          "type": "principal"
        }
      ],
      "lines": [
        {
          "line": 1,
          "procedureCode": "99214",
          "chargeAmount": 245,
          "units": 1
        }
      ]
    }
  ]
}
```

## Frequently Asked Questions & Edge Cases
### Q: What version of 837P is supported?
**A:** The parser supports ANSI X12 837P version 005010X222A1 (HIPAA 5010) as well as legacy 4010 formats.

### Q: Does the parser resolve multiple service lines per claim?
**A:** Yes. All LX and SV1 service loops are collected into strongly-typed arrays with procedure codes, modifiers, and charges.

### Q: How is secondary insurance coordination of benefits (COB) parsed?
**A:** Coordination of Benefits loops (2320/2330) are parsed into payer hierarchy arrays with respective prior payments.
