Hello, trying to put a filter on my module to restrict cases to only those in the last year and those where follow up hasn’t already been completed.
date(y_date_of_act) >= today() - 365.25 and followup_done = ‘no’
The first part about the date seems to work well (date(y_date_of_act) >= today() - 365.25), but the second half (and followup_done = ‘no’) makes all cases disappear.
Is there something obvious that I’m doing wrong?
Two potential recommendations:
- I don’t see any here, but it may help prevent any operator ordering issues in general to ensure that clauses in your expressions are encapsulated with parethensis, IE:
(date(y_date_of_act) >= (today() - 365.25)) and followup_done = ‘no’
- Is it possible that
not(followup_done = ‘yes’)
is a more complete way to express the second clause? Maybe the cases that are missing were created before the followup_done flag was introduced into the app config, and so there’s no “confirmed negative” possible from the data?