We are students at Boston University School of Public Health taking a
mobile health class. We are currently creating an application on CommCare
that would function as a childhood developmental delays screening tool. Our
application contains one registration module, twelve follow-up modules that
correspond to specific age ranges (containing 72 forms total), and a close
module. We want the specific module and their corresponding forms to show
up based on the child's age, which is calculated based on the child's date
of birth. This is the display condition we are using:
(int((today() - date(./childs_date_of_birth)) div 30.4) >= 0) and
(int((today() - date(./childs_date_of_birth)) div 30.4) <= 2)
Our display condition is placed at the form level, and not for individual
questions. However, when we preview our app, we keep getting this error
message:
(int((today() - date(./childs_date_of_birth)) div 30.4) >= 0) and
(int((today() - date(./childs_date_of_birth)) div 30.4) <= 2)
org.commcare.resources.model.UnresolvedResourceException: Invalid XML
Structure(START_TAG (empty) <command id='m1-f0' relevant='(int((today()
- date(instance('casedb')/casedb/case[@case_id=instance('commcaresession')/session/data/case_id]/childs_date_of_birth))
div 30.4) >= 0) and (int((today() - date(instance('casedb')/casedb/case[@case_id=instance('commcaresession')/session/data/case_id]/childs_date_of_birth))
div 30.4) <= 2)'>@3448:347 in java.io.InputStreamReader@75b4be1f): Bad
XPath Expression {(int((today() - date(instance('casedb')/casedb/case[@case_id=instance('commcaresession')/session/data/case_id]/childs_date_of_birth))
div 30.4) >= 0) and (int((today() - date(instance('casedb')/casedb/case[@case_id=instance('commcaresession')/session/data/case_id]/childs_date_of_birth))
div 30.4) <= 2)}
The Error message appears immediately after clicking on “Start” in the App
Preview. Please let us know how we might be able to fix the display
condition.