Stream: questionnaire
Topic: EnableWhen behavior with operator `exists`
Jing Tang (Jun 30 2021 at 12:32):
In this example: http://www.hl7.org/FHIR/questionnaire-example-bluebook.json.html, the enableWhen
expression for question vitaminKgivenDoses
evaluates to true
if an answer is given to a boolean question. In reality though, once you have ticked the checkbox, unchecking it would only change it to false
, rather than clearing the answer. So the behavior of this questionnaire is a little unexpected to me - the additional question will not go away after you uncheck the checkbox. Solutions? 1) rewrite this example and only show the new question if and only if a true
answer is given to the boolean question 2) make the rendering tool clear false
answer when a checkbox is unchecked. 2) seems very odd to me and inconsistent with how answers are handled... so should we update this example? Thanks!
Brian Postlethwaite (Jun 30 2021 at 12:37):
vitaminKgiven is a choice type (coded response), so if the selection is cleared, then the group would go away again.
Jing Tang (Jun 30 2021 at 13:44):
sorry yes i think i mixed up two things in my question... about vitaminKgiven
: so that is to say the tool should always have a way to clear choice type? that's not so obvious an option for things like radio button group.
Jing Tang (Jun 30 2021 at 13:47):
I was also meant to ask about hepBgiven
and its nested question hepBgivenDate
. In this case if the parent question is answered but then unticked, should the child question be hidden?
Yunwei Wang (Jun 30 2021 at 13:59):
It depends on how you design the Questionnaire. We had similar issues so we use three values value set yes-no-notSepcified instead of boolean if we really cares the default to be notSpecified. In UI, the item is rendered as a group with three radio buttons.
Lloyd McKenzie (Jun 30 2021 at 14:48):
I think we have a change request in SDC that includes a recommendation that boolean items be rendered with a 3-state control to allow "not answered" to be a choice. However, we can't guarantee all renderers will do that.
Tilo Christ (Jun 30 2021 at 18:28):
This is already the recommended way of doing things today:https://build.fhir.org/questionnaire.html#booleans
In my Faiadashu filler I actually went to great lengths to make sure that everything could be brought back into an untouched state. See http://legentix.com/faidashu/#/ for an implementation of the Bluebook questionnaire that hopefully gets everything right.
Brian Postlethwaite (Jun 30 2021 at 22:02):
My renderer does bools as t/f, options with radios once you choose, that's it, options with a drop down can select the blank entry.
Jing Tang (Jul 01 2021 at 08:33):
thanks all - this makes sense. but i think for nested questions (e.g. the hepBgiven question in the questionnaire i linked) it still is a little strange that answering no would display nested questions.
ps @Tilo Christ awesome demo!
@Kashyap Jois @Fred Hersch
Kashyap Jois (Jul 01 2021 at 09:13):
Yup all this makes sense , thanks @Jing Tang !
Kashyap Jois (Jul 01 2021 at 09:19):
There is still a point that @Jing Tang made which is not clear yet, If a parent item has nested items, should the nested items be hidden until the parent has been answered?
Jing Tang (Jul 01 2021 at 10:19):
i think the question is whether we treat boolean type as a special case and still hide the nested item if the answer to the the parent question is false
Yunwei Wang (Jul 01 2021 at 13:45):
That is a Questionnaire design issue. You can design it either way.
Lloyd McKenzie (Jul 01 2021 at 14:29):
If you have a question with nested questions, the questions nest beneath the answers - so there's nothing to nest within if you don't have an answer to the parent question.
Kashyap Jois (Jul 02 2021 at 05:27):
Lloyd McKenzie said:
If you have a question with nested questions, the questions nest beneath the answers - so there's nothing to nest within if you don't have an answer to the parent question.
Thanks this makes perfect sense.. sorry about the silly question :sweat_smile:
Lloyd McKenzie (Jul 02 2021 at 15:41):
It wasn't a silly question :)
Last updated: Apr 12 2022 at 19:14 UTC