Variable: FATAL_CODES
constFATAL_CODES:object
Stable string codes for every Tier-3 fatal the parser may throw. Locked
at four codes: anything else MUST be a Tier-2 warning. Consumers narrow
on err.code to react to specific structural failures.
Type Declaration
EMPTY_INPUT
readonlyEMPTY_INPUT:"EMPTY_INPUT"="EMPTY_INPUT"
INVALID_ENCODING_CHARACTERS
readonlyINVALID_ENCODING_CHARACTERS:"INVALID_ENCODING_CHARACTERS"="INVALID_ENCODING_CHARACTERS"
MSH_TOO_SHORT
readonlyMSH_TOO_SHORT:"MSH_TOO_SHORT"="MSH_TOO_SHORT"
NO_MSH_SEGMENT
readonlyNO_MSH_SEGMENT:"NO_MSH_SEGMENT"="NO_MSH_SEGMENT"
Example
import { parseHL7, FATAL_CODES, Hl7ParseError } from "@cosyte/hl7";
try {
parseHL7("");
} catch (err) {
if (err instanceof Hl7ParseError && err.code === FATAL_CODES.EMPTY_INPUT) {
// handle empty input
}
}