Skip to main content

Immunizations Service — Migration Plan

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

1. Migration Scenarios

Scenario A: Greenfield Deployment

  1. Run DB migrations (pnpm db:migrate).
  2. Load Afghanistan EPI schedule into config/epi-schedule.json.
  3. Verify EPI schedule loads and forecasts calculate correctly for sample patients.
  4. Configure national registry sync credentials.
  5. Begin recording immunizations.

Scenario B: Migration from Paper Registers / Legacy HMIS

StepAction
1Extract historical immunization records from paper register digitization or legacy HMIS export (patient ID, vaccine, dose number, date)
2Map vaccine names to CVX codes using terminology-service lookup table
3Register patients in registration-service first (REG-US-001)
4Import historical records via POST /v1/immunizations/historical with source.type: "paper_card" or "external_emr"
5Trigger forecast refresh for all imported patients: POST /v1/immunizations/forecast/:patientId/refresh
6Validate forecast outputs against expected schedule position for a sample of patients
7Generate defaulter list and review with district vaccination officer

Scenario C: HL7 VXU / National Registry Cutover

  1. Configure interop-service with national registry VXU adapter pointing to immunizations-service.
  2. Run parallel mode (2 weeks): compare VXU-imported records with paper register records.
  3. Validate no duplicate or conflicting records.
  4. Cut over live registry sync (enable SyncToRegistryUseCase cron).

2. Rollback Plan

  • Schema: Drizzle down migrations per step.
  • Data: Historical imports use source_type field; truncate by source type and date range on rollback.
  • Registry sync: Disable registry sync cron in environment config; no registry records are mutated by rollback.

3. Phased Delivery

PhaseScopeSlice
Phase 1Core record + refusal + basic forecastS0
Phase 2Defaulter tracking + outreach eventS1
Phase 3National registry bidirectional syncS2
Phase 4Digital certificates + coverage analyticsS2
Phase 5AI-assisted defaulter prioritisationS3