Versions Compared

Key

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

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 without inverting the logic (see Image 10).

...