Hello everyone,
Following up on my earlier post about V{event_status} missing from the program indicator variable list in 2.43, the variable turns out to have a deeper problem than a missing UI entry. On 2.43.1, it breaks analytics outright for enrollment-type program indicators.
To reproduce, take an enrollment-type indicator that counts patients on treatment, scoped to completed events:
analyticsType: ENROLLMENT
expression: V{tei_count}
filter: isNotNull(#{StAgEuId001.DaTaElEm001}) && V{event_status} == 'COMPLETED'
On 2.42 this returns data. On 2.43.1 the analytics request fails:
{"httpStatus":"Conflict","httpStatusCode":409,"status":"ERROR",
"message":"Invalid string token '<EOF>' at line:1 character:40"}
Character 40 is the giveaway. isNotNull(#{StAgEuId001.DaTaElEm001}) && is exactly 40 characters. In other words, the parser is being handed the filter with V{event_status} == 'COMPLETED' deleted from it and the dangling && left behind. It looks like 2.43 lifts the status comparison out of the filter so it can apply it as a separate predicate, but doesn’t neutralise the operator that was joining it to the rest of the expression. I have explained it more in Jira.
- It is specific to
V{event_status}.V{enrollment_status} == 'COMPLETED'combined with other conditions is fine, as areV{analytics_period_end},V{creation_date}and friends. - The operator and the literal don’t matter:
V{event_status} != 'SCHEDULE'andV{event_status} == 'ACTIVE'are removed just the same, with or without spaces around==.
I want to once again emphasize that V{event_status} utility is not limited to PIs with Event analyticsType and is indeed vital for filtering out ACTIVE events (which haven’t passed program rules validation for being COMPLETED) from Enrollment type PIs.