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
readonlyclaims: readonlyX12Claim[]
hierarchies
readonlyhierarchies: readonlyX12HierarchicalLevel[]
implementationConventionReference
readonlyimplementationConventionReference:string|undefined
receiver
readonlyreceiver:X12ClaimEntity|undefined
submitter
readonlysubmitter:X12ClaimEntity|undefined
variant
readonlyvariant:X12Claim837Variant
warnings
readonlywarnings: readonlyX12ParseWarning[]