Checklist score as lookup field

Hello all,

I would like to add the pregnancy checklist "score" to the lookup values
when following up on a pregnant mother. For those of you not familiar with
said checklist, the "score" is the number of items that have been answered
"Yes" from a checklist of "Yes/No" items.

This will give the chw quick feedback at the beginning of a follow visit on
the results of the last visit with the mother and might also allow the chw
to show the mother her score in comparison with the other mothers who have
already registered and completed the checklist.

Is there an easy way of going about this?

Thanks,
Derek

yes

··· On Tue, Jan 11, 2011 at 3:14 AM, Derek Treatman wrote:

Hello all,

I would like to add the pregnancy checklist "score" to the lookup values
when following up on a pregnant mother. For those of you not familiar with
said checklist, the "score" is the number of items that have been answered
"Yes" from a checklist of "Yes/No" items.

This will give the chw quick feedback at the beginning of a follow visit on
the results of the last visit with the mother and might also allow the chw
to show the mother her score in comparison with the other mothers who have
already registered and completed the checklist.

Is there an easy way of going about this?

Thanks,
Derek

(can give you more detail in two hours or so)

··· On Tue, Jan 11, 2011 at 8:10 AM, Drew Roos wrote:

yes

On Tue, Jan 11, 2011 at 3:14 AM, Derek Treatman dtreatman@dimagi.comwrote:

Hello all,

I would like to add the pregnancy checklist "score" to the lookup values
when following up on a pregnant mother. For those of you not familiar with
said checklist, the "score" is the number of items that have been answered
"Yes" from a checklist of "Yes/No" items.

This will give the chw quick feedback at the beginning of a follow visit
on the results of the last visit with the mother and might also allow the
chw to show the mother her score in comparison with the other mothers who
have already registered and completed the checklist.

Is there an easy way of going about this?

Thanks,
Derek

ok, so...

  1. you can display miscellaneous messages to the user (not as part of a
    question) through the tag. you define it like other questions
    (, , etc.), but when you get to it, instead of displaying a
    question, it shows a message with an 'OK' button. the trigger still needs to
    be bound to a node in the instance -- even though no data will get stored in
    this node -- you can attach conditions to this node to determine whether or
    not to show the alert.
... ...

You are done!

  1. messages (both for s and question captions) can show
    customizable content via the tag. this tag is embedded in the
    message (making the message more like a template), and the content of the
    tag contains an expressions which is evaluated to get the text inserted into
    the final message.

You have
descendants

  1. depending on how you want to calculate the score, you have several
    options:

a) if the score is just 1 point for every yes in a single multi-select
question, you can use

count-selected(../pregnancy_checklist)

b) if the individual factors are split amongst multiple questions or you
want to vary the number of points for each factor, you need a more explicit
calculation, like:

if(../factor1 = 'y', 1, 0) + if(../factor2 > 4, 1, 0) + if(../factor3 = 'n',
1, 0) + if(../factor4 = 'severe', 1, 0)

or

if(selected(../checklist, 'A'), 1, 0) + if(selected(../checklist, 'B'), 2,
0) + if(selected(../checklist, 'C'), 1.5, 0) + if(selected(../checklist,
'D'), 0.5, 0)

also fyi, there is a 'checklist' xpath helper function for when you want to
drive conditions off these kind of 'scores' (though it doesn't actually give
you the score for display, like you need in this case). for example, if you
want to ask some 'high risk' questions if someone has at least 3 of 8 risk
factors, you'd use checklist().

··· On Tue, Jan 11, 2011 at 3:14 AM, Derek Treatman wrote:

Hello all,

I would like to add the pregnancy checklist "score" to the lookup values
when following up on a pregnant mother. For those of you not familiar with
said checklist, the "score" is the number of items that have been answered
"Yes" from a checklist of "Yes/No" items.

This will give the chw quick feedback at the beginning of a follow visit on
the results of the last visit with the mother and might also allow the chw
to show the mother her score in comparison with the other mothers who have
already registered and completed the checklist.

Is there an easy way of going about this?

Thanks,
Derek

To followup on the other part of your question (persisting and using this
value beyond the individual session):

Once you've gotten a node in your instance which corresponds to the score,
you can associate it with the pregnant mother's case inside of the case's
update block (I'm assuming here that the xform already has a case block for
this xform). So inside of your instance, you would have


...

...


...


...

Along with a bind for the score

<bind nodeset="/data/case/update/pregscore"/>

You can associate that value with your number either by using a calculate=""
to tie the pregscore to the other node in your instance, or by performing
the calculation directly inside of the field.

Once the score is associated with the case, you can use it in the
blocks of the suite file as

... ...

Or load it into future xforms (which have the user select a case) by setting
up a node in your instance


...

...

And preloading it in a bind

<bind nodeset="/data/previouspregscore" jr:preload="case"

jr:preloadParams="pregscore"/>

So you can now reference that node with a trigger or other element to
display it at the start of of a form or at any point during the form
interaction.

-Clayton

··· On Tue, Jan 11, 2011 at 11:42 AM, Drew Roos wrote:

ok, so...

  1. you can display miscellaneous messages to the user (not as part of a
    question) through the tag. you define it like other questions
    (, , etc.), but when you get to it, instead of displaying a
    question, it shows a message with an 'OK' button. the trigger still needs to
    be bound to a node in the instance -- even though no data will get stored in
    this node -- you can attach conditions to this node to determine whether or
    not to show the alert.
... ...

You are done!

  1. messages (both for s and question captions) can show
    customizable content via the tag. this tag is embedded in the
    message (making the message more like a template), and the content of the
    tag contains an expressions which is evaluated to get the text inserted into
    the final message.

You have
descendants

  1. depending on how you want to calculate the score, you have several
    options:

a) if the score is just 1 point for every yes in a single multi-select
question, you can use

count-selected(../pregnancy_checklist)

b) if the individual factors are split amongst multiple questions or you
want to vary the number of points for each factor, you need a more explicit
calculation, like:

if(../factor1 = 'y', 1, 0) + if(../factor2 > 4, 1, 0) + if(../factor3 =
'n', 1, 0) + if(../factor4 = 'severe', 1, 0)

or

if(selected(../checklist, 'A'), 1, 0) + if(selected(../checklist, 'B'), 2,
0) + if(selected(../checklist, 'C'), 1.5, 0) + if(selected(../checklist,
'D'), 0.5, 0)

also fyi, there is a 'checklist' xpath helper function for when you want to
drive conditions off these kind of 'scores' (though it doesn't actually give
you the score for display, like you need in this case). for example, if you
want to ask some 'high risk' questions if someone has at least 3 of 8 risk
factors, you'd use checklist().

On Tue, Jan 11, 2011 at 3:14 AM, Derek Treatman dtreatman@dimagi.comwrote:

Hello all,

I would like to add the pregnancy checklist "score" to the lookup values
when following up on a pregnant mother. For those of you not familiar with
said checklist, the "score" is the number of items that have been answered
"Yes" from a checklist of "Yes/No" items.

This will give the chw quick feedback at the beginning of a follow visit
on the results of the last visit with the mother and might also allow the
chw to show the mother her score in comparison with the other mothers who
have already registered and completed the checklist.

Is there an easy way of going about this?

Thanks,
Derek

Dear Drew & Clayton,

Many thanks for such thorough and descriptive responses! Have all I need
now.

The best,
Derek

··· On Wed, Jan 12, 2011 at 2:16 AM, Clayton Sims wrote:

To followup on the other part of your question (persisting and using this
value beyond the individual session):

Once you've gotten a node in your instance which corresponds to the score,
you can associate it with the pregnant mother's case inside of the case's
update block (I'm assuming here that the xform already has a case block for
this xform). So inside of your instance, you would have


...

...


...


...

Along with a bind for the score

<bind nodeset="/data/case/update/pregscore"/>

You can associate that value with your number either by using a
calculate="" to tie the pregscore to the other node in your instance, or by
performing the calculation directly inside of the field.

Once the score is associated with the case, you can use it in the
blocks of the suite file as

... ...

Or load it into future xforms (which have the user select a case) by
setting up a node in your instance


...

...

And preloading it in a bind

<bind nodeset="/data/previouspregscore" jr:preload="case"

jr:preloadParams="pregscore"/>

So you can now reference that node with a trigger or other element to
display it at the start of of a form or at any point during the form
interaction.

-Clayton

On Tue, Jan 11, 2011 at 11:42 AM, Drew Roos droos@dimagi.com wrote:

ok, so...

  1. you can display miscellaneous messages to the user (not as part of a
    question) through the tag. you define it like other questions
    (, , etc.), but when you get to it, instead of displaying a
    question, it shows a message with an 'OK' button. the trigger still needs to
    be bound to a node in the instance -- even though no data will get stored in
    this node -- you can attach conditions to this node to determine whether or
    not to show the alert.
... ...

You are done!

  1. messages (both for s and question captions) can show
    customizable content via the tag. this tag is embedded in the
    message (making the message more like a template), and the content of the
    tag contains an expressions which is evaluated to get the text inserted into
    the final message.

You have
descendants

  1. depending on how you want to calculate the score, you have several
    options:

a) if the score is just 1 point for every yes in a single multi-select
question, you can use

count-selected(../pregnancy_checklist)

b) if the individual factors are split amongst multiple questions or you
want to vary the number of points for each factor, you need a more explicit
calculation, like:

if(../factor1 = 'y', 1, 0) + if(../factor2 > 4, 1, 0) + if(../factor3 =
'n', 1, 0) + if(../factor4 = 'severe', 1, 0)

or

if(selected(../checklist, 'A'), 1, 0) + if(selected(../checklist, 'B'), 2,
0) + if(selected(../checklist, 'C'), 1.5, 0) + if(selected(../checklist,
'D'), 0.5, 0)

also fyi, there is a 'checklist' xpath helper function for when you want
to drive conditions off these kind of 'scores' (though it doesn't actually
give you the score for display, like you need in this case). for example, if
you want to ask some 'high risk' questions if someone has at least 3 of 8
risk factors, you'd use checklist().

On Tue, Jan 11, 2011 at 3:14 AM, Derek Treatman dtreatman@dimagi.comwrote:

Hello all,

I would like to add the pregnancy checklist "score" to the lookup values
when following up on a pregnant mother. For those of you not familiar with
said checklist, the "score" is the number of items that have been answered
"Yes" from a checklist of "Yes/No" items.

This will give the chw quick feedback at the beginning of a follow visit
on the results of the last visit with the mother and might also allow the
chw to show the mother her score in comparison with the other mothers who
have already registered and completed the checklist.

Is there an easy way of going about this?

Thanks,
Derek