Implementing flexible notification workflows in a CommCare app

Good morning!

We’re in the process of developing a fairly complex CommCare app for a study focused on childhood vaccination timeliness. Pregnant women enrolled in their third trimester will receive a home visit from a CHW before delivery, during which they’ll be registered in the CommCare app and receive a tailored knowledge intervention to address common concerns and knowledge gaps about routine childhood vaccinations.

After the birth, mothers will receive:

  • Personalized SMS reminders for upcoming vaccinations
  • Targeted messages to address any remaining knowledge gaps
  • Service notifications (e.g., stockouts or service disruptions)
  • Conditional economic incentives to encourage timely vaccination

CHWs will use the app for task planning, recording vaccination dates/due dates, and following up on missed appointments, with support via phone calls and in-person visits when needed.

One challenge we’re working through is how to track vaccine availability across health facilities. CHWs will need to call facilities a few days in advance of mothers getting their child vaccinated to confirm stock status for the vaccination (the facility will give an approximate timeline for when it will be back in stock). Each mother identifies a preferred vaccination facility as well as backup facilities. If a stockout is reported at the preferred facility, the CHW will follow up with the mother—by text or call—to recommend one of the backup facilities that has confirmed availability.

We’d like to avoid linking mothers as child cases to facilities (since they may switch), but we do want to create a system that:

  • Tracks vaccine availability by facility and vaccine type
  • Links this data to the children due for specific vaccinations
  • Allows CHWs to generate a task list for reaching out to affected mothers

Does anyone have creative ideas for how we might design this within CommCare?

Thanks so much in advance!

Hello Salome,

Thanks for posting this and I hope this message finds you well.

To design a system within CommCare that tracks vaccine availability and links this data to children due for specific vaccinations, you can consider the following approach:

  1. Facility Case Type: Create a separate case type for health facilities. Each facility case can store information about vaccine availability, including the type of vaccines available and their stock status.
  2. Vaccine Availability Form: Develop a form that CHWs or facility staff can use to update the vaccine stock status. This form can include fields for vaccine type, current stock level, and expected restock date.
  3. Linking Children to Vaccines: Instead of linking mothers or children directly to facilities, link them to the vaccine types they need. This can be done by creating a child case type that includes fields for upcoming vaccinations and due dates.
  4. Task Generation: Use CommCare's task management features to generate tasks for CHWs. When a stockout is reported, the system can automatically create tasks for CHWs to contact mothers whose children are due for the affected vaccines. These tasks can include details about backup facilities with available stock.
  5. Notification System: Implement a notification system that sends SMS or app notifications to CHWs when a facility updates its stock status by creating conditional alerts. This ensures CHWs have the latest information when planning visits or contacting mothers.
  6. Backup Facility Management: Allow mothers to select preferred and backup facilities during registration. Store this information in the child case, so CHWs know which facilities to check for availability.
    By using separate case types for facilities and children, and linking them through vaccine types and tasks, you can maintain flexibility in facility choice while ensuring timely vaccination reminders and follow-ups. Let me know in case you have any doubts here. I will try my best to help you with this.

Best,
Shiv

Hi Shiv,

Thank you so much for this thoughtful and detailed explanation—it’s incredibly helpful!

I had a couple of follow-up questions as we think through the workflow:

  1. Linking children to vaccine availability at a facility: Is there a way to ensure that if a facility reports that a specific vaccine is out of stock (e.g., for a two-week period), the stockout information can be expanded to all mothers who are due to get their child vaccinated for that vaccination during the time of the stockout? We are still unsure of how to make the link between facility-level stockout information and multiple mothers' vaccination schedules. Ideally, when a CHW or facility staff updates the stockout for a specific vaccine at a facility, the system would automatically identify all children scheduled to receive that vaccine at that facility during the stockout window and generate appropriate follow-up tasks or alerts for CHWs.
  2. CHW notification and reporting features: How might we best build a simple reporting or task feature for CHWs that lets them know they need to contact a mother due to a stockout? For example, if a child is due for Penta-3, but it’s currently unavailable at their selected facility, the system could generate a task for the CHW to either call or visit the household to inform the mother and suggest alternatives. Could this be tied to stock updates so that tasks are created automatically (i.e. child cases)?

Would love to hear your thoughts on how this could be structured in CommCare!

Best,
Salome

Hi Salome,

Thanks so much for your thoughtful follow-up questions. I’m really glad the initial suggestions were helpful. You’ve raised two important points that get at the heart of designing a responsive and efficient system. Let me walk through some options for how this can be set up in CommCare:

  1. Linking Children to Facility-Level Vaccine Stockouts

To dynamically connect vaccine stockouts at a facility to all affected children, I recommend the following approach:

a. Stockout Tracking via Facility Cases
Each facility case can include a case property for each vaccine (e.g., penta3_status) along with an optional restock_date field. These can be updated regularly via a simple facility stock update form completed by CHWs or facility staff.

b. Stockout Period Definition
When a stockout is reported, CHWs can enter:
• The vaccine type (e.g., Penta-3)
• Stock status (in/out of stock)
• Start date and expected restock date

c. Linking Logic Using Lookup Tables or Case Sharing
Rather than linking children directly to a facility case (since preferences may change), store the preferred and backup facility IDs in each child case as properties (e.g., preferred_facility_id, backup_facility_1_id).

Then, using either:
• Case Sharing + Case List Filtering, or
• Lookup Tables mapping facilities to current stock statuses,
you can filter children due for a vaccine during the stockout window by comparing:
• The child’s upcoming vaccine due date
• Their preferred facility
• The current stock status and restock window

This logic can be applied using hidden values in follow-up forms or reports to identify affected cases.

  1. Generating Tasks for CHWs Based on Stockouts

Here’s how to notify CHWs and generate follow-up tasks:

a. Auto-Flagging Affected Children
When a stockout is recorded, you can use a follow-up form or scheduled form to:
• Identify child cases whose due date for a specific vaccine falls within the stockout period
• Flag them using a property like vaccine_alert_needed = yes and specify affected_vaccine

b. Task/Follow-Up Form for CHWs
Build a custom follow-up form with a case list filter such that only child cases with vaccine_alert_needed = yes appear. The CHW can open this form to:
• View vaccine and facility stock details
• Contact the mother (via call or visit)
• Record the action taken (e.g., alternative facility suggested, rescheduled date)

c. Optional SMS Reminders for CHWs
You can set up conditional SMS reminders triggered when a child case has:
• An upcoming due date
• A preferred facility that’s out of stock for the required vaccine
This can prompt CHWs to check the task list and take action.

Putting It All Together

This workflow enables you to:
• Keep mothers flexible in their facility preferences
• Use facility cases to centrally manage stock data
• Dynamically match affected vaccine schedules with stockouts
• Guide CHWs through tailored follow-ups via forms and alerts

Kindly note that the above configuration might require a paid plan on CommCare. It is because features like SMS reminders, Lookup Tables, Case Sharing are only available on selected paid plans of Commcare.

Let me know if you need any further guidance.

Best regards,
Shiv

Hi Shiv!
I'm following most of this, but where I get lost is here:

Then, using either:
• Case Sharing + Case List Filtering, or
• Lookup Tables mapping facilities to current stock statuses,
you can filter children due for a vaccine during the stockout window by comparing:
• The child’s upcoming vaccine due date
• Their preferred facility
• The current stock status and restock window

This logic can be applied using hidden values in follow-up forms or reports to identify affected cases.

We would most likely be trying to use case sharing and case list filtering, but how exactly do those allow you to compare properties (the 4 you mentioned) across cases (child and facility in this case)? You mentioned hidden value in forms or reports, but my understanding was that those can only be drawing from the form/report's case type.

In our case, the facility id links the child and facility cases, but I'm not sure how to compare the other properties if they have to remain on their side of the wall between the case types. e.g. I can set up a hidden field in a child form, but can only reference child or user properties.

Let me know if this isn't quite right or I'm missing something.

Thanks,
Andy