A little help please

I'm having problem with calculating the z score for children again. I
modified the original form (containing lookup table) but it doesn't work.
Any idea? Can I copy a form within the same module? Thanks!

Here is the source XML of my form! Hope some advanced users could help me
out!

<?xml version="1.0" encoding="UTF-8" ?>

<h:html xmlns:h="XHTML namespace"
xmlns:orx="http://openrosa.org/jr/xforms"
xmlns="XForms Namespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jr="http://openrosa.org/javarosa"
xmlns:vellum="http://commcarehq.org/xforms/vellum">
<h:head>
<h:title>GMP</h:title>



/data/Child_DOB
<child_gender>Child_Gender</child_gender>
<date_of_gmp />
<child_dob />
<show_age_months />
<child_gender_1 />
<child_age_months />
<child_muac />
<child_weight />
<wfa_show_zscore />
<wfa_severe />
<wfa_moderate />
<wfa_mild />
<wfa_normal />
<wfa_zscore_lookup />





-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0




-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0





















Date of GMP


Date must be today!


Child's date of birth is .


Child's age in months is .
If this isn't correct, please go back and answer again.


Child gender is .


MUAC


Green


Yellow


Red


Child's weight in kilograms


Weight for Age (WFA) zscore:


Severe acute malnutrition: Immediately refer the child for
treatment


Moderate Acute Malnutrition: Take appropriate actions to improve the
nutritional status of the child e.g. PD Hearth.


Child is well nourished but need to provide extra care and
support.


Child is well nourished. Please continue to feed the child
properly.




ကိုယ္အေလးခ်ိန္သည္႕ေန႕


ရက္စြဲသည္ ယေန႕ျဖစ္ရပါမည္။


ကေလး၏ ေမြးသၠရာဇ္မွာ ျဖစ္ပါသည္။


ကေလး၏ ျပည္႔ၿပီးအသက္(လျဖင္႕)မွာ ျဖစ္ပါသည္။ အကယ္၍ မမွန္ပါက ကေလးေမြးေန႕ကို
ျပန္လည္ဆန္းစစ္ပါ။


ကေလးသည္ ျဖစ္ပါသည္။


လက္ေမာင္းလုံးပတ္


အစိမ္း


အဝါ


အနီ


ကေလး၏ ကိုယ္အေလးခ်ိန္ (ကီလိုဂရမ္ျဖင္႕)


အသက္အလိုက္ ကိုယ္အေလးခ်ိန္ (WFA)အတြက္ zscoreမွာ


ကေလး၏ အာဟာရအေျခအေနမွာ ကိုယ္အေလးခ်ိန္ကဒ္၏ အနီေရာင္အပိုင္းထဲတြင္
ေရာက္ရွိေနၿပီး ျပင္းထန္စြာ အာဟာရခ်ိဳ႕တဲ႕ေနပါသည္။ ကုသမႈ ခံယူႏိုင္ရန္အတြက္
က်န္းမာေရးဌာနသို႕ ညႊန္းပို႕ပါ။


ကေလး၏ အာဟာရအေျခအေနမွာ ကိုယ္အေလးခ်ိန္ကဒ္၏ အဝါေရာင္အပိုင္းထဲတြင္
ေရာက္ရွိေနၿပီး အသင္႕အတင္႔ အာဟာရခ်ိဳ႕တဲ႕ေနပါသည္။ အာဟာရအေျခအေနကို
ျမွင္႕တင္ေပးရန္ အစီအစဥ္မ်ား ျပဳလုပ္ေပးရပါမည္။ ဥပမာ - PD Hearth


ကေလး၏ အာဟာရအေျခအေနမွာ ကိုယ္အေလးခ်ိန္ကဒ္၏ အစိမ္းေရာင္အပိုင္းထဲတြင္
ရွိေသာ္လည္း အဝါေရာင္အပိုင္းထဲသို႕ ေရာက္ရွိသြားႏိုင္ေျခရွိေသာေၾကာင္႕
အစားအစာပိုမို ေကြ်းရန္ လိုအပ္ပါသည္။


ကေလး၏ အာဟာရအေျခအေနမွာ ကိုယ္အေလးခ်ိန္ကဒ္၏ အစိမ္းေရာင္အပိုင္းထဲတြင္
ရွိပါသည္။ ကေလးသည္ အာဟာရျပည္႕ဝသည္႕အတြက္ ဂုဏ္ယူပါသည္။ ကေလးကို ေကြ်းေသာအစာတြင္
အစာအုပ္စု (၃) အုပ္စုလုံး ပါဝင္ေအာင္ ဆက္လက္ေကြ်းပါ။




</h:head>
<h:body>
















green



yellow



red




















</h:body>
</h:html>

··· On Friday, May 15, 2015 at 4:10:58 PM UTC+6:30, Chan Nyein Myat Aung wrote: > > I'm having problem with calculating the z score for children again. I > modified the original form (containing lookup table) but it doesn't work. > Any idea? Can I copy a form within the same module? Thanks! >

Dear Chan Nyein Myat Aung,

If we can meet somewhere this weekend, I'm happy to sit down with you so we can try to solve this issue together. Just send me a direct email to sort a good time and place.

Regards,

Charles

··· On Friday 15 May 2015 02:40:58 Chan Nyein Myat Aung wrote: > I'm having problem with calculating the z score for children again. I > modified the original form (containing lookup table) but it doesn't work. > Any idea? Can I copy a form within the same module? Thanks! > >

--
Charles Flèche
mHealth Advisor
Télécoms Sans Frontières http://www.tsfi.org
Première Urgence - Aide Médicale Internationale http://www.pu-ami.org

Dear Charles,

Thanks for your kind help! But I won't be in Yangon this weekend. I better
take my laptop when we meet again at ict4d meet up.

Best,

Chan

··· On Friday, May 15, 2015 at 4:15:21 PM UTC+6:30, Charles Flèche wrote: > > Dear Chan Nyein Myat Aung, > > > > If we can meet somewhere this weekend, I'm happy to sit down with you so > we can try to solve this issue together. Just send me a direct email to > sort a good time and place. > > > > Regards, > > > > Charles > > > > > > On Friday 15 May 2015 02:40:58 Chan Nyein Myat Aung wrote: > > > I'm having problem with calculating the z score for children again. I > > > modified the original form (containing lookup table) but it doesn't > work. > > > Any idea? Can I copy a form within the same module? Thanks! > > > > > > > > > > -- > > Charles Flèche > > mHealth Advisor > > Télécoms Sans Frontières http://www.tsfi.org > > Première Urgence - Aide Médicale Internationale http://www.pu-ami.org > > >

Hello,

It looks like node /data/child_gender is being preset to hard coded value
'Child_Gender':

<child_gender>Child_Gender</child_gender>

so when this is referenced in your zscore calculate:

It is neither 'm' nor 'f' (as in your fixture's gender ids) and thus your
predicate filters do not resolve properly. You should this value set,
likely via a single-select with option values 'm' and 'f'.

Best,
Will

:

··· 2015-05-15 5:43 GMT-04:00 Chan Nyein Myat Aung

Here is the source XML of my form! Hope some advanced users could help me
out!

<?xml version="1.0" encoding="UTF-8" ?>

<h:html xmlns:h="http://www.w3.org/1999/xhtml" xmlns:orx="
http://openrosa.org/jr/xforms" xmlns="XForms Namespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jr="
http://openrosa.org/javarosa" xmlns:vellum="
http://commcarehq.org/xforms/vellum">
<h:head>
<h:title>GMP</h:title>



/data/Child_DOB
<child_gender>Child_Gender</child_gender>
<date_of_gmp />
<child_dob />
<show_age_months />
<child_gender_1 />
<child_age_months />
<child_muac />
<child_weight />
<wfa_show_zscore />
<wfa_severe />
<wfa_moderate />
<wfa_mild />
<wfa_normal />
<wfa_zscore_lookup />





-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0




-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0


-3
-2
-1
0





















Date of GMP


Date must be today!


Child's date of birth is .


Child's age in months is .
If this isn't correct, please go back and answer again.


Child gender is .


MUAC


Green


Yellow


Red


Child's weight in kilograms


Weight for Age (WFA) zscore:


Severe acute malnutrition: Immediately refer the child for
treatment


Moderate Acute Malnutrition: Take appropriate actions to improve
the nutritional status of the child e.g. PD Hearth.


Child is well nourished but need to provide extra care and
support.


Child is well nourished. Please continue to feed the child
properly.




ကိုယ္အေလးခ်ိန္သည္႕ေန႕


ရက္စြဲသည္ ယေန႕ျဖစ္ရပါမည္။


ကေလး၏ ေမြးသၠရာဇ္မွာ ျဖစ္ပါသည္။


ကေလး၏ ျပည္႔ၿပီးအသက္(လျဖင္႕)မွာ ျဖစ္ပါသည္။ အကယ္၍ မမွန္ပါက ကေလးေမြးေန႕ကို
ျပန္လည္ဆန္းစစ္ပါ။


ကေလးသည္ ျဖစ္ပါသည္။


လက္ေမာင္းလုံးပတ္


အစိမ္း


အဝါ


အနီ


ကေလး၏ ကိုယ္အေလးခ်ိန္ (ကီလိုဂရမ္ျဖင္႕)


အသက္အလိုက္ ကိုယ္အေလးခ်ိန္ (WFA)အတြက္ zscoreမွာ


ကေလး၏ အာဟာရအေျခအေနမွာ ကိုယ္အေလးခ်ိန္ကဒ္၏ အနီေရာင္အပိုင္းထဲတြင္
ေရာက္ရွိေနၿပီး ျပင္းထန္စြာ အာဟာရခ်ိဳ႕တဲ႕ေနပါသည္။ ကုသမႈ ခံယူႏိုင္ရန္အတြက္
က်န္းမာေရးဌာနသို႕ ညႊန္းပို႕ပါ။


ကေလး၏ အာဟာရအေျခအေနမွာ ကိုယ္အေလးခ်ိန္ကဒ္၏ အဝါေရာင္အပိုင္းထဲတြင္
ေရာက္ရွိေနၿပီး အသင္႕အတင္႔ အာဟာရခ်ိဳ႕တဲ႕ေနပါသည္။ အာဟာရအေျခအေနကို
ျမွင္႕တင္ေပးရန္ အစီအစဥ္မ်ား ျပဳလုပ္ေပးရပါမည္။ ဥပမာ - PD Hearth


ကေလး၏ အာဟာရအေျခအေနမွာ ကိုယ္အေလးခ်ိန္ကဒ္၏ အစိမ္းေရာင္အပိုင္းထဲတြင္
ရွိေသာ္လည္း အဝါေရာင္အပိုင္းထဲသို႕ ေရာက္ရွိသြားႏိုင္ေျခရွိေသာေၾကာင္႕
အစားအစာပိုမို ေကြ်းရန္ လိုအပ္ပါသည္။


ကေလး၏ အာဟာရအေျခအေနမွာ ကိုယ္အေလးခ်ိန္ကဒ္၏ အစိမ္းေရာင္အပိုင္းထဲတြင္
ရွိပါသည္။ ကေလးသည္ အာဟာရျပည္႕ဝသည္႕အတြက္ ဂုဏ္ယူပါသည္။ ကေလးကို ေကြ်းေသာအစာတြင္
အစာအုပ္စု (၃) အုပ္စုလုံး ပါဝင္ေအာင္ ဆက္လက္ေကြ်းပါ။




</h:head>
<h:body>
















green



yellow



red




















</h:body>
</h:html>

On Friday, May 15, 2015 at 4:10:58 PM UTC+6:30, Chan Nyein Myat Aung wrote:

I'm having problem with calculating the z score for children again. I
modified the original form (containing lookup table) but it doesn't work.
Any idea? Can I copy a form within the same module? Thanks!

--
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.

Unfortunately I'm off to Nepal next week, for 3 months…

··· On Friday 15 May 2015 02:59:07 Chan Nyein Myat Aung wrote: > Dear Charles, > > Thanks for your kind help! But I won't be in Yangon this weekend. I better > take my laptop when we meet again at ict4d meet up.

--
Charles Flèche
mHealth Advisor
Télécoms Sans Frontières http://www.tsfi.org
Première Urgence - Aide Médicale Internationale http://www.pu-ami.org

Hello!

Thanks for your suggestion, Will! Actually, the source xml I mentioned is
just a follow-up form. My application have one module containing two forms:
one is Registration and another is Follow-up form. I used the single select
type question for child's gender in Registration form and I carried that to
Follow-up form as a Case Property. I'd like to use that case property to
calculate the Z score but I can't. That's the problem! Thanks!!!

··· On Friday, May 15, 2015 at 7:25:06 PM UTC+6:30, William Pride wrote: > > Hello, > > It looks like node /data/child_gender is being preset to hard coded value > 'Child_Gender': > > Child_Gender > > so when this is referenced in your zscore calculate: > > calculate="if(count(instance('chart')/zscore/gender[@id=/data/child_gender]/month[@id > = /data/child_age_months]/weight[@low < /data/child_weight][@high = > 'none' or @high >= /data/child_weight]) = 1, > instance('chart')/zscore/gender[@id=/data/child_gender]/month[@id = > /data/child_age_months]/weight[@low < /data/child_weight][@high = 'none' > or @high >= /data/child_weight], 'invalid entry')" /> > > It is neither 'm' nor 'f' (as in your fixture's gender ids) and thus your > predicate filters do not resolve properly. You should this value set, > likely via a single-select with option values 'm' and 'f'. > > Best, > Will >

Please take a look at the case management
https://confluence.dimagi.com/display/commcarepublic/[Learning+Module]+Case+Management?src=search
module
which should explain how to get that value into your case.

Best,
Will

··· On Mon, May 18, 2015 at 11:25 PM, Chan Nyein Myat Aung < channyeinmyataung@gmail.com> wrote:

Hello!

Thanks for your suggestion, Will! Actually, the source xml I mentioned is
just a follow-up form. My application have one module containing two forms:
one is Registration and another is Follow-up form. I used the single select
type question for child's gender in Registration form and I carried that to
Follow-up form as a Case Property. I'd like to use that case property to
calculate the Z score but I can't. That's the problem! Thanks!!!

On Friday, May 15, 2015 at 7:25:06 PM UTC+6:30, William Pride wrote:

Hello,

It looks like node /data/child_gender is being preset to hard coded value
'Child_Gender':

<child_gender>Child_Gender</child_gender>

so when this is referenced in your zscore calculate:

It is neither 'm' nor 'f' (as in your fixture's gender ids) and thus your
predicate filters do not resolve properly. You should this value set,
likely via a single-select with option values 'm' and 'f'.

Best,
Will

--
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.