Overview
The Medical Appointments feature helps you manage all your healthcare visits in one place. Record upcoming appointments, document past visits, attach medical files, and keep a complete history of your medical consultations.Appointments appear on your calendar with green badges and can include attached files like prescriptions, lab results, or medical reports.
Creating an Appointment
Quick Access Method
The fastest way to log a new appointment:- Click the FAB (Floating Action Button) in the bottom-right corner
- Select “Nueva Cita” (New Appointment) - the button with the green doctor icon
- Fill out the appointment form
- Save to add it to your calendar
Appointment Form Fields
Title
Brief description of the appointment (e.g., “Annual Physical”, “Cardiology Follow-up”)
Date & Time
When the appointment is scheduled - supports both past and future dates
Description
Optional detailed notes about the appointment, symptoms, or discussion points (max 1000 characters)
File Attachments
Upload medical documents, prescriptions, lab results, or images (max 10MB per file)
Validation Requirements
Managing Attachments
Uploading Files
The appointment system supports comprehensive file management:-
During Creation:
- Click “Choose Files” or drag files to the upload area
- Multiple files can be attached to a single appointment
- Preview file names before saving
-
Supported File Types:
- Medical images (JPG, PNG, DICOM)
- PDF documents (lab results, prescriptions)
- Office documents (DOC, DOCX, XLS)
- Any file type up to 10MB per file
-
File Information Stored:
Managing Existing Attachments
When editing an appointment:- View Existing Files: All previously uploaded files are displayed
- Delete Attachments: Remove files individually without deleting the appointment
- Add New Files: Upload additional files to existing appointments
- Separate Management: Files and appointment details can be updated independently
Deleted files are permanently removed from storage. The system automatically cleans up both the database record and the physical file.
Viewing Appointments
Calendar Integration
Appointments integrate seamlessly with your calendar:- Green Badge: Appears on calendar days with scheduled appointments
- Click to View: Select any day to see full appointment details
- Upcoming Indicator: Dashboard shows your next appointment at the top
Day Details View
When you click a calendar day with appointments:- Appointment title and time
- Full description text
- List of attached files with download links
- Edit and delete options
Next Appointment Widget
The calendar dashboard prominently displays:- Shows the nearest future appointment
- Includes date and title
- Helps you stay prepared
- Updates automatically when appointments are added
Editing Appointments
How to Edit
- Locate the Appointment: Click the calendar day containing the appointment
- Open Edit Modal: Click the edit button in the day details view
- Modify Details: Update title, date, description, or attachments
- Save Changes: Appointment updates across all views
Edit Workflow
The edit process uses event listeners:Data Model Structure
MedicalAppointment Model
Relationships
The model defines two key relationships:-
User Relationship:
-
Polymorphic Attachments:
The polymorphic relationship allows the same attachment system to be used across different features (appointments, exercises, etc.).
File Storage
Storage Location
Files are stored securely in the local storage:- Path:
storage/app/attachments/appointments/ - Naming: Laravel generates unique hash-based filenames
- Security: Files are stored outside the public web directory
- Access Control: Only the owner and authorized viewers can download files
Deletion Process
When deleting attachments:- Checks if physical file exists
- Deletes file from storage
- Removes database record
- Updates the attachment list
Use Cases
Pre-Appointment Planning
Schedule upcoming appointments and attach notes about symptoms or questions to discuss with your doctor.
Medical Records
Document past appointments with visit summaries and attach prescriptions or treatment plans.
Lab Results Tracking
Store lab results and test reports attached to the appointment when they were ordered.
Prescription Management
Keep digital copies of prescriptions associated with the appointment where they were issued.
Real-time Updates
After saving an appointment:- Modal closes automatically
- Calendar displays the green appointment badge
- “Next Appointment” widget updates
- History views refresh instantly
- No page reload required
Data Sharing
When you share your health data:- Appointments Are Included: Shared viewers see your appointment schedule
- Attachments Accessible: Viewers can download attached medical files
- Read-Only Access: Viewers cannot edit or delete your appointments
- Privacy Control: Revoke access anytime to stop sharing
Viewer Mode Restrictions
When viewing another user’s shared calendar:- Cannot create new appointments
- Cannot edit existing appointments
- Cannot upload or delete attachments
- Can view all appointment details and download files
- Blue banner indicates “Modo Espectador” (Viewer Mode)
Best Practices
Schedule in Advance
Add appointments as soon as they’re scheduled to avoid forgetting them.
Document Immediately
After appointments, add notes and attachments while the visit is fresh in your mind.
Organize Files
Use clear file names before uploading to make documents easy to identify later.
Regular Reviews
Periodically review past appointments to track your health journey and prepare for follow-ups.
Technical Implementation
Livewire Component
Component:App\Livewire\Dashboard\AppointmentLog
Traits Used:
WithFileUploads- Enables file upload functionality
- Multi-file upload support
- Real-time file preview
- Separate management of new vs. existing attachments
- Event-driven updates
Form State Management
The component maintains separate arrays for file handling:- Adding new files to existing appointments
- Removing files before they’re saved
- Deleting existing files without affecting new uploads
Related Features
- Interactive Calendar - View appointments in calendar context
- Health Tracking - Track measurements before/after appointments
- Data Sharing - Share appointment records with healthcare providers
