Skip to main content
Version: v0.0.4

Function: unterminatedEscapeSequence()

unterminatedEscapeSequence(position): Hl7ParseWarning

Build an UNKNOWN_ESCAPE_SEQUENCE warning for an unterminated escape (an escape character with no closing partner before end-of-input). The "body" in this case is the entire remainder of the field, so the message carries NEITHER the body NOR its length (the length of a truncated tail is itself derivable field-shape information): just the fact that an unterminated escape was found, and the position. The remainder is still preserved verbatim in the parsed output.

Parameters

position

Hl7Position

Returns

Hl7ParseWarning

Example

import { unterminatedEscapeSequence } from "@cosyte/hl7";
const w = unterminatedEscapeSequence({ segmentIndex: 2, fieldIndex: 3 });
// message: `Unterminated HL7 escape sequence preserved verbatim.`