Variable: ENROLLMENT_834_BUILD_ERROR_CODES
constENROLLMENT_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- anINS-03orHD-01maintenance 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
readonlyX12_834_BUILD_INVALID_SPEC:"X12_834_BUILD_INVALID_SPEC"="X12_834_BUILD_INVALID_SPEC"
X12_834_BUILD_UNKNOWN_MAINTENANCE_TYPE
readonlyX12_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
}
}