Generating two different values subject to different conditions for hidden value

Hie guys,

I want to allocate a particular value to a question id subject to the
satisfaction of certain conditons.

For example, i have a field called malnutrition_class.

if the patient has a MUAC of below 115 that chils should automatically be
classified as ‘Severe’ and if the MUAC > 115 it can be ‘Moderate’.

how do i put these if conditions to allocate the appropriate value probably
to a single hidden value.

Please Help

Eva…

Hi Eva,

CommCare supports a robust logic framework which should allow you to build
an expression that meets your needs.

You should be able to write an if() expression
https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-if
into
your hidden value’s calculate field which allows the value to be set
conditionally based on other questions. You can nest XPath expressions if
needed for more powerful capabilities.

-Clayton

··· On Mon, Apr 24, 2017 at 1:30 PM, Eva wrote:

Hie guys,

I want to allocate a particular value to a question id subject to the
satisfaction of certain conditons.

For example, i have a field called malnutrition_class.

if the patient has a MUAC of below 115 that chils should automatically be
classified as ‘Severe’ and if the MUAC > 115 it can be ‘Moderate’.

how do i put these if conditions to allocate the appropriate value
probably to a single hidden value.

Please Help

Eva…


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.

Hie Clayton,

Thanks for that.

Thats precisely what I’m looking for; if-then-else statements.

Any chance you can assist me with the syntax or refer me to written
material that I can reference.

I have more experience programming in Oracle and Commcare is quite new to
me.

Kind regards,

Eva

··· On Monday, April 24, 2017 at 9:05:53 PM UTC+2, Clayton Sims wrote: > > Hi Eva, > > CommCare supports a robust logic framework which should allow you to build > an expression that meets your needs. > > You should be able to write an if() expression > into > your hidden value's calculate field which allows the value to be set > conditionally based on other questions. You can nest XPath expressions if > needed for more powerful capabilities. > > -Clayton > > On Mon, Apr 24, 2017 at 1:30 PM, Eva <eva.t...@gmail.com > wrote: > >> Hie guys, >> >> I want to allocate a particular value to a question id subject to the >> satisfaction of certain conditons. >> >> For example, i have a field called malnutrition_class. >> >> if the patient has a MUAC of below 115 that chils should automatically be >> classified as 'Severe' and if the MUAC > 115 it can be 'Moderate'. >> >> how do i put these if conditions to allocate the appropriate value >> probably to a single hidden value. >> >> Please Help >> >> >> Eva.. >> >> -- >> 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-user...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > >

Hi Eva,

This CommCare Functions documentation
https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions
that Clayton linked to should give you a great foundation to start off with
for how to implement a wide variety of logical and mathematical statements
in CommCare.

Cheers,
Aliza

··· On Wed, Apr 26, 2017 at 5:53 AM, Eva wrote:

Hie Clayton,

Thanks for that.

Thats precisely what I’m looking for; if-then-else statements.

Any chance you can assist me with the syntax or refer me to written
material that I can reference.

I have more experience programming in Oracle and Commcare is quite new to
me.

Kind regards,

Eva

On Monday, April 24, 2017 at 9:05:53 PM UTC+2, Clayton Sims wrote:

Hi Eva,

CommCare supports a robust logic framework which should allow you to
build an expression that meets your needs.

You should be able to write an if() expression
https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-if into
your hidden value’s calculate field which allows the value to be set
conditionally based on other questions. You can nest XPath expressions if
needed for more powerful capabilities.

-Clayton

On Mon, Apr 24, 2017 at 1:30 PM, Eva eva.t...@gmail.com wrote:

Hie guys,

I want to allocate a particular value to a question id subject to the
satisfaction of certain conditons.

For example, i have a field called malnutrition_class.

if the patient has a MUAC of below 115 that chils should automatically
be classified as ‘Severe’ and if the MUAC > 115 it can be ‘Moderate’.

how do i put these if conditions to allocate the appropriate value
probably to a single hidden value.

Please Help

Eva…


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-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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.

Hi Eva,

To add some additional info to Aliza’s response, the wiki linked also has a
fair amount of documentation which you may find helpful as examples, like

Cheers!
-Clayton

··· On Wed, Apr 26, 2017 at 1:41 AM, Aliza Stone wrote:

Hi Eva,

This CommCare Functions documentation
https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions
that Clayton linked to should give you a great foundation to start off with
for how to implement a wide variety of logical and mathematical statements
in CommCare.

Cheers,
Aliza

On Wed, Apr 26, 2017 at 5:53 AM, Eva eva.tsitsi@gmail.com wrote:

Hie Clayton,

Thanks for that.

Thats precisely what I’m looking for; if-then-else statements.

Any chance you can assist me with the syntax or refer me to written
material that I can reference.

I have more experience programming in Oracle and Commcare is quite new to
me.

Kind regards,

Eva

On Monday, April 24, 2017 at 9:05:53 PM UTC+2, Clayton Sims wrote:

Hi Eva,

CommCare supports a robust logic framework which should allow you to
build an expression that meets your needs.

You should be able to write an if() expression
https://confluence.dimagi.com/display/commcarepublic/CommCare+Functions#CommCareFunctions-if into
your hidden value’s calculate field which allows the value to be set
conditionally based on other questions. You can nest XPath expressions if
needed for more powerful capabilities.

-Clayton

On Mon, Apr 24, 2017 at 1:30 PM, Eva eva.t...@gmail.com wrote:

Hie guys,

I want to allocate a particular value to a question id subject to the
satisfaction of certain conditons.

For example, i have a field called malnutrition_class.

if the patient has a MUAC of below 115 that chils should automatically
be classified as ‘Severe’ and if the MUAC > 115 it can be ‘Moderate’.

how do i put these if conditions to allocate the appropriate value
probably to a single hidden value.

Please Help

Eva…


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-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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.


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.