Tracker - Help correct a program rule for a specific data element

Hi, all.

In a repeatable stage, I have a yes/no data element to track. That is, if the answer to this DE is No four consecutive times, then display a message and block program stage for future data entry. In other words, if the answer to the DE is No for 1st, 2nd, 3rd and 4th visits, display a message and block user input for the program stage). I need a counter

I did try this, but it is not working. There may a syntax problem in this rule or the PR does not make sense

V{program_stage_id} == ‘H1r8g2lxK4i’ && V{event_count} == 4 && d2:countIfValue( #{ARCO_Was the patient found}, false ) == 4

Did you try to have a program indicator count the No and then create a program rule which have in its condition the program indicator?


Below is the way I built the program indicator to count the number of No answers, but the filter is giving error. Maybe something is wrong.

Aggregation type: count

Analytics type: event

Expression: V{value_count}

Filter: ARCO_Was the patient found==No

A part from the Program indicator issue, I am wondering if you could show me how to have the program indicator as a condition in the program rule.


Hi @SDKAAA and every one,

I seem to have made progress but I think I am missing something, Please see and comment on my steps.

  1. I created a counter as a data element and a program variable for this DE.
  2. I created a program rule to count number of no answers.
    PR expression: d2:hasValue( V{enrollment_date} ) - to mean trigger the rule when the enrollment date is selected.
  3. I created program rule action: assign value to data element counter:
  4. expression to evaluate and assign: d2:countIfValue( DE, ‘false’ )

When entering data and selecting No for 4 consecutive visits, I see the counter working properly, but the following program rule to trigger a message if the condition is met does not work.

V{program_stage_id} == ‘program Stage uid’ && V{event_count} == 4 && counter == 4. If this condition were met, an error on complete or show error message should be triggered.