Skip to main content
Version: v0.0.4

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 (ORCRXA[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:

  • vaccineCode carries its own coding-system provenance via the CWE (vaccineCode.nameOfCodingSystem: CVX HL7 Table 0292; live IIS feeds frequently dual-code RXA-5 with an alternate CVX/NDC in CWE.4-6, surfaced as vaccineCode.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.
  • doseAmount is strict-Number() parsed; the IIS "unknown dose" sentinel 999 is surfaced as the number 999, 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?

readonly optional actionCode?: string

RXA-21 action code (A=add, D=delete, U=update): preserved verbatim, NEVER defaulted.


administeredDateTime?

readonly optional administeredDateTime?: DtmParts

RXA-3 date/time start of administration as the fidelity TS.


completionStatus?

readonly optional completionStatus?: string

RXA-20 completion status (CP=complete, RE=refused, NA=not administered, PA=partially administered).


doseAmount?

readonly optional doseAmount?: number

RXA-6 administered dose amount (strict-parsed; never NaN). 999 = IIS "unknown", surfaced as-is.


doseUnits?

readonly optional doseUnits?: CWE

RXA-7 administered dose units (UCUM).


doseUnitsAreUcum?

readonly optional doseUnitsAreUcum?: 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?

readonly optional expirationDate?: DtmParts

RXA-16 substance expiration date (first repetition) as the fidelity TS.


informationSource?

readonly optional informationSource?: CWE

RXA-9 immunization information source (HL7 Table NIP001), preserved verbatim.


lotNumber?

readonly optional lotNumber?: string

RXA-15 substance lot number (first repetition).


manufacturer?

readonly optional manufacturer?: CWE

RXA-17 substance manufacturer (MVX, HL7 Table 0227; first repetition).


observations

readonly observations: readonly Observation[]

OBX children grouped under this RXA (VFC eligibility, funding source, …). Always present (possibly empty).


orderControl?

readonly optional orderControl?: string

ORC-1 order control when an ORC precedes this RXA in the VXU order group.


recordOrigin?

readonly optional recordOrigin?: ImmunizationRecordOrigin

Derived administered-vs-historical classification from RXA-9.1. See ImmunizationRecordOrigin.


refusalReason?

readonly optional refusalReason?: CWE

RXA-18 substance/treatment refusal reason (first repetition).


routes

readonly routes: readonly MedicationRoute[]

RXR children grouped under this RXA (Table 0162 route / Table 0163 site). Always present (possibly empty).


vaccineCode?

readonly optional vaccineCode?: CWE

RXA-5 administered vaccine code (CVX, HL7 Table 0292) with provenance + any alternate coding.