Variable: CLAIM_STATUS_277_BUILD_ERROR_CODES
constCLAIM_STATUS_277_BUILD_ERROR_CODES:object
Stable string codes for every ClaimStatus277BuildError. Locked
here so consumers can narrow exhaustively on err.code; additions-only
thereafter (renaming any code is a breaking change).
X12_277_BUILD_INVALID_HIERARCHY- the nested tree cannot form a valid 277 HL spine (no sources, a source with no receiver, a receiver with no provider, a provider with no subscriber, a subscriber with neither claims nor dependents, a dependent with no claim). The message carries structural indices + counts only - never a member id / name.X12_277_BUILD_INVALID_SPEC- a non-hierarchy precondition failed (a claim that would not materialize on read - no trace, no statuses, no service lines; a status whose first composite has no category code; an over-long ISA-13 control number).
Type Declaration
X12_277_BUILD_INVALID_HIERARCHY
readonlyX12_277_BUILD_INVALID_HIERARCHY:"X12_277_BUILD_INVALID_HIERARCHY"="X12_277_BUILD_INVALID_HIERARCHY"
X12_277_BUILD_INVALID_SPEC
readonlyX12_277_BUILD_INVALID_SPEC:"X12_277_BUILD_INVALID_SPEC"="X12_277_BUILD_INVALID_SPEC"
Example
import { CLAIM_STATUS_277_BUILD_ERROR_CODES, ClaimStatus277BuildError, build277 } from "@cosyte/x12";
try {
build277(spec);
} catch (err) {
if (
err instanceof ClaimStatus277BuildError &&
err.code === CLAIM_STATUS_277_BUILD_ERROR_CODES.X12_277_BUILD_INVALID_HIERARCHY
) {
// the hierarchy is impossible - fix the tree, do not emit
}
}