📋 ER Diagram Overview
EVEP Mobile Reflection Unit Entity-Relationship Diagram represents the complete database schema for the vision screening and glasses prescription management system. The diagram shows all entities, their attributes, and relationships that support the clinical workflow.
🎨 Legend & Color Coding:
🏗️ Core Entities
- patient_id (ObjectId) - Primary Key
- student_id (String) - School ID
- first_name (String) - First Name
- last_name (String) - Last Name
- date_of_birth (Date) - Birth Date
- gender (String) - Gender
- school_name (String) - School
- grade_level (String) - Grade
- parent_name (String) - Parent
- parent_phone (String) - Contact
- parent_email (String) - Email
- address (String) - Address
- registration_date (Date) - Reg Date
- medical_history (String) - History
- allergies (String) - Allergies
- created_at (Date) - Created
- updated_at (Date) - Updated
- screening_id (ObjectId) - Primary Key
- patient_id (ObjectId) - Patient Reference
- medical_staff_id (ObjectId) - Staff Reference
- screening_date (Date) - Date
- screening_type (String) - Type
- left_eye_va (Number) - Left VA
- right_eye_va (Number) - Right VA
- both_eyes_va (Number) - Both VA
- left_eye_notes (String) - Left Notes
- right_eye_notes (String) - Right Notes
- screening_result (String) - Result
- recommendation (String) - Recommendation
- additional_notes (String) - Notes
- created_at (Date) - Created
- updated_at (Date) - Updated
- prescription_id (ObjectId) - Primary Key
- patient_id (ObjectId) - Patient Reference
- screening_id (ObjectId) - Screening Reference
- medical_staff_id (ObjectId) - Staff Reference
- prescription_date (Date) - Date
- left_eye_sphere (Number) - Left Sphere
- left_eye_cylinder (Number) - Left Cylinder
- left_eye_axis (Number) - Left Axis
- right_eye_sphere (Number) - Right Sphere
- right_eye_cylinder (Number) - Right Cylinder
- right_eye_axis (Number) - Right Axis
- pd_distance (Number) - PD Distance
- prescription_type (String) - Type
- special_requirements (String) - Requirements
- status (String) - Status
- created_at (Date) - Created
- updated_at (Date) - Updated
- delivery_id (ObjectId) - Primary Key
- patient_id (ObjectId) - Patient Reference
- prescription_id (ObjectId) - Prescription Reference
- inventory_id (ObjectId) - Inventory Reference
- delivery_date (Date) - Date
- school_name (String) - School
- delivery_address (String) - Address
- contact_person (String) - Contact
- contact_phone (String) - Phone
- delivery_status (String) - Status
- delivery_notes (String) - Notes
- signature_received (Boolean) - Signature
- received_by (String) - Received By
- created_at (Date) - Created
- updated_at (Date) - Updated
👥 Medical Staff Entities
- medical_staff_id (ObjectId) - Primary Key
- staff_id (String) - Staff ID
- first_name (String) - First Name
- last_name (String) - Last Name
- email (String) - Email
- phone (String) - Phone
- role (String) - Role
- specialization (String) - Specialization
- license_number (String) - License
- hire_date (Date) - Hire Date
- status (String) - Status
- created_at (Date) - Created
- updated_at (Date) - Updated
- credential_id (ObjectId) - Primary Key
- medical_staff_id (ObjectId) - Staff Reference
- credential_type (String) - Type
- credential_number (String) - Number
- issuing_authority (String) - Authority
- issue_date (Date) - Issue Date
- expiry_date (Date) - Expiry Date
- status (String) - Status
- document_url (String) - Document
- created_at (Date) - Created
- updated_at (Date) - Updated
- training_id (ObjectId) - Primary Key
- medical_staff_id (ObjectId) - Staff Reference
- training_name (String) - Name
- training_type (String) - Type
- training_provider (String) - Provider
- training_date (Date) - Date
- expiry_date (Date) - Expiry
- certificate_number (String) - Certificate
- status (String) - Status
- notes (String) - Notes
- created_at (Date) - Created
- updated_at (Date) - Updated
📦 Inventory & Support Entities
- inventory_id (ObjectId) - Primary Key
- item_code (String) - Item Code
- item_name (String) - Name
- category (String) - Category
- brand (String) - Brand
- model (String) - Model
- specifications (String) - Specs
- quantity_available (Number) - Available
- quantity_reserved (Number) - Reserved
- unit_price (Number) - Price
- supplier (String) - Supplier
- location (String) - Location
- status (String) - Status
- notes (String) - Notes
- created_at (Date) - Created
- updated_at (Date) - Updated
- school_id (ObjectId) - Primary Key
- school_code (String) - Code
- school_name (String) - Name
- school_type (String) - Type
- address (String) - Address
- city (String) - City
- district (String) - District
- contact_person (String) - Contact
- contact_phone (String) - Phone
- contact_email (String) - Email
- total_students (Number) - Students
- status (String) - Status
- created_at (Date) - Created
- updated_at (Date) - Updated
- user_id (ObjectId) - Primary Key
- username (String) - Username
- email (String) - Email
- password_hash (String) - Password
- role (String) - Role
- medical_staff_id (ObjectId) - Staff Reference
- is_active (Boolean) - Active
- last_login (Date) - Last Login
- created_at (Date) - Created
- updated_at (Date) - Updated
🔗 Entity Relationships
📊 Relationship Mapping:
Foreign Key: screening.patient_id → patient.patient_id
Foreign Key: prescription.screening_id → screening.screening_id
Foreign Key: delivery.prescription_id → prescription.prescription_id
Foreign Key: screening.medical_staff_id → medical_staff.medical_staff_id
Foreign Key: staff_credentials.medical_staff_id → medical_staff.medical_staff_id
Foreign Key: staff_training.medical_staff_id → medical_staff.medical_staff_id
Foreign Key: delivery.inventory_id → inventory.inventory_id
Foreign Key: user.medical_staff_id → medical_staff.medical_staff_id