Store number of forms as a case field

Hi everyone,

We have a "patient consultation" form where the case informations are
displayed after selecting a patient. In this case summary we'd like to
show the number of time this "patient consultation" form has been filled
for a given patient.

What could be the best way to achieve that ?

Many 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 +95 9 431 978 25 Skype: charles.fleche

Hi Charles,

The easiest way to implement this is with a single case property that gets
incremented by 1 each time the form is filled in. Let us know if you need
more guidance than that.

Cory

··· On Tue, Jul 8, 2014 at 4:13 PM, Charles Flèche wrote:

Hi everyone,

We have a "patient consultation" form where the case informations are
displayed after selecting a patient. In this case summary we'd like to show
the number of time this "patient consultation" form has been filled for a
given patient.

What could be the best way to achieve that ?

Many 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
+95 9 431 978 25
Skype: charles.fleche

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

The easiest way to implement this is with a single case property that
gets incremented by 1 each time the form is filled in. Let us know if
you need more guidance than that.

Actually yes. Is there some doc in the wiki to implement such an
incrementation ?

Many thanks,

··· On 08/07/2014 19:10, Cory Zue wrote:

--
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
+95 9 431 978 25
Skype: charles.fleche

Hi Charles,

The easiest way to implement this is with a single case property that
gets incremented by 1 each time the form is filled in. Let us know if
you need more guidance than that.

Actually yes. Is there some doc in the wiki to implement such an
incrementation ?

So basically you would have a add a few hidden values to the form. One
could be last_form_count and the other could be next_form_count.
last_form_count would load a case property called "form_count".
next_form_count would have a calculate expression that was equal to
last_form_count + 1, and would update the "form_count" case property. The
end result will be that the case property gets incremented by one each
time. You may also have to add logic so that "last_form_count" gets a
proper default value of 0 the first time.

Am hoping others on this list who are more experienced app builders can
fill in the details if you need more than that. I'd also encourage you to
check out the common logic expressions wiki page:
https://confluence.dimagi.com/display/commcarepublic/Common+Logic+and+Calculations

Cory

··· On Wed, Jul 9, 2014 at 1:45 PM, Charles Flèche wrote: > On 08/07/2014 19:10, Cory Zue wrote:

Many 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
+95 9 431 978 25
Skype: charles.fleche

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

Hello Charles,

Cory provided the relevant information, but here it is organized a little
differently on the CommCare Help Site:
https://help.commcarehq.org/display/commcarepublic/General+Workflow+Suggestions#GeneralWorkflowSuggestions-HowcanIreferencethenumberoftimesagivenformhasbeenfilledout
?

Jeremy

··· On Wed, Jul 9, 2014 at 3:00 PM, Cory Zue wrote:

Hi Charles,

On Wed, Jul 9, 2014 at 1:45 PM, Charles Flèche mhealth-myanmar@tsfi.org wrote:

On 08/07/2014 19:10, Cory Zue wrote:

The easiest way to implement this is with a single case property that
gets incremented by 1 each time the form is filled in. Let us know if
you need more guidance than that.

Actually yes. Is there some doc in the wiki to implement such an
incrementation ?

So basically you would have a add a few hidden values to the form. One
could be last_form_count and the other could be next_form_count.
last_form_count would load a case property called "form_count".
next_form_count would have a calculate expression that was equal to
last_form_count + 1, and would update the "form_count" case property. The
end result will be that the case property gets incremented by one each
time. You may also have to add logic so that "last_form_count" gets a
proper default value of 0 the first time.

Am hoping others on this list who are more experienced app builders can
fill in the details if you need more than that. I'd also encourage you to
check out the common logic expressions wiki page:
Common Logic and Calculations - CommCare Public - CommCare Public

Cory

Many 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
+95 9 431 978 25
Skype: charles.fleche

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