Skip to main content
Version: v0.0.4

Interface: Meta

MSH-derived message metadata (HELPERS-01). D-03: always defined on Hl7Message.meta (MSH absence throws NO_MSH_SEGMENT at parse time); individual fields are optional because vendor-quirky messages routinely omit pieces of MSH. timestamp is the fidelity TS (precision + timezone preserved), not an eager UTC-assuming Date.

Example

import type { Meta } from "@cosyte/hl7";
const meta: Meta = {
type: "ADT^A01",
messageCode: "ADT",
triggerEvent: "A01",
controlId: "MSG001",
version: "2.5",
};
console.log(meta.timestamp?.raw, meta.timestamp?.precision);

Properties

controlId?

readonly optional controlId?: string

MSH-10 message control ID: unique per message per sender.


messageCode?

readonly optional messageCode?: string

MSH-9.1 message code (e.g. "ADT", "ORU").


messageStructure?

readonly optional messageStructure?: string

MSH-9.3 message structure (e.g. "ADT_A01").


processingId?

readonly optional processingId?: string

MSH-11.1 processing id (P=production, T=test, D=debug).


receivingApp?

readonly optional receivingApp?: string

MSH-5.1 receiving application namespace id.


receivingFacility?

readonly optional receivingFacility?: string

MSH-6.1 receiving facility namespace id.


sendingApp?

readonly optional sendingApp?: string

MSH-3.1 sending application namespace id.


sendingFacility?

readonly optional sendingFacility?: string

MSH-4.1 sending facility namespace id.


timestamp?

readonly optional timestamp?: DtmParts

MSH-7 message date/time as the fidelity TS.


triggerEvent?

readonly optional triggerEvent?: string

MSH-9.2 trigger event (e.g. "A01", "R01").


type?

readonly optional type?: string

MSH-9 full message type string, e.g. "ADT^A01" or "ORU^R01^ORU_R01".


version?

readonly optional version?: string

MSH-12 HL7 version string (e.g. "2.5", "2.5.1").