TorbatYar/docs/healthcare-roadmap.md
Mortezakoohjani 5c6a2e78cf feat(platform): seed service registry, deploy all modules, and fix homepage catalog.
Register all active platform services and base features in core DB so admin can manage them, add delivery/hospitality/sports-center backend phases, update apps catalog and production deploy tooling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 12:39:51 +03:30

166 lines
7.8 KiB
Markdown

# Healthcare Platform Roadmap
> Future only for Healthcare phases. Completed work → [progress.md](progress.md). Module inventory → [module-registry.md](module-registry.md#healthcare).
Independent **Healthcare Platform** (commercial product: **Torbat Health**): clinics, doctors, appointments, patient portal, medical records, pharmacy network, and Delivery integration — reusable across tenant workspaces.
Implementation of every phase must follow the [Enterprise / AI Development Framework](ai-framework/README.md) ([ADR-013](architecture/adr/ADR-013.md), [ADR-018](architecture/adr/ADR-018.md), [ADR-019](architecture/adr/ADR-019.md)).
---
## Phase Overview
| Phase | Identifier | Title | Status |
| --- | --- | --- | --- |
| 13.0 | `healthcare-13-0` | Healthcare Platform Foundation | Planned |
| 13.1 | `healthcare-13-1` | Appointment Engine | Planned |
| 13.2 | `healthcare-13-2` | Doctor Panel | Planned |
| 13.3 | `healthcare-13-3` | Clinic Management | Planned |
| 13.4 | `healthcare-13-4` | Patient Portal | Planned |
| 13.5 | `healthcare-13-5` | Medical Record | Planned |
| 13.6 | `healthcare-13-6` | Pharmacy Network | Planned |
| 13.7 | `healthcare-13-7` | Delivery Integration | Planned |
Phase documents: [phases/Healthcare/README.md](phases/Healthcare/README.md).
---
## Phase 13.0 — Healthcare Platform Foundation
**Objective:** Independent `healthcare` service scaffold with tenant-aware foundation aggregates, permissions, publish-only events, provider contracts, health/capabilities — no appointment/clinical workflow engines.
**In scope (planned):**
- Service folder `backend/services/healthcare` (future implementation)
- Database `healthcare_db`; API prefix `/api/v1`; port **8010** (reserved)
- Foundation shells: Clinic, Branch, Department, HealthcareRole, HealthcarePermission, Doctor (profile shell), Patient (profile shell), ExternalProviderConfig, HealthcareConfiguration, HealthcareSetting, HealthcareAuditLog, OutboxEvent
- Provider contracts only: Identity, Communication, CRM, Loyalty, Accounting, Delivery, File Storage, AI
- Permissions `healthcare.*`; events `healthcare.clinic.*`, `healthcare.doctor.*`, `healthcare.patient.*`, …
- Alembic `0001_initial`; architecture / tenant / permission / migration / docs tests
**Out of scope:** Appointment booking engine, doctor panel workflows, clinic admin ops, patient portal UI/APIs, EHR/clinical documents, pharmacy catalog, real Delivery dispatch.
→ [phase-13-0-healthcare-foundation.md](phases/Healthcare/phase-13-0-healthcare-foundation.md)
---
## Phase 13.1 — Appointment Engine
**Objective:** Scheduling engine — availability, slots, appointment lifecycle, reminders via Communication contracts.
**In scope (planned):** Schedules, availability windows, appointment types, appointments (book/confirm/cancel/reschedule/no-show), waiting list shells, appointment events, `healthcare.appointments.*` permissions.
**Out of scope:** Doctor panel UX, clinic billing, full patient portal, medical record content, pharmacy fulfillment, Delivery jobs.
→ [phase-13-1-appointment-engine.md](phases/Healthcare/phase-13-1-appointment-engine.md)
---
## Phase 13.2 — Doctor Panel
**Objective:** Doctor-facing operational APIs — daily schedule, patient queue, visit notes shells, prescription intent refs.
**In scope (planned):** Doctor dashboard aggregates, visit sessions, queue management, note shells (metadata + Storage refs), handoff to appointment engine.
**Out of scope:** Clinic-wide admin, patient self-service portal, immutable clinical record engine, pharmacy inventory, Delivery tracking.
→ [phase-13-2-doctor-panel.md](phases/Healthcare/phase-13-2-doctor-panel.md)
---
## Phase 13.3 — Clinic Management
**Objective:** Clinic administrator operations — staff, departments, services catalog, operating hours, policies.
**In scope (planned):** Clinic services catalog, staff assignments, department hierarchy, clinic policies, admin audit extensions.
**Out of scope:** Platform tenant admin (Core), Accounting postings, CRM sales pipeline, patient portal, EHR legal archive, pharmacy wholesale.
→ [phase-13-3-clinic-management.md](phases/Healthcare/phase-13-3-clinic-management.md)
---
## Phase 13.4 — Patient Portal
**Objective:** Patient-facing APIs — profile, appointments, documents refs, notifications — no frontend in backend phases.
**In scope (planned):** Patient self-service profile, appointment list/book/cancel (via appointment engine), document download refs, notification preferences (Communication client).
**Out of scope:** Identity user admin, Loyalty campaigns, full medical record write path, pharmacy checkout, Delivery driver UI.
→ [phase-13-4-patient-portal.md](phases/Healthcare/phase-13-4-patient-portal.md)
---
## Phase 13.5 — Medical Record
**Objective:** Structured medical record shells — encounters, diagnoses refs, allergies, medications list, immunization refs, access control.
**In scope (planned):** MedicalRecord aggregate, Encounter, Condition/Medication/Allergy shells, record access policies, audit trail, Storage refs for attachments.
**Out of scope:** National EHR exchange, HL7/FHIR mandatory compliance, pharmacy dispensing, Accounting invoices, AI diagnosis.
→ [phase-13-5-medical-record.md](phases/Healthcare/phase-13-5-medical-record.md)
---
## Phase 13.6 — Pharmacy Network
**Objective:** Pharmacy partner network — pharmacy registry, prescription routing intents, fulfillment status shells.
**In scope (planned):** Pharmacy, PrescriptionOrder, PrescriptionLine, fulfillment status lifecycle, events for downstream consumers.
**Out of scope:** Drug inventory accounting, payment capture, Delivery dispatch (Phase 13.7), CRM marketing.
→ [phase-13-6-pharmacy-network.md](phases/Healthcare/phase-13-6-pharmacy-network.md)
---
## Phase 13.7 — Delivery Integration
**Objective:** Integrate prescription / medical supply delivery via Delivery platform contracts — job intake, status sync, no duplicate logistics domain.
**In scope (planned):** DeliveryIntegrationRegistration, DeliveryJobIntent, status webhook/event consumption shells, Communication notifications on status change.
**Out of scope:** Owning drivers/fleet/dispatch (Delivery service), Hospitality/Restaurant orders, Experience pages.
→ [phase-13-7-delivery-integration.md](phases/Healthcare/phase-13-7-delivery-integration.md)
---
## Cross-Module Dependencies
| Platform | Relationship |
| --- | --- |
| Core | Entitlement, tenant resolution, memberships |
| Identity | User/profile refs for doctors and patients |
| Communication | Appointment reminders, OTP, notifications |
| CRM | Optional contact sync (refs only) |
| Loyalty | Optional patient loyalty (refs only) |
| Accounting | Future billing/settlement intents (refs only) |
| Delivery | Prescription/supply delivery jobs (Phase 13.7) |
| File Storage | Document and imaging refs |
| Experience | Clinic marketing sites (pages owned by Experience) |
---
## Boundary Reminders
- Healthcare owns clinic/clinical/appointment/pharmacy **domain** aggregates in `healthcare_db` only.
- No cross-database foreign keys; no importing other services' models.
- Financial postings only through Accounting Posting Engine ([ADR-010](architecture/adr/ADR-010.md)).
- Logistics only through Delivery platform ([ADR-015](architecture/adr/ADR-015.md)).
- Messaging only through Communication platform ([ADR-012](architecture/adr/ADR-012.md)).
---
## Related Documents
- [Module Registry — healthcare](module-registry.md#healthcare)
- [Module Boundaries — Healthcare](architecture/module-boundaries.md)
- [Progress](progress.md)
- [Roadmap](roadmap.md)
- [Next Steps](next-steps.md)
- [Phase area README](phases/Healthcare/README.md)
- [AI / Enterprise Development Framework](ai-framework/README.md)