Interface: Build835Spec
The full input to "./build-835.js".build835: the envelope, the
payment header, ≥ 1 trace, optional payer/payee parties, the claims, and
optional provider-level adjustments. A balanced spec round-trips through
get835 field-for-field; an imbalanced one is REFUSED with a "./build-errors.js".Remit835BuildError.
Example
import { build835, X12Decimal, type Build835Spec } from "@cosyte/x12";
const spec: Build835Spec = {
envelope: {
senderId: "MEDICARE", receiverId: "SUBMITTER",
interchangeDate: "260601", interchangeTime: "1200",
interchangeControlNumber: "000000001",
groupControlNumber: "1", transactionSetControlNumber: "0001",
},
payment: {
transactionHandlingCode: "I",
totalActualPayment: X12Decimal.fromString("450.00")!,
creditDebitFlag: "C", method: "ACH", paymentDate: "20260601",
},
traces: [{ traceTypeCode: "1", referenceId: "0012345", originatingCompanyId: "1512345678" }],
claims: [
{
patientControlNumber: "PT-ACCT-001", claimStatusCode: "1",
totalChargeAmount: X12Decimal.fromString("500.00")!,
totalPaymentAmount: X12Decimal.fromString("450.00")!,
patientResponsibilityAmount: X12Decimal.fromString("50.00")!,
adjustments: [{ groupCode: "PR", reasonCode: "1", amount: X12Decimal.fromString("50.00")! }],
},
],
};
const ix = build835(spec);
Properties
claims
readonlyclaims: readonlyBuild835ClaimSpec[]
Loop 2100 claim payments.
envelope
readonlyenvelope:Build835EnvelopeSpec
Interchange / group / transaction identity.
payee?
readonlyoptionalpayee?:Build835PartySpec
Loop 1000B payee party (N1*PE).
payer?
readonlyoptionalpayer?:Build835PartySpec
Loop 1000A payer party (N1*PR).
payment
readonlypayment:Build835PaymentSpec
BPR payment header.
providerAdjustments?
readonlyoptionalproviderAdjustments?: readonlyBuild835ProviderAdjustmentSpec[]
PLB provider-level adjustments.
traces
readonlytraces: readonlyBuild835TraceSpec[]
TRN traces (≥ 1 required).