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
| Scope | What it lets you do |
|---|---|
edi.transaction.read | View transactions |
billing.claim.write | Originate 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] (billing taxonomy — only when the billing entity has one)
Loop 2010AA — Billing Provider
NM1*85
N3 / N4
REF*EI (TIN) or REF*EI (EIN)
[PER]
Loop 2010AB — Pay-To Address (only when the billing entity's pay-to
address differs from the 2010AA billing address)
NM1*87*2
N3 / N4
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 (only when the claim's facility
address differs from the 2010AA billing address)
NM1*77 (NM108/NM109 XX + NPI only when the facility has an NPI)
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~
| Element | Meaning |
|---|---|
CLM01 | Patient control number — our internal claim ID. The payer echoes this back in the 277CA and 835. |
CLM02 | Total claim charge amount. |
CLM05 | Composite — <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). |
CLM06 | Provider signature on file. |
CLM07 | Assignment of benefits. |
CLM08 | Benefits assignment certification. |
CLM09 | Release of information code. |
CLM11-19 | (Less commonly used.) |
2010AB — pay-to address
The 837P tells the payer to remit somewhere other than the billing provider's address in loop 2010AB, right after 2010AA. The pay-to address is the billing entity's Pay-to address (Organization Setup), frozen on the claim's context snapshot when the claim was built — like the 2010AA address, a later edit to the billing entity does not change a claim already built.
| Billing entity pay-to address | 2010AB |
|---|---|
| Not set | Not sent — the payer remits to the 2010AA address. |
| Same address as the billing provider (case, punctuation and a ZIP+4 suffix are ignored) | Not sent. |
| A different, complete address (street, city, state, ZIP) | NM1*87*2, then N3 / N4. In 5010 the loop carries the address only — no name or NPI. |
| Incomplete, or a claim built before the snapshot carried the pay-to address | Not sent. |
The 837I sends the same 2010AB, under the same rules (3.2 — 837I outbound).
2310C — service facility location
The 837P names where the service was rendered in loop 2310C when that is not the billing provider's address. Both addresses come from the claim's context snapshot, frozen when the claim was built: the 2010AA address is the billing entity's default facility, and 2310C is the claim's own facility.
| Claim facility | 2310C |
|---|---|
| Same address as the billing provider (case, punctuation and a ZIP+4 suffix are ignored) | Not sent. |
| A different address, with an NPI | NM1*77*2*<name>*****XX*<NPI>, then N3 / N4. |
| A different address, no NPI | NM1*77*2*<name>, then N3 / N4 — the NPI is situational. |
| No complete address (street, city, state, ZIP), or a claim built before the snapshot carried the facility address | Not sent. |
The 837I sends the same loop as 2310E, under the same rules (3.2 — 837I outbound).
SV1 segment — the line
SV1*HC:99213:HQ*100.00*UN*1***1:2~
| Element | Meaning |
|---|---|
SV1-01 | Composite procedure code: <qualifier>:<code>:<modifier1>:<modifier2>:<modifier3>:<modifier4>. Qualifier HC HCPCS, WK advisory. |
SV1-02 | Charge amount. |
SV1-03 | Unit basis qualifier (UN units, MJ minutes, DA days). |
SV1-04 | Units. |
SV1-05 | (Place of service, when overriding CLM05). |
SV1-07 | Composite 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.
rcm-core builds the source claim — encounter, charges, modifiers, fee schedule pricing.
rcm-core publishes a
claim.submission_queuedevent to Service Bus.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
837Pfor the partner. - Submits via the partner's transport.
The transaction record appears at
/transactionswithtx_type = 837P, directionoutbound, statussubmitted. The segment trace tab shows the full envelope.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
| Check | Expected |
|---|---|
Outbound 837P record appears with status submitted | Yes. |
CLM01 echoes the source claim's patient control number | Yes. |
| Companion guide rules visible in the segment trace as "applied rules" | Yes. |
| Control numbers are monotonic per partner | Yes. |
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Build fails with "no routing rule" | Routing rule missing for tx_type = 837P + payer | Add the rule (see 3.3). |
| Build fails with "control-number contention" | Transient race in control-number-manager | Re-queue; the retry succeeds. |
| 999 rejects the file | Companion guide produced invalid output, or provider taxonomy is wrong | Read 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 absent | Compare the segment trace against the partner's companion guide expectations. |