Scripting & More Tab - Show this field if

  • The "Show this field if" field in the Scripting and More tab of the eForm Editor can be used to show or hide items (or make a clinical note), depending on answers to previous questions or other patient information.
  • Below you will find some examples of what types of scripts can go into this field.

Display a question, based on demographics:

If you are creating a general health assessment form and you want to ask about the possibility of pregnancy, you can choose to only show this field if the patient is female by entering the following into the "Show this field if" field:

pt.isFemale()
Copy Rule

For a full list of available patient-related functions, please refer to: "ScriptPatient ("Pt") Functions".

Display a question, based on how the patient responds to another question:

To determine if a smoking cessation counseling, you can first create an item that asks the patient whether or not they smoke and has item reference: "smoking".

If the answer is yes, you can show the next question, asking about whether or not they are interested in quitting, with the following in the "Show this field if" field:

smoking.r == 'Y'
Copy Rule

Note: .r refers to that item’s response choice (e.g. “N” for no, “Y” for yes).

Analyze a menu-type item:

If you only want to show a follow-up question if a patient picks a menu choice, use the following ".r" value in combination with Javascript's String.indexOf() function in the "Show this field if" field:

myMenuItem.r.indexOf("myAnswer") >= 0
Copy Rule

Note: In the above string, "myAnswer" is the specific menu choice that you wish to flag.

Have more questions? Submit a request