showing or hiding items on a CRF, based on the input of another item (OC 3.1)

One of the features of OpenClinica since version 3.1 is showing or hiding items based on the value of an other item on the same CRF. OpenClinica offers two ways of doing this: in the Excel-sheet or by using an XML-file. On this page we'll discuss the first option.

To make things a bit livelier we uploaded a video to Youtube, so you can sit back and watch that. But the same information is given below, plus a link to download the XL, so read on.

what to show and when to show it

For this demo we'll make a CRF with just three items: Gender, Are you currently pregnant? and Have you been tested for Prostate Cancer

fig. 1: CRF with three items

If the user chooses for gender 1, then we would like to hide the question about pregnancy and show the prostate-question. And if on the other hand 2 is chosen, so if the subject is female, then hide the prostate-question and show the pregnancy-question.

two essential columns

To do this we use the last two columns:

The function of the first column is to assign a default display-status to an item. If you leave this cell open, the default is Show. For our example we fill in for Gender Show and for the other two items Hide.

The last column, SIMPLE_CONDITIONAL_DISPLAY, is used to change the ITEM_DISPLAY_STATUS from hide to show and has three parameters. The syntax is:
ITEM_NAME: name of the item that decides whether the the hidden item will be shown
RESPONSE_VALUE: if ITEM_NAME equals RESPONSE_VALUE then the item will be shown
message: the message to be displayed if inconsistencies arise

In our case we type in for the pregnancy-question: show it, if item Gender equals two, plus a message:
Gender, 2, Only provide answer if subject is female.

fig. 2: conditional display of two questions

the message

The third parameter, the message, may be a bit confusing: why would you add a message? Consider the following situation. At first the data-entry person chooses Male and answers for the prostate-question "no", by clicking the appropriate radio-button. Then he/she realises a mistake was made and changes the Gender-item to Female. The prostate-item will be hidden, but there will be a value associated with it. This is of course a discrepancy and should be handled as such. At the top of the CRF the message will be displayed Only provide answer if Subject is male. Because this item is of type radio-button, you can not delete the answer. What you can do is make a note of the discrepancy by clicking on the blue flag, give an explanation of your mistake and close the discrepancy.

limitations of Simple Conditional Display

Simple Conditional Display works only with non-repeating items that have pre-determined values, so with radio and single-select fields: the DATA_TYPE must be INT. And only if the item equals a certain value: you can not define a conditional display by "greater than" or other operators.
The items that are hidden and shown can be of any type.

Click here to download the XL-file used for this example.

what about checkboxes and multi-selects?

As we've seen on another page about the checkboxes, the answer, or rather answers, to this type of question are a string with all the options checked, separated with comma's. And the ResponseType is always ST. But fortunately this does not mean that we can not use a check-box answer with SimpleConditonalDisplay.
For example take the question Are you allergic? where a user can tick all that apply.

fig. 3: check boxes

As you can see in the XL-sheet the ResponseType of the group of checkboxes is ST, but the SimpleConditionalDisplay can still be used.

fig. 4: XL-file

fig. 5: the result

Of course the limitation is that you can only define one item to perform the SimpleConditionalDisplay on. As soon as you have more than one item, you must use the ShowAction, of which you can find an example here.

Other how-to-pages can be found here.

this page was last reviewed August 2013