Skip to main content

837P outbound — composing a professional claim

Outcome

A professional claim is composed as a syntactically valid 837P, the right loops are populated from the source claim record, the envelope carries the right control numbers and partner identifiers, and the companion guide is applied before transport.

Prerequisites

ScopeWhat it lets you do
edi.transaction.readView transactions
billing.claim.writeOriginate claim builds (rcm-core side)

A trading partner with 837P outbound capability (2.4 — Capabilities).

837P anatomy

Source: packages/x12/src/outbound/claim-837p.ts. Implementation convention: 005010X222A1.

ISA → GS → ST*837 → BHT
Loop 1000A — Submitter Name
NM1*41 (submitter)
PER (contact)
Loop 1000B — Receiver Name
NM1*40 (receiver)
Loop 2000A — Billing Provider Hierarchy
HL*1**20*1
PRV*BI (provider taxonomy)
Loop 2010AA — Billing Provider
NM1*85
N3 / N4
REF*EI (TIN) or REF*EI (EIN)
[PER]
Loop 2010AB — Pay-To Address (when different from billing)
Loop 2010AC — Pay-To Plan Name (when different)
Loop 2000B — Subscriber Hierarchy
HL*2*1*22*0|1
SBR (subscriber info)
Loop 2010BA — Subscriber
NM1*IL
N3 / N4
DMG (DOB / gender)
REF*SY (SSN, when required)
Loop 2010BB — Payer
NM1*PR
REF*2U (provider commercial identifier)
Loop 2000C — Patient Hierarchy (when patient is not subscriber)
HL*3*2*23*0
PAT (patient relationship)
Loop 2010CA — Patient
NM1*QC
N3 / N4
DMG
Loop 2300 — Claim Information (one per claim, can repeat for multi-claim batches)
CLM (patient control # + claim total + claim freq)
DTP (claim dates)
CL1 (institutional only — skipped for P)
[PWK] (paperwork — when attachments)
[HI] (diagnoses — BK principal, BF other)
[REF] (claim-level identifiers)
Loop 2310A — Referring Provider
NM1*DN
[REF]
Loop 2310B — Rendering Provider (when different from billing)
NM1*82
[REF]
Loop 2310C — Service Facility Location
NM1*77
N3 / N4
Loop 2310D — Supervising Provider
Loop 2320 — Other Subscriber Information (COB)
see [6.3 — COB chaining](../remittance/03-cob-chaining-and-2320)
Loop 2400 — Service Line (one per line)
LX (line counter)
SV1 (line — code, charge, units, diagnosis pointer)
DTP*472 (service date)
[REF] (line identifiers)
[AMT] (line amounts)
Loop 2410 — Drug (when applicable)
Loop 2420 — Per-line provider (when overriding)
Loop 2430 — Line Adjudication (COB lines)
SE → GE → IEA

CLM segment — the heart of the claim

The CLM carries claim-wide context:

CLM*PT123*250.00***11:B:1*Y*A*Y*Y~
ElementMeaning
CLM01Patient control number — our internal claim ID. The payer echoes this back in the 277CA and 835.
CLM02Total claim charge amount.
CLM05Composite — <POS>:<facility code qualifier>:<claim freq>. POS 11 (office), 12 (home), 21 (inpatient hospital), 22 (outpatient hospital), 23 (ER), 31 (skilled nursing), 81 (independent lab). Claim frequency 1 (original), 7 (replacement), 8 (void).
CLM06Provider signature on file.
CLM07Assignment of benefits.
CLM08Benefits assignment certification.
CLM09Release of information code.
CLM11-19(Less commonly used.)

SV1 segment — the line

SV1*HC:99213:HQ*100.00*UN*1***1:2~
ElementMeaning
SV1-01Composite procedure code: <qualifier>:<code>:<modifier1>:<modifier2>:<modifier3>:<modifier4>. Qualifier HC HCPCS, WK advisory.
SV1-02Charge amount.
SV1-03Unit basis qualifier (UN units, MJ minutes, DA days).
SV1-04Units.
SV1-05(Place of service, when overriding CLM05).
SV1-07Composite diagnosis pointer — 1:2 means primary diagnosis pointer 1, secondary pointer 2. Up to 4 pointers.

Steps

The flow is fully automated — operator awareness for diagnosis only.

  1. rcm-core builds the source claim — encounter, charges, modifiers, fee schedule pricing.

  2. rcm-core publishes a claim.submission_queued event to Service Bus.

  3. The gateway's claim-submission-consumer picks it up:

    • Resolves the trading partner via routing rules (3.3 — Submission routing rules).
    • Allocates ISA / GS / ST control numbers.
    • Composes the 837P via generate837P() from the claim record + the member's coverage + the provider hierarchy.
    • Applies any companion guide bound to 837P for the partner.
    • Submits via the partner's transport.
  4. The transaction record appears at /transactions with tx_type = 837P, direction outbound, status submitted. The segment trace tab shows the full envelope.

  5. Acknowledgments arrive in turn — see 3.4 — Acknowledgments.

Test envelopes

The platform supports usageIndicator = T for end-to-end testing. Submitted via the same path; the partner's response acks but does not adjudicate. Operator-side rcm-app exposes a Test mode toggle on a single-claim build.

Validation

CheckExpected
Outbound 837P record appears with status submittedYes.
CLM01 echoes the source claim's patient control numberYes.
Companion guide rules visible in the segment trace as "applied rules"Yes.
Control numbers are monotonic per partnerYes.

Troubleshooting

SymptomCauseFix
Build fails with "no routing rule"Routing rule missing for tx_type = 837P + payerAdd the rule (see 3.3).
Build fails with "control-number contention"Transient race in control-number-managerRe-queue; the retry succeeds.
999 rejects the fileCompanion guide produced invalid output, or provider taxonomy is wrongRead IK3/IK4 from the 999; usually traces to a single segment / element.
277CA rejects with STC01 = A8:21 (missing info)A required loop or segment is absentCompare the segment trace against the partner's companion guide expectations.

Next

3.2 — 837I outbound