Skip to main content
Version: v0.0.2

Variable: ENROLLMENT_834_BUILD_ERROR_CODES

const ENROLLMENT_834_BUILD_ERROR_CODES: object

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

  • X12_834_BUILD_UNKNOWN_MAINTENANCE_TYPE - an INS-03 or HD-01 maintenance type code falls outside the X12 Code Source 875 subset the library validates against. The message carries the structural index of the affected member / coverage and the offending code (an X12 control code, never PHI).
  • X12_834_BUILD_INVALID_SPEC - a non-maintenance precondition failed: no member loop, an empty (required) INS-03, or an over-long ISA-13 interchange control number. The message carries structural indices + counts only - never a member id / name (PHI discipline).

Type Declaration

X12_834_BUILD_INVALID_SPEC

readonly X12_834_BUILD_INVALID_SPEC: "X12_834_BUILD_INVALID_SPEC" = "X12_834_BUILD_INVALID_SPEC"

X12_834_BUILD_UNKNOWN_MAINTENANCE_TYPE

readonly X12_834_BUILD_UNKNOWN_MAINTENANCE_TYPE: "X12_834_BUILD_UNKNOWN_MAINTENANCE_TYPE" = "X12_834_BUILD_UNKNOWN_MAINTENANCE_TYPE"

Example

import { ENROLLMENT_834_BUILD_ERROR_CODES, Enrollment834BuildError, build834 } from "@cosyte/x12";
try {
build834(spec);
} catch (err) {
if (
err instanceof Enrollment834BuildError &&
err.code === ENROLLMENT_834_BUILD_ERROR_CODES.X12_834_BUILD_UNKNOWN_MAINTENANCE_TYPE
) {
// the maintenance action is unrecognized - fix the code, do not emit
}
}