Skip to main content
Version: v0.0.4

Type Alias: OnWarningCallback

OnWarningCallback = (warning) => void

Callback invoked inline each time the parser emits a Tier-2 warning. Always fires BEFORE the warning is appended to Hl7Message.warnings so consumers observe warnings in the same order the parser discovered them.

Parameters

warning

Hl7ParseWarning

Returns

void

Example

import { parseHL7, type OnWarningCallback } from "@cosyte/hl7";
const onWarning: OnWarningCallback = (w) => {
console.warn(w.code, w.message);
};
parseHL7(raw, { onWarning });