Conditional Fields

About

Conditional Fields (v11.18) are rules that can be set up using the Form Builder. These rules will make fields visible based on the value of the prior fields. (Example: If sex is selected as female, then it is conditionally set up to have pregnancy questions appear and can be made required.)  

Rules Overview

A rule may be made up of one or more conditions.  Conditions can currently be built using the following fields:

  • Yes/No
  • Dropdown
  • Select One Only
  • Select All That Apply
  • Integer
  • Double

There are two types of conditional rules, and both rules are based on the values of other fields in that form.

  • Visible Rule: determines when a field is visible
  • Required Rule: determines when a field is required

To add a rule to one of the fields type above, edit the field in the form builder and select one of the buttons: Add Visible Rule or Add Required Rule.

A rule can be made up of a single condition, like:

If a field has a Visible Rule like the one above, that field would only appear if the Score field in the form had a value greater than zero. If the score was blank, 0, or less than zero, the field would be hidden. This rule might be applied to a Details text area where the user could enter more information about the score. 

A rule can also be made up of multiple conditions, like:

If a field had a Required rule like the one above, that field would be required if the Prior Gambling Episodes field had a value of yes AND if the Prior Gambling Episode Count had a value greater than 2. In this example, if Prior Gambling Episodes = yes and Prior Gambling Episode Count = 1, the field this rule was applied to would NOT be required.

Conditions

A condition can consist of:

  • A field the condition is based on, e.g. 
  • A comparator, to describe how a field is compared to a value, e.g. 
  • The value the condition is compare to, e.g. 

Conditions are connected together with AND and OR.

  • AND: all conditions connected by the AND must be true for the rule to be true
  • OR: one or more of the conditions connected by the OR must be true for the rule to be true

Editing Rules

You can edit a rule by doing the following:

  • click the button to add a condition to a rule
  • click on the pink boxto switch between AND and OR
  • click the blue boxto choose the field for the condition
  • click on the green boxto change the comparator, how the field is compared to some value
  • click the grey boxto change the value you are comparing against in the condition

How Rules affect other field settings

There are some changes to how existing field settings work:

  • If you add a Required rule, the standard Required checkbox on the field is no longer valid and overridden by the required rule.
  • If you add a Hidden Rule to a field that has the standard Required checkbox on, that checkbox is turned off and disabled.  
  • Rule buttons will not be visible if a does not contain at least one of the following fields
    • Yes/No
    • Dropdown
    • Select One Only
    • Select All That Apply
    • Dropdown Templates
    • Integer
    • Double

Rule Exceptions

There are some field exceptions for which you cannot create conditional rules.  Some of these may be implemented in future releases.

You currently cannot create Visible rules for the following fields:

  • Form name (Always required, cannot be hidden)
  • DSM5
  • Header display only

You currently cannot create Required rules for the following fields:

  • allergy intolerance
  • appointment list
  • average
  • barcode
  • body text display only
  • chart fill table
  • chart fixed rows
  • chart variable rows
  • contact block
  • count
  • ctb insurance widget
  • eligibility
  • field reference only
  • form name
  • header display only
  • horizontal separator
  • intervention
  • linkdoc
  • medication listing
  • minmax
  • pain diagram
  • patient groups widget
  • payment history
  • pcpgoals
  • procedure
  • patient body
  • realtime eligibility
  • search notes
  • total
  • vitals
  • vitals history