Type Alias HL7_2_4_MSH

HL7_2_4_MSH: HL7_2_3_1_MSH & {
    msh_11_2?:
        | "A"
        | "I"
        | "R"
        | "T"
        | "";
    msh_9_3?: string;
}

HL7 2.4 MSH Specification

Type declaration

  • Optionalmsh_11_2?:
        | "A"
        | "I"
        | "R"
        | "T"
        | ""

    Processing Mode

    1.0.0

  • Optionalmsh_9_3?: string

    Message Structure

    2.2.0

    If not specified, it will be the combo of 9.1 and 9.2 with an underscore.
    

Only the required ones are listed below for typescript validation to pass.

1.0.0

To make it easier on having to fill this out each time, you may do this in your code:

// Make this a constant in your application.
const MSH_HEADER: HL7_2_4_MSH = {
msh_9_1: "ADT",
msh_9_2: "A01",
msh_11_1: "D",
msh_11_2: "A",
}

MSH.7 (Date Time) and MSH.12 (HL7 Spec) are filled in automatically at the time of creation. and when you create your Message class:

const message = new Message({ ...MSH_HEADER, msh_10: 'unique id' })

so this way your code is much neater.