Skip to main content

Immunizations Service — Domain Model

Status: populated Owner: TBD Last updated: 2026-04-18 Companion: Service Template

1. Aggregate Roots

1.1 ImmunizationRecord

The central aggregate. Represents a single vaccine dose event — administration, refusal, or historical record — for one patient.

ID prefix: imm_

Invariants:

  1. patientId must reference a registered patient (not deceased at time of recording).
  2. vaccineCode must resolve in the EPI schedule vocabulary.
  3. A recorded dose cannot transition back to refused or not-given.
  4. lotNumber is required for administered doses; optional for historical and refused records.
  5. administeredAt must not be in the future.
  6. doseQuantity must be a positive number when provided.
  7. Contraindicated vaccines cannot be recorded as completed without an explicit overrideReason and CLINICIAN/ADMIN role.
  8. Tenant isolation: only records belonging to the current tenant are accessible.

State machine:

FHIR mapping: Immunization resource; status maps as completedcompleted, not-donenot-done, entered-in-errorentered-in-error.


1.2 ImmunizationForecast

Represents the computed vaccination schedule for a patient — which antigens are due, overdue, or complete.

ID prefix: fcst_

Invariants:

  1. Forecast is always patient-scoped and tenant-scoped.
  2. Forecast is derived deterministically from the EPI schedule and the patient's existing ImmunizationRecord set.
  3. A forecast must be refreshed whenever a new ImmunizationRecord is created or corrected for the patient.
  4. Contraindications suppress forecast recommendations for affected antigens.

FHIR mapping: ImmunizationRecommendation resource with one recommendation entry per antigen series.


2. Entities

EntityDescriptionID prefix
ImmunizationRecordAggregate root; single dose eventimm_
ImmunizationForecastComputed due-date set per patientfcst_
EpiScheduleEntryAntigen series definition (read-only from EPI config)n/a (config)
ContraindicationRecordPatient-level contraindication for a vaccine/antigencind_
RegistrySyncJobTracks outbound sync attempt to national registryrsj_

3. Value Objects

Value ObjectFieldsNotes
VaccineCodesystem, code, displayCVX code system preferred; EPI code as fallback
DoseQuantityvalue, unitUCUM units (e.g., mL)
ImmunizationSitesystem, codeSNOMED body site
ImmunizationRoutesystem, codeSNOMED route of administration
LotNumbervalue, expiryDate?String; expiry optional
PerformeractorId, actorType, roleClinician who administered
ForecastRecommendationvaccineCode, doseNumber, seriesDoses, dueDate, earliestDate, latestDate, forecastStatusPer-antigen entry
ContraindicationReasoncode, display, sourceSNOMED or local code

4. Domain Events

EventTriggerKey payload fields
IMMUNIZATIONS.immunization.recordedDose administered and savedimmunizationId, patientId, vaccineCode, doseNumber, administeredAt, performerId
IMMUNIZATIONS.immunization.refusedPatient refused vaccineimmunizationId, patientId, vaccineCode, refusalReason, recordedAt
IMMUNIZATIONS.immunization.updatedLot/site/route amendedimmunizationId, patientId, changedFields, updatedAt
IMMUNIZATIONS.immunization.reportedHistorical record importedimmunizationId, patientId, source, vaccineCode
IMMUNIZATIONS.forecast.updatedForecast recalculated for patientforecastId, patientId, recommendations[], calculatedAt

5. Consumed Events

EventSource servicePurpose
REGISTRATION.patient.registeredregistration-serviceSeed forecast on first registration
REGISTRATION.patient.mergedregistration-serviceMerge immunization histories to surviving patient
REGISTRATION.patient.vital-status-changedregistration-serviceSuppress outreach for deceased patients
SCHEDULING.appointment.fulfilledscheduling-serviceTrigger immunization recording workflow

6. Ubiquitous Language

TermDefinition
EPI scheduleAfghanistan Expanded Programme on Immunization national vaccination schedule defining antigen series, dose intervals, and age windows
ForecastComputed set of due dates for remaining doses across all antigen series for one patient
DefaulterPatient who has missed one or more due vaccine doses beyond the latestDate grace window
ContraindicationClinical reason a specific antigen is contraindicated for a patient; suppresses forecast recommendation
Antigen seriesA named sequence of vaccine doses protecting against a single disease (e.g., Polio OPV series)
Dose numberOrdinal position within an antigen series (1-indexed)
Lot numberBatch identifier for a physical vaccine vial
Registry syncBidirectional exchange with the national immunization registry via interop-service
CoveragePopulation-level metric: proportion of eligible patients who have completed a vaccine series
Historical recordImmunization administered outside the platform, imported for forecasting continuity