Case Linking (Parent/ChildCases)

Dear All,

We already have Parent/Child Case features in our application and we would
like to expose/load the parent case_id to child cases when doing
registration or we would like to have the parent case_id data-node appear
on child case exports as parent_id.
Has anyone faced this scenario and how did you implement it?
Is this already build in Commcare case exports for Child Cases?

··· -- Regards, Moses

github: katembu http://github.com/katembu
twitter: mkatembu http://twitter.com/mkatembu
skype:* katembu*

Hi Moses,

Unfortunately that isn't easily possible - when you do an export, you'll
actually get two tables. The first one lists all the child cases, and the
other one maps the child cases to their parent case IDs. Its a bit clunky

In your forms, in the case config section, you can also try loading
parent/@case_id or index/parent (i'm not sure either will work but worth
trying).

Thanks,
Sheel

··· On Thursday, May 21, 2015, Moses Katembu wrote:

Dear All,

We already have Parent/Child Case features in our application and we would
like to expose/load the parent case_id to child cases when doing
registration or we would like to have the parent case_id data-node appear
on child case exports as parent_id.
Has anyone faced this scenario and how did you implement it?
Is this already build in Commcare case exports for Child Cases?

--
Regards,
Moses

github: katembu http://github.com/katembu
twitter: mkatembu http://twitter.com/mkatembu
skype:* katembu*

--
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
<javascript:_e(%7B%7D,'cvml','commcare-users%2Bunsubscribe@googlegroups.com');>
.
For more options, visit https://groups.google.com/d/optout.

--
Sheel Shah
Project Manager | Dimagi
m: +1.781.428.5419 | skype: sheel_shah

Hey Sheel -- I am sure I am misunderstanding this thread... but when I read
Moses's words, "expose/load the parent case_id to child cases when doing
registration," is that not that different from the technique you showed me,
where, when a form creates a child case, you can simply pass the parent
form's case_id to the child simply by means of the case management field?

That seems too easy, there must be something I'm misunderstanding.

Eric

Hi Eric-

Thanks for the reply. I hope I am getting you correctly: are you basically
just saying to add parent_id to the case management field properties during
child registration? If so, it is a good idea, and would work for only
prospective registrations, correct? How about all the retrospective
children, ie those who have been registered in the past. When we export
the case list, they will not have the parent_id attached to them will they?

Thanks again-

··· On Friday, May 22, 2015 at 12:34:04 PM UTC+3, Eric Stephan wrote: > > > Hey Sheel -- I am sure I am misunderstanding this thread... but when I > read Moses's words, "expose/load the parent case_id to child cases when > doing registration," is that not that different from the technique you > showed me, where, when a form creates a child case, you can simply pass the > parent form's case_id to the child simply by means of the case management > field? > > That seems too easy, there must be something I'm misunderstanding. > > Eric > >

Hi there -- I'm running out of the office right now, and wanted to make a
quick reply for now. (Also, not certain I can speak clearly to your
questions so it's maybe better for Sheel to reply and point out that I am
totally misunderstanding you guys.)

But just for a summary of what I did for my own "wanting to pass the
owner_id to a child case so that it would have the same owner as the case
that created it," ... please see the answer that Jeremy gave to my thread
here: Redirecting to Google Groups

Eric

Hi Sheel,

Thank you for your response. I had tried the two method you've suggested
and none seemed worked. Just retested again to affirm this.
Also I haven't found a common data_node to link the two tables. Would you
mind sharing the data_node that link cases between the two tables.

··· On Fri, May 22, 2015 at 1:25 PM, Eric Stephan wrote:

Hi there -- I'm running out of the office right now, and wanted to make a
quick reply for now. (Also, not certain I can speak clearly to your
questions so it's maybe better for Sheel to reply and point out that I am
totally misunderstanding you guys.)

But just for a summary of what I did for my own "wanting to pass the
owner_id to a child case so that it would have the same owner as the case
that created it," ... please see the answer that Jeremy gave to my thread
here: Redirecting to Google Groups

Eric

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

--
Regards,
Moses

github: katembu http://github.com/katembu
twitter: mkatembu http://twitter.com/mkatembu
skype:* katembu*

Just to add to the discussion, another way to link the parent case to the
child case is to include "Parent Case" in the custom child exports
(selecting row.number and case_id and case_type if you want). I linked the
row.number from the child cases excel sheet to the row.number from the
parent case excel sheet, and you will have the child case_id with the
parent case_id.

··· On Friday, May 22, 2015 at 8:13:06 PM UTC+3, Moses Katembu wrote: > > Hi Sheel, > > Thank you for your response. I had tried the two method you've suggested > and none seemed worked. Just retested again to affirm this. > Also I haven't found a common data_node to link the two tables. Would you > mind sharing the data_node that link cases between the two tables. > > On Fri, May 22, 2015 at 1:25 PM, Eric Stephan <este...@fhi360.org > wrote: > >> >> Hi there -- I'm running out of the office right now, and wanted to make a >> quick reply for now. (Also, not certain I can speak clearly to your >> questions so it's maybe better for Sheel to reply and point out that I am >> totally misunderstanding you guys.) >> >> But just for a summary of what I did for my own "wanting to pass the >> owner_id to a child case so that it would have the same owner as the case >> that created it," ... please see the answer that Jeremy gave to my thread >> here: https://groups.google.com/forum/#!topic/commcare-users/awKPmRp80g8 >> >> Eric >> >> -- >> 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. >> > > > > -- > Regards, > Moses > > github: *katembu * > twitter: *mkatembu * > skype:* katembu* >

Thanks for the update Kai - I think that's the only way (for now) to get a
data export linking parent and child cases. Moses, I would put your other
suggestions on our Uservoice (dimagi.uservoice.com).

Thanks,
Sheel

··· On Tue, May 26, 2015 at 4:23 PM, Kai Cowger wrote:

Just to add to the discussion, another way to link the parent case to the
child case is to include "Parent Case" in the custom child exports
(selecting row.number and case_id and case_type if you want). I linked the
row.number from the child cases excel sheet to the row.number from the
parent case excel sheet, and you will have the child case_id with the
parent case_id.

On Friday, May 22, 2015 at 8:13:06 PM UTC+3, Moses Katembu wrote:

Hi Sheel,

Thank you for your response. I had tried the two method you've suggested
and none seemed worked. Just retested again to affirm this.
Also I haven't found a common data_node to link the two tables. Would you
mind sharing the data_node that link cases between the two tables.

On Fri, May 22, 2015 at 1:25 PM, Eric Stephan este...@fhi360.org wrote:

Hi there -- I'm running out of the office right now, and wanted to make
a quick reply for now. (Also, not certain I can speak clearly to your
questions so it's maybe better for Sheel to reply and point out that I am
totally misunderstanding you guys.)

But just for a summary of what I did for my own "wanting to pass the
owner_id to a child case so that it would have the same owner as the case
that created it," ... please see the answer that Jeremy gave to my thread
here:
Redirecting to Google Groups

Eric

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

--
Regards,
Moses

github: katembu http://github.com/katembu
twitter: mkatembu http://twitter.com/mkatembu
skype:* katembu*

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

--
Sheel Shah
Project Manager | Dimagi
m: +1.781.428.5419 | skype: sheel_shah