Variable: FINDING_CODES
constFINDING_CODES:object
The frozen registry of finding codes. Stable, additive string codes: a
consumer compares finding.code === FINDING_CODES.PROFILE_REQUIRED_ABSENT.
Segment-level vs field-level is disambiguated by whether the finding's
FindingLocus.field is present, not by separate codes.
Type Declaration
PROFILE_CARDINALITY
readonlyPROFILE_CARDINALITY:"PROFILE_CARDINALITY"="PROFILE_CARDINALITY"
A segment-occurrence or field-repetition count is outside its cardinality.
PROFILE_LENGTH
readonlyPROFILE_LENGTH:"PROFILE_LENGTH"="PROFILE_LENGTH"
A checked component value exceeds the declared maximum length.
PROFILE_MALFORMED
readonlyPROFILE_MALFORMED:"PROFILE_MALFORMED"="PROFILE_MALFORMED"
The profile ITSELF is structurally malformed (a diagnostic, not a message finding).
PROFILE_NOT_PERMITTED
readonlyPROFILE_NOT_PERMITTED:"PROFILE_NOT_PERMITTED"="PROFILE_NOT_PERMITTED"
A Not-permitted (X) segment or field is present.
PROFILE_REQUIRED_ABSENT
readonlyPROFILE_REQUIRED_ABSENT:"PROFILE_REQUIRED_ABSENT"="PROFILE_REQUIRED_ABSENT"
A Required (R) segment or field is absent (or present-but-empty).
PROFILE_VALUE_NOT_IN_SET
readonlyPROFILE_VALUE_NOT_IN_SET:"PROFILE_VALUE_NOT_IN_SET"="PROFILE_VALUE_NOT_IN_SET"
A checked component value is not a member of the consumer-supplied value set.
Example
import { validateAgainstProfile, FINDING_CODES } from "@cosyte/hl7";
const { findings } = validateAgainstProfile(msg, profile);
const missing = findings.filter((f) => f.code === FINDING_CODES.PROFILE_REQUIRED_ABSENT);