Skip to main content

Disable rule examples

These examples show various ways you might set up disable rules.

Disable an answer when a single-select or multi-select answer is chosen 

getTestAnswerValue("TEST_CODE_HERE", "QUESTION_CODE_HERE", "ANSWER_CAPTION_HERE")===true

  • For radio buttons and check boxes, 'true' indicates the item is selected.

clipboard_e3be1886d32e8cafede5c90602f5b06ae.png

  • The disable rule is applied to the question you want disabled.
    • If the answer, ‘Constipation requires intervention’, in Question “ELIM_CODE” is checked (true), disable this question.
    • When checked, the narrative question will become disabled. While this rule does work as written, it is not the correct rule to produce the desired result.

clipboard_ed3c210a4a5b847e67f701b82fd7f8afd.png

Disable an answer when a single-select or multi-select answer is not chosen 

getTestAnswerValue("TEST_CODE_HERE", "QUESTION_CODE_HERE", "ANSWER_CAPTION_HERE")!==true

  • The following example is the correct disable rule to make a question enabled or required if the specific answer is selected. (Use ‘not true’ in the disable rule.)
    • This code is added to the narrative question: “If Constipation requires intervention- Average PRN interventions per month.”

clipboard_e75b86a27a913656af1be8437805915a2.png

  • The disable rule indicates that this question is disabled, unless, on the RN Assessment event, for the Elimination Checklist question the answer ‘Constipation-requires intervention’ is checked. When checked, the narrative question will become enabled. A simpler way to state this is: When ‘Constipation requires intervention is ‘not true’, keep this question disabled.

clipboard_e3de6f794a894f54304f0cad800cd86a7.png

Narrative, numeric, pick list, and date/time questions 

getTestAnswerValue("TEST_CODE_HERE", "QUESTION_CODE_HERE") ==="THE RESULT HERE"

  • No answer caption is used in this rule.
  • The result is the value you enter.
Individual pick list selections 

getTestAnswerValue("TEST_CODE_HERE", "QUESTION_CODE_HERE")==="PICKLIST_DESCRIPTION"

  • Pick list descriptions are the values in the lookup table (LUT) description.
Disable a question based on any answer entered in a narrative or a numeric field or selected from a pick list

!Util.isNullOrEmpty(getTestAnswerValue("TEST_CODE_HERE", "QUESTION_CODE_HERE"))

  • This will likely be the least commonly used rule.
Apply the same disable rule to multiple questions to disable multiple questions based on a single answer 
  • In this example, if the individual is independent, the following questions do not need to be completed.
    clipboard_e2cb9bf386f29ab0f847f22b293609633.png

clipboard_e69949c287aa5a0a0fe52971f8207e28c.png

Disable a question based on any answer entered in a narrative or a numeric field
  • In the following example, a field is disabled when 'any' value is entered in the Prior Date field.
    • If the individual has an appointment scheduled, when information is entered, disable the next field.

clipboard_e316b8e36125b4d6c13288ddafca891d9.png

Narrative, numeric, pick list, and date/time questions - Disable when a numeric value is entered
  • On the numeric answer, note the question code.

clipboard_e32575bef4acf83e9571ebbd62ff6b95d.png

  • On the question you want required:

clipboard_ef2d367bd20f349ace58235777c71b7f4.png

  • The disable rule will be:

clipboard_e303a5238b0440bcc8bb5459302d39d31.png

Narrative, numeric, pick list, and date/time questions - Enable or disable if a value ‘greater than’ a numeric value is entered
  • On the question you want required, remove the ‘===‘ and enter the 'greater than' > symbol.

clipboard_e86941411c59c48d07cfac170ba3fbefe.png

Narrative, numeric, pick list, and date/time questions - Use 'less than' operator
  • On the question you want required, remove the ‘===‘ and enter the 'less than' < symbol.

clipboard_e4a12d78faa3b564a899f8ad40c3c187a.png

  • Since the assessment opens with no value, the question is disabled.

clipboard_e4ebd15631670f5c8293d2a9b32ed0e11.png

Narrative, numeric, pick list, and date/time questions - Disable pick list value selected
  • On the pick list, ensure the answer ‘description’ is accurate.

clipboard_e139c414b9e0b6e0f76ae841388dd8b60.png

  • On the question you want disabled:

clipboard_ea8926fc673b3456edeaeb13d4ac7bee4.png

Disable rules across assessments

When there are multiple tests used in a parent event, you can apply disable rules that disable questions across assessments.

  • Identify the Test Header Code, Question Code, and Answer Caption to be used in the disable rule.

clipboard_e97ab1cf4d9f55f01338e9b8e933e18fd.png

  • Apply the disable rule to the question on the second assessment that will be disabled based on the answer selected on the first assessment.

clipboard_eaa77b9d24b1e6823a47b30ae97f78510.png

  • Important: If the assessment with the disable rule will be used as a stand-alone assessment, it is recommended that you make a copy of the assessment.
    • Notice in this example the SU assessment was copied and labeled to indicate it is used with another assessment.
      clipboard_e454ce09fd9fb3d3c28fc13fbfc22ec8e.png
    • When an assessment contains disable rules for an assessment not included on the parent form, the system generates an error, such as:

clipboard_eebc434adf891fb70c5e176965982dfe6.png

Disable an entire assessment
  • When a form contains multiple tests, you can apply a disable rule on the test line in the parent form to disable an entire test based on an answer.
    • This form includes two assessments:

clipboard_eb9accd3968cc80333c2b7fa42610e31e.png

clipboard_e55340c2c0c1250024031818360036586.png

  • If you prefer to have only one assessment but require another assessment to be completed, consider using a nested test and assessment subform on the parent event to be required based on an answer. 

clipboard_ee4a2e41b0ff448a4183b53b27c45f5a1.png

  • If an answer to a question on an assessment is ‘this’, then make the nested subform on the parent form required.
    • Use event groups to limit the assessments available under 'Add record.'

 

clipboard_ecf0a8c558e95a80f2955e3955869b5e6.png

Use additional options such as 'Is Required' and 'Erase on Disable' for disable rules

clipboard_efe1242b3018ff7d40b1851a3431a870d.png

► See Also

 

  • Was this article helpful?