> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/appertafoundation/openeyes/llms.txt
> Use this file to discover all available pages before exploring further.

# OphDrPrescription Module

> Electronic prescribing and medication management in OpenEyes

# OphDrPrescription - Prescriptions

The **OphDrPrescription** module provides comprehensive electronic prescribing functionality for ophthalmic medications. It handles the complete prescription lifecycle from creation through authorization, printing, and administration tracking.

## Overview

OphDrPrescription is designed for prescribing medications in ophthalmic practice, with particular support for:

* Topical eye medications (drops, ointments, gels)
* Systemic medications related to eye conditions
* Post-operative medication regimens
* Controlled drug prescriptions
* Patient Group Directions (PGD) and Patient Specific Directions (PSD)

<Note>
  This module is separate from but integrates with the OphCiExamination medication management element and the OphDrPGDPSD module for protocol-based prescribing.
</Note>

## Core Components

### Prescription Details Element

The main element for prescription events:

```php theme={null}
Element_OphDrPrescription_Details
```

**Properties:**

* `event_id`: Links to the prescription event
* `comments`: General prescription notes
* `printed_by_user`: User who printed the prescription
* `printed_date`: Timestamp of printing
* `authorised_by_user`: Authorizing prescriber
* `authorised_date`: Authorization timestamp

**Relations:**

* `items[]`: Collection of prescription items (medications)
* `printedByUser`: User who printed
* `authorisedByUser`: User who authorized

## Prescription Workflow

### 1. Creating a Prescription

<Steps>
  <Step title="Select Patient">
    Navigate to the patient record for whom you're prescribing
  </Step>

  <Step title="Create Event">
    Click "Add Event" and select "Prescription"
  </Step>

  <Step title="Add Medications">
    Use the medication search to add drugs to the prescription
  </Step>

  <Step title="Specify Details">
    For each medication, specify:

    * Route of administration (both eyes, right eye, left eye, oral, etc.)
    * Dose and frequency
    * Duration of treatment
    * Specific instructions
  </Step>

  <Step title="Review Warnings">
    Check for allergy alerts and drug interactions
  </Step>

  <Step title="Save">
    Save the prescription (may require authorization depending on configuration)
  </Step>
</Steps>

### 2. Authorization Workflow

Depending on institutional policy, prescriptions may require authorization:

<Accordion title="Authorization Process">
  **When Required:**

  * Prescriptions by non-prescribers
  * Controlled substances
  * High-risk medications
  * Medications outside formulary

  **Authorization Steps:**

  1. Initial prescription saved as "pending"
  2. Authorized prescriber reviews
  3. Authorizer approves (or rejects)
  4. System records authorizer and timestamp
  5. Prescription becomes active
</Accordion>

### 3. Printing Prescriptions

Prescriptions can be printed for:

* Patient to take to pharmacy
* Hospital pharmacy dispensing
* Clinic medication room
* GP information

**Print Features:**

* Standard NHS prescription format support
* Private prescription templates
* Batch printing for multiple patients
* Reprint functionality with audit trail
* Digital signatures (where configured)

### 4. Electronic Distribution

Modern installations may support:

* Electronic Prescription Service (EPS) integration
* Direct pharmacy messaging
* Patient portal access
* GP system integration

## Medication Management

### Formulary Integration

The prescription module integrates with the OpenEyes medication formulary:

<CardGroup cols={2}>
  <Card title="Drug Database" icon="database">
    Comprehensive ophthalmic medication database with standard preparations, doses, and frequencies
  </Card>

  <Card title="Local Formulary" icon="building">
    Institution-specific formulary customization and restrictions
  </Card>

  <Card title="Usage Tracking" icon="chart-line">
    Frequently prescribed items appear first for quick selection
  </Card>

  <Card title="Tapers & Sets" icon="layer-group">
    Common medication regimens saved as sets (e.g., post-op cataract drops)
  </Card>
</CardGroup>

### Prescription Items

Each prescription can contain multiple items:

```php theme={null}
OphDrPrescription_Item
```

**Item Properties:**

* Medication/drug
* Dose
* Route (both eyes, right eye, left eye, oral, IM, IV, etc.)
* Frequency (QDS, TDS, BD, OD, PRN, etc.)
* Duration
* Quantity to dispense
* Special instructions
* Taper schedule (if applicable)

### Laterality Support

Ophthalmic medications often require laterality specification:

* **Both Eyes (OU)**: Medication to both eyes
* **Right Eye (OD)**: Right eye only
* **Left Eye (OS)**: Left eye only
* **Systemic**: Oral, injection, or other non-topical routes

<Note>
  The system automatically calculates quantities based on laterality and duration.
</Note>

## Safety Features

### Allergy Checking

Automatic allergy screening against patient allergy records:

<Accordion title="Allergy Alert System">
  **Alert Types:**

  * **Critical**: Direct allergy to prescribed medication
  * **Warning**: Cross-reactivity or class allergy
  * **Information**: Related medication sensitivity

  **Workflow:**

  1. System checks each medication against patient allergies
  2. Alerts displayed prominently if matches found
  3. Prescriber must acknowledge alert to proceed
  4. Override rationale documented in audit trail

  **Audit Method:**

  ```php theme={null}
  auditAllergicDrugEntries($target, $action = "allergy_override")
  ```
</Accordion>

### Drug Interaction Warnings

Check for interactions between:

* Newly prescribed medications
* Existing patient medications
* Recent prescriptions

### Duplicate Detection

Prevents duplicate prescriptions:

```php theme={null}
public $check_for_duplicate_entries = true;
```

System alerts if:

* Same medication already prescribed
* Similar medications in same class
* Active prescription already exists

### Controlled Drugs

Special handling for controlled substances:

* Additional authorization requirements
* Quantity limits
* Enhanced audit trail
* Special printing format
* Destruction records

## Medication Sets & Tapers

### Predefined Sets

Create standard medication bundles for common scenarios:

<Accordion title="Example Medication Sets">
  **Post-Cataract Surgery:**

  * Prednisolone 0.5% QDS tapering over 4 weeks
  * Chloramphenicol 0.5% QDS for 2 weeks
  * Ketorolac 0.5% TDS for 2 weeks

  **Post-Trabeculectomy:**

  * Prednisolone 1% 2-hourly tapering protocol
  * Chloramphenicol 0.5% QDS
  * Atropine 1% BD

  **Acute Anterior Uveitis:**

  * Prednisolone 1% hourly initially
  * Cyclopentolate 1% TDS
  * Glaucoma medications as required

  **Glaucoma Initiation:**

  * First-line agent (prostaglandin analog)
  * Optional second-line combination
  * Monitoring instructions
</Accordion>

### Tapering Schedules

Support for complex tapering regimens:

```
Week 1: QDS (4 times daily)
Week 2: TDS (3 times daily)
Week 3: BD (twice daily)
Week 4: OD (once daily)
Then stop
```

Tapers can be:

* Time-based (weekly reductions)
* Symptom-based (with review points)
* Custom schedules

## Integration with Examination

The prescription module integrates with OphCiExamination:

### Medication Management Element

```php theme={null}
use \OEModule\OphCiExamination\models\MedicationManagement;
```

Links between:

* Current medications recorded in examination
* New prescriptions generated
* Medication changes documented
* Adherence tracking

### Workflow Integration

1. **During Examination**: Review current medications in MedicationManagement element
2. **Treatment Decision**: Decide on medication changes in management plan
3. **Create Prescription**: Generate prescription event with new/changed medications
4. **Link Events**: Prescription linked to examination event
5. **Update Record**: Medication list automatically updates

## Patient Group Directions (PGD/PSD)

Integration with the OphDrPGDPSD module:

```php theme={null}
use OEModule\OphDrPGDPSD\models\OphDrPGDPSD_PGDPSD;
```

<Accordion title="PGD/PSD Support">
  **Patient Group Directions (PGD):**

  * Protocol-based prescribing for defined patient groups
  * Non-prescribers can administer under PGD
  * Specific inclusion/exclusion criteria
  * Limited medication list per PGD

  **Patient Specific Directions (PSD):**

  * Individual prescription by prescriber
  * Administration by non-prescriber
  * Specific to named patient and occasion

  **Use Cases:**

  * Diagnostic mydriasis by technicians
  * Post-injection medications by nurses
  * Emergency medications in clinic
  * Screening program medications
</Accordion>

## Reporting & Audit

### Prescription Reports

<CardGroup cols={2}>
  <Card title="Prescribing Patterns" icon="chart-bar">
    Analyze medication usage by prescriber, clinic, or diagnosis
  </Card>

  <Card title="Formulary Compliance" icon="clipboard-check">
    Track adherence to local formulary guidelines
  </Card>

  <Card title="Controlled Drugs" icon="lock">
    Audit trail for controlled substance prescribing
  </Card>

  <Card title="Allergy Overrides" icon="triangle-exclamation">
    Review cases where allergy alerts were overridden
  </Card>
</CardGroup>

### Audit Trail

Complete audit trail captures:

* Prescription creation (user, timestamp)
* Modifications (before/after values)
* Authorization (authorizer, timestamp)
* Printing events (user, timestamp, number of copies)
* Allergy alert acknowledgments
* Destruction records (for controlled drugs)

## Administration

### Configuration

Module registration:

```php theme={null}
'modules' => [
    'OphDrPrescription' => [
        'class' => 'application.modules.OphDrPrescription.OphDrPrescriptionModule',
    ],
],
```

### Formulary Management

Administrators can:

* Add/edit medications in formulary
* Set local restrictions
* Define standard doses and frequencies
* Create medication sets
* Configure allergy checking rules
* Set authorization requirements

### Print Templates

Customizable print templates for:

* NHS FP10 prescriptions
* Private prescriptions
* Hospital pharmacy requisitions
* Patient information leaflets
* Clinic medication charts

## Best Practices

<CardGroup cols={2}>
  <Card title="Check Allergies" icon="allergies">
    Always review patient allergies before prescribing - the system will alert but clinical review is essential
  </Card>

  <Card title="Verify Current Medications" icon="pills">
    Review existing medications to avoid duplicates and check for interactions
  </Card>

  <Card title="Specify Laterality" icon="eye">
    Always specify which eye(s) for topical medications - never assume
  </Card>

  <Card title="Clear Instructions" icon="comment">
    Provide clear dosing instructions, especially for tapers and PRN medications
  </Card>

  <Card title="Document Indication" icon="notes-medical">
    Use comments field to document indication, especially for off-label use
  </Card>

  <Card title="Print Promptly" icon="print">
    Print prescriptions promptly after creation to ensure patient receives medications
  </Card>
</CardGroup>

## Common Medications

Frequently prescribed ophthalmic medications include:

<AccordionGroup>
  <Accordion title="Glaucoma Medications">
    * Latanoprost 0.005% (Xalatan) - OD
    * Timolol 0.25%/0.5% - BD
    * Dorzolamide 2% - TDS
    * Brinzolamide 1% - BD
    * Brimonidine 0.2% - BD/TDS
    * Fixed combinations (e.g., Cosopt, Ganfort, DuoTrav)
  </Accordion>

  <Accordion title="Anti-Inflammatory">
    * Prednisolone acetate 1% - hourly to QDS
    * Dexamethasone 0.1% - QDS
    * Ketorolac 0.5% - TDS/QDS
    * Diclofenac 0.1% - QDS
    * Fluorometholone 0.1% - BD to QDS
  </Accordion>

  <Accordion title="Anti-Infective">
    * Chloramphenicol 0.5% drops - QDS
    * Chloramphenicol 1% ointment - ON
    * Fusidic acid 1% gel - BD
    * Ofloxacin 0.3% - QDS
    * Aciclovir 3% ointment - 5x daily
  </Accordion>

  <Accordion title="Mydriatics & Cycloplegics">
    * Tropicamide 1% - for diagnostics
    * Cyclopentolate 1% - for uveitis or cycloplegia
    * Atropine 1% - for severe uveitis
    * Phenylephrine 2.5%/10% - for mydriasis
  </Accordion>

  <Accordion title="Lubricants">
    * Hypromellose 0.3% - PRN
    * Carbomer 0.2% gel - QDS
    * Sodium hyaluronate - PRN
    * Paraffin ointment - ON
    * Preservative-free preparations for frequent use
  </Accordion>
</AccordionGroup>

## Troubleshooting

<Accordion title="Medication Not in Formulary">
  **Solution:**

  * Contact system administrator to add medication
  * Use "Other" category for unlisted medications
  * Provide full drug details in free text
  * Request formulary update for future use
</Accordion>

<Accordion title="Allergy Alert Override">
  **Process:**

  * Carefully review the allergy alert
  * Consult patient about reaction details
  * Consider alternative medications
  * If override necessary, document clear rationale
  * System maintains audit trail
</Accordion>

<Accordion title="Prescription Won't Print">
  **Check:**

  * Prescription is saved and authorized
  * Printer connection and status
  * Print template configuration
  * User has printing permissions
  * Browser pop-up settings (for PDF generation)
</Accordion>

## Related Modules

<CardGroup cols={3}>
  <Card title="Examination" icon="eye" href="/modules/examination">
    Record findings that inform prescribing decisions
  </Card>

  <Card title="PGD/PSD" icon="file-signature" href="/modules/overview">
    Protocol-based prescribing and administration
  </Card>

  <Card title="Correspondence" icon="envelope" href="/modules/correspondence">
    Include prescription information in letters
  </Card>
</CardGroup>

## Further Information

<CardGroup cols={2}>
  <Card title="User Guide" icon="book" href="/user-guide">
    Step-by-step prescribing workflows
  </Card>

  <Card title="Admin Guide" icon="gear" href="/admin">
    Formulary management and configuration
  </Card>
</CardGroup>
