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.

- 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.

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.”

- 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.

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.


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.

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

- On the question you want required:

- The disable rule will be:

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.

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.

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

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

- On the question you want disabled:

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.

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

- 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.

- When an assessment contains disable rules for an assessment not included on the parent form, the system generates an error, such as:
- Notice in this example the SU assessment was copied and labeled to indicate it is used with another assessment.

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:


- 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.

- 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.'

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

