The goal of the hidden value for each rapid test type is to report on tests
that were performed and came back negative without placing additional
burden on the user to indicate those.
The current collection of test questions displays only if the user
indicates that rapid testing is needed during this visit. The questions are:
- positive_test_list: Select all rapid tests which had POSITIVE results
(check box)- hiv
- syphilis
- gonorrhea
- chlamydia
- malaria
- none_of_above
- tests_not_performed: Were any rapid tests NOT performed? (check box)
- hiv_not_performed
- syphilis_not_performed
- gonorrhea_not_performed
- chlamydia_not_performed
- malaria_not_performed
- all_tests_performed
Essentially, we want to have one hidden value per test type which indicates
deliberately whether or not that test was performed AND negative. To that
end, I attempted a hidden value called "chlamydia_done_negative," but when
I go to preview the form in the web browser (to test), I receive the error "internal
error handling request: <type
'org.javarosa.xpath.XPathUnhandledException'>:
org.javarosa.xpath.XPathUnhandledException: The problem was located in
calculate expression for /data/hiv_done_negative XPath evaluation: cannot
handle function 'If'". I'm certain this is just user error, so if anyone
could help me w/ my logic, I would be so grateful! See below:
If(not(selected(#form/positive_test_list, 'chlamydia') and
not(selected(#form/tests_not_performed, 'chlamydia_not_performed')) or
not(selected(#form/positive_test_list, 'chlamydia') and
selected(#form/tests_not_performed, 'all_tests_performed')) or
selected(#form/positive_test_list, 'none_of_above') and
not(selected(#form/tests_not_performed, 'chlamydia_not_performed')) or
selected(#form/positive_test_list, 'none_of_above') and
selected(#form/tests_not_performed, 'all_tests_performed')), 'yes', 'no')
This is intended to capture a test as negative if:
-
the test was not marked positive and was not marked not-performed OR
-
the test was not marked positive and the all_tests_performed check box
was marked OR -
none_of_above was selected from positive_test_list and test was not
marked not-performed OR -
none_of_above was selected from positive_test_list and all_tests_performed
was selected from tests_not_performed