Skip to main content
Version: v0.0.2

Variable: ELIGIBILITY_271_BUILD_ERROR_CODES

const ELIGIBILITY_271_BUILD_ERROR_CODES: object

Stable string codes for every Eligibility271BuildError. Locked here so consumers can narrow exhaustively on err.code; additions-only thereafter (renaming any code is a breaking change).

  • X12_271_BUILD_INVALID_HIERARCHY - the nested tree cannot form a valid 271 HL spine (no information sources, a source with no receiver, a receiver with no subscriber). The message carries structural indices + counts only - never a member id / name (PHI discipline).
  • X12_271_BUILD_INVALID_SPEC - a non-hierarchy precondition failed (an over-long ISA-13 interchange control number).

Type Declaration

X12_271_BUILD_INVALID_HIERARCHY

readonly X12_271_BUILD_INVALID_HIERARCHY: "X12_271_BUILD_INVALID_HIERARCHY" = "X12_271_BUILD_INVALID_HIERARCHY"

X12_271_BUILD_INVALID_SPEC

readonly X12_271_BUILD_INVALID_SPEC: "X12_271_BUILD_INVALID_SPEC" = "X12_271_BUILD_INVALID_SPEC"

Example

import { ELIGIBILITY_271_BUILD_ERROR_CODES, Eligibility271BuildError, build271 } from "@cosyte/x12";
try {
build271(spec);
} catch (err) {
if (
err instanceof Eligibility271BuildError &&
err.code === ELIGIBILITY_271_BUILD_ERROR_CODES.X12_271_BUILD_INVALID_HIERARCHY
) {
// the hierarchy is impossible - fix the tree, do not emit
}
}