Skip to main content
Version: v0.0.3

Interface: SerializedMessage

Snapshot-stable JSON projection of an Hl7Message (SER-03). Every field is readonly; segment order is preserved; isNull flags are preserved.

Runtime immutability: the top-level object is Object.freezed (boundary-frozen). Inner arrays are readonly at the TypeScript type level but mutable at runtime: treat as immutable, do not mutate.

Example

import { parseHL7, type SerializedMessage } from "@cosyte/hl7";
const msg = parseHL7(raw);
const snap: SerializedMessage = msg.toJSON();
console.log(snap.segments[0]?.name); // "MSH"
console.log(snap.warnings.length); // 0 when clean
console.log(JSON.stringify(msg) === JSON.stringify(snap)); // true
console.log(Object.isFrozen(snap)); // true (D-30 boundary freeze)

Properties

encodingCharacters

readonly encodingCharacters: EncodingCharacters


profile?

readonly optional profile?: object

lineage

readonly lineage: readonly string[]

name

readonly name: string


segments

readonly segments: readonly object[]


warnings

readonly warnings: readonly Hl7ParseWarning[]