Overview
The Admin Dashboard provides a comprehensive command center for monitoring clinic operations in real-time. It displays critical metrics, appointment schedules, inventory alerts, and financial data across all clinic branches.The dashboard automatically refreshes data and displays role-specific metrics based on user permissions (admin, doctor, secretary).
Key Features
Real-Time Statistics
The dashboard fetches live data from thesp_get_dashboard_stats stored procedure and displays:
Patient Metrics
- Total active patients
- New patient growth
- Patients per branch
Appointment Data
- Today’s scheduled appointments
- Waiting room status
- Completed appointments
Inventory Alerts
- Low stock items count
- Critical inventory warnings
- Reorder notifications
Financial Overview
- Total outstanding debt
- Revenue projections
- Payment collection status
Dashboard Components
Stats Cards
Role-based metric cards that adapt based on user role: Admin View - Four primary metrics:- Patients: Total patient count with growth indicator
- Citas Hoy: Today’s appointment schedule
- Inventario: Low stock alert count (links to
/admin/inventory) - Por Cobrar: Total outstanding debt in DOP currency (links to
/admin/reports)
- Mis Pacientes: Assigned patient base
- Agenda Hoy: Today’s appointment schedule
- En Espera: Waiting room patient count
- Completadas: Completed appointments today
- Agenda: Total appointments today
- Check-in: Patients in waiting room
- Check-out: Completed appointments
- Pacientes: Total patient base
Clinical Management Panel
The main agenda view displays:Appointment Entry Details
Appointment Entry Details
Each appointment card shows:
- Time: Hour and minute (24-hour format)
- Patient Name: Full name with link to patient profile
- Doctor: Assigned practitioner
- Procedure: Treatment type or “Consulta General”
- Status Badge: Color-coded status indicator
- Green (Atendida): Completed
- Amber (En sala): Waiting
- Teal (Confirmada): Confirmed
- Slate (Pendiente): Scheduled
Branch Filtering
Branch Filtering
Use the branch selector to filter dashboard data by clinic location:
- Select “Todas las sedes” for aggregate view
- Choose specific branch for location-specific metrics
- Data automatically refreshes on selection change
Performance Widget
Displays clinical efficiency metrics:- Completion Rate: Percentage of appointments completed vs scheduled
- Progress Bar: Visual representation of throughput
- Contextual Data: Shows
{completed}/{total}appointments
Activity Feed
Recent system activity log showing:- User login events
- Clinical record updates
- Timestamped actions
- User initials avatars
- Color-coded action types
Quick Access Console
Direct navigation buttons (admin only):- Pacientes: Navigate to patient management
- Citas: Jump to appointment scheduler
- Logística: Access inventory management
- Finanzas: View financial reports
API Integration
Dashboard Stats Endpoint
Endpoint:GET /api/dashboard/stats
Query Parameters:
branchId(string): Branch ID or “all” for aggregate data
/src/routes/api/dashboard/stats/+server.js
Alerts Endpoint
Endpoint:GET /api/dashboard/alerts
Returns inventory alerts via sp_list_inventory_alerts procedure.
Source: /src/routes/api/dashboard/alerts/+server.js
Visual Design
The dashboard uses a modern, high-density design with gradient accents and smooth animations for professional clinical presentation.
Color Coding
- Teal (#0d9488): Primary accent, patient data
- Blue (#2563eb): Appointments, scheduling
- Rose (#e11d48): Critical alerts, low inventory
- Amber (#d97706): Financial data, warnings
- Green (#059669): Completed tasks, success states
Responsive Behavior
- Desktop: Two-column layout (main console + sidebar)
- Tablet (< 1200px): Sidebar becomes two-column grid
- Mobile (< 768px): Single column stack
Usage Example
Related Pages
Inventory Management
Manage stock levels and track supplies
Financial Reports
View revenue, debts, and financial analytics
Analytics Dashboard
Deep-dive performance metrics
System Settings
Configure clinic identity and parameters
