Skip to main content

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:

  1. Paper-based or standalone Excel workflows — no prior LIS data
  2. External commercial LIS (e.g., Meditech, Cerner LIS) — HL7 v2 ORU exports available
  3. Existing laboratory-lis + results modules (pre-merge) — database migration required

2. Phase 1 — Test Catalog Migration

StepAction
1Export test catalog from source system (CSV: code, LOINC, specimen type, reference ranges)
2Validate LOINC codes via terminology-service; flag unmapped codes
3Import via POST /v1/laboratory/catalog (or bulk CSV via admin endpoint)
4Stakeholder review and sign-off on catalog content

3. Phase 2 — Historical Results Migration

For tenants with historical lab data:

StepAction
1Extract historical DiagnosticReport + Observation records from source system
2Map to FHIR R4 schema; assign LOINC codes where possible
3Ingest via FHIR $import through interop-service (bulk import operation)
4Flag imported records with meta.source = "migration" and meta.tag = "historical"
5Do not create accession rows for historical imports — only FHIR resources are filed

4. Phase 3 — Go-Live Cutover

StepAction
1Configure HL7 v2 connectors in interop-service for any external LIS
2Validate ORM/ORU round-trip with integration partner
3Run parallel mode: new accessions in platform LIS; verify results match source system
4Cutover: disable source system write; all orders route to platform
5Monitor 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.