Cohort Module Enhancements

@ssmusoke, the primary purpose of the Cohort Module is to provide new features for cohorts that we would like to migrate into core so all aspects of OpenMRS (reporting, programs, orders, scheduling, etc.) can take advantage of them:

  • Support for both static & dynamic cohorts as two flavors of Cohort – i.e., cohorts can be manually defined/managed or can be dynamically/programmatically defined like reporting’s cohort definitions.
  • Allow for implementations to define different types of cohorts. Examples could include households, treatment groups, research cohorts, or just about any other purpose for grouping patients. What is done with the cohort will vary by use case, but they all share the need to define a group of persons.
  • Allow for encounters & observations of cohorts (groups of people) just like we do for individuals. We do not want to dual-purpose the existing encounter & obs tables, since doing so would over-complicate their use. Being able to gather observations about groups would be incredibly helpful, for example, for community health workers going into households and for data collections about treatment groups.

The old cohort builders was designed to allow users to define (build) cohorts by applying filters & constraints through a UI without programming. Such a tool could leverage the Cohort Module to persist its cohorts. I would not expect the Cohort Module itself to try to provide this functionality. If it did, I would want to ensure that this functionality is cleanly separated from the parts we want to move into core.

The cohort definitions within the reporting module were created for lack of having dynamic cohorts in core, do not share a parent “Cohort” class with static cohorts, and were targeting the needs of reporting. The Cohort Module should aim to provide a Cohort interface that underlies both static & dynamic cohorts (so clients can work with a cohort without having to know or care whether the cohort was manually or programmatically defined). Also, providing dynamic cohorts in core allows them to be used & incorporated into parts of the EMR that have nothing to do with reporting.