Function: checkClaimBalance()
checkClaimBalance(
claim,position):X12ParseWarning|undefined
Check the claim-level invariant CLP-03 === CLP-04 + Σ(all CAS in claim, both claim and line level). Returns the warning when out of
balance, or undefined otherwise. Pure - no side effects.
Parameters
claim
position
Returns
X12ParseWarning | undefined
Example
import { checkClaimBalance } from "@cosyte/x12";
declare const claim: X12RemitClaim;
const w = checkClaimBalance(claim, { segmentIndex: 12 });
if (w !== undefined) {
// not balanced - w.message names invariant + spec + computed + delta
}