> ## 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.

# OphCiExamination Module

> Comprehensive clinical examination recording in OpenEyes

# OphCiExamination - Clinical Examination

The **OphCiExamination** module is the most comprehensive and frequently used module in OpenEyes. It provides a flexible framework for recording complete ophthalmic examinations with 59+ specialized element types covering all aspects of eye care.

## Overview

OphCiExamination is designed to support all ophthalmic subspecialties with configurable workflows. Elements can be enabled or disabled based on the clinic type, and the initial set of elements displayed can be customized for each subspecialty.

<Note>
  The module is implemented as a namespaced Yii module: `\OEModule\OphCiExamination\OphCiExaminationModule`
</Note>

## Core Examination Elements

### History & Presenting Complaint

<CardGroup cols={2}>
  <Card title="History" icon="clock-rotate-left">
    Free-text recording of patient history and presenting complaint
  </Card>

  <Card title="Comorbidities" icon="notes-medical">
    Systematic recording of ocular and systemic comorbidities
  </Card>

  <Card title="Allergy" icon="allergies">
    Comprehensive allergy recording with severity grading
  </Card>

  <Card title="Triage" icon="user-nurse">
    Initial triage assessment and vital signs
  </Card>
</CardGroup>

### Vision Assessment

#### Visual Acuity

The visual acuity element supports both simple and complex recording modes:

<Accordion title="Visual Acuity Features">
  **Simple Mode:**

  * Quick entry for routine clinic use
  * Single reading per eye
  * Common correction types

  **Complex Mode:**

  * Multiple readings per eye
  * Detailed correction specification (unaided, pinhole, glasses, contact lens)
  * Different notation systems (Snellen, LogMAR, ETDRS)
  * Method recording (standard chart, near chart, CF, HM, PL, NPL)

  **Near Visual Acuity:**

  * Separate element for near vision testing
  * Jaeger and other near notation support
  * Reading distance recording
</Accordion>

```php theme={null}
// Visual acuity configuration
Element_OphCiExamination_VisualAcuity
Element_OphCiExamination_NearVisualAcuity
```

#### Refraction

Comprehensive refraction recording with:

* Sphere, cylinder, axis for both eyes
* Addition for presbyopia
* Subjective and objective refraction
* Cycloplegic refraction support

### Intraocular Pressure

<Accordion title="IOP Measurement">
  Records intraocular pressure with:

  * Multiple measurement methods (applanation, non-contact, iCare, Perkins, etc.)
  * Time of measurement
  * Multiple readings per eye
  * Statistical analysis of readings
  * Automatic flagging of abnormal values
</Accordion>

### Anterior Segment Examination

<CardGroup cols={2}>
  <Card title="Anterior Segment" icon="eye">
    Detailed slit-lamp examination findings using EyeDraw integration for graphical documentation
  </Card>

  <Card title="Pupillary Abnormalities" icon="circle-dot">
    Records pupil size, reactivity, and abnormalities (RAPD, irregular pupils, etc.)
  </Card>

  <Card title="Dilation" icon="eye-dropper">
    Documents dilating drops administered including drug, time, and side effects
  </Card>

  <Card title="Cornea" icon="circle">
    Specific corneal findings including thickness, clarity, and pathology
  </Card>
</CardGroup>

### Posterior Segment Examination

<Accordion title="Fundus Examination Elements">
  **Posterior Pole:**

  * Detailed posterior segment findings
  * EyeDraw integration for retinal diagrams
  * Macula assessment
  * Vascular changes

  **Optic Disc:**

  * Cup-to-disc ratio
  * Disc appearance and color
  * Neuroretinal rim assessment
  * Optic disc photos integration

  **Diabetic Retinopathy Grading:**

  * Standardized DR severity scale
  * Retinopathy level (none, background, pre-proliferative, proliferative)
  * Maculopathy assessment
  * Clinical Significance of Macular Edema (CSMO)
  * Photo grade comparison

  **DR Retinopathy & Maculopathy:**

  * Separate detailed elements for diabetic eye disease
  * Retinopathy features (microaneurysms, hemorrhages, exudates, neovascularization)
  * Maculopathy classification
</Accordion>

### Imaging & Investigations

<CardGroup cols={2}>
  <Card title="OCT" icon="image">
    Optical coherence tomography results and interpretation
  </Card>

  <Card title="Slit Lamp" icon="microscope">
    Detailed slit lamp biomicroscopy findings
  </Card>

  <Card title="Fundus" icon="camera">
    Fundus photography and findings
  </Card>

  <Card title="Specular Microscopy" icon="grid">
    Corneal endothelial cell counts and morphology
  </Card>
</CardGroup>

### Specialist Examination Elements

#### Glaucoma

<Accordion title="Glaucoma-Specific Elements">
  * **Glaucoma Risk**: Automated risk stratification
  * **Optic Disc**: Detailed disc assessment for glaucoma
  * **Gonioscopy**: Angle assessment and grading
  * **Van Herick**: Anterior chamber depth estimation
  * **IOP Graph**: Longitudinal IOP tracking
</Accordion>

#### Cataract

<Accordion title="Cataract Elements">
  * **Anterior Segment - CCT**: Central corneal thickness measurement
  * **Cataract Surgical Management**: Pre-operative assessment and planning
  * **PCR Risk**: Posterior capsule rupture risk calculation
  * **Biometry Integration**: Links to biometry measurements
</Accordion>

#### Medical Retina

<Accordion title="Retina-Specific Elements">
  * **DR Grading**: Diabetic retinopathy assessment
  * **Maculopathy**: Macular pathology documentation
  * **OCT**: Retinal imaging and measurements
  * **Injection Management**: Anti-VEGF treatment planning
</Accordion>

#### Corneal

<Accordion title="Corneal Elements">
  * **Cornea**: Detailed corneal examination
  * **Anterior Segment - CCT**: Pachymetry
  * **Specular Microscopy**: Endothelial assessment
  * **CXL History**: Corneal cross-linking history
  * **CXL Outcome**: Cross-linking treatment outcomes
</Accordion>

#### Strabismus & Pediatrics

<Accordion title="Orthoptic Elements">
  * **Cover Test**: Ocular alignment assessment
  * **Nine Positions**: Motility examination in diagnostic positions
  * **Convergence & Accommodation**: Near point testing
  * **Stereo Acuity**: Depth perception testing
  * **Colour Vision**: Color blindness testing (Ishihara, etc.)
  * **Red Reflex**: Pediatric screening
</Accordion>

### Clinical Decision Support

<CardGroup cols={2}>
  <Card title="PCR Risk" icon="calculator">
    Automated posterior capsule rupture risk calculation for cataract surgery
  </Card>

  <Card title="Glaucoma Risk" icon="triangle-exclamation">
    Risk stratification for glaucoma progression
  </Card>

  <Card title="AE Red Flags" icon="flag">
    A\&E red flag identification for urgent conditions
  </Card>

  <Card title="Safeguarding" icon="shield">
    Safeguarding concerns documentation
  </Card>
</CardGroup>

### Management & Outcomes

#### Diagnoses

Structured diagnosis recording with:

* Principal and secondary diagnoses
* ICD-10 coding
* Laterality (right, left, bilateral)
* Date of diagnosis

#### Management Planning

<Accordion title="Management Elements">
  **Current Management Plan:**

  * Active management strategies
  * Treatment goals
  * Monitoring frequency

  **Cataract Surgical Management:**

  * Surgical suitability assessment
  * Patient expectations
  * Biometry requirements
  * IOL selection guidance

  **Overall Management Plan:**

  * Comprehensive treatment strategy
  * Follow-up planning
  * Multi-disciplinary coordination
</Accordion>

#### Clinic Outcomes

Defines the next steps in patient care:

* Follow-up booking (interval and location)
* Discharge from service
* Community optometry follow-up
* Patient advice

### Additional Elements

<Accordion title="Supporting Elements">
  **Clinical Procedures:**

  * In-clinic minor procedures
  * Procedure documentation

  **Drug Administration:**

  * Medications given during examination
  * Dosage and route recording

  **Observations:**

  * Blood pressure
  * Pulse
  * Temperature
  * Other vital signs

  **Communication Preferences:**

  * Patient contact preferences
  * Language needs
  * Information sharing consent

  **Contacts:**

  * GP details
  * Next of kin
  * Social services involvement

  **Risks:**

  * Clinical risk factors
  * Falls risk
  * VTE assessment

  **Post-Op Complications:**

  * Surgical complication recording
  * Severity grading
  * Management documentation

  **Pain:**

  * Pain assessment scales
  * Location and characteristics

  **Comments & Conclusion:**

  * Free-text clinical notes
  * Summary of findings

  **Optom Comments:**

  * Optometrist-specific notes
  * Recommendations for ophthalmologist
</Accordion>

## Examination Workflow

### Creating an Examination

1. **Select Patient**: Navigate to patient record
2. **Create Event**: Click "Add Examination"
3. **Add Elements**: Use the element adder to select relevant examination components
4. **Record Data**: Complete each element with clinical findings
5. **Review**: Check completeness and accuracy
6. **Save**: Finalize the examination

<Note>
  The initial set of elements displayed is configurable per subspecialty, reducing clicks for routine examinations.
</Note>

### Element Adder Dialog

The examination uses a sophisticated adder dialog system:

* Quick search for elements
* Recently used elements highlighted
* Subspecialty-specific element grouping
* Add multiple elements at once

### EyeDraw Integration

Many elements integrate with the **EyeDraw** canvas for graphical documentation:

* Anterior segment diagrams
* Fundus drawings
* Surgical procedure illustrations
* Standardized iconography

```php theme={null}
// EyeDraw is a required dependency
'dependencies' => [
    'Eyedraw'
],
```

## Configuration

### Module Registration

```php theme={null}
'OphCiExamination' => array(
    'class' => '\OEModule\OphCiExamination\OphCiExaminationModule',
),
```

### Element Configuration

Configure which elements are available per subspecialty through the admin interface or system settings:

* Enable/disable elements globally
* Set default elements for each subspecialty
* Configure mandatory vs optional elements
* Set element display order

### Visual Acuity Settings

Configure default recording mode:

* Simple vs complex mode preference
* Default notation system
* Default correction type

### DR Grading Image

Optionally provide a reference image for DR grading:

```bash theme={null}
# Copy DR grading reference image
cp drgrading.jpg protected/modules/OphCiExamination/assets/img/
# Expected dimensions: 452 x 699 pixels
```

## Development Guidelines

The OphCiExamination module follows modern development practices:

### Use of Traits

Common functionality is abstracted into reusable PHP traits:

* `HasCorrectionType`: For visual acuity corrections
* `HasWithHeadPosture`: For orthoptic measurements
* `HasRelationOptions`: For enumerated options

### Widget-Based Architecture

Business logic is managed in widgets and models, not templates:

* Element rendering logic in widget classes
* Data validation in models
* Minimal PHP in view templates

### Testing

Comprehensive testing approach:

* **PHP Unit Tests**: Model and business logic (TDD encouraged)
* **Katalon Tests**: End-to-end functional testing
* **JavaScript**: Element controller testing

### Naming Conventions

* Use `ClassName::class` instead of string literals
* Descriptive method names
* Public methods first, then protected, then private

## Clinical Use Cases

<AccordionGroup>
  <Accordion title="Glaucoma Clinic">
    **Typical Elements:**

    * History
    * Visual Acuity
    * IOP
    * Anterior Segment
    * Gonioscopy
    * Optic Disc
    * Glaucoma Risk
    * Management Plan
    * Clinic Outcome
  </Accordion>

  <Accordion title="Cataract Clinic">
    **Typical Elements:**

    * History
    * Visual Acuity
    * Refraction
    * Anterior Segment
    * Cataract Surgical Management
    * PCR Risk
    * Biometry (linked module)
    * Posterior Pole
    * Management Plan
  </Accordion>

  <Accordion title="Medical Retina Clinic">
    **Typical Elements:**

    * History
    * Visual Acuity
    * IOP
    * Anterior Segment
    * Posterior Pole
    * DR Grading (for diabetic patients)
    * OCT
    * Maculopathy
    * Injection Management
    * Clinic Outcome
  </Accordion>

  <Accordion title="Pediatric/Strabismus Clinic">
    **Typical Elements:**

    * History
    * Visual Acuity (age-appropriate)
    * Colour Vision
    * Cover Test
    * Nine Positions
    * Stereo Acuity
    * Refraction
    * Anterior Segment
    * Posterior Pole
    * Diagnoses
    * Management Plan
  </Accordion>
</AccordionGroup>

## Integration Points

### Other Modules

OphCiExamination integrates with:

* **OphInBiometry**: Links biometry measurements for cataract management
* **OphDrPrescription**: Treatment plan generates prescription requirements
* **OphTrOperationbooking**: Surgical management triggers operation booking
* **OphCoCorrespondence**: Examination findings populate letter templates

### External Systems

Supports integration with:

* Imaging devices (OCT, fundus cameras)
* IOP measurement devices
* Visual field analyzers
* Hospital PAS/EPR systems

## Best Practices

<CardGroup cols={2}>
  <Card title="Structured Data" icon="database">
    Use structured elements rather than free text where possible for better data quality and reporting
  </Card>

  <Card title="Complete Records" icon="check-double">
    Include all relevant elements even if findings are normal - negative findings are clinically important
  </Card>

  <Card title="Diagnoses" icon="stethoscope">
    Always record formal diagnoses using the Diagnoses element for accurate coding
  </Card>

  <Card title="Clinic Outcome" icon="calendar-check">
    Complete the Clinic Outcome element to ensure appropriate follow-up is scheduled
  </Card>
</CardGroup>

## Further Reading

<CardGroup cols={3}>
  <Card title="Module Overview" icon="home" href="/modules/overview">
    Return to modules overview
  </Card>

  <Card title="User Guide" icon="book" href="/user-guide">
    Examination recording workflows
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference">
    Element models and APIs
  </Card>
</CardGroup>
