Stream: questionnaire
Topic: Enablewhen based on repeating item
Elliot Silver (Nov 15 2020 at 18:39):
In my questionnaire, I have a repeating item for the user to select applicable co-morbidities from a valueset. I would like to add a follow-on question for one of the selected co-morbidities. Is there a way that I can write an enablewhen condition so that if any of the repetitions is for a particular co-morbidity, then my follow-on question is enabled?
(It looks like I can have the follow-on be a nested item under the co-morbidity choice, and enable it if that repetition is the one I'm interested in, but that may cause the follow-on to be displayed, inactive, for each repetition that isn't the particular co-morbidity. Especially, if I have multiple follow-on questions, I'd rather not have them repeat over and over.)
Lloyd McKenzie (Nov 15 2020 at 19:45):
Sure. You'd need a variable on the common parent of the co-morbidity question and the follow-on question that would take on a boolean value based on whether one of the 'relevant' co-morbidities had been selected. You'd then use the enableWhenExpression extension to enable/disable the follow-on question
Elliot Silver (Nov 16 2020 at 03:04):
Thanks. I'll probably be back for clarification, but let me see what I can do first.
Last updated: Apr 12 2022 at 19:14 UTC