← Back to team overview

dhis2-devs team mailing list archive

How do filters work in Enrolment program indicators?

 

Hi devs,

Just a quick question around the operation of the enrolment indicators.  I’m trying to do a program indicator which searches a repeatable program stage to see if one or more events include a specific data value (a test result).  The catch is that the data value could be in any event, and may even appear multiple times, but I only want to count each enrolment once, regardless of the number of test results.

I’ve tried using an ‘enrolment’ program indicator with a filter that ensures only events which include my data value are included in the indicator calculation; however, this doesn’t seem to be working as I expected, and the entire enrolment is often being filtered out, even though it contains a positive test result.

So I’d be grateful if you could clarify when the filter is applied for ‘enrolment’ program indicators:

·         Is it applied at the event level, before the enrolment record takes the ‘latest’ event for each program stage (so I can filter the events that are used to calculate the ‘latest’ event for each enrolment?)

·         Or for Enrolment PIs is it actually an enrolment rather than an event filter, ie it’s applied after the ‘latest’ event has been pulled for each program stage (so the filter is only applied to the ‘latest’ events, not all events)?

I think the former would be more powerful, but if it’s the latter (which I suspect), is there another way of counting the number of enrolments that have had a particular value recorded during any one of a number of repeatable events?

Many thanks in advance for any help/thoughts you can share!

Cheers, Sam.


Follow ups