Variable: AUTH_278_BUILD_ERROR_CODES
constAUTH_278_BUILD_ERROR_CODES:object
Stable string codes for every ServicesReview278BuildError. Locked
here so consumers can narrow exhaustively on err.code; additions-only
thereafter (renaming any code is a breaking change).
X12_278_BUILD_INVALID_HIERARCHY- the nested tree cannot form a valid 278 HL spine (a subscriber with neither a review nor a dependent; a dependent with no review). The message carries structural indices + counts only - never a member id / name.X12_278_BUILD_INVALID_SPEC- a non-hierarchy precondition failed (a review with norequestCategoryCode; a request spec carrying anHCRcertification decision -HCRis response-only; a response review with a decision whoseactionCodeis empty; an over-long ISA-13 control number).
Type Declaration
X12_278_BUILD_INVALID_HIERARCHY
readonlyX12_278_BUILD_INVALID_HIERARCHY:"X12_278_BUILD_INVALID_HIERARCHY"="X12_278_BUILD_INVALID_HIERARCHY"
X12_278_BUILD_INVALID_SPEC
readonlyX12_278_BUILD_INVALID_SPEC:"X12_278_BUILD_INVALID_SPEC"="X12_278_BUILD_INVALID_SPEC"
Example
import { AUTH_278_BUILD_ERROR_CODES, ServicesReview278BuildError, build278Response } from "@cosyte/x12";
try {
build278Response(spec);
} catch (err) {
if (
err instanceof ServicesReview278BuildError &&
err.code === AUTH_278_BUILD_ERROR_CODES.X12_278_BUILD_INVALID_HIERARCHY
) {
// the hierarchy is impossible - fix the tree, do not emit
}
}