As described in What is ChildCount+?, ChildCount+ collects data, runs analysis on those data, then generates reports and alerts based on the results of the analysis. The indicators functionality takes care of the simple data analysis that goes on inside of ChildCount+.
The data analysis features are centered around the idea of “indicators.” An indicator is a function that takes two arguments: a data set and a time period and returns a numerical value. For example, an indicator called “Number of Households” would take a list of patients and a time period as arguments, and would return an integer – the number of households heads in the patient list at the given time period – as output.
The standard interface for indicators provides a few benefits to the programmer:
- We can transparently cache indicator values.
- Aggregation is simple: the same indicator function can generate per-patient, per-CHW, per-village, and per-site values, depending on the patient (or other) list you provide as input.
- It is easy to reuse reporting code across indicators.
The indicators code lives in two places. The
definition of the indicators interface is
in a library directory:
while the ChildCount+ indicator definitions
live inside the ChildCount+ application
Creating an Indicator¶
All of the ChildCount+ indicator code resides in the
For the most part, one indicator module (e.g.,
corresponds to one ChildCount+ SMS form
+V or the
To create a new indicator, you must add a new class
to one of the files in
Calculating indicator values can be very nuanced and tricky. Please make sure to extensively test your indicator code before you deploy it.
For example, you might want to create an indicator that
measures the number of households headed by people over
the age of 50 (at the end of the time period).
Since this indicator relates most directly to registration
+NEW form), we would put it in the file
If your indicator returns a percentage value,
make sure that your indicator class inherits
Using the percentage class will save you lots
of time and will make caching your life easier!
Adding a time period¶
Since all indicators take a time period as an argument,
ChildCount+ defines a standard set of time periods we
can use for indicator and report generation.
Every time period has a start and end
plus one or more sub-periods.
A time period might be “One Year” and the sub-periods might
be each of the months of the year.
These time periods are defined in
To define a new time period, clone one of the files
edit it to do what you want,
and make sure to add it to the list of imports