You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We aim to enhance the Home profile template by adding a multi-line chart to display activity level trends of residents over the past seven days. This visualization will provide insights into the daily activity patterns of residents, categorized into four levels: inactive, low, good, and high.
Objective
To visualize the trend of activity levels of residents in a specific home, helping staff and caregivers to monitor and understand changes in resident activity patterns.
Chart Details
Type: Multi-Line Chart
X-Axis: Dates of the past seven days.
Y-Axis: Integer count of residents.
Lines: Four lines representing the daily count of residents with different activity levels (inactive, low, good, high).
Color Coding: Each line will have a distinct color corresponding to its activity level.
Data Calculation
Activity Levels: Defined by the WEEKLY_ACTIVITY_RANGES constant.
Data Source: Resident activities, homes, and residencies data. For each of the past seven days, calculate the number of residents in the home and their respective activity levels based on the past week's activities.
Activity Level Calculation: The resident's activity level is determined by the count of activities over the prior seven days from the date of counting.
Aggregation Summary for Activity Level Trends Chart
The core of this chart lies in the aggregation of resident activity data to accurately represent activity levels over the past seven days. This involves several key steps:
Time Frame Selection: Identify the seven-day period for analysis, ending with the current date.
Residency Determination: For each day within this period, get a list of residents who were living in the home. This requires checking the move_in and move_out dates for each residency.
Activity Counting: For each resident, count the number of activities they participated in during the seven days prior to the specific date being analyzed.
Categorization: Based on the counted activities, categorize each resident into one of the four activity levels (inactive, low, good, high) as defined by WEEKLY_ACTIVITY_RANGES.
Daily Aggregation: For each of the past seven days, aggregate the number of residents in each activity level category.
Data Structuring: Organize this aggregated data in a format suitable for the multi-line chart, ensuring each line represents one of the activity level categories across the seven-day period.
Data Integrity and Performance: Ensure the aggregation logic is optimized for performance, especially considering the potentially large dataset of residents and activities.
Design Considerations
Ensure the chart is visually consistent with the existing UI design of the Home profile template.
The chart should be responsive and easily interpretable.
Default to dark mode theme
Technical Requirements
Implement the chart using Plotly Python (with logic being defined in Python rather than JavaScript)
Backend logic should efficiently aggregate and process data to feed into the chart.
Reference Image
Acceptance Criteria
A multi-line chart accurately displaying the trend of resident activity levels over the past seven days is present on the Home profile template.
The chart updates dynamically with the latest data (when page is reloaded).
The implementation is efficient, responsive, and aligns with the design aesthetics of the platform.
The text was updated successfully, but these errors were encountered:
We aim to enhance the Home profile template by adding a multi-line chart to display activity level trends of residents over the past seven days. This visualization will provide insights into the daily activity patterns of residents, categorized into four levels: inactive, low, good, and high.
Objective
To visualize the trend of activity levels of residents in a specific home, helping staff and caregivers to monitor and understand changes in resident activity patterns.
Chart Details
Data Calculation
WEEKLY_ACTIVITY_RANGES
constant.Aggregation Summary for Activity Level Trends Chart
The core of this chart lies in the aggregation of resident activity data to accurately represent activity levels over the past seven days. This involves several key steps:
move_in
andmove_out
dates for each residency.WEEKLY_ACTIVITY_RANGES
.Design Considerations
Technical Requirements
Reference Image
Acceptance Criteria
The text was updated successfully, but these errors were encountered: