I can't make my logic for the respirator counter work. I am trying to write
the code to classify a child between 6 and 11 months with a respiratory
rate above 50 as a "rapid" breather and a child between 12 and 60 months
with a respiratory rate above 40 as a "rapid" breather. With any other
signs of gravity these cases should be classified as "pneumonie grave" and
without any signs of gravity they should be "pneumonie simple". A child
without "rapid" breathing should just be classified as a case of
"TouxRhume".
However, I can't make it work. With the most recently deployed version of
the app ti seems to classify all cases as TouxRhume. I think it is doing
that because that is the default and something is wrong with the other code
but I can't figure it out for the life of me. Any ideas?
Here is the code I wrote:
Android App Callout Variable for Respiratory Counter = "results_respcount"
Hidden Variable "Resp_classification" = if(((/data/Identification_du_patient/age_mois>=2
and /data/Identification_du_patient/age_mois<12) and
/data/PEC_pneumonie/results_respcount>=50),"Rapide",if((/data/Identification_du_patient/age_mois>=12
and /data/Identification_du_patient/age_mois<=60) and
/data/PEC_pneumonie/results_respcount>=40,"Rapide","Normale"))
Hidden Variable "IRA_classification"
= if(/data/PEC_pneumonie/Resp_classification="Rapide" and
/data/Rechercher_les_signes_de_gravite/signes_pneumonie_grave="yes","Pneumonie
Grave",if(/data/PEC_pneumonie/Resp_classification="Normale" and
/data/Rechercher_les_signes_de_gravite/signes_pneumonie_grave="no","Pneumonie
Simple","TouxRhume"))
The display logic is: (it is the same for all 3 because they are in the
same folder)
selected(/data/symptomes, 'toux') and
/data/Population_vulnerable/Pop_vulnerable = 'no' and /data/PEC_eligible =
'yes' and /data/Ebola/ebola_suspect != 'yes'
Hidden Variable "Pop_vulnerable"
= if(/data/Identification_du_patient/age_mois<2, "moins2mois",
if(/data/Population_vulnerable/status_enceinte="oui", "enceinte",
if(/data/Population_vulnerable/status_enceinte = "ne_sait_pas", "etat
grossesse inconnue", "no")))
Hidden Variable "PEC_eligible"
= if(/data/Identification_du_patient/age_mois<=60 or
(/data/Identification_du_patient/age_mois>60 and selected(/data/symptomes,
'fievre')),"yes","no")
Hidden Variable "ebola_suspect" = if(/data/Ebola/voyage = 'oui' and
(selected(/data/Ebola/pays_voyage, 'guinee') or
selected(/data/Ebola/pays_voyage, 'sierra_leone')), 'yes', 'no')