Task scheduling for all patients under 12 months old without a vaccination report

I am looking for a solution to help CHW know if a household has registered babies under 12 months, without a vaccination report submitted for the baby.
Ideally, we would want to display a task for each baby, but I don’t know how to trigger a task under these conditions.

I think this use case is pretty general and I would like to know how other people solved this problem.

If anyone wants to share her experience with us, welcome.

Hi @Victor_ZUGADI,

The task definition contains appliesIf which triggers a task if certain condition is met. Here’s where you can call a function which returns true when the contact’s age is less than 12 months.

Function definition in nools-extras:

isChildUnder12Months: function (c) {
//returns true if child’s age is < 12 months
},

//The task definition may look like this:

{
name: ‘under12months_task’,
icon: ‘child’,
title: ‘task.under_12_months’,
appliesTo: ‘contacts’,
appliesIf: function (c) {
return extras.isChildUnder12Months(c);
},
appliesToType: [‘person’],
actions: [{
form: ‘form_name’, //the form to open when the task is clicked
modifyContent: function (content, c) {
}
}],
events: [
{
id: ‘under_12_months’,
days: 0,
start: 0,
end: 0
},
],
priority: {
level: ‘high’,
label: ‘task.under_12_months.high_priority’
},
resolvedIf: function (c) {
return extras.countReportsSubmitted(c, ‘form_name’) > 0
}
},

2 Likes