Skip to main content
Version: v0.0.4

Function: unknownCharset()

unknownCharset(position, requested): Hl7ParseWarning

Build an UNKNOWN_CHARSET warning. Emitted when MSH-18 (or an options.charset override) declares a value that is not a recognized HL7 Table-0211 character set. The parser never guesses an encoding: it reads the raw bytes as latin1 (a 1:1 byte mapping) so single-byte content stays recoverable, rather than corrupting it with replacement characters. The message carries the charset code only, never a decoded field value: the code is shape-checked before it is interpolated, and withheld if it does not match.

Parameters

position

Hl7Position

requested

string

Returns

Hl7ParseWarning

Example

import { unknownCharset } from "@cosyte/hl7";
const w = unknownCharset({ segmentIndex: 0, fieldIndex: 18 }, "ISO IR 999");