Laboratory Service — Migration Plan
Status: populated Owner: TBD Last updated: 2026-04-18 Companion: Service Template · 03 platform-services · 02 DDD
1. Migration Context
Tenants migrating to the platform may arrive from:
- Paper-based or standalone Excel workflows — no prior LIS data
- External commercial LIS (e.g., Meditech, Cerner LIS) — HL7 v2 ORU exports available
- Existing
laboratory-lis+resultsmodules (pre-merge) — database migration required
2. Phase 1 — Test Catalog Migration
| Step | Action |
|---|---|
| 1 | Export test catalog from source system (CSV: code, LOINC, specimen type, reference ranges) |
| 2 | Validate LOINC codes via terminology-service; flag unmapped codes |
| 3 | Import via POST /v1/laboratory/catalog (or bulk CSV via admin endpoint) |
| 4 | Stakeholder review and sign-off on catalog content |
3. Phase 2 — Historical Results Migration
For tenants with historical lab data:
| Step | Action |
|---|---|
| 1 | Extract historical DiagnosticReport + Observation records from source system |
| 2 | Map to FHIR R4 schema; assign LOINC codes where possible |
| 3 | Ingest via FHIR $import through interop-service (bulk import operation) |
| 4 | Flag imported records with meta.source = "migration" and meta.tag = "historical" |
| 5 | Do not create accession rows for historical imports — only FHIR resources are filed |
4. Phase 3 — Go-Live Cutover
| Step | Action |
|---|---|
| 1 | Configure HL7 v2 connectors in interop-service for any external LIS |
| 2 | Validate ORM/ORU round-trip with integration partner |
| 3 | Run parallel mode: new accessions in platform LIS; verify results match source system |
| 4 | Cutover: disable source system write; all orders route to platform |
| 5 | Monitor critical alert delivery and FHIR publish for first 48 hours |
5. Pre-Merge Database Migration (laboratory-lis + results modules)
If upgrading from the separate modules:
-- Migrate accessions from laboratory_lis.accessions → laboratory.accessions
INSERT INTO laboratory.accessions
SELECT id, tenant_id, accession_number, patient_id, encounter_id,
order_id, priority, status, canceled_reason,
created_at, updated_at, 1 AS version
FROM laboratory_lis.accessions;
-- Migrate results → lab_results (with released results getting status 'released')
INSERT INTO laboratory.lab_results
SELECT id, tenant_id, accession_id, test_code, test_display,
value_quantity, value_unit, value_text, ...
FROM results.result_observations;
Run in a transaction; validate row counts before committing. Use blue-green deployment to avoid downtime.