Overview
The Patient Management module provides a complete CRUD system for managing patient records in Nguhöe EHR. It includes demographic information, medical history, attachments, and powerful search capabilities.Patient management is accessible to Admin, Doctor, and Receptionist roles. Only admins can delete patient records.
Patient Data Model
Personal Information
Patients are managed through thePatient model with the following core fields:
| Field | Type | Description |
|---|---|---|
full_name | string | Patient’s complete name |
document_id | string (unique) | National ID/DNI/CURP |
birth_date | date | Date of birth |
gender | enum | male, female, or other |
phone | string | Contact phone number |
email | string | Email address |
address | text | Physical address |
Medical History
| Field | Type | Description |
|---|---|---|
medical_antecedents | text | Previous medical conditions and history |
allergies | text | Known allergies |
chronic_diseases | text | Ongoing chronic conditions |
current_medication | text | Current medications being taken |
notes | text | Additional clinical notes |
Key Features
CRUD Operations
Creating a Patient
Route:
patients.create → PatientController@createForm Request:
StorePatientRequestAction:
CreatePatientAction
Viewing Patient Details
The patient detail view (routes/web.php:27) loads comprehensive information including:- All patient demographic and medical data
- Attached files and documents
- Consultation history with doctor information
patients.show → PatientController@show
Updating Patient Records
Patient information can be updated through the edit form: Route:patients.update → PatientController@updateForm Request:
UpdatePatientRequestAction:
UpdatePatientAction
Deleting Patients (Admin Only)
Patient records use soft deletes to maintain data integrity:Search and Filtering
The patient index page (routes/web.php:14-32) supports multi-field search:- Full name
- Document ID (national ID)
- Phone number
- Email address
Attachments System
Patients can have multiple file attachments using a polymorphic relationship:Uploading Attachments
Route:patients.attachments.store → AttachmentController@storePatientEndpoint:
POST /patients/{patient}/attachments
Attachments can include:
- Lab results
- Medical imaging
- Insurance documents
- ID copies
- Previous medical records
Deleting Attachments
Route:attachments.destroy → AttachmentController@destroyEndpoint:
DELETE /attachments/{attachment}
Relationships
The Patient model has the following relationships:UI Workflow
Access Control
Admin
Admin
- Full CRUD access
- Can delete patient records
- View all patients
Doctor
Doctor
- Create, read, and update patients
- Cannot delete patients
- View all patients
Receptionist
Receptionist
- Create, read, and update patients
- Cannot delete patients
- View all patients
Database Schema
Best Practices
Complete Medical History
Always fill out allergies and chronic diseases to prevent medical errors
Verify Contact Info
Ensure phone and email are current for appointment reminders
Attach Documents
Upload important medical documents for easy reference
Regular Updates
Keep medical information current as patient conditions change