Advanced logistical issue - need help!

Hi there,

I am really stumped by an issue I am trying to resolve, I feel like there
is some simple logic to it, if anyone could help I would really appreciate
it.

We have a Health Scheme where Each case has 2 episodes when they are
registered. However, if one form ‘bKash’ is filled out then the case now
has 1 episode left, if two bKash forms are filled out then the case has no
episodes left and no more bKash forms may be filled out. I have been trying
to work this out using certain answers to questions in the bKash
form…however, it would be much more logical if this number could be
dependent on the filling out of the form.

  1. I need to work out the logic by which I can calculate how many episodes
    each case has (depending if one, two or no bKash forms have been filled
    out).

  2. I also need this to value to be stored within one hidden value which I
    can display on the case details.

If anyone could help me I would be extremely grateful! My brain cannot work
it out at all!

Heidi

Hi there –

Afraid I don’t have the time to give a full opinion here, but I’ll tell you
what thoughts came to mind… And also I believe another user is replying
to this saying something similar.

In a number of my forms, I use a hidden value called a “counter” that
simply keeps a count of the number of times that a given engagement has
been carried out.

Each time an additional follow-up form is filled out, it adds one to that
counter.

if you did that, then it seems that your follow-up form that you use in
recording one additional “episode” as you call it, could have in its very
beginning, a label question that says “Sorry – this person has already
gotten two episodes filled in to this system… no more for them!” … and
then set the display condition for that label to be “/data/episodecounter >
2”

If this makes basic sense… and I’m not completely misunderstanding your
needs… then I can give the additional info on how I make a counter in a
form, though it may be already clear to you.

– In the registration form for your case type… assuming that the filling
out of the registration form itself should not count as one episode… you
make the registration form include a hidden value called episodecounter,
and simply set its calculated value to zero. In case management, make sure
that property is passed onwards (either through the regular case, if the
bkash episodes are in regular follow-ups to this form, or passed on to the
child case if that is the method you are using.)
– Then, in the follow-up form that will count as one bKash episode, have
case management set to load that episodecounter into a new hidden value
called loadepisodecounter. and then in that form, make a separate hidden
value with the normal name episodecounter, and set the calculated value of
that episodecounter to be /data/loadepisodecounter+1
– Now, each time you run that form, it should keep that running count of
how many times that form has been run. You can even display it as an output
in a label field if you want.
– then, as I said, create a warning/stop here label question, saying
"Whoops, no more, too many episodes, stop now" … and set the display
logic for that warning question to be /data/episodecounter >2. You can even
PREVENT people from passing through that warning page by making it a
required text input question instead of a label page… and then set its
validation to be . = ‘password’ … so the person can’t pass that page
unless they type the word password into the field.

Fun stuff

Eric

Hi Heidi,

There are couple of steps.

A. Add two hidden values in the bkash form:

  1. count which has the following calculation /data/prev_count +1
  2. prev_count in which you will load your case property and it will keep
    the previous value of the property

These hidden values will update your case property “count” which will keep
a count of how many times for the form has been filled for each case (the
hidden value #1 count adds 1 to the previous value each time the form bkash
is filled out).

B. On the case management of the form you will need to load the case
property into prev_count and save the hidden value count to the case (see
instructions here
https://confluence.dimagi.com/display/commcarepublic/Advanced+Case+Management+Tutorial+Part+3+-+Loading+Data+from+the+Case
)

C. In the case details you can display the property “count”

··· On Tue, Jun 2, 2015 at 7:08 AM, Heidi Lowe wrote:

Hi there,

I am really stumped by an issue I am trying to resolve, I feel like there
is some simple logic to it, if anyone could help I would really appreciate
it.

We have a Health Scheme where Each case has 2 episodes when they are
registered. However, if one form ‘bKash’ is filled out then the case now
has 1 episode left, if two bKash forms are filled out then the case has no
episodes left and no more bKash forms may be filled out. I have been trying
to work this out using certain answers to questions in the bKash
form…however, it would be much more logical if this number could be
dependent on the filling out of the form.

  1. I need to work out the logic by which I can calculate how many episodes
    each case has (depending if one, two or no bKash forms have been filled
    out).

  2. I also need this to value to be stored within one hidden value which I
    can display on the case details.

If anyone could help me I would be extremely grateful! My brain cannot
work it out at all!

Heidi


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.


Fiorenzo Conte
Project Manager | Gestionnaire de projet
West Africa | Afrique de l’Ouest
Dimagi, Inc
m : +221 77 293 91 89 | s : fioreco86
http://www.dimagi.com/

Hi there,

Thanks for all your help, your suggestions are exactly what I’ve been
trying to do for a long time, however, what I have found with this method
is that my exact same function will only +1 when I run the form once, I
have never been able to get the function to work the second time (when I
complete the second form) to bring the number up to 2!

Do you have any idea what could be the problem for this?? I am especially
intrigued if you use this method to count in your apps, but I tried to
follow both of you step by step but came out with the same problem.

Thanks again,

Heidi

··· On Tuesday, 2 June 2015 14:08:41 UTC+6, Heidi Lowe wrote: > > Hi there, > > I am really stumped by an issue I am trying to resolve, I feel like there > is some simple logic to it, if anyone could help I would really appreciate > it. > > We have a Health Scheme where Each case has 2 episodes when they are > registered. However, if one form 'bKash' is filled out then the case now > has 1 episode left, if two bKash forms are filled out then the case has no > episodes left and no more bKash forms may be filled out. I have been trying > to work this out using certain answers to questions in the bKash > form....however, it would be much more logical if this number could be > dependent on the filling out of the form. > > 1) I need to work out the logic by which I can calculate how many episodes > each case has (depending if one, two or no bKash forms have been filled > out). > > 2) I also need this to value to be stored within one hidden value which I > can display on the case details. > > If anyone could help me I would be extremely grateful! My brain cannot > work it out at all! > > Heidi >

Hi there –

I have configured my little test app so that it does the typical counter
thing. See attached, I’ve taken some screenshots that might help you.

– the app’s registration form, which simply has the hidden value called
counter, and simply sets it to 1.
– the case mgt for that reg form, which passes that hidden value to a case
property called counter.

Then, over in the follow-up form,

– the follow-up form’s case management loads that case property called
counter into a hidden value in the form called loadcounter
– then inside the follow-up form’s actual form, there is also a hidden
value with the original name counter. and that hidden value calculates
itself to be /data/loadcounter+1
– and you will see that in the follow-up form’s case management, it passes
that hidden value called counter back into the case property called
counter. So that new higher value will be picked up into the form the next
time the follow up form is run!

See attached screenshots
Eric

counters.docx (331 KB)

Hi Heidi,

I’m not sure if this will help, but there is an example of a counter on the
help site:
https://help.commcarehq.org/display/commcarepublic/General+Workflow+Suggestions#GeneralWorkflowSuggestions-HowcanImakeaformdisappearfromaformlistonceithasbeenfilledout,ormakeformsappearinsequence
?

Otherwise if you could describe your hidden values and case management we
could try to help.

Thanks,

Jeremy

··· On Thu, Jun 4, 2015 at 6:20 AM, Heidi Lowe wrote:

Hi there,

Thanks for all your help, your suggestions are exactly what I’ve been
trying to do for a long time, however, what I have found with this method
is that my exact same function will only +1 when I run the form once, I
have never been able to get the function to work the second time (when I
complete the second form) to bring the number up to 2!

Do you have any idea what could be the problem for this?? I am especially
intrigued if you use this method to count in your apps, but I tried to
follow both of you step by step but came out with the same problem.

Thanks again,

Heidi

On Tuesday, 2 June 2015 14:08:41 UTC+6, Heidi Lowe wrote:

Hi there,

I am really stumped by an issue I am trying to resolve, I feel like there
is some simple logic to it, if anyone could help I would really appreciate
it.

We have a Health Scheme where Each case has 2 episodes when they are
registered. However, if one form ‘bKash’ is filled out then the case now
has 1 episode left, if two bKash forms are filled out then the case has no
episodes left and no more bKash forms may be filled out. I have been trying
to work this out using certain answers to questions in the bKash
form…however, it would be much more logical if this number could be
dependent on the filling out of the form.

  1. I need to work out the logic by which I can calculate how many
    episodes each case has (depending if one, two or no bKash forms have been
    filled out).

  2. I also need this to value to be stored within one hidden value which I
    can display on the case details.

If anyone could help me I would be extremely grateful! My brain cannot
work it out at all!

Heidi


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.


Jeremy Wacksman
Dimagi http://www.dimagi.com, Inc.

Thank you so much everyone, I have finally realised what I was doing wrong!
(I simply couldn’t understand loading the ‘counter’ from my second form
into the original ‘counter’ of my registration form) but now it makes
perfect sense!

Thanks again for all your help, really appreciated,

Heidi

··· On Wednesday, 10 June 2015 10:00:45 UTC+6, Eric Stephan wrote: > > Hi there -- > > I have configured my little test app so that it does the typical counter > thing. See attached, I've taken some screenshots that might help you. > > -- the app's registration form, which simply has the hidden value called > counter, and simply sets it to 1. > -- the case mgt for that reg form, which passes that hidden value to a > case property called counter. > > Then, over in the *follow-up* form, > > -- the follow-up form's case management loads that case property called > counter into a hidden value in the form called loadcounter > -- then inside the follow-up form's actual form, there is also a hidden > value with the original name counter. and that hidden value calculates > itself to be /data/loadcounter+1 > -- and you will see that in the follow-up form's case management, it > passes that hidden value called counter back into the case property called > counter. So that new higher value will be picked up into the form the next > time the follow up form is run! > > See attached screenshots > Eric > >

Hey Heidi,

Can you check that you’re loading the case property “count” into the hidden
value “prev_count” on the case management of the form? and also that you
save it the question “count” to the case?

··· On Thu, Jun 4, 2015 at 9:39 AM, Jeremy W. wrote:

Hi Heidi,

I’m not sure if this will help, but there is an example of a counter on
the help site:

https://help.commcarehq.org/display/commcarepublic/General+Workflow+Suggestions#GeneralWorkflowSuggestions-HowcanImakeaformdisappearfromaformlistonceithasbeenfilledout,ormakeformsappearinsequence
?

Otherwise if you could describe your hidden values and case management we
could try to help.

Thanks,

Jeremy

On Thu, Jun 4, 2015 at 6:20 AM, Heidi Lowe heidijoanlowe11@gmail.com wrote:

Hi there,

Thanks for all your help, your suggestions are exactly what I’ve been
trying to do for a long time, however, what I have found with this method
is that my exact same function will only +1 when I run the form once, I
have never been able to get the function to work the second time (when I
complete the second form) to bring the number up to 2!

Do you have any idea what could be the problem for this?? I am especially
intrigued if you use this method to count in your apps, but I tried to
follow both of you step by step but came out with the same problem.

Thanks again,

Heidi

On Tuesday, 2 June 2015 14:08:41 UTC+6, Heidi Lowe wrote:

Hi there,

I am really stumped by an issue I am trying to resolve, I feel like
there is some simple logic to it, if anyone could help I would really
appreciate it.

We have a Health Scheme where Each case has 2 episodes when they are
registered. However, if one form ‘bKash’ is filled out then the case now
has 1 episode left, if two bKash forms are filled out then the case has no
episodes left and no more bKash forms may be filled out. I have been trying
to work this out using certain answers to questions in the bKash
form…however, it would be much more logical if this number could be
dependent on the filling out of the form.

  1. I need to work out the logic by which I can calculate how many
    episodes each case has (depending if one, two or no bKash forms have been
    filled out).

  2. I also need this to value to be stored within one hidden value which
    I can display on the case details.

If anyone could help me I would be extremely grateful! My brain cannot
work it out at all!

Heidi


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.


Jeremy Wacksman
Dimagi http://www.dimagi.com, Inc.


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.


Fiorenzo Conte
Project Manager | Gestionnaire de projet
West Africa | Afrique de l’Ouest
Dimagi, Inc
m : +221 77 293 91 89 | s : fioreco86
http://www.dimagi.com/

Hi everyone,

Thanks for all your help. Fiorenzo, I am sure I am loading in the
"prev_count" into the case property “count”. And I have been saving it
afterwards back into case management so it appears as a case detail.

I tried to do a simplified ‘test’ version with no extenuating questions to
distract me. I found I still could not get it to work. Here is my 'Test’
Module work:

1st Form (Registration)(this form registers a new case): 1. Question
(Name), 2. Hidden Value (prev_count set as 0), 3. Label for hidden value.
1st Form Case Management (data saved to case properties): 1. Artisan’s name

  • name, 2. hidden value prev_count - prev_count

2nd Form (bKash)(updates or closes a case): 1. Question (How much?) 2.
Hidden Value (prev_count - loaded with prev_count from 1st form), 3. Label
of previous count, 4. Hidden value (count - calculate condition =
/data/prev_count+1), 5. Label of current count.
2nd Form Case Management(load case properties into form): 1. prev_count -
hidden value prev_count. (save data to case properties): 1. count - count

I loaded my ‘count’ value into my case list and it reflects the fact that I
after I fill out one bKash form the count goes to 1, when I fill out two or
more the prev_count stays at 0 so hence the count stays at 1…

Any help is greatly appreciated,

Heidi

··· On Thursday, 4 June 2015 17:17:13 UTC+6, fconte wrote: > > Hey Heidi, > > Can you check that you're loading the case property "count" into the > hidden value "prev_count" on the case management of the form? and also that > you save it the question "count" to the case? > > On Thu, Jun 4, 2015 at 9:39 AM, Jeremy W. <jwac...@dimagi.com > wrote: > >> Hi Heidi, >> >> I'm not sure if this will help, but there is an example of a counter on >> the help site: >> >> https://help.commcarehq.org/display/commcarepublic/General+Workflow+Suggestions#GeneralWorkflowSuggestions-HowcanImakeaformdisappearfromaformlistonceithasbeenfilledout,ormakeformsappearinsequence >> ? >> >> Otherwise if you could describe your hidden values and case management we >> could try to help. >> >> Thanks, >> >> Jeremy >> >> >> >> On Thu, Jun 4, 2015 at 6:20 AM, Heidi Lowe <heidijo...@gmail.com > wrote: >> >>> Hi there, >>> >>> Thanks for all your help, your suggestions are exactly what I've been >>> trying to do for a long time, however, what I have found with this method >>> is that my exact same function will only +1 when I run the form once, I >>> have never been able to get the function to work the second time (when I >>> complete the second form) to bring the number up to 2! >>> >>> Do you have any idea what could be the problem for this?? I am >>> especially intrigued if you use this method to count in your apps, but I >>> tried to follow both of you step by step but came out with the same problem. >>> >>> Thanks again, >>> >>> Heidi >>> >>> >>> On Tuesday, 2 June 2015 14:08:41 UTC+6, Heidi Lowe wrote: >>>> >>>> Hi there, >>>> >>>> I am really stumped by an issue I am trying to resolve, I feel like >>>> there is some simple logic to it, if anyone could help I would really >>>> appreciate it. >>>> >>>> We have a Health Scheme where Each case has 2 episodes when they are >>>> registered. However, if one form 'bKash' is filled out then the case now >>>> has 1 episode left, if two bKash forms are filled out then the case has no >>>> episodes left and no more bKash forms may be filled out. I have been trying >>>> to work this out using certain answers to questions in the bKash >>>> form....however, it would be much more logical if this number could be >>>> dependent on the filling out of the form. >>>> >>>> 1) I need to work out the logic by which I can calculate how many >>>> episodes each case has (depending if one, two or no bKash forms have been >>>> filled out). >>>> >>>> 2) I also need this to value to be stored within one hidden value which >>>> I can display on the case details. >>>> >>>> If anyone could help me I would be extremely grateful! My brain cannot >>>> work it out at all! >>>> >>>> Heidi >>>> >>> -- >>> 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. >>> >> >> >> >> -- >> Jeremy Wacksman >> Dimagi , Inc. >> >> -- >> 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. >> > > > > -- > *Fiorenzo Conte* > Project Manager | Gestionnaire de projet > West Africa | Afrique de l'Ouest > Dimagi, Inc > m : +221 77 293 91 89 | s : fioreco86 > http://www.dimagi.com/ > > > >

Heidi,

Its a bit hard for me to grok the XForm from a just a textual description
but I believe the issue might be here:

  1. Hidden Value (prev_count - loaded with prev_count from 1st form)

and

(save data to case properties): 1. count - count

Is it possible that the form is always loading the “prev_count” case value
from the first form instead of the updated “count” case value from the
follow up form? I think this would explain the behavior you’re seeing.

Best,
Will

··· On Sun, Jun 7, 2015 at 12:56 AM Heidi Lowe wrote:

Hi everyone,

Thanks for all your help. Fiorenzo, I am sure I am loading in the
"prev_count" into the case property “count”. And I have been saving it
afterwards back into case management so it appears as a case detail.

I tried to do a simplified ‘test’ version with no extenuating questions to
distract me. I found I still could not get it to work. Here is my 'Test’
Module work:

1st Form (Registration)(this form registers a new case): 1. Question
(Name), 2. Hidden Value (prev_count set as 0), 3. Label for hidden value.
1st Form Case Management (data saved to case properties): 1. Artisan’s
name - name, 2. hidden value prev_count - prev_count

2nd Form (bKash)(updates or closes a case): 1. Question (How much?) 2.
Hidden Value (prev_count - loaded with prev_count from 1st form), 3. Label
of previous count, 4. Hidden value (count - calculate condition =
/data/prev_count+1), 5. Label of current count.
2nd Form Case Management(load case properties into form): 1. prev_count -
hidden value prev_count. (save data to case properties): 1. count - count

I loaded my ‘count’ value into my case list and it reflects the fact that
I after I fill out one bKash form the count goes to 1, when I fill out two
or more the prev_count stays at 0 so hence the count stays at 1…

Any help is greatly appreciated,

Heidi

On Thursday, 4 June 2015 17:17:13 UTC+6, fconte wrote:

Hey Heidi,

Can you check that you’re loading the case property “count” into the
hidden value “prev_count” on the case management of the form? and also that
you save it the question “count” to the case?

On Thu, Jun 4, 2015 at 9:39 AM, Jeremy W. jwac...@dimagi.com wrote:

Hi Heidi,

I’m not sure if this will help, but there is an example of a counter on
the help site:

https://help.commcarehq.org/display/commcarepublic/General+Workflow+Suggestions#GeneralWorkflowSuggestions-HowcanImakeaformdisappearfromaformlistonceithasbeenfilledout,ormakeformsappearinsequence
?

Otherwise if you could describe your hidden values and case management
we could try to help.

Thanks,

Jeremy

On Thu, Jun 4, 2015 at 6:20 AM, Heidi Lowe heidijo...@gmail.com wrote:

Hi there,

Thanks for all your help, your suggestions are exactly what I’ve been
trying to do for a long time, however, what I have found with this method
is that my exact same function will only +1 when I run the form once, I
have never been able to get the function to work the second time (when I
complete the second form) to bring the number up to 2!

Do you have any idea what could be the problem for this?? I am
especially intrigued if you use this method to count in your apps, but I
tried to follow both of you step by step but came out with the same problem.

Thanks again,

Heidi

On Tuesday, 2 June 2015 14:08:41 UTC+6, Heidi Lowe wrote:

Hi there,

I am really stumped by an issue I am trying to resolve, I feel like
there is some simple logic to it, if anyone could help I would really
appreciate it.

We have a Health Scheme where Each case has 2 episodes when they are
registered. However, if one form ‘bKash’ is filled out then the case now
has 1 episode left, if two bKash forms are filled out then the case has no
episodes left and no more bKash forms may be filled out. I have been trying
to work this out using certain answers to questions in the bKash
form…however, it would be much more logical if this number could be
dependent on the filling out of the form.

  1. I need to work out the logic by which I can calculate how many
    episodes each case has (depending if one, two or no bKash forms have been
    filled out).

  2. I also need this to value to be stored within one hidden value
    which I can display on the case details.

If anyone could help me I would be extremely grateful! My brain cannot
work it out at all!

Heidi


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.


Jeremy Wacksman
Dimagi http://www.dimagi.com, Inc.


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.


Fiorenzo Conte
Project Manager | Gestionnaire de projet
West Africa | Afrique de l’Ouest
Dimagi, Inc
m : +221 77 293 91 89 | s : fioreco86
http://www.dimagi.com/


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 Will,

Yes I believe this is exactly what is happening but I don’t know how to get
round it! I can’t seem to load the updated count value without running
against all kinds of errors!

Heidi

··· On Monday, 8 June 2015 20:48:50 UTC+6, William Pride wrote: > > Heidi, > > Its a bit hard for me to grok the XForm from a just a textual description > but I believe the issue might be here: > > 2. Hidden Value (prev_count - loaded with prev_count from 1st form) > > and > > (save data to case properties): 1. count - count > > Is it possible that the form is always loading the "prev_count" case value > from the first form instead of the updated "count" case value from the > follow up form? I think this would explain the behavior you're seeing. > > Best, > Will > > On Sun, Jun 7, 2015 at 12:56 AM Heidi Lowe <heidijo...@gmail.com > wrote: > >> Hi everyone, >> >> Thanks for all your help. Fiorenzo, I am sure I am loading in the >> "prev_count" into the case property "count". And I have been saving it >> afterwards back into case management so it appears as a case detail. >> >> I tried to do a simplified 'test' version with no extenuating questions >> to distract me. I found I still could not get it to work. Here is my 'Test' >> Module work: >> >> 1st Form (Registration)(this form registers a new case): 1. Question >> (Name), 2. Hidden Value (prev_count set as 0), 3. Label for hidden value. >> 1st Form Case Management (data saved to case properties): 1. Artisan's >> name - name, 2. hidden value prev_count - prev_count >> >> 2nd Form (bKash)(updates or closes a case): 1. Question (How much?) 2. >> Hidden Value (prev_count - loaded with prev_count from 1st form), 3. Label >> of previous count, 4. Hidden value (count - calculate condition = >> /data/prev_count+1), 5. Label of current count. >> 2nd Form Case Management(load case properties into form): 1. prev_count - >> hidden value prev_count. (save data to case properties): 1. count - count >> >> I loaded my 'count' value into my case list and it reflects the fact that >> I after I fill out one bKash form the count goes to 1, when I fill out two >> or more the prev_count stays at 0 so hence the count stays at 1... >> >> Any help is greatly appreciated, >> >> Heidi >> >> >> >> >> On Thursday, 4 June 2015 17:17:13 UTC+6, fconte wrote: >> >>> Hey Heidi, >>> >>> Can you check that you're loading the case property "count" into the >>> hidden value "prev_count" on the case management of the form? and also that >>> you save it the question "count" to the case? >>> >> On Thu, Jun 4, 2015 at 9:39 AM, Jeremy W. wrote: >>> >> Hi Heidi, >>>> >>>> I'm not sure if this will help, but there is an example of a counter on >>>> the help site: >>>> >>>> https://help.commcarehq.org/display/commcarepublic/General+Workflow+Suggestions#GeneralWorkflowSuggestions-HowcanImakeaformdisappearfromaformlistonceithasbeenfilledout,ormakeformsappearinsequence >>>> ? >>>> >>>> Otherwise if you could describe your hidden values and case management >>>> we could try to help. >>>> >>>> Thanks, >>>> >>>> Jeremy >>>> >>>> >>>> On Thu, Jun 4, 2015 at 6:20 AM, Heidi Lowe wrote: >>>> >>> Hi there, >>>>> >>>>> Thanks for all your help, your suggestions are exactly what I've been >>>>> trying to do for a long time, however, what I have found with this method >>>>> is that my exact same function will only +1 when I run the form once, I >>>>> have never been able to get the function to work the second time (when I >>>>> complete the second form) to bring the number up to 2! >>>>> >>>>> Do you have any idea what could be the problem for this?? I am >>>>> especially intrigued if you use this method to count in your apps, but I >>>>> tried to follow both of you step by step but came out with the same problem. >>>>> >>>>> Thanks again, >>>>> >>>>> Heidi >>>>> >>>>> >>>>> On Tuesday, 2 June 2015 14:08:41 UTC+6, Heidi Lowe wrote: >>>>>> >>>>>> Hi there, >>>>>> >>>>>> I am really stumped by an issue I am trying to resolve, I feel like >>>>>> there is some simple logic to it, if anyone could help I would really >>>>>> appreciate it. >>>>>> >>>>>> We have a Health Scheme where Each case has 2 episodes when they are >>>>>> registered. However, if one form 'bKash' is filled out then the case now >>>>>> has 1 episode left, if two bKash forms are filled out then the case has no >>>>>> episodes left and no more bKash forms may be filled out. I have been trying >>>>>> to work this out using certain answers to questions in the bKash >>>>>> form....however, it would be much more logical if this number could be >>>>>> dependent on the filling out of the form. >>>>>> >>>>>> 1) I need to work out the logic by which I can calculate how many >>>>>> episodes each case has (depending if one, two or no bKash forms have been >>>>>> filled out). >>>>>> >>>>>> 2) I also need this to value to be stored within one hidden value >>>>>> which I can display on the case details. >>>>>> >>>>>> If anyone could help me I would be extremely grateful! My brain >>>>>> cannot work it out at all! >>>>>> >>>>>> Heidi >>>>>> >>>>> -- >>>>> 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. >>>>> >>>> -- >>>> Jeremy Wacksman >>>> Dimagi , Inc. >>>> >>>> -- >>>> 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. >>>> >>> >>> >>> >>> -- >>> *Fiorenzo Conte* >>> Project Manager | Gestionnaire de projet >>> West Africa | Afrique de l'Ouest >>> Dimagi, Inc >>> m : +221 77 293 91 89 | s : fioreco86 >>> http://www.dimagi.com/ >>> >>> >>> >>> -- >> 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. >> >

Heidi,

To confirm the proper pattern should be:

“count” case variable loaded into “prev_count” hidden value in form
"count" hidden value is set to hidden value (“prev_count” + 1)
“count” hidden value is saved into “count” case variable

What errors do you see when you have this configuration?

Thanks,
Will

··· On Tue, Jun 9, 2015 at 1:41 AM, Heidi Lowe wrote:

Hi Will,

Yes I believe this is exactly what is happening but I don’t know how to
get round it! I can’t seem to load the updated count value without running
against all kinds of errors!

Heidi

On Monday, 8 June 2015 20:48:50 UTC+6, William Pride wrote:

Heidi,

Its a bit hard for me to grok the XForm from a just a textual description
but I believe the issue might be here:

  1. Hidden Value (prev_count - loaded with prev_count from 1st form)

and

(save data to case properties): 1. count - count

Is it possible that the form is always loading the “prev_count” case
value from the first form instead of the updated “count” case value from
the follow up form? I think this would explain the behavior you’re seeing.

Best,
Will

On Sun, Jun 7, 2015 at 12:56 AM Heidi Lowe heidijo...@gmail.com wrote:

Hi everyone,

Thanks for all your help. Fiorenzo, I am sure I am loading in the
"prev_count" into the case property “count”. And I have been saving it
afterwards back into case management so it appears as a case detail.

I tried to do a simplified ‘test’ version with no extenuating questions
to distract me. I found I still could not get it to work. Here is my 'Test’
Module work:

1st Form (Registration)(this form registers a new case): 1. Question
(Name), 2. Hidden Value (prev_count set as 0), 3. Label for hidden value.
1st Form Case Management (data saved to case properties): 1. Artisan’s
name - name, 2. hidden value prev_count - prev_count

2nd Form (bKash)(updates or closes a case): 1. Question (How much?) 2.
Hidden Value (prev_count - loaded with prev_count from 1st form), 3. Label
of previous count, 4. Hidden value (count - calculate condition =
/data/prev_count+1), 5. Label of current count.
2nd Form Case Management(load case properties into form): 1. prev_count

  • hidden value prev_count. (save data to case properties): 1. count - count

I loaded my ‘count’ value into my case list and it reflects the fact
that I after I fill out one bKash form the count goes to 1, when I fill out
two or more the prev_count stays at 0 so hence the count stays at 1…

Any help is greatly appreciated,

Heidi

On Thursday, 4 June 2015 17:17:13 UTC+6, fconte wrote:

Hey Heidi,

Can you check that you’re loading the case property “count” into the
hidden value “prev_count” on the case management of the form? and also that
you save it the question “count” to the case?

On Thu, Jun 4, 2015 at 9:39 AM, Jeremy W. jwac...@dimagi.com wrote:

Hi Heidi,

I’m not sure if this will help, but there is an example of a counter
on the help site:

https://help.commcarehq.org/display/commcarepublic/General+Workflow+Suggestions#GeneralWorkflowSuggestions-HowcanImakeaformdisappearfromaformlistonceithasbeenfilledout,ormakeformsappearinsequence
?

Otherwise if you could describe your hidden values and case management
we could try to help.

Thanks,

Jeremy

On Thu, Jun 4, 2015 at 6:20 AM, Heidi Lowe heidijo...@gmail.com wrote:

Hi there,

Thanks for all your help, your suggestions are exactly what I’ve been
trying to do for a long time, however, what I have found with this method
is that my exact same function will only +1 when I run the form once, I
have never been able to get the function to work the second time (when I
complete the second form) to bring the number up to 2!

Do you have any idea what could be the problem for this?? I am
especially intrigued if you use this method to count in your apps, but I
tried to follow both of you step by step but came out with the same problem.

Thanks again,

Heidi

On Tuesday, 2 June 2015 14:08:41 UTC+6, Heidi Lowe wrote:

Hi there,

I am really stumped by an issue I am trying to resolve, I feel like
there is some simple logic to it, if anyone could help I would really
appreciate it.

We have a Health Scheme where Each case has 2 episodes when they are
registered. However, if one form ‘bKash’ is filled out then the case now
has 1 episode left, if two bKash forms are filled out then the case has no
episodes left and no more bKash forms may be filled out. I have been trying
to work this out using certain answers to questions in the bKash
form…however, it would be much more logical if this number could be
dependent on the filling out of the form.

  1. I need to work out the logic by which I can calculate how many
    episodes each case has (depending if one, two or no bKash forms have been
    filled out).

  2. I also need this to value to be stored within one hidden value
    which I can display on the case details.

If anyone could help me I would be extremely grateful! My brain
cannot work it out at all!

Heidi


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.


Jeremy Wacksman
Dimagi http://www.dimagi.com, Inc.


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.


Fiorenzo Conte
Project Manager | Gestionnaire de projet
West Africa | Afrique de l’Ouest
Dimagi, Inc
m : +221 77 293 91 89 | s : fioreco86
http://www.dimagi.com/


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.