Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The file is written using JSON notation. To learn more about the basic notation used in JSON, click here.

Country-based exceptions

The main elements to configure these restrictions are country and methods.

...

The example above excludes the method IUD from the recommended methods to a user in Guatemala.

...

Answer based exceptions

To configure this type of exclusion, use the following elements:

...

Code Block
"breastFeeding:[Y]":{
            "add" : [],
            "remove" : [],
            "replace" : [{"COP":"POP"}]
        },

...

Disclaimers

It is possible to add disclaimers according to a specific answer. These messages will be returned and should be shown on the UI as informational text messages. As in the questions.json file, the message is a term in POEditor but the variable is configured in the exceptions file.

...

Code Block
"disclaimers":{
        "gender:[M]":"gender.disclaimer.M",
        "gender:[N]":"gender.disclaimer.N",
        "breastFeeding:[Y]":"breastFeeding.disclaimer"
    }

...

Changes: simple edits

How to exclude a method from an already listed country

To exclude a new method, search the country ISO code and then the keyword for the methods to exclude. The list of available methods is in the questions.json file. The methods must be separated by commas. Make sure there is no comma next to the closing bracket.

...

Code Block
BEFORE
{
    "methodsToExclude":{
        "GT" : ["IUD"]
    },
    "questionsToExclude":{

    }
}

```JSON
ADDING METHOD TO EXCLUDE: EC
{
    "methodsToExclude":{
        "GT" : ["IUD", "EC"]
    },
    "questionsToExclude":{

    }
}

How to exclude an option from a new country

If the country does not exist, the first step is to add the new country key. To do that, write the ISO code of the country in double quotes then add a colon (:) and finally, add an array with the methods to exclude. All the methods must be separated by commas.

...

Code Block
Adding Kenya and its restricted methods EC and IUD
{
    "methodsToExclude":{
        "GT" : ["EC"],
        "KE" : ["EC", "IUD"]
    },
    "questionsToExclude":{

    }
}

...

How to add a method based on a specific answer

Identify the question/option and in the "add" action write all the new methods. Remember each method must be in double quotes and separated by commas. In the following example, the method Oral Contraceptive Pills (OCP) will be added to the response when the user's answer is "yes" to "Are you breastfeeding a baby less than 6 months old?".

...

Code Block
 "breastFeeding:[Y]":{
            "add" : [COP]
}

...

How to remove a method based on a specific answer

Identify the question/option and in the "remove" action write all the new methods. Remember each method must be in double quotes and separated by commas. In the following example, the method Oral Contraceptive Pills (OCP) will be removed from the response when the user's answer is "yes" to "Are you breastfeeding a baby less than 6 months old?".

Code Block
 "breastFeeding:[Y]":{
            "remove" : [COP]
}

...

How to replace a method based on a specific answer

Identify the question/option and in the "replace" action use the following structure to indicate the method to be replaced:

...

Code Block
 "excludeAnswerBased":{
        "breastFeeding:[Y]":{
            
            "replace" : [{"COP":"POP"}]
        },

...

Other Changes: new logic

Add a new exception section

If a new parameter needs to be added such as questions or factor options, contact the C4C technical administrator to make the configuration change. Otherwise, the logic could get damaged.

...