Skip to content

Pharmacy & Dispensing Use Cases

Implementation Note: Pharmacy module integrates with HL7 RDE messages for prescription orders and provides inventory management, drug-drug interaction checks, and dispensing workflows compliant with Indian pharmacy regulations.


UC-PHRM-001: Receive Prescription Order

Purpose: Receive and validate prescription orders from clinicians.

Property Value
Actor Pharmacy System
Trigger New prescription created
Priority P0

Main Success Scenario:

1. Receive prescription from:
   - HL7 RDE message
   - EMR direct integration
   - Manual entry (walk-in)
2. Validate prescription:
   - Doctor registration valid
   - Patient identity confirmed
   - Drug names recognized
3. Parse medication details:
   - Drug name (generic + brand)
   - Dosage, Frequency, Duration
   - Quantity to dispense
4. Check drug availability:
   - Query inventory
   - Check alternative brands
5. Perform safety checks:
   - Drug-drug interactions
   - Allergy contraindications
   - Dose range validation
6. Queue for dispensing
7. Notify pharmacy staff

Acceptance Criteria: 1. [ ] HL7 RDE message parsing 2. [ ] Drug master lookup (generic/brand) 3. [ ] Interaction check integration 4. [ ] Allergy alert from patient record 5. [ ] Audit trail for all orders

India-Specific: - Schedule H/H1 drug flagging - Narcotic drug (Schedule X) special handling - Generic substitution per NMC guidelines


UC-PHRM-002: Drug-Drug Interaction Check

Purpose: Alert pharmacist and clinician of potential drug interactions.

Property Value
Actor Pharmacy Safety Service
Trigger New prescription order
Priority P0

Main Success Scenario:

1. Fetch patient's current medications:
   - Active prescriptions
   - Self-reported medications
2. Check new prescription against current meds:
   - Use drug interaction database
   - Classify severity (Minor/Moderate/Major/Contraindicated)
3. For interactions found:
   - Display interaction details
   - Show clinical recommendations
4. Severity-based workflow:
   - Minor: Log and proceed
   - Moderate: Alert pharmacist, require acknowledgment
   - Major: Alert prescriber, require override
   - Contraindicated: Block dispensing, require prescriber approval
5. Log all interactions and overrides

Acceptance Criteria: 1. [ ] Real-time interaction check (< 2 sec) 2. [ ] Severity classification 3. [ ] Prescriber notification for major interactions 4. [ ] Override workflow with reason capture 5. [ ] Audit trail for patient safety


UC-PHRM-003: Dispense Medication

Purpose: Process medication dispensing with patient verification.

Property Value
Actor Pharmacist
Trigger Prescription ready for dispensing
Priority P0

Main Success Scenario:

1. Pharmacist retrieves prescription
2. Verify patient identity:
   - Name, DOB
   - Prescription number
3. Pick medications from inventory:
   - Scan drug barcode
   - Verify drug name and strength
   - Check expiry date
4. Prepare dispensing:
   - Count/measure quantity
   - Label with patient name and instructions
5. Pharmacist verification:
   - Cross-check drug vs. prescription
   - Digital signature
6. Patient/caregiver handover:
   - Explain usage instructions
   - Capture acknowledgment signature
7. Update inventory
8. Generate dispensing receipt

Acceptance Criteria: 1. [ ] Barcode scanning for drug verification 2. [ ] Expiry date validation (block if < 3 months) 3. [ ] Patient counseling checklist 4. [ ] Digital signature capture 5. [ ] Real-time inventory update


UC-PHRM-004: Manage Drug Inventory

Purpose: Track drug stock levels, expiry, and reorder points.

Property Value
Actor Pharmacy Manager
Trigger Stock change or scheduled check
Priority P1

Main Success Scenario:

1. Maintain drug master:
   - Drug name (generic + brands)
   - Strength, Form, Pack size
   - Manufacturer
   - Schedule (H/H1/X)
2. Track inventory per batch:
   - Batch number
   - Expiry date
   - Quantity on hand
   - Storage location
3. Monitor stock levels:
   - Minimum stock threshold
   - Reorder point
   - Maximum stock level
4. Generate alerts:
   - Low stock alert
   - Expiry approaching (30/60/90 days)
   - Overstock alert
5. Support stock operations:
   - Goods receipt (GRN)
   - Stock transfer
   - Stock adjustment
   - Return to vendor

Acceptance Criteria: 1. [ ] Batch-wise inventory tracking 2. [ ] FEFO (First Expiry First Out) enforcement 3. [ ] Automated reorder alerts 4. [ ] Expiry alert dashboard 5. [ ] Stock audit trail


UC-PHRM-005: Process Stock Receipt (GRN)

Purpose: Record incoming drug inventory from suppliers.

Property Value
Actor Pharmacy Staff
Trigger Drug shipment received
Priority P1

Main Success Scenario:

1. Receive shipment from supplier
2. Verify against purchase order:
   - Drug name and quantity
   - Batch numbers
   - Expiry dates
3. Physical inspection:
   - Package integrity
   - Storage conditions maintained
4. Create Goods Receipt Note (GRN):
   - Supplier details
   - Invoice reference
   - Line items with batch details
5. Update inventory:
   - Add stock to location
   - Update batch records
6. Process invoice for payment
7. Generate GRN document

Acceptance Criteria: 1. [ ] PO-based receipt validation 2. [ ] Batch and expiry capture 3. [ ] Photo documentation (optional) 4. [ ] Invoice reconciliation 5. [ ] Supplier performance tracking


UC-PHRM-006: Expiry Management

Purpose: Track and manage near-expiry and expired drugs.

Property Value
Actor Pharmacy Manager
Trigger Scheduled check or expiry alert
Priority P1

Main Success Scenario:

1. Run expiry check (daily/weekly):
   - Identify drugs expiring in 30/60/90 days
   - Identify expired drugs
2. Generate expiry report:
   - Drug name, Batch, Expiry date
   - Quantity on hand
   - Value at risk
3. Action near-expiry stock:
   - Prioritize for dispensing (FEFO)
   - Transfer to high-consumption location
   - Return to supplier (if policy allows)
   - Discount sale (if permitted)
4. Handle expired stock:
   - Block from dispensing
   - Move to quarantine
   - Initiate destruction process
   - Record destruction with witness
5. Update inventory and reports

Acceptance Criteria: 1. [ ] Automated expiry alerts 2. [ ] FEFO enforcement in dispensing 3. [ ] Expired stock auto-block 4. [ ] Destruction documentation 5. [ ] Financial impact reporting


UC-PHRM-007: Generate Prescription Label

Purpose: Print medication labels with patient-specific instructions.

Property Value
Actor Pharmacy System
Trigger Dispensing initiated
Priority P1

Main Success Scenario:

1. Generate label content:
   - Patient name, Age
   - Drug name and strength
   - Dosage instructions (Hindi + English)
   - Frequency with timing icons
   - Duration
   - "Keep out of reach of children"
2. Include auxiliary labels:
   - "Take with food"
   - "Avoid sunlight"
   - "May cause drowsiness"
3. Add identifiers:
   - Barcode (prescription + drug)
   - Expiry date
   - Pharmacy name and license
4. Print label:
   - Thermal printer
   - A4 sheet (multiple labels)
5. Apply to medication package

Acceptance Criteria: 1. [ ] Multi-language labels (English + Hindi) 2. [ ] Visual timing icons (morning/noon/night) 3. [ ] Auxiliary warning labels 4. [ ] Barcode for tracking 5. [ ] Pharmacy license number displayed


UC-PHRM-008: Controlled Substance Dispensing

Purpose: Handle Schedule H1 and Narcotic (Schedule X) drug dispensing with special controls.

Property Value
Actor Pharmacist
Trigger Controlled substance prescription
Priority P0

Main Success Scenario:

1. Identify controlled substance:
   - Schedule H1 (antibiotics, certain drugs)
   - Schedule X (narcotics, psychotropics)
2. Validate prescription:
   - Original prescription required
   - Doctor credentials verified
   - Patient ID verified
3. For Schedule X:
   - Record in Narcotic Register
   - Capture prescription photocopy
   - Patient signature mandatory
4. Dispense with controls:
   - Pharmacist signature
   - Witness signature (for X)
   - Quantity double-checked
5. Retain prescription:
   - Store for 3 years (H1)
   - Store for 5 years (X)
6. Report to regulatory body (if required)

Acceptance Criteria: 1. [ ] Schedule classification auto-detection 2. [ ] Mandatory prescription retention 3. [ ] Digital narcotic register 4. [ ] Regulatory reporting format 5. [ ] Audit trail for compliance

India-Specific: - Drugs and Cosmetics Act compliance - NDPS Act for Schedule X - State Drug Controller reporting


Pharmacy Integration Architecture

flowchart TB
    subgraph "Order Sources"
        A["EMR/HIS"]
        B["HL7 RDE"]
        C["Manual Entry"]
    end

    subgraph "Pharmacy Engine"
        D["Order Validation"]
        E["Interaction Check"]
        F["Inventory Service"]
        G["Dispensing Workflow"]
    end

    subgraph "External"
        H["Drug Master DB"]
        I["Interaction DB"]
        J["Supplier Portal"]
        K["Regulatory Reports"]
    end

    A --> D
    B --> D
    C --> D
    D --> E
    E --> H
    E --> I
    D --> F
    G --> F
    F --> J
    G --> K

Document Owner: Pharmacy Lead / Integration Lead
Last Updated: 2024-12-09
Related: Billing | Ingestion - HL7 | Document Generation