Documentation Index
Fetch the complete documentation index at: https://mintlify.com/diegolozadev/DataMed/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The DataMed dashboard provides a centralized view of program health with real-time statistics, patient engagement alerts, and capita cycle distribution analytics. It serves as the command center for clinical operations.The dashboard focuses exclusively on active patients (estado=‘ACTIVO’) to provide actionable insights for current operations.
Accessing the Dashboard
Dashboard Landing
The dashboard is typically the default landing page after login, or access it via Home → Dashboard in the navigation
Key Statistics
The dashboard displays three primary metrics at the top:Total Active Patients
Count of patients with ACTIVO admission statusUpdated in real-time from database query
Most Recent Admission
Latest patient to join the programShows name and admission date
Patients Needing Follow-Up
Count of patients without contact in 15+ daysCritical attention indicator
Statistics Calculation
Why distinct() on Active Patients Count?
Why distinct() on Active Patients Count?
The
distinct() call is critical because:- A patient might theoretically have multiple ACTIVO admissions (edge case/data error)
- The query joins through the
ingresosrelationship - Without
distinct(), the same patient could be counted multiple times - Ensures accurate patient count, not admission count
Follow-Up Alert System
The dashboard’s most critical feature is the follow-up alert list:Alert Logic
- Alert Scenarios
- Annotation Explanation
- Pagination
Scenario A: New Patient, No Follow-Up
- Patient admitted: February 1, 2026
- Today: February 20, 2026
- No
Seguimientorecords - Alert Status: YES (19 days since admission)
- Patient admitted: January 1, 2026
- Last follow-up: February 28, 2026
- Today: March 5, 2026
- Alert Status: NO (only 5 days since contact)
- Patient admitted: December 1, 2025
- Last follow-up: January 15, 2026
- Today: March 5, 2026
- Alert Status: YES (49 days since contact)
The alert list is action-oriented - it should be reviewed daily and used to prioritize outreach efforts.
Capita Cycle Distribution
The dashboard includes a visual chart showing patient distribution across the 18-month capita cycle:Data Collection
Why Manual Aggregation?
Why Manual Aggregation?
The capita month (Since it’s calculated in Python (not SQL), we can’t use database aggregation functions like
mes_capita) is a computed property, not a database field:GROUP BY or COUNT(). The code must:- Fetch all active admissions
- Calculate
mes_capitafor each in Python - Manually count occurrences in a dictionary
Chart Interpretation
- Healthy Distribution
- Warning Patterns
- Capacity Planning
Ideal Pattern:Indicates steady enrollment and consistent cycle progression
- Relatively even spread across months 1-18
- Slight decline toward month 18 (natural attrition)
- No dramatic spikes or valleys
Dashboard Layout
The dashboard typically displays information in this structure:Real-Time Updates
All dashboard data is calculated on each page load:No Caching
Statistics reflect current database stateRefresh page to see latest data
Performance Considerations
For large patient databases (>1000 patients), consider:
- Caching capita distribution (recalculate hourly)
- Indexing
estadoandfecha_iniciofields - Optimizing follow-up query with database indexes
Optimization Opportunities
Optimization Opportunities
For production deployments at scale:
Dashboard Context Data
The view passes this context to the template:User Workflows
Morning Check-In
Daily Routine:
- Log in to DataMed
- Review dashboard statistics
- Check “Patients Needing Follow-Up” count
- Click through alert list pages
Triage Alerts
For each patient in alert list:
- Check capita month (prioritize early months)
- Review days since last contact
- Click patient name to access full record
Take Action
From patient record:
- Call patient to schedule follow-up
- Register new appointment/exam
- Document contact in clinical notes
- Patient automatically clears from alert list
Best Practices
Review dashboard daily
Review dashboard daily
Make the dashboard your first task each day:
- Identify urgent patient needs
- Track program growth trends
- Monitor alert list size
Act on alerts within 24 hours
Act on alerts within 24 hours
When a patient appears in the alert list:
- Contact within 24 hours of alert appearance
- Don’t let patients exceed 20 days without contact
- Document all contact attempts (even if unsuccessful)
Monitor capita distribution trends
Monitor capita distribution trends
Review the distribution chart weekly:
- Screenshot for weekly team meetings
- Compare month-over-month changes
- Adjust enrollment pace based on capacity
Use statistics for program reporting
Use statistics for program reporting
Dashboard metrics support:
- Monthly reports to administration
- Payer audits (total active patients, engagement)
- Quality improvement initiatives
- Staff workload assessment
Mobile Responsiveness
The dashboard is optimized for desktop use, but pagination ensures mobile usability. Statistics cards stack vertically on small screens.
Future Enhancements
Potential dashboard improvements:Adherence Metrics
Average CPAP usage hours across active patients
Exam Completion Rates
Percentage of patients with required exams by capita month
Outcomes Tracking
Average IAH reduction, patient-reported outcomes
Financial Dashboard
Capita revenue, cost per patient, profit margins
Next Steps
Follow-Up System
Deep dive into follow-up tracking and state management
Patient Management
Learn about patient lifecycle and capita cycles