Authentication
All endpoints require:- Middleware:
auth,verified - Role:
adminordoctoronly
Endpoints
Create Consultation Form
Query Parameters
Pre-select a patient for the consultation
Link consultation to a specific appointment. Automatically loads the associated patient.
Response
Returns an Inertia render with:Patient information (if patient_id or appointment_id provided)
Appointment information with patient relationship (if appointment_id provided)
Store Consultation
Request Body
Required Fields
Patient ID (must exist in patients table)
Doctor ID (must exist in users table). Note: This is automatically overridden to the authenticated user’s ID for security.
Reason for the patient’s visit
Medical diagnosis
Optional Fields - Vital Signs
Patient weight in kg (0-500)
Patient height in cm (0-300)
Body temperature in Celsius (30-45)
Systolic blood pressure in mmHg (40-250)
Diastolic blood pressure in mmHg (30-150)
Heart rate in beats per minute (30-220)
Respiratory rate in breaths per minute (8-60)
Blood oxygen saturation percentage (50-100)
Optional Fields - Clinical Information
Link to existing appointment (must exist in appointments table)
Clinical observations and findings
Recommended treatment plan
Optional Fields - Prescription
Array of medications to prescribe
Medication name (required if prescription_items provided)
Dosage instructions (required if prescription_items provided)
Frequency of administration (e.g., “3 times daily”)
Treatment duration (e.g., “7 days”)
General prescription instructions
Optional Fields - Payment
Consultation fee (minimum: 0)
Payment method:
cash, card, or transferSecurity
Thedoctor_id field is automatically overridden with the authenticated user’s ID to prevent impersonation:
Response
Redirects to/patients/{patient_id} with success message: “Consulta registrada exitosamente.”
Show Consultation
Path Parameters
Consultation ID
Authorization
- Admins: Can view any consultation
- Doctors: Can only view their own consultations (where
doctor_idmatches authenticated user)
Response
Consultation record with relationships
Consultation ID
Patient ID
Patient information
Doctor ID
Doctor information
Associated appointment ID (if linked)
Weight in kg
Height in cm
Temperature in Celsius
Systolic blood pressure
Diastolic blood pressure
Heart rate (bpm)
Respiratory rate (breaths/min)
O2 saturation percentage
Reason for visit
Clinical findings
Medical diagnosis
Treatment plan
Associated prescription (if created)
Implementation Details
- Source:
app/Http/Controllers/ConsultationController.php - Route:
/consultations - Uses action class:
CreateConsultationAction - Soft deletes enabled
- Relationships:
patient,doctor,appointment,prescription
Vital Signs Validation Ranges
All vital sign fields are validated with medically appropriate ranges:| Field | Range | Unit |
|---|---|---|
| Weight | 0-500 | kg |
| Height | 0-300 | cm |
| Temperature | 30-45 | °C |
| BP Systolic | 40-250 | mmHg |
| BP Diastolic | 30-150 | mmHg |
| Heart Rate | 30-220 | bpm |
| Respiratory Rate | 8-60 | breaths/min |
| O2 Saturation | 50-100 | % |
Workflow Integration
- From Appointment: Consultations can be linked to appointments via
appointment_idquery parameter - Prescription Creation: Prescription data can be submitted alongside consultation data
- Payment Recording: Payment information can be captured during consultation creation
- Security: Doctor ID is enforced server-side to prevent impersonation
Related Resources
- Appointment Controller - Schedule consultations
- Prescription Controller - View and download prescriptions
- Patient Controller - Patient medical records