Interface: Immunization
A vaccine dose extracted from one RXA (Pharmacy/Treatment Administration)
segment of a VXU^V04 immunization message, with its RXR
(route/site) and OBX (e.g. VFC eligibility / funding source) children grouped
positionally under the RXA, and orderControl from the preceding ORC of the
VXU order group (ORC→RXA→[RXR]→[{OBX}]).
Safety contract. A wrong vaccine, dose, or mis-keyed action code can harm a patient or corrupt an IIS (Immunization Information System) registry, so this view is deliberately conservative:
vaccineCodecarries its own coding-system provenance via the CWE (vaccineCode.nameOfCodingSystem:CVXHL7 Table 0292; live IIS feeds frequently dual-code RXA-5 with an alternate CVX/NDC in CWE.4-6, surfaced asvaccineCode.alternateIdentifier/alternateText/nameOfAlternateCodingSystem). The helper reports the claim; it never validates or looks the code up.actionCode(RXA-21,A/D/U) is surfaced verbatim and never defaulted: mis-keying it corrupts a registry's add/delete/update dedup.doseAmountis strict-Number()parsed; the IIS "unknown dose" sentinel999is surfaced as the number999, never specially coerced.recordOrigin(administered vs historical) is derived only from the well-known NIP001 RXA-9.1 codes and OMITTED otherwise: see ImmunizationRecordOrigin.- Malformed RXA segments never throw: absent fields are omitted keys.
routes and observations are ALWAYS present (possibly empty). Deferred (not
v1): IIS-specific state profile constraints; CVX/MVX validity checks; the 2nd+
repetition of the repeating RXA-15/16/17 lot/expiry/manufacturer fields (only
the first repetition is surfaced).
Example
import type { Immunization } from "@cosyte/hl7";
const imm: Immunization = {
vaccineCode: { identifier: "115", text: "Tdap", nameOfCodingSystem: "CVX" },
doseAmount: 0.5,
doseUnits: { identifier: "mL", nameOfCodingSystem: "UCUM" },
doseUnitsAreUcum: true,
recordOrigin: "administered",
manufacturer: { identifier: "PMC", text: "Sanofi Pasteur", nameOfCodingSystem: "MVX" },
completionStatus: "CP",
actionCode: "A",
routes: [{ route: { identifier: "IM", text: "Intramuscular" } }],
observations: [],
};
Properties
actionCode?
readonlyoptionalactionCode?:string
RXA-21 action code (A=add, D=delete, U=update): preserved verbatim, NEVER defaulted.
administeredDateTime?
readonlyoptionaladministeredDateTime?:DtmParts
RXA-3 date/time start of administration as the fidelity TS.
completionStatus?
readonlyoptionalcompletionStatus?:string
RXA-20 completion status (CP=complete, RE=refused, NA=not administered, PA=partially administered).
doseAmount?
readonlyoptionaldoseAmount?:number
RXA-6 administered dose amount (strict-parsed; never NaN). 999 = IIS "unknown", surfaced as-is.
doseUnits?
readonlyoptionaldoseUnits?:CWE
RXA-7 administered dose units (UCUM).
doseUnitsAreUcum?
readonlyoptionaldoseUnitsAreUcum?:boolean
true iff RXA-7's coding system (CWE.3) is exactly UCUM (HL7 Table 0396)
: i.e. the dose unit is declared UCUM and safe to interpret as computable.
false means a unit IS present but is NOT declared UCUM (surfaced as-is,
never coerced). OMITTED when RXA-7 is absent. A claim check only: UCUM
grammar is not validated here.
expirationDate?
readonlyoptionalexpirationDate?:DtmParts
RXA-16 substance expiration date (first repetition) as the fidelity TS.
informationSource?
readonlyoptionalinformationSource?:CWE
RXA-9 immunization information source (HL7 Table NIP001), preserved verbatim.
lotNumber?
readonlyoptionallotNumber?:string
RXA-15 substance lot number (first repetition).
manufacturer?
readonlyoptionalmanufacturer?:CWE
RXA-17 substance manufacturer (MVX, HL7 Table 0227; first repetition).
observations
readonlyobservations: readonlyObservation[]
OBX children grouped under this RXA (VFC eligibility, funding source, …). Always present (possibly empty).
orderControl?
readonlyoptionalorderControl?:string
ORC-1 order control when an ORC precedes this RXA in the VXU order group.
recordOrigin?
readonlyoptionalrecordOrigin?:ImmunizationRecordOrigin
Derived administered-vs-historical classification from RXA-9.1. See ImmunizationRecordOrigin.
refusalReason?
readonlyoptionalrefusalReason?:CWE
RXA-18 substance/treatment refusal reason (first repetition).
routes
readonlyroutes: readonlyMedicationRoute[]
RXR children grouped under this RXA (Table 0162 route / Table 0163 site). Always present (possibly empty).
vaccineCode?
readonlyoptionalvaccineCode?:CWE
RXA-5 administered vaccine code (CVX, HL7 Table 0292) with provenance + any alternate coding.