Skip to main content
Version: v0.0.2

Interface: X12_837Submission

The top-level result returned by get837Claims(). Carries the submitter (Loop 1000A) and receiver (Loop 1000B) parties, the HL hierarchy walk (Loops 2000A/B/C - every HL segment captured with parent-pointer provenance), every claim payment loop (Loop 2300), and every warning surfaced during the walk - including the safety-critical X12_HL_PARENT_MISMATCH and X12_HL_PARENT_LEVEL_INVALID.

Example

import { parseX12, get837Claims } from "@cosyte/x12";
const ix = parseX12(raw);
const tx = ix.groups[0]?.transactions.find((t) => t.st.elements[1] === "837");
if (tx !== undefined) {
const sub = get837Claims(ix.delimiters, tx);
sub?.variant; // "P" | "I" | "D" | "unknown"
sub?.claims.length; // count of CLM segments encountered
for (const claim of sub?.claims ?? []) {
claim.totalCharge.toString();
claim.diagnoses[0]?.codeSystem; // "ICD-10-CM" etc.
}
}

Properties

claims

readonly claims: readonly X12Claim[]


hierarchies

readonly hierarchies: readonly X12HierarchicalLevel[]


implementationConventionReference

readonly implementationConventionReference: string | undefined


receiver

readonly receiver: X12ClaimEntity | undefined


submitter

readonly submitter: X12ClaimEntity | undefined


variant

readonly variant: X12Claim837Variant


warnings

readonly warnings: readonly X12ParseWarning[]