Skip to main content
Version: v0.0.7

Function: remitBalanceMismatch()

remitBalanceMismatch(position, invariant): X12ParseWarning

Build an X12_835_REMIT_BALANCE_MISMATCH warning. Emitted by the 835 helper when a TR3 X221A1 §1.10.2 balance invariant fails. invariant names which equation broke; the spec'd, computed and delta amounts stay on the model as "../decimal.js".X12Decimal values and are never rendered into the message.

The parser ALWAYS surfaces this and NEVER silently rebalances. To report the numbers, recompute them from the model: claim.totalChargeAmount, claim.totalPaymentAmount and the CAS adjustments are all present.

Parameters

position

X12Position

invariant

X12BalanceInvariant

Returns

X12ParseWarning

Example

import { remitBalanceMismatch, BALANCE_INVARIANTS } from "@cosyte/x12";
const w = remitBalanceMismatch(
{ segmentIndex: 12, groupIndex: 0, transactionIndex: 0 },
BALANCE_INVARIANTS.CLAIM,
);