Enable community health workers to view last month's statistics in the Analytics tab

Context:
Each month, community health workers (CHWs) submit reports to their supervisors and key stakeholders, including health center managers, village chiefs, and other community leaders. Presentation meetings are typically held between the 5th and 15th of the month, during which CHWs share the indicators from the previous reporting period.

Paint points
The CHW’s “Analysis” tab displays the current month’s indicators. These indicators are reset to zero at the end of each month, making it difficult for CHWs to view and present data from the previous month using this tab. While it’s possible to access past indicators via the “Contact” tab, that section already contains a large volume of information, including the list of medications.

Suggested solution
Introduce a toggle or dropdown within the “Analysis” tab that allows users to switch between “Current Month” and “Previous Month.”

3 Likes

Thanks for the feature proposal @Loukman!

@diana might have more thoughts on the technical feasibility here, but off the top of my head, I guess this might be pretty simple to implement for targets where date: 'reported' is set (since basically the system just needs to change the date value used for finding the docs from the given month). However, for date: 'now' or when date is set to a custom function, things could get more complicated. :grimacing: (e.g., it seems like for date: 'now' you would want to see the value for the target as of the selected month, where currently the implementation is just giving all-time totals with no regard for reported_date.)

Alternatively, I wonder if we could do something similar to the target aggregates where we rely on the existing target docs from the previous months for our target values instead of trying to retroactively calculate target value for a previous month… :thinking:

Calculating previous month’s targets retroactively is not possible unfortunately, due to how tasks handle emissions for now internally. This is why we had a whole process to update existing target docs when the interval changed - where we just saved “cached” values instead of doing a recalculation.

If we were to display a previous target, we would use the existent target doc.

1 Like

I created an issue to track this: Add ability to display previous month's targets · Issue #10140 · medic/cht-core · GitHub

1 Like