Quantcast
Channel: DHIS2 Community - Latest topics
Viewing all articles
Browse latest Browse all 1886

Seeking Help with DHIS2 Program Rule for Medicine Adherence Calculation

$
0
0

:magnifying_glass_tilted_left: Seeking Help with DHIS2 Program Rule for Medicine Adherence Calculation

I’m back again, not with a solution this time, but with a request for help and a possible feature suggestion for the DHIS2 program rule.

I am currently using the d2:daysBetween function, but we need it to include the end date (+1 day) in our calculations. This is critical for accurately determining medicine adherence rates for our patients.

Background

We collect medicine consumption data for 10 patients, recording the most recent and second most recent dates of medicine use. The d2:daysBetween function helps us calculate the interval between these dates, which is then used to compute adherence rates.

Since there is no built-in function to include the end date, I had to improvise using:
:pushpin: [(d2:daysBetween( #{Date of second most recent}, #{Date of most recent})) + 1]

The Challenge

When calculating total adherence across patients, the system incorrectly adds +1 even when no data is available.
For example:

  • If only 5 patients have data and the total days between is 100, the system outputs 105 instead of 100—because it still sums up the extra +1 for non-existent data.
  • The mobile app doesn’t handle this properly when referring to assigned data elements.

Possible Solutions

:one: A new function in DHIS2 for daysBetween + end date
:two: A function that does not add +1 when no data is present (though tricky to implement)
:three: The mobile app properly handling program rules with assigned calculated data elements

:loudspeaker: I’d love to hear from the DHIS2 community! Has anyone encountered this issue before? Any workarounds or thoughts on implementing a better solution?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 1886

Trending Articles