I am creating a new chart that shows the number of patients prescribed statins each month, the indicator focuses on the latest visit in the past 12 months.
I created a patient with 3 visits:
April visit: Statins prescribed
May visit: No statin prescribed
June visit; Statin prescribed
This data is a dropdown field inside an event. When the patient is not prescribed a statin, the dropdown field is left blank (null?).
I am finding that the aggregate value is showing this patient as being prescribed statins for all 3 months rather than April = 1, May = 0, June = 1, I am unsure why this is happening?
Hi @jamiecarter7
Thanks for your patience and providing all those details. I would like to ask for clarification on some points please..
So for each month on those 12 months, the patient might visit multiple times but you’re only concerned whether they received a prescription in their last visit within that month? If you could clarify this one because I understood from your post is that you want to count how many patients received a prescription for each month..
I see that the ‘analytics type’ is set to Enrollment, so could this be because the ‘prescription’ is being counted within their entire enrollment instead of that specific event within that month.
Please follow below steps in order and check the results again:
After entering your data in tracker, go to Data Administration app → Analytics Table → Uncheck everything → Start export.
Open a new private window of your browser, login and check the results in Data Visualizer.
While developing PIs on localhost, I had similar issues with PIs behaving odd (and Capture app too) until I found that simple cache clearing app of DHIS2 is not enough to see changes.
Each month the system should look back at the previous 12 months and select the latest visit.
The check is then done on that latest visit to see if the a statin was prescribed - this is done by selecting an option from the dropdown menu.
→ Where this field is left blank then no statin was prescribed.
→ Where an option is selected, a statin was prescribed.
The PI seems to skip over events where any of my parameters are NULL. This means if a statin was started then stopped, those patients remain counted as being on statins.
Solution:
We have found a solution which is a little hacky but seems to work.
A hidden DE is added to the event ‘prescribed statins’ as a boolean field (True/False)
Program rules are assigned so that when the event is saved a check is made to see if the field is empty → if yes a false value is set for 'prescrived statins, → if no, false value is set.
This DE(as part of the event) is then used in the PI to make the check rather than the dropdown field.
Hi @jamiecarter7
Thank you for sharing the magic pill for similar use-cases!
Yes, that is precisely what was happening when we set the analytics types to Enrollment, but not it will check the latest value from the Data Element which will either be a yes or no. Before when it was null in the latest event, it still looked for the value in any of the previous events (hence Enrollment analytics).