Skip to main content
Version: v0.0.4

Function: unterminatedStreamMessage()

unterminatedStreamMessage(position): Hl7ParseWarning

Build an UNTERMINATED_STREAM_MESSAGE warning. Emitted by parseStream(): attached to a StreamMessageEntry's streamWarnings, NOT to Hl7Message.warnings: when the final message in a stream ends without a segment terminator (its last segment ran to end-of-stream with no trailing \r/\r\n/\n). The message is still parsed and yielded in full; this is the fail-safe signal that the tail may have been truncated mid-message (a cut-off feed), never a reason to drop it and never a throw. Only the last message can be unterminated: every earlier message is closed by the terminator that precedes the next MSH/envelope boundary.

The message carries only the structural fact, NEVER a field value, so no PHI is exposed. position references the message's MSH segment index.

Parameters

position

Hl7Position

Returns

Hl7ParseWarning

Example

import { unterminatedStreamMessage } from "@cosyte/hl7";
const w = unterminatedStreamMessage({ segmentIndex: 6 });