Using Repeat Group with a parent Form to create child cases

Hello there,

Does anyone know how i can accomplish this? I need to register a woman
using one form, and then at the end i ask if woman has got children.

If answer is yes then i run questions within a repeat group to collect
details related to this child, and it has to repeat until the user chooses
to end (i.e. until there are no more children to be registered for that
particular woman).

Also i would like to have children registered under this repeat group be
treated as individual cases which can be tracked under a different module,
and that they should be treated as child cases of their mother
case(parent)-related to their mother in way that makes it easier for the
user to pick a mother and then show all children under that particular
mother.

This might too much, but if someone can just highlight key tips to lookout
for, will be highly appreciated!

Thanks,
Chaiwa.

Hi Chaiwa,

Yes, you can do this! Simple name the child case after a property in the
repeat group…

You can find documentation here:
https://help.commcarehq.org/display/commcarepublic/Child+Cases

“It is possible to open a child case from questions that are in a repeat
group. Note that you will not be able to use the questions in the repeat
group to update the parent case, only for the child case. This is useful if
you want to be able to open multiple child cases of one type.”

I hope this helps!
Amelia

··· On Thu, Mar 5, 2015 at 10:18 AM, Chaiwa Berian wrote:

Hello there,

Does anyone know how i can accomplish this? I need to register a woman
using one form, and then at the end i ask if woman has got children.

If answer is yes then i run questions within a repeat group to collect
details related to this child, and it has to repeat until the user chooses
to end (i.e. until there are no more children to be registered for that
particular woman).

Also i would like to have children registered under this repeat group be
treated as individual cases which can be tracked under a different module,
and that they should be treated as child cases of their mother
case(parent)-related to their mother in way that makes it easier for the
user to pick a mother and then show all children under that particular
mother.

This might too much, but if someone can just highlight key tips to lookout
for, will be highly appreciated!

Thanks,
Chaiwa.


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

Thanks for the helpful and useful explanation and links. I tried to setup
the forms following ideas on the help site but i seem to have missed it
somewhere! What is happening is that, i am able to register the
caregiver(mother) and then a repeat group question to add new child comes
up. When i agree to adding a new child, i can beautifully register the
first child and at the end if asked to add another and i say no, then the
child case is created separate from the parent case. Beautiful!

But the problem is after registering the first child and if i say yes to
adding more children, the app reports an error. The error is “uv uv
unhandled exception in gui-cip =>
java.lang.illegalArgumentException[null]”. What could be the possible cause
of this error? I expect the app to repeat creating child cases but it fails
on the second child! That is, it works fine if i just register one child,
but if more than one it fails!

Kind regards,
Chaiwa.

··· On Friday, March 6, 2015 at 1:45:55 AM UTC+2, Amelia Sagoff wrote:

Hi Chaiwa,

Yes, you can do this! Simple name the child case after a property in the
repeat group…

You can find documentation here:
https://help.commcarehq.org/display/commcarepublic/Child+Cases

“It is possible to open a child case from questions that are in a repeat
group. Note that you will not be able to use the questions in the repeat
group to update the parent case, only for the child case. This is useful if
you want to be able to open multiple child cases of one type.”

I hope this helps!
Amelia

On Thu, Mar 5, 2015 at 10:18 AM, Chaiwa Berian <chaiwa...@gmail.com <javascript:>> wrote:

Hello there,

Does anyone know how i can accomplish this? I need to register a woman
using one form, and then at the end i ask if woman has got children.

If answer is yes then i run questions within a repeat group to collect
details related to this child, and it has to repeat until the user chooses
to end (i.e. until there are no more children to be registered for that
particular woman).

Also i would like to have children registered under this repeat group be
treated as individual cases which can be tracked under a different module,
and that they should be treated as child cases of their mother
case(parent)-related to their mother in way that makes it easier for the
user to pick a mother and then show all children under that particular
mother.

This might too much, but if someone can just highlight key tips to
lookout for, will be highly appreciated!

Thanks,
Chaiwa.


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 <javascript:>.
For more options, visit https://groups.google.com/d/optout.

Hi Chaiwa,

I’d like to take a closer look at this error as it sounds like this may be
a bug. I’ll follow up with you on a new thread, but I’ll post back to this
thread with our conclusions.

Cheers,

Nate

··· On Tue, Mar 10, 2015 at 2:21 PM, Chaiwa Berian wrote:

Hi Amelia,

Thanks for the helpful and useful explanation and links. I tried to setup
the forms following ideas on the help site but i seem to have missed it
somewhere! What is happening is that, i am able to register the
caregiver(mother) and then a repeat group question to add new child comes
up. When i agree to adding a new child, i can beautifully register the
first child and at the end if asked to add another and i say no, then the
child case is created separate from the parent case. Beautiful!

But the problem is after registering the first child and if i say yes to
adding more children, the app reports an error. The error is “uv uv
unhandled exception in gui-cip =>
java.lang.illegalArgumentException[null]”. What could be the possible cause
of this error? I expect the app to repeat creating child cases but it fails
on the second child! That is, it works fine if i just register one child,
but if more than one it fails!

Kind regards,
Chaiwa.

On Friday, March 6, 2015 at 1:45:55 AM UTC+2, Amelia Sagoff wrote:

Hi Chaiwa,

Yes, you can do this! Simple name the child case after a property in the
repeat group…

You can find documentation here: https://help.commcarehq.
org/display/commcarepublic/Child+Cases

“It is possible to open a child case from questions that are in a repeat
group. Note that you will not be able to use the questions in the repeat
group to update the parent case, only for the child case. This is useful if
you want to be able to open multiple child cases of one type.”

I hope this helps!
Amelia

On Thu, Mar 5, 2015 at 10:18 AM, Chaiwa Berian chaiwa...@gmail.com wrote:

Hello there,

Does anyone know how i can accomplish this? I need to register a woman
using one form, and then at the end i ask if woman has got children.

If answer is yes then i run questions within a repeat group to collect
details related to this child, and it has to repeat until the user chooses
to end (i.e. until there are no more children to be registered for that
particular woman).

Also i would like to have children registered under this repeat group be
treated as individual cases which can be tracked under a different module,
and that they should be treated as child cases of their mother
case(parent)-related to their mother in way that makes it easier for the
user to pick a mother and then show all children under that particular
mother.

This might too much, but if someone can just highlight key tips to
lookout for, will be highly appreciated!

Thanks,
Chaiwa.


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.


Nate Haduch

Technical Support Analyst
Dimagi, Inc | 585 Massachusetts Ave | Suite 3 | Cambridge, MA 02139
web: http://www.dimagi.com/

Hi CommCare-Users,

We were able to find the source of this issue for this case, which is
a display issue for repeat groups for certain J2ME phones. We have made a
fix for this case for CommCare ODK 2.20, but a workaround may be available
in the meantime for anyone who is encountering difficulties with repeat
groups on Java phones.

Thanks,

··· -- Nate Haduch

Technical Support Analyst
Dimagi, Inc | 585 Massachusetts Ave | Suite 3 | Cambridge, MA 02139
web: http://www.dimagi.com/

On Tue, Mar 10, 2015 at 10:46 AM, Nate Haduch nhaduch@dimagi.com wrote:

Hi Chaiwa,

I’d like to take a closer look at this error as it sounds like this may be
a bug. I’ll follow up with you on a new thread, but I’ll post back to this
thread with our conclusions.

Cheers,

Nate

On Tue, Mar 10, 2015 at 2:21 PM, Chaiwa Berian chaiwa.berian@gmail.com wrote:

Hi Amelia,

Thanks for the helpful and useful explanation and links. I tried to setup
the forms following ideas on the help site but i seem to have missed it
somewhere! What is happening is that, i am able to register the
caregiver(mother) and then a repeat group question to add new child comes
up. When i agree to adding a new child, i can beautifully register the
first child and at the end if asked to add another and i say no, then the
child case is created separate from the parent case. Beautiful!

But the problem is after registering the first child and if i say yes to
adding more children, the app reports an error. The error is “uv uv
unhandled exception in gui-cip =>
java.lang.illegalArgumentException[null]”. What could be the possible cause
of this error? I expect the app to repeat creating child cases but it fails
on the second child! That is, it works fine if i just register one child,
but if more than one it fails!

Kind regards,
Chaiwa.

On Friday, March 6, 2015 at 1:45:55 AM UTC+2, Amelia Sagoff wrote:

Hi Chaiwa,

Yes, you can do this! Simple name the child case after a property in
the repeat group…

You can find documentation here: https://help.commcarehq.
org/display/commcarepublic/Child+Cases

“It is possible to open a child case from questions that are in a
repeat group. Note that you will not be able to use the questions in the
repeat group to update the parent case, only for the child case. This is
useful if you want to be able to open multiple child cases of one type.”

I hope this helps!
Amelia

On Thu, Mar 5, 2015 at 10:18 AM, Chaiwa Berian chaiwa...@gmail.com wrote:

Hello there,

Does anyone know how i can accomplish this? I need to register a woman
using one form, and then at the end i ask if woman has got children.

If answer is yes then i run questions within a repeat group to collect
details related to this child, and it has to repeat until the user chooses
to end (i.e. until there are no more children to be registered for that
particular woman).

Also i would like to have children registered under this repeat group
be treated as individual cases which can be tracked under a different
module, and that they should be treated as child cases of their mother
case(parent)-related to their mother in way that makes it easier for the
user to pick a mother and then show all children under that particular
mother.

This might too much, but if someone can just highlight key tips to
lookout for, will be highly appreciated!

Thanks,
Chaiwa.


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.


Nate Haduch

Technical Support Analyst
Dimagi, Inc | 585 Massachusetts Ave | Suite 3 | Cambridge, MA 02139
web: http://www.dimagi.com/

Hello Chaiwa_Berian, I have just started to use CommCare and I am trying to repeat a group of questions until the user chooses to end, but unlike you I don’t need the child case to be separeated from the parent. I need help as I don’t have the option asking to add another group, it just skips all the block of questions. How could you achieve it? Thanks in advance.

Hi @roberto88,

If you have correctly setup the repeat group, the skip shouldn’t happen! However, I would suspect the following to cause the skip:

  1. From my experience, repeat groups don’t work if you are testing using CommCare’s Form Player(Emulator) unless this has been fixed, so you need to test that using the actual phone/device.

  2. The Question Type may not have been a Repeat Group! Check and ensure it is the correct question type! Also make sure all the questions you want repeated are placed inside the Repeat Group Question!

  3. The display condition on the repeat group may be returning false all the time, so please check to ensure that the display condition is correct!

  4. You may not have setup the Repeat Count correctly.

To answer the second part of your question on how I would achieve this kind of scenario, here are a few tips:

  1. Add a question outside the repeat group which will determine whether to repeat a group of questions or not. Drag this question into the display condition for the repeat group, set it so it evaluates to true whenever you want to repeat that group of questions. E.g., in the display condition for the repeat group you would put caregiver_has_children=‘yes’ . This assumes caregiver_has_children is the question outside the repeat group which determines whether to display the questions in the group or not. So whenever the user indicates that the caregiver has children, the questions in the repeat group will be displayed!

  2. Since you do not want to pre-determine how many times the App should repeat the group of questions, leave the repeat count as it is(i.e. blank)! By default, CommCare will repeat the questions in the repeat group as long as the user keeps on “tapping” on “Add Group” of the three options that show up at the end of the repeat question.

  3. If you would like the App to repeat those questions a certain number of times, then you need to add a question outside repeat group which will determine the number of times the questions will be repeated. Drag that question into the repeat count property of the repeat group question! Remember it has to be a question, it cannot be a literal value directly typed in the repeat cout! E.g. The question would ask the user how many children does the caregiver have?, then depending on the number of children indicated by the user, the group of questions will repeat that number of times!

  4. Since you do not want child cases to be created, this is all you may need to do or check! Let me know if this helps. You can also read more here!

Thanks and kind regards,
Chaiwa.

Thank you very much Chaiwa_Berian the information has been very helpful.

Best regards,
Roberto