Skip to main content
Version: v0.0.3

Function: encodingMismatch()

encodingMismatch(position, detail): Hl7ParseWarning

Build an ENCODING_MISMATCH warning. Emitted when the MSH-2 encoding characters declared by the sender do not match what the parser observed downstream (e.g. the sender declares ^~\& but uses !@#$ as actual separators in later segments).

Parameters

position

Hl7Position

detail

string

Returns

Hl7ParseWarning

Example

import { encodingMismatch } from "@cosyte/hl7";
const w = encodingMismatch({ segmentIndex: 0 }, "MSH-2 declares ^~\\& but segment used !@#$");