How to configure Advanced Modules to force selection of parent case?

Hi,

I'd like be able to configure an Advanced Module to replicate the behavior of Basic Modules that have the Parent Child Selection option enabled:

The expected behavior is: When the user enters the (Advanced) Module, s/he is prompted to select a parent case right away, then the list of child cases appears (that case type is the one configured for the Advanced Module).

Help much appreciated.

Thanks,

In an advanced module this logic is pushed into the Actions configuration under an individual form's Case Management.

If you load multiple cases, you can specify a constraint relationship in the Conditions section:

I believe this will restrict the case selection the way you are intending.

Hi Clayton,

Thanks for your answer. Let me give bit more context (should have in the first post).

I am trying to implement the workflow where you have the registration form in the case list (meaning the registration form is in a separate module). This is Case Type Pregnancy. Pregnancy is a sub case of Case Type Woman.

I am not organizing forms with parent/child modules because Pregnancy has child cases of its own. So both Pregnancy and Woman are top level modules.

I am using Advances Modules to implement this workflow because I want to use Shadow Form in order to avoid duplicating a complex form.

With the Parent Child Selection option in Basic Modules the user is first prompted to select the Woman, before the Pregnancy case list (with the reg. form at the bottom) is displayed. That's the behavior I'd like to replicate.

I am a bit confused because the logic is pushed to Actions in the forms, and this seems to be a module setting since the intended behavior should happen before the user clicks on a form.

Cheers,

The model for advanced modules is more similar to the mobile app data model where each entry (form) defines it's own set of datums (actions).

In basic modules we assume that all forms will operate on the same set of data and hence push the some of the configuration up to the module level. For advanced modules this decision is left to the app builder.

Thanks Simon. I get what you are saying.

It's just that I don't see were to configure the fact that the parent list of cases (woman) should be displayed before displaying the list of child cases (pregnancy), since this should happen before the user clicks on a form.

Oh I see. You need to add 2 actions. The first will load the 'parent' case and the 2nd will load the 'child' case:

image

In the config of the 'child' case action you will see a 'Conditions' section in which you can configure the action to link it to the parent case:

image

Thanks Simon. In your example your action suggests that the form is updating the child case. I'd like the form to open a new case.

Here's the app structure:

image

Modules AM - Woman - Register and AM -Pregnancy - Register are hidden since they are only used to provide registration forms in their respective corresponding case lists AM - Woman and AM - Pregnancy. Pregnancy is a child case of Woman.

The exact workflow I'd like to implement is:

  1. User click on the AM - Woman module => The Woman case list is displayed with the Register Woman (AM) form button at the bottom.
  2. The user clicks on the Register Woman (AM) form and register a new woman.
  3. The user navigates back to the main menu
  4. The user clicks on the AM - Pregnancy module => The list of Woman is displayed (the parent cases is displayed - that's what I can't get configured properly)
  5. The user selects a woman
  6. The case list of Pregnancies for that woman is displayed with the Register Pregnancy (AM) form button at the bottom.
  7. The user either opens the registration form or selects a Pregnancy case.

Because the logic is set on Actions at the form level, I assume that I have to configure the Register Pregnancy (AM). I don't know where else it would make sense with my current understanding (but also feel weird).

That form has the following actions:

  • Load a Woman case
  • Open Pregnancy case with Parent Indices to set up the parent/child relationship

The result is that when the user clicks on the AM - Pregnancy module the list all pregnancies is displayed. When the user clicks on the Register Pregnancy (AM) form button at the bottom of the case list, s/he indeed gets to select the Woman and then access the registration form.

If I do what you suggest, the registration form becomes an update form and I lose the "registration form at the bottom of the case list" feature. What you suggests makes sense if you want to select (not create) the child case based on a initial selection of the parent case.

You can check this out here.

Sorry for the back and forth here. I hope this clarifies further what I am trying to achieve, and how (the how is the problem :slight_smile:).

Thanks

Bumping this hoping someone can take a quick look.

Thanks,

Hi Guillaume

  1. The user clicks on the AM - Pregnancy module => The list of Woman is displayed (the parent cases is displayed - that's what I can't get configured properly)

You'll need to add an action to the 'Update Pregnancy' form that loads the Woman case. This is the same as you have configured for the 'Register Pregnancy' form (except for Update Pregnancy you are going to have 2 load/update actions instead of 1 load and 1 open).

Because the logic is set on Actions at the form level, I assume that I have to configure the Register Pregnancy (AM) . I don't know where else it would make sense with my current understanding (but also feel weird).

The 'registration from the case list' form is configured at the module level (since it's applied to the case list). It seems like you already have this configured.

Thanks @Simon_Kelly. It works now.