Skip to main content
Version: v0.0.3

Function: unsupportedCharset()

unsupportedCharset(position, code): Hl7ParseWarning

Build an UNSUPPORTED_CHARSET warning. Emitted when a recognized Table-0211 character set is not decoded into text: either because this parser does not decode it (the multibyte / ISO-2022-switched East-Asian sets: JIS, GB 18030, KS X 1001, CNS 11643, BIG-5: and the wide Unicode transforms UTF-16 / UTF-32), or because a strict decode of a decodable set failed (a byte invalid / undefined for the declared set, or an ICU build lacking the label). In every case the raw bytes are read as latin1, never guessed at, so the parser does not emit replacement-char-corrupted text. Single-byte content stays byte-recoverable; multibyte content is best-effort (a content byte can coincide with a structural delimiter: see the parser's known-limitations). The switch escapes (\Cxxyy\ / \Mxxyyzz) are recognized and preserved by the escape layer; full stateful decoding is a documented non-goal. The message carries the charset code only, never a decoded field value, so no PHI is exposed.

Parameters

position

Hl7Position

code

string

Returns

Hl7ParseWarning

Example

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