Skip to main content
Version: v0.0.2

Function: get835()

get835(delimiters, tx): X12Remittance | undefined

Extract a typed X12Remittance from an 835 transaction set. Pure function - no I/O, no global state. Returns undefined only if the input transaction's ST-01 is not "835" (mis-routed call); every other deviation is recoverable and surfaces on result.warnings.

Parameters

delimiters

Delimiters

tx

X12TransactionSet

Returns

X12Remittance | undefined

Example

import { parseX12, get835 } from "@cosyte/x12";
const ix = parseX12(raw);
for (const group of ix.groups) {
for (const tx of group.transactions) {
if (tx.st.elements[1] !== "835") continue;
const remit = get835(ix.delimiters, tx);
remit?.payment.totalActualPayment.toString();
for (const claim of remit?.claims ?? []) {
claim.totalPaymentAmount.toString();
}
}
}