TorbatYar/docs/phases/Healthcare/phase-13-6-pharmacy-network.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.2 KiB

Phase: Pharmacy Network

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

Objective

Build a pharmacy partner network within Healthcare: pharmacy registry, prescription orders routed from medical encounters, fulfillment status lifecycle, and events for downstream consumers — without drug inventory accounting, payment capture, or Delivery dispatch (Phase 13.7).

Enterprise Phase Discovery

Required before Implementation.

Field Value
Discovery date TBD at implementation
Inputs reviewed Phase 13.5 encounters · pharmacy actor workflows

Target Responsibility (this phase when Complete)

  • Pharmacy aggregate (partner registry, contact, hours, service area refs)
  • PrescriptionOrder + PrescriptionLine linked to Encounter/VisitSession
  • Fulfillment lifecycle: submitted → accepted → preparing → ready → picked_up / cancelled
  • Pharmacy staff permissions separate from clinic doctor permissions
  • Events healthcare.pharmacy.*, healthcare.prescription_order.*
  • Communication notifications on status changes (client only)

Explicitly Excluded

  • Drug wholesale inventory and Accounting COGS
  • Payment gateway / POS
  • Delivery driver assignment (13.7)
  • CRM marketing to pharmacies
  • Regulated e-prescription national gateway (future ADR)

Business Analysis

Item Detail
Actors Doctor (prescribe intent), pharmacy staff, patient (status view via 13.4)
Business capabilities Route prescriptions to network pharmacies; track fulfillment
Success metrics Order state machine enforced; tenant + pharmacy isolation
Non-goals Controlled substance scheduling compliance (future)

Scope

In Scope

  • Aggregates: Pharmacy, PrescriptionOrder, PrescriptionLine, PrescriptionStatusHistory
  • APIs for clinic submit and pharmacy accept/prepare/complete
  • Validators: lines reference medication codes/shells from medical record
  • Alembic 0007_phase_136_pharmacy_network; version 0.13.6.0

Permissions

Permission Description
healthcare.prescriptions.submit Clinic submits order
healthcare.pharmacies.manage Admin registry
healthcare.prescription_orders.fulfill Pharmacy staff updates status

Out of Scope

  • Delivery integration (13.7)
  • Accounting invoices
  • Marketplace vendor model

Completion Criteria

  • Prescription lifecycle tests
  • Pharmacy tenant isolation (partner sees only assigned orders)
  • Handover + registry at 0.13.6.0