Great, works for me, but only if the statement is enclaused by parenthesis (at least for numeric fields) (/form/obs/field_name/value)==10?10:0 Added to wiki. El nov 23, 2011 4:56 a.m., "Daniel Kayiwa" <[email protected]> escribió:
> Hi Joaquin, > > For the question that you want to give a value of 0 or 10 depending on > another question's answer, in the form designer's properties tab, put this > expression in the question's calculate property: /form/obs/fieldname/value > == 'no' ? 0 : 10 > > Replace "fieldname" with the actual one which you can see in the binding > property. > > > On Wed, Nov 23, 2011 at 5:46 AM, Joaquín Blaya < > [email protected]> wrote: > >> I'm trying to create a form that has 5 yes or no questions, each answer >> has a certain number of points, and then the sum of those points is the >> risk score of the patients. >> >> In XForms, I see that I can do the sum of the respective scores of each >> question. The question I have is there a way to have a field be 0 if the >> answer to the previous question is no, and 10 if the answer is yes? i.e. >> define the value of the field depending on the answer of the previous field? >> >> Thanks, >> >> Joaquín >> ___________________________________________________________________ >> Gerente de Desarrollo, eHealth Systems <http://www.ehs.cl/> >> Research Fellow, Escuela de Medicina de Harvard <http://hms.harvard.edu/> >> Moderador, GHDOnline.org <http://www.ghdonline.org/> >> >> >> >> ------------------------------ >> Click here to >> unsubscribe<[email protected]?body=SIGNOFF%20openmrs-implement-l>from >> OpenMRS Implementers' mailing list > > > > > -- > If we keep uppermost in our minds the unkind and unjust acts of others, we > shall find it impossible to love them as Christ has loved us; but if our > thoughts dwell upon the wondrous love and pity of Christ for us, the same > spirit will flow out to others. > ------------------------------ > Click here to > unsubscribe<[email protected]?body=SIGNOFF%20openmrs-implement-l>from > OpenMRS Implementers' mailing list _________________________________________ To unsubscribe from OpenMRS Implementers' mailing list, send an e-mail to [email protected] with "SIGNOFF openmrs-implement-l" in the body (not the subject) of your e-mail. [mailto:[email protected]?body=SIGNOFF%20openmrs-implement-l]

