Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Case Sharing allows your field team to share responsibilities of a case load.

Excerpt
Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#EAE6FF

Multiexcerpt include macro
macro_uuid77a79df7-a5d1-4f8f-828d-6c8d8a40e9b2
nameSoftware Plan - Pro
templateDataeJyLjgUAARUAuQ==
page[Internal] CommCare Public ManagementCommCare Help Site Design Guidance
addpanelfalse

Overview

In the default CommCare model, each CommCare user has their own list of cases, comprised of the cases he/she has created. When a mobile worker registers a pregnant mother on CommCare Mobile, let's call her 'Monica' in this example, the 'Monica' case will only appear in this specific mobile worker's case list (What's a case list is? See https://dimagi.atlassian.net/wiki/x/8xrKfw). The 'Monica' case will not be show in anyone else's case list, meaning no other mobile worker can perform a follow-up visit with Monica.

...

Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#EAE6FF

Alternative Option

This page describes manually configuring case sharing groups. You can also use the Organizations feature to more easily configure this setup.

...

Unfortunately this use case is not currently supported in the app builder. However, you can configure this manually by specifying the "owner_id" property for new cases which you don't want to share to be set to the id of the current user (defined in the form as a hidden value) in the normal case property configuration screen. That will result in those cases not being shared.

Debugging Case Sharing errors

If you are here, then you probably came across the error message "The case sharing settings for your user are incorrect. This user must be in exactly one case sharing group. Please contact your supervisor" in a CommCare app on a mobile device:

...

Or via Web Apps:

...

Before we can debug this error it's important to understand a few relevant concepts:

...

shared

...

Case Ownership - every case in CommCare has an owner that can be a user (web or mobile), a user group or a location, which means that before a case can be created its ownership needs to be decided. The decision of who (or what) should be the owner is normally done by CommCare but can also be done manually, as we will explain later. However, when Case Sharing is enable this process becomes complex for CommCare as the User, the default option, is no longer acceptable.

...

The following is a list of example scenarios that could lead to this error coming up:

...

User is not assigned to a Location or Case sharing group - without a Location or Case Sharing Group associated to the mobile user, CommCare is forced to set the ownership to the user. However, setting the ownership to the user will automatically prevent the case from being shared, so CommCare prevents this behavior from happening automatically.

  1. Solution: assign the user to a Location or a Case Sharing Group

...

  1. Solution: There are two potential approaches here. You can change the configuration of the user so that they are only assigned to a single Case Sharing Group (see more in Mobile Worker Groups) or Location (see more in https://dimagi.atlassian.net/wiki/x/YzPKfw). Alternatively, you set the ownership manually within the form (see below).

...

User is assigned to a Location that can't Own cases - in this scenario, CommCare sees that the user is assigned to a Location that, according to the configuration of the Organization Level, can't own Cases.

  1. Solution: There are two potential approaches here. You can change the configuration of the location to allow it to own cases (see more in Setting up Organization Levels and Structure), or you can set the ownership manually (see below). You will need to ensure that all cases created within the form settings have an owner_id property set, including any child cases.

...

User is assigned to a Location with child Locations and View Child Data is Enabled - this is a more complex problem to solve. In this case, it typically appears that the users are correctly configured, and that each one is assigned to a single location. However, since the user has access to data in the child locations as well, the child locations are also considered valid candidates for case sharing, similarly to if the user was actually assigned to multiple locations as outlined above.

...

In this example, we can conclude that Nurse should be able to see cases from their CHWs and also to have their own cases. The error would occur when Nurse tries to create a new case, however, the app should work fine for CHW 1 and 2.

a. Solution: In this case, usually the only viable option is to set the ownership manually (setting a hidden value in the form called owner_id, manually setting it to be the location you need the case to live at, and saving it as a case property). Of course, you could turn the View Child Data option off but this would most likely go against the workflow of the app.  

Setting case ownership manually

So, at this point it's safe to assume that you have exhausted all other options and decided to set the ownership of the case manually. First, you need the ID of the owner, this can be achieved either by having the user selecting a Location or a Case Sharing group from a Multiple Choice Lookup Table question or some calculation that returns a single ID. Next, you need to instruct CommCare to assign the ownership based on that ID, for that you have to set the case property owner_id in the Case Management section of your form. Find more information about this process in  Assigning Cases to One of Multiple Locations.