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?
readonlyoptionalcontrolId?:string
MSH-10 message control ID: unique per message per sender.
messageCode?
readonlyoptionalmessageCode?:string
MSH-9.1 message code (e.g. "ADT", "ORU").
messageStructure?
readonlyoptionalmessageStructure?:string
MSH-9.3 message structure (e.g. "ADT_A01").
processingId?
readonlyoptionalprocessingId?:string
MSH-11.1 processing id (P=production, T=test, D=debug).
receivingApp?
readonlyoptionalreceivingApp?:string
MSH-5.1 receiving application namespace id.
receivingFacility?
readonlyoptionalreceivingFacility?:string
MSH-6.1 receiving facility namespace id.
sendingApp?
readonlyoptionalsendingApp?:string
MSH-3.1 sending application namespace id.
sendingFacility?
readonlyoptionalsendingFacility?:string
MSH-4.1 sending facility namespace id.
timestamp?
readonlyoptionaltimestamp?:DtmParts
MSH-7 message date/time as the fidelity TS.
triggerEvent?
readonlyoptionaltriggerEvent?:string
MSH-9.2 trigger event (e.g. "A01", "R01").
type?
readonlyoptionaltype?:string
MSH-9 full message type string, e.g. "ADT^A01" or "ORU^R01^ORU_R01".
version?
readonlyoptionalversion?:string
MSH-12 HL7 version string (e.g. "2.5", "2.5.1").