TorbatYar/docs/phases/Healthcare/phase-13-5-medical-record.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

3.4 KiB

Phase: Medical Record

Field Value
Identifier healthcare-13-5
Status Planned
Owner Platform
Module(s) healthcare.medical_records, healthcare.encounters, healthcare.clinical_lists
Service(s) healthcare
Depends On healthcare-13-0, healthcare-13-2
ADR(s) TBD
Manifest phase-manifest.yaml
Framework ADR-013 · ADR-018 · ADR-019

Objective

Introduce structured medical record shells: MedicalRecord per patient, Encounter linked to VisitSession/Appointment, conditions/allergies/medications lists, immunization refs, and access-control policies — without national EHR exchange, mandatory HL7/FHIR compliance, or pharmacy dispensing.

Enterprise Phase Discovery

Required before Implementation.

Field Value
Discovery date TBD at implementation
Inputs reviewed Phase 13.2 visit sessions · privacy/regulatory non-goals

Target Responsibility (this phase when Complete)

  • MedicalRecord aggregate (one per patient per clinic or tenant policy)
  • Encounter records with immutable finalized state
  • Clinical list items: Condition, Allergy, MedicationStatement (shells)
  • ImmunizationRecord refs
  • MedicalRecordAccessPolicy (doctor role, department, break-glass audit)
  • Append-only clinical audit for record access and amendments
  • Permissions healthcare.medical_records.*, healthcare.encounters.*
  • Events healthcare.medical_record.*, healthcare.encounter.*

Explicitly Excluded

  • Sports Center medical_information (sports clearance only)
  • National health information exchange
  • AI diagnosis / treatment recommendation
  • Pharmacy inventory and dispensing (13.6)
  • Binary imaging PACS (Storage refs only)

Business Analysis

Item Detail
Actors Doctor, authorized clinic staff, patient (read subset via 13.4 later)
Business capabilities Document encounters; maintain problem/medication/allergy lists
Success metrics Finalized encounters immutable; access logged
Non-goals Legal e-signature archive, regulated prescription format

Scope

In Scope

  • Aggregates: MedicalRecord, Encounter, Condition, Allergy, MedicationStatement, ImmunizationRecord, MedicalRecordAccessLog
  • Lifecycle: encounter draft → in_progress → finalized (immutable)
  • Amendment pattern for finalized records (addendum, not silent edit)
  • Storage refs for attachments/lab results metadata
  • Alembic 0006_phase_135_medical_record; version 0.13.5.0

Domain Model

Aggregate Entities Invariants
MedicalRecord Encounter, Condition, Allergy, MedicationStatement Patient-scoped; access policy enforced
Encounter Links VisitSession; finalized = immutable body

Out of Scope

  • Pharmacy orders (13.6)
  • Delivery of supplies (13.7)
  • Accounting clinical billing codes
  • Patient portal full record export (partial read may extend 13.4)

Completion Criteria

  • Encounter finalize immutability tests
  • Access policy + audit tests
  • Handover + registry at 0.13.5.0