Stream: questionnaire
Topic: EnableWhen with answerOptions
Marieke Span (Apr 01 2022 at 12:17):
Hi all,
I faced a problem in using the enableWhen together with answerOptions.
I am creating questionnaires in FSH and want to use answerOptions for some of the questions in the questionnaires. The permitted answers in our questionnaires are very specific, therefore we want to avoid creating numerous valueSets by using answerOptions.
However, I can’t figure out how to use anwerOptions in the enableWhen. I’ve tested my questionnaires in a rendering tool, SDC questionnaire app, but it is not working. So I would like to know whether it is possible to use enableWhen with valueString answerOptions.
This is an example of what I am trying to do:
-
item[+]
* linkId = "SYSTPATIENT"
* type = #choice
* text = "Is the patient currently receiving systemic treatment for breast cancer?"
* answerOption[+].valueString = "no, never had systemic treatment"
* answerOption[+].valueString = "yes, but the treatment has stopped"
* answerOption[+].valueString = "yes, on chemotherapy"
* answerOption[+].valueString = "yes, on targeted therapy"
* answerOption[+].valueString = "yes, on hormone therapy"
* required = true -
item[+]
- linkId = "SYSTDATEPATIENT_Date"
- type = #boolean
- text = "Is the stop date of the systemic treatment known?"
- enableWhen[+]
- question = "SYSTPATIENT"
- operator = #=
- answerString = "yes, but the treatment has stopped"
- required = true
Lloyd McKenzie (Apr 01 2022 at 13:45):
You can't have 'valueString' when the type is 'choice'. If you're using 'choice', the answer must have a type of 'Coding'. An open-choice will allow a user-specified string as an answer, but all controlled answers must be Codings.
Vadim Peretokin (Apr 07 2022 at 13:59):
Question with a Coding drawn from a list of possible answers (specified in either the answerOption property, or via the valueset referenced in the answerValueSet property) as an answer (valueCoding).
Vadim Peretokin (Apr 07 2022 at 13:59):
So we can do answerOption with an inline valueCoding, but not a valueString?
Vadim Peretokin (Apr 07 2022 at 14:00):
That would actually solve another problem we're having, will try this.
Lloyd McKenzie (Apr 07 2022 at 14:45):
You can do valueString, but best practice is definitely valueCoding.
Last updated: Apr 12 2022 at 19:14 UTC