I must say I’m lost here…
You have a property in wich you store the last visit date at the end of the form used during this last visit, true ? This property is called hv_last_visit_date.
Then you want to discriminate between beneficiary that
- were visited in the last 3 days (green)
- weren’t visited during those last 3 days (red)
Then, using hv_last_visit_date in the case list, you do the mapping as said :
- Green : today() <= date(. + 3)
- Red : today() > date(. + 3)
Now, if the next visit date is known, no need for all this : just count the number of days between the last visit and the next visit and check if this number is greater than 3 or not…
An advice : always follow the easiest solution !