Program indicator not working using tracked entity count expression to count from 2 different stages in the same program

Hi all,

I am trying to create a program indicator that counts tracked entity instances from 2 different stages in the same program. My use case is tracking patients at 3 stages; the 2nd stage has a ‘destination ward’ data element and the 3rd stage has a ‘hospital outcome’ data element. I want to count patients from a specific destination ward that died as a hospital outcome i.e. destinantion_ward== 'Ward 4 & 5' && hospital_outcome == 'Death' . This does not work despite using the option set codes & not names.

I am working on a v2.37.9 instance. Any thoughts on how to get around this?

Hi @herbert_kiwalya

Welcome back to the community!

So when creating a Program Indicator, you would add in the expression d2:condition('#{destination_ward_UID} == "Ward 4 & 5"',0,1) and in the filter of the program indicator hospital_outcome == 'Death'?

Thanks!

Thanks @Gassim

Unfortunately this counted all the ‘Death’ from all the ‘Destination wards’. I only need a count from ‘Ward 4 & 5’. It’s like it disregarded the condition