- This feature solves the static cohort limitation where by once a cohort is created, there is no removal of members who fail to satisfy the criteria in future nor addition of members who meet the cohort criteria.
The Expanded cohort solves this limitation by:
Providing a schedulable task class that runs at specified time interval to update the cohort membership
Providing a configuration for individual cohort to:
Enable/disable schedulalable task to run
Enable/disable automatic addition of new member/members (members who satisfy/fulfill the criteria/condition for that cohort) to a cohort
Enable/disable automatic removal of member/members (members who do not satisfy/fulfill the criteria/condition for that cohort due to change in parameters used) from a cohort
Storing cohort update history to track addition and removal of cohort members.
Setting Up expanded cohort.
Expanded cohort comes bundled into muzima core module. This means you only need to set up a schedulable task using class org.openmrs.module.muzima.task.ProcessExpandedCohortTask and creating cohort definitions as shown below:
Setting Up Schedulable task.
Go to administration, then select manage scheduler under scheduler, and then add task.
Set the time interval which the scheduler task will be run
Creating Cohort Definition
Under mUzima column within the main dashboard select Cohort definitions.
Click on Create cohort definition
Select a cohort from the select box/dropdown
Enter the creteria to be satisfied/fullfilled for addition/removal of members eg select patient_id from patient pt,person ps where TIMESTAMPDIFF(YEAR, birthdate, CURDATE())=18 and gender='M' and pt.patient_id=ps.person_id; This will automatically add patients aged 18 and are male to the cohort and remove all those who are not 18 years from the cohort membership.
Cohort defination relies on cohorts created using cohort builder.
1. Scheduler task will only be run on a cohort defination if Enable Scheduled task checkbox is checked
2. Addition of members who fullfill a creteria is only possible if Enable Addition of members is checked. (Enable Scheduled task checkbox must be checked for the addition to be possible)
3. Removal of members who do not fullfill the creteria is only possible if Enable Removal of members is checked. (Enable Scheduled task checkbox must be checked for the removal to be possible)
Mobile Side Setting and indicators
Enable Real time sync in order cohort membership changes can be automatically be synched. If Real time sync is disabled, a maual sync will be needed.
A red icon in the cohorts tab on the dashboard means a a cohort has changed and syncing is needed.
A red red text in cohort list shows which cohorts have changed since the lsat sync and that need manual sync.