Legacy therapy reports migrated
Release: R1 (multi-specialty clinic) · Who is affected: therapy clinics (occupational therapy, physiotherapy, speech therapy) that used the old Clinical Reports menu.
What changed
- The old report pages — SP2 Sensory Profile, OT Evaluation, OT Progress, PT Evaluation, Dev. Delay Assessment and Discharge Summary — are replaced by Clinical Documents. Open Clinical Documents → New document and pick the matching template (OT initial evaluation, OT progress, PT initial evaluation, Developmental milestones, Therapy discharge, Sensory quadrant screening).
- Every existing report was migrated into a clinical document for the same patient:
- complete reports are signed documents marked "Migrated — legacy record", with a document number and the original therapist as signer (or system when the therapist could not be identified);
- incomplete reports (for example a discharge summary without a discharge reason) are drafts — open them, fill the highlighted required fields and sign;
- anything from the old report that does not fit the new template is kept on the document under "Migrated from a legacy record" → Show preserved legacy fields — nothing was deleted.
- The Sensory Profile 2 score tables are kept only as preserved legacy fields (SP2 is a licensed instrument); the new Sensory quadrant screening template records your own observations.
- Old bookmarks (
/app/ot-report,/app/discharge-summary, …) open the new-document page; the patient is kept. - Patients see signed, shared reports under Patient portal → Medical reports and can view or print them. PDFs are generated on the server; nothing is stored in the browser.
Also in this release
- The product now reads your specialty's wording everywhere: therapy clinics keep Therapist / Session, general clinics see Doctor / Visit, dental clinics Dentist / Sitting — including WhatsApp confirmations and the website chatbot.
- Default services are created from your specialties (only for workspaces without services).
- Patient registration shows the profile sections of your specialties (for example the pediatric profile); values entered earlier are shown until you save the patient again.
- Staff can be added as Practitioner with a designation and registration number / council.
For administrators
Run the migration once per environment (safe to repeat):
cd backend
npm run migrate:legacy-reports -- --dry-run # counts only, writes nothing
npm run migrate:legacy-reports # all tenants
npm run migrate:legacy-reports -- --tenant <id> # one tenant
The summary lists, per tenant, how many reports became signed documents, drafts, were already migrated or skipped.
The old API endpoints now answer 410 Gone and point to /clinical/documents.
Deploy runbook (operators)
- Before deploy:
npm run migrate:legacy-reports -- --dry-run— counts per tenant, writes nothing. The summary also showsclinicalDocumentsModule=WOULD_ENABLEfor tenants whose saved clinical configuration does not list the Clinical Documents module yet. - Deploy.
- Right after deploy:
npm run migrate:legacy-reports— migrates the reports and enables Clinical Documents in saved clinical configurations (version bump + audit event through the normal settings service; tenants that never saved a configuration already have it by default). - Re-run step 3 once more (safe — already migrated reports and already enabled tenants are skipped) to pick up reports written between the dry run and the cut-over.
- Only the module step, e.g. for a tenant restored from backup:
npm run migrate:enable-clinical-documents -- [--dry-run] [--tenant <id>].
A non-zero exit code (2) means at least one tenant or report failed; the log lists tenant and record ids (no patient data). Fix the cause and re-run — every step is idempotent.