Deciaml question Validation

in a situation where the first question asks for symptoms and options are
fever and no fever,
the the second question requires an input for temperature, where if if the
patient had fever temp should be say 100 to 109 inclusive and when patient
did not have fever temp should be 96 to 101.

How do I write the validation code for that. I cant seam to figure out a
way to do this. I am actually one 4 days old in using commcare.

Hi Mark,

For the Temperature (with fever) question you can write this in the
Validation Condition field: . >= 100 and . <=109
and for Temperature (no fever) question write: . >= 96 and . <=101

We have a bunch of common display condition and validation condition
expressions on our Wiki as well. Check it out!
Common Logic & Calculations
https://confluence.dimagi.com/display/commcarepublic/Common+Logic+and+Calculations#CommonLogicandCalculations-ValidationConditions
Basic Validation Conditions
https://confluence.dimagi.com/display/commcarepublic/Basic+Validation+Conditions

Lauren

Lauren N. Fox
Dimagi, Inc.
Maputo, Mozambique

Moz: +258 82 78 49 245
dimagi.com http://www.dimagi.com/ *| *commcarehq.org

··· On Fri, Mar 11, 2016 at 5:44 PM, Mark Onimbo wrote:

in a situation where the first question asks for symptoms and options are
fever and no fever,
the the second question requires an input for temperature, where if if the
patient had fever temp should be say 100 to 109 inclusive and when patient
did not have fever temp should be 96 to 101.

How do I write the validation code for that. I cant seam to figure out a
way to do this. I am actually one 4 days old in using commcare.

http://www.unfpa.org

https://www.facebook.com/UNFPA https://twitter.com/unfpa
https://instagram.com/unfpa/ https://www.linkedin.com/company/unfpa
https://www.youtube.com/user/unfpa
https://plus.google.com/+unfpa/posts
http://visitor.r20.constantcontact.com/manage/optin?v=001-YNFZmXHhSP25d9kiBTi0ZxtEwaeIcM-UeLsaXPKYoHs5SAGE1WbNakIrfhkc_3wTTkXkKXbHJpBnXtbqkTATg_O174jFAyLQdNkQkPKQAk=&MERGE0=

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Similarly When I do this, I am unable to figure out why my decimal type
question won't allow me to input values. If i leave the field blank in the
preview the question has the check. Otherwise it Shows a X.

··· On Friday, March 11, 2016 at 9:44:31 AM UTC-6, Mark Onimbo wrote: > > in a situation where the first question asks for symptoms and options are > fever and no fever, > the the second question requires an input for temperature, where if if the > patient had fever temp should be say 100 to 109 inclusive and when patient > did not have fever temp should be 96 to 101. > > How do I write the validation code for that. I cant seam to figure out a > way to do this. I am actually one 4 days old in using commcare. >

Hi I have the same problem. Did you figure it out?

Akash,

What is the expression you are using in your validation condition?

In the previous example a correct condition would look something like

if( selected(#form/symptoms, 'fever'), . > 100 and . <= 109, . > 96
and <= 101 )

-Clayton

··· On Thu, Mar 30, 2017 at 11:36 PM, Akash Makhija wrote:

Hi I have the same problem. Did you figure it out?

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.