Scheduling Service — Migration Plan
Status: populated Owner: TBD Last updated: 2026-04-17 Companion: Service Template
1. Migration Scenarios
Scenario A: Greenfield deployment
- Run DB migrations.
- Configure tenant schedules via
POST /v1/schedules. - Generate slots via
POST /v1/slotsor availability pattern expansion. - Configure holiday exceptions via
POST /v1/schedules/:id/exceptions. - Begin booking.
Scenario B: Migration from legacy scheduling module
| Step | Action |
|---|---|
| 1 | Export legacy appointments to JSON (id, patientId, providerId, locationId, startAt, endAt, status, reason) |
| 2 | Map legacy statuses to FHIR vocabulary (scheduled→booked, completed→fulfilled, etc.) |
| 3 | Create corresponding Schedule and Slot records first |
| 4 | Import appointments via bulk-insert migration script (not public API); link to slots |
| 5 | Verify appointment-slot linkage consistency |
| 6 | Validate appointment counts and status distributions against legacy system |
Scenario C: HL7 SIU feed cutover
- Enable SIU adapter in interop-service pointing to scheduling-service.
- Run parallel mode (1 week): compare SIU-imported vs legacy-imported appointments.
- Verify no double-booking from dual-write period.
- Cut over live traffic.
2. Rollback Plan
- Schema: Drizzle down migrations per step.
- Data: Migration imports use
import_batch_idcolumn; truncate by batch on rollback. - HL7 feed: Disable adapter in interop-service.