Skip to main content
Version: v0.0.2

Variable: AUTH_278_BUILD_ERROR_CODES

const AUTH_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 no requestCategoryCode; a request spec carrying an HCR certification decision - HCR is response-only; a response review with a decision whose actionCode is empty; an over-long ISA-13 control number).

Type Declaration

X12_278_BUILD_INVALID_HIERARCHY

readonly X12_278_BUILD_INVALID_HIERARCHY: "X12_278_BUILD_INVALID_HIERARCHY" = "X12_278_BUILD_INVALID_HIERARCHY"

X12_278_BUILD_INVALID_SPEC

readonly X12_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
}
}