Follow up visit number - error in calculation

Hi,

In our app we use case management, and we have children returning for
weekly follow-up visits. The same module of forms in administered each time
they return. To track which form is for which follow-up visit, we have a
visit count which is generated each time.

However, looking at the data there are lots of instances where there is one
ID number who has 2 forms with visit count 2, but none for visit count 1.
Or 2 forms for visit count 3 which should be visit 3 and 4… I can see by
the dates that they were done 1 week apart, so something is going wrong,
but I can’t work out what!!

Any advice much appreciated!!!

This is the calculation code we have:

Question ID: fu_visit count

Calculate condition: if(#form/prev_fu_visit_count = “”, 1,
#form/prev_fu_visit_count + 1)

Question ID: prev_fu_visit_count
Calculate condition: #case/fu_visit_count

There are 2 forms in the follow-up module. Each one has the two
calculations listed above for fu_visit_count and prev_fu_visit_count. One
of the forms saves the fu_visit_count to the case management data. The
other form doesn’t. Is this perhaps the issue?? Could it be something to do
with the order which these two forms are completed? As sometimes it seems
to be correct and other times not…

Please help! Im confused!!

Best wishes,

Natasha

Hi Natasha,

··· On Wed, Jun 28, 2017 at 12:37 PM, Natasha Lelijveld < natasha.lelijveld@gmail.com> wrote:

One of the forms saves the fu_visit_count to the case management data. The
other form doesn’t.

That definitely sounds like it would cause this problem - why does the
other form not increment the counter?

Other possible causes of this issue would be:

  • If the first form was saved as incomplete, then the second form was
    started before the first was submitted, both would have the same value for
    the count
  • If the two forms were filled out on separate devices then if the
    second form was filled out before syncing the data from the first, both
    would have the same count

Cheers,
Will

Hi Will,

Thanks so much for your input. Your idea about the “saved as incomplete” is
another possibility - I will have to investigate what the data collectors
are up to. They always sync immediately, so that isn’t the issue.

The two forms are done at the same follow up visit, so the count number
should be the same for both forms. But it needs to be attached to both
forms so that I can easily know when they were done.

I think the idea was that the first form would calculate the count but not
save it to the case. Then the second form would be done (on the same visit)
and the count would be calculated and this time save to the case, so next
time when the first form is done it starts of from the saved value.

But I guess if they do the two forms in a different order or if they save
as incomplete, that might mess things up.

I’ll do some further investigating !!

Thanks!

Hi Natasha,

··· On 28 Jun 2017 7:57 pm, "William Pride" wrote:

On Wed, Jun 28, 2017 at 12:37 PM, Natasha Lelijveld < natasha.lelijveld@gmail.com> wrote:

One of the forms saves the fu_visit_count to the case management data. The
other form doesn’t.

That definitely sounds like it would cause this problem - why does the
other form not increment the counter?

Other possible causes of this issue would be:

  • If the first form was saved as incomplete, then the second form was
    started before the first was submitted, both would have the same value for
    the count
  • If the two forms were filled out on separate devices then if the
    second form was filled out before syncing the data from the first, both
    would have the same count

Cheers,
Will


You received this message because you are subscribed to a topic in the
Google Groups “commcare-users” group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/commcare-users/GsgNxN9FRf8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Natasha,

Interesting, that makes sense. You should be able to tell whether the form
was saved as incomplete by looking at the timeEnd and timeStart fields
of the form - if one form is started, then the next form started before the
first form is completed that would cause this issue.

Let us know if you can’t find the source of the problem!

Cheers,
Will

··· On Wed, Jun 28, 2017 at 2:41 PM, Natasha Lelijveld < natasha.lelijveld@gmail.com> wrote:

Hi Will,

Thanks so much for your input. Your idea about the "saved as incomplete"
is another possibility - I will have to investigate what the data
collectors are up to. They always sync immediately, so that isn’t the
issue.

The two forms are done at the same follow up visit, so the count number
should be the same for both forms. But it needs to be attached to both
forms so that I can easily know when they were done.

I think the idea was that the first form would calculate the count but not
save it to the case. Then the second form would be done (on the same visit)
and the count would be calculated and this time save to the case, so next
time when the first form is done it starts of from the saved value.

But I guess if they do the two forms in a different order or if they save
as incomplete, that might mess things up.

I’ll do some further investigating !!

Thanks!

On 28 Jun 2017 7:57 pm, “William Pride” wpride@dimagi.com wrote:

Hi Natasha,

On Wed, Jun 28, 2017 at 12:37 PM, Natasha Lelijveld < natasha.lelijveld@gmail.com> wrote:

One of the forms saves the fu_visit_count to the case management data.
The other form doesn’t.

That definitely sounds like it would cause this problem - why does the
other form not increment the counter?

Other possible causes of this issue would be:

  • If the first form was saved as incomplete, then the second form was
    started before the first was submitted, both would have the same value for
    the count
  • If the two forms were filled out on separate devices then if the
    second form was filled out before syncing the data from the first, both
    would have the same count

Cheers,
Will


You received this message because you are subscribed to a topic in the
Google Groups “commcare-users” group.
To unsubscribe from this topic, visit https://groups.google.com/d/to
pic/commcare-users/GsgNxN9FRf8/unsubscribe.
To unsubscribe from this group and all its topics, 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.