Immunizations Service — Migration Plan
Status: populated Owner: TBD Last updated: 2026-04-18 Companion: Service Template
1. Migration Scenarios
Scenario A: Greenfield Deployment
- Run DB migrations (
pnpm db:migrate). - Load Afghanistan EPI schedule into
config/epi-schedule.json. - Verify EPI schedule loads and forecasts calculate correctly for sample patients.
- Configure national registry sync credentials.
- Begin recording immunizations.
Scenario B: Migration from Paper Registers / Legacy HMIS
| Step | Action |
|---|---|
| 1 | Extract historical immunization records from paper register digitization or legacy HMIS export (patient ID, vaccine, dose number, date) |
| 2 | Map vaccine names to CVX codes using terminology-service lookup table |
| 3 | Register patients in registration-service first (REG-US-001) |
| 4 | Import historical records via POST /v1/immunizations/historical with source.type: "paper_card" or "external_emr" |
| 5 | Trigger forecast refresh for all imported patients: POST /v1/immunizations/forecast/:patientId/refresh |
| 6 | Validate forecast outputs against expected schedule position for a sample of patients |
| 7 | Generate defaulter list and review with district vaccination officer |
Scenario C: HL7 VXU / National Registry Cutover
- Configure interop-service with national registry VXU adapter pointing to immunizations-service.
- Run parallel mode (2 weeks): compare VXU-imported records with paper register records.
- Validate no duplicate or conflicting records.
- Cut over live registry sync (enable
SyncToRegistryUseCasecron).
2. Rollback Plan
- Schema: Drizzle down migrations per step.
- Data: Historical imports use
source_typefield; 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
| Phase | Scope | Slice |
|---|---|---|
| Phase 1 | Core record + refusal + basic forecast | S0 |
| Phase 2 | Defaulter tracking + outreach event | S1 |
| Phase 3 | National registry bidirectional sync | S2 |
| Phase 4 | Digital certificates + coverage analytics | S2 |
| Phase 5 | AI-assisted defaulter prioritisation | S3 |