Get Wellness Heatmap
Generate a wellness heatmap for a hospital showing department-level aggregated wellbeing metrics. The heatmap provides visual representation of employee wellness across different departments with color-coded indicators.Authentication
Requires authentication andadmin or user role authorization.
Path Parameters
Unique identifier of the hospital
Query Parameters
Time period for aggregation. Possible values:
daily- Current dayweekly- Current week (default)monthly- Current month
Request Example
Response
Indicates if the request was successful
Response message
Response data object
Response Example
How Wellness Value is Calculated
The wellness value (0-100) for each department is calculated based on average employee mood scores:averageMood is the average of all employees’ currentMoodScore in that department (scale 1-5).
See implementation in diagnosticService.js:304-389.
Color Coding
The heatmap uses a color-coded system for quick visual assessment:- Green (#10B981): Wellness ≥ 80 - Healthy department
- Yellow (#F59E0B): Wellness 60-79 - Moderate attention needed
- Red (#EF4444): Wellness 40-59 - Requires intervention
- Dark Red (#DC2626): Wellness < 40 - Critical state
Department Aggregation
The heatmap aggregates data from multiple sources:- Employee Wellness Metrics - Current mood, workload, and satisfaction from employee records
- Survey Data - Recent quick survey responses within the specified period
- Risk Distribution - Count of employees at each risk level (bajo, medio, alto)
- Participation Rates - Percentage of employees who completed recent surveys
Data Persistence
Generated heatmap data is saved to theWellnessMetric collection for historical tracking and trend analysis. This allows administrators to:
- Compare wellness trends over time
- Identify seasonal patterns
- Track the effectiveness of wellness interventions
- Generate reports for stakeholders
models/WellnessMetric.js.
Grid Layout
The heatmap uses a 2x2 grid layout for standard hospital departments:| Position | Department |
|---|---|
| (0,0) | urgencias (Emergency) |
| (1,0) | hospitalizacion (Inpatient) |
| (0,1) | consulta_externa (Outpatient) |
| (1,1) | administracion (Administration) |
The grid layout can be customized in the frontend to support different hospital structures or additional departments.
Use Cases
- Executive Dashboards: Quick overview of organizational wellness
- Department Managers: Identify areas needing support
- HR Teams: Prioritize wellness interventions
- Trend Analysis: Track wellness changes over time
- Resource Allocation: Direct resources to departments with greatest need
Related Endpoints
- Quick Survey - Submit individual employee surveys
- Smart Alerts - View alerts generated for at-risk departments