The C4C algorithm is available for download from our GitHub repository using the link below.
C4C comes ready to use out-of-the-box, however, you may need to make changes to meet your
consists of three configuration elements:
Questions
Algorithms
Exceptions:
questions.json
The questions file contains two main elements that are the source for the algorithm file construction: questions and options.
Questions
The questions file is just an inventory of all possible questions (and their possible answers) that may be asked to a user. They are not listed in any particular order, as that's controlled by the algorithm. Currently (Feb 2021) the questions flow is as follows:
A simplified view of the algorithm
Full algorithm flow
Some of the questions can be omitted depending on the user's answers.
All the paths end in a contraceptive method recommendation.
Options
Each question contains at least two options to be presented to the user as possible answers. Their choice determines the path to follow: which question to ask next, or presenting the final result in the form of family planning methods recommendation.
Additionally, the questions and their options (answers) are directly connected to POEditor terms, the service used for localization.
algorithm.json
The algorithm drives the logic of what question to ask next, based on the previous answer. All possible paths end with a family planning method list recommendation.
exceptions.json
The exceptions file restricts the methods to be returned based on various criteria. Currently, they include country, age, and breastfeeding.