Versions Compared

Key

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

Custom Program Rules

The PCA currently does not support In-app creation of custom Program Rules, meaning that the standard Program Rules management in the DHIS2 Maintenance App is required for this. However, the custom Program Rules are displayed in the PCA as described in the Checking Existing Program Rules page.

Please Note: A Program Rule creation feature is being planned for a future release of the PCA.

...

Program Rules Generated by the PCA

If the HNQIS2 Metadata Package has been installed in the server, the PCA will enable the H2 features. These features allow the creation and modification of H2 Programs, enabling access to other features like the Import/Export of Excel Templates, and the Set Up of H2 Logic and Analytics (see Image 1).

...

The Excel Template is the main way to define Program Logic in H2 Assessments, allowing for easy configuration of Parent Questions (Hide/Show logic), label creation, scoring calculations, and
much more (see Image 2). You can check how to use the Excel Template here.

...

After importing the Excel Template with the desired changes, the Program Rules can be generated by using the Set Up Program button in case the Tracker and Event Program you must click on the Build Program Rules button.

Please Note:

  • The Set Up Program button is only enabled after changes are Validated and Saved.

  • The Build Program Rules is only enabled after changes are validated.

Keep in mind that this button also generates Program Indicators and Analytics used in H2 the Programs.

Info

The PCA will automatically generate all the necessary Program Rules and Program Rules Variables to implement the specified logic and the scoring calculations used by the Assessment.

Note

Executing this process again will delete all Previously generated Program Rules and Program Rule Variables to create new ones.

Your custom Program Rules and Program Rule Variables will not be deleted.

Parent Logic - Hide/Show Rules

A Parent Question displays more questions if a specific answer is given, this means that some questions can be hidden from the Assessment until the Parent Question has one specific value. This is useful for displaying questions related to another question, for example:

  • Is the test result positive? (Parent Question - Yes/No)

    • If yes, Was the necessary medication administered? (Show if answer is Yes)

    • If no, Are the test results recent? (Show if answer is No)

Hide/Show Rules are generated by the PCA when the Parent Question and Answer Value columns are configured (see Image 2). This translates into Program rules named using the following structure:

Panel
bgColor#F4F5F7

PR - Show/Hide - Show when Question is Answer

The resulting Program Rules in DHIS2 will follow the previous naming convention (see Image 3). The rules generated by the PCA are tagged as Scripted in the configurations so the App is able to differentiate custom and automated Program Rules (see Image 4).

...

Note

Please avoid adding the text _Scripted to the Description field of your Custom Program Rules, otherwise, the PCA will delete these when generating new Program Rules.

The logic of these Program Rules is “Inverted” due to the fact that DHIS2 can only Hide Questions. This means that if the Rule is “Show Questions when Answer is 1”, the logic would be “Hide Questions when Answer is not 1” (see Images 5 and 6).

...

Special Case: Mandatory Child Questions

Mandatory questions in DHIS2 represent a problem when these are hidden by a Parent Question. DHIS2 always displays mandatory questions, this means that a Child Question cannot be mandatory directly, or else the question will be shown even if the Parent hasn’t been answered.

To circumvent this issue, Mandatory Child Questions aren’t mandatory by default, that is why the PCA also generates Program Rules for making questions mandatory (see Image 7). These rules are named following the structure:

Panel
bgColor#F4F5F7

PR - Make Field Mandatory - Make mandatory when Question is Answer

...

The configuration is mostly the same as the Hide/Show Program Rules, basically only changing the Program Rule Name and the Program Rule Actions (see Images 8 and 9). Also, the condition would be the same as the Hide/Show rules (see Image 10) without inverting the logic.

...

With that new set of Program Rules, Mandatory Child Questions are no longer an issue.

H2 Scoring Program Rules

In H2, any numeric type question can contribute to the scoring process of an Assessment. By numeric question we refer to any question with a DHIS2 Value Type of Number, Integer, Positive Integer, etc. This includes questions limited to the options contained in an Option Set (requiring the Option Set to be of numeric type).

A numeric question can contribute to a score if the question Numerator, Denominator and Feedback Order are defined (see Images 11 and 12). Lacking any of the previous configurations means that the question doesn’t contribute to any score.

...

Info

Questions are also divided into Critical and Non-critical, which generates a new set of Scoring Rules. This configuration can also be applied using the Excel Template or directly from editing a Data Element in the PCA.

Critical Score

The Critical Score is calculated by using all the Critical Questions answered in the Assessment. This means that if a question has been left unanswered, it won’t be taken into account for the Critical Score Calculation.

The PCA generates a Program Rule named PR - Calculated - Critical Questions that operates the Numerator, Denominator and Answer Value of all the answered Critical Questions in the Assessment (see Image 13).

...

Then, it generates another Program Rule named PR - Score - Critical Questions (%) that stores the value into a Data Element named Critical Steps located in the Critical Steps Calculations section (see Image 14).

...

Meaning that two Program Rules are used for this process:

Panel
bgColor#F4F5F7

PR - Calculated - Critical Questions

Panel
bgColor#F4F5F7

PR - Score - Critical Questions (%)

The first one being used for calculating and debugging, and the second one being used to present the result to the supervisor during the Assessment.

Non-critical Score

Similarily the Non-critical Score is calculated by using all the Non-critical Questions answered in the Assessment.

The PCA generates a Program Rule named PR - Calculated - Non-Critical Questions that operates the Numerator, Denominator and Answer Value of all the answered Non-critical Questions in the Assessment (see Image 15).

...

Then, it generates another Program Rule named PR - Score - Non-Critical Questions (%) that stores the value into a Data Element named Non-critical Steps located in the Critical Steps Calculations section (see Image 16).

...

Meaning that two Program Rules are used for this process:

Panel
bgColor#F4F5F7

PR - Calculated - Non-Critical Questions

Panel
bgColor#F4F5F7

PR - Score - Non-Critical Questions (%)

The first one being used for calculating and debugging, and the second one being used to present the result to the supervisor during the Assessment.

Competency Class

WIP

Overall Score

The Overall Score isn’t a calculation like the Critical and Non-critical Scores, it is basically a copy of the value contained in the Critical Steps or Non-critical Steps.

Basically, if the Assessment contains Critical Questions, the Overall Score is the same as the Critical Score. On the other hand, If the Assessment doesn’t have a single Critical Question, the Overall Score is the same as the Non-critical Score instead.

The Program Rule generated by the PCA is named as follows:

Panel
bgColor#F4F5F7

PR - Attributes - Assign Global Score

This rule assigns either the Critical Steps or the Non-critical Steps value to the Global Score attribute of the Tracked Entity Instance (see Image 17).

...

Compositive Score

The Compositive Scores are scores that group questions by using the Feedback Order, for example, Compositive Score 1 is calculated using every question or Sub-score derived from the Score 1, which means that:

  1. If there are other Sub-scores like 1.1, 1.2, 1.3 and so on, the questions contained within those Scores would be used to calculate Score 1.

  2. If there are only questions with Feedback Order 1.1, 1.2, 1.3 and so on, these are used to calculate the Score 1 directly.

  3. A Sub-score cannot be grouped with other questions in the same level, for example: there cannot exist a Sub-score 1.1 and questions 1.2, 1.3, 1.4 and so on. However, a Sub-score 1.1 can contain questions 1.1.1, 1.1.2, 1.1.3 and so on.

Info

For more information about Feedback Order and the Scoring process please refer to the Scoring Technical Documentation.

...

be

...

These calculation rules are named as following:

Panel
bgColor#F4F5F7

PR - Calculated - Feedback_Order Score_Name

Then, another Program Rule is generated for each Score, used for rounding the Calculated Score and storing it in a Data Element present in the Assessment (see Images 20 and 21).

...

These rules are named as following:

Panel
bgColor#F4F5F7

PR - Score - [Feedback_Order] Score_Name (%)

You will notice that most of the Program Rules generated by the PCA are Score related, this is due to the fact that each Score needs two rules (one to perform the calculation and another to round and display).

Program Rule Variables

The PCA uses Program Rule Variables to reference Data Elements contained in the Assessment, and also to store temporary Calculated Values such as Scores (see Image 22).

...

Similarily to the Program Rules, the variables are identified as scripted when the variable name starts with a underscore (_). The Variables follow some naming conventions:

  • Calculated Values

Panel
bgColor#F4F5F7

_CV_Name

  • Compositive Scores (Variation of Calculated Values)

Panel
bgColor#F4F5F7

_CV_CSFeedback_Order

  • Questions in the Assessment

Panel
bgColor#F4F5F7

_SSection_NumberQQuestion_Number

  • Competency

Panel
bgColor#F4F5F7

_competencyNewest

  • Critical Score

Panel
bgColor#F4F5F7

_criticalNewest

  • Non-critical Score

Panel
bgColor#F4F5F7

_noncriticalNewest

Note

Please Note:

Avoid starting the name of your custom Program Rule Variables with an underscore (_), as this is used by the PCA to identify scripted variables.

Scripted variables will be deleted when generating new Program Rules using the Set Up Program button.

...