Stream: implementers
Topic: Questionnaire with conditional ValueSet binding?
Michael Lawley (Jan 25 2017 at 00:51):
In a Questionnaire, can I make the "binding" to the permitted answers ValueSet conditional on the value of a previous question?
For example, I may have a ValueSet of procedures for men and a different one for procedures for women and I want to use the appropriate ValueSet based on the answer to a male/female question item (yes, I know gender is more complex than this, but it's just an example)
Lloyd McKenzie (Jan 25 2017 at 01:34):
Not as part of core - meaning most systems wouldn't recognize it. The easiest way to accomplish this behavior would be to have multiple questions and enable only one of them based on the answer to the previous question.
Donna Truran (Jan 25 2017 at 04:32):
Sorry Lloyd, I'm not sure I follow your advice. Could you expand a little, using Michael's "Gender Answer with conditional binding to Gender specific Px ValueSet" example? appreciated :-)
Lloyd McKenzie (Jan 26 2017 at 01:25):
<q1 "What's your gender (M/F)?">
<q1.1 "What healthcare conditions currently apply to you?" (valueset includes pregnancy) enableWhen q1=F/>
<q1.2 "What healthcare conditions currently apply to you?" (valueset includes prostate cancer) enableWhen q1=M/>
</q1>
Lloyd McKenzie (Jan 26 2017 at 01:26):
That's rather abbreviated/pseudo-coded, but hopefully it conveys the gist
Donna Truran (Jan 30 2017 at 01:41):
Thanks @Lloyd McKenzie I now better understand this using this simple gender based example. I'm going to assume (!!! always dangerous) that I could use the same approach to do something more complex such as <q1 "Clinical discipline?" (Speech/Physiotherapy/Dietetics/Social Work/etc <q1.1 "Patient condition managed this encounter?" (valueset Speech) enableWhen q1=Speech <q1.2 "Patient condition managed this encounter?" (valueset Physiotherapy) enableWhen q1=Physiotherapy <q1.3 "Patient condition managed this encounter?" (valueset Dietetics) enableWhen q1=Dietetics .... and so on.... for the 12 or so disciplines I might want to consolidate into a single questionnaire (for use in a multidisciplinary clinical practice?) Stop me if I'm wrong! :-) thanks for your help.
Michael Lawley (Jan 30 2017 at 01:47):
Thanks @Lloyd McKenzie , that's the only solution I'd been able to come up with.
Lloyd McKenzie (Jan 30 2017 at 02:43):
@Donna Truran I'm afraid that's the only way supported right now. You could certainly be more concise with a modifier extension - at the cost that all your client systems would have to customize to support it and you'd have to use custom validators and renderers, etc. too. That doesn't mean that the current design has hit the proper sweet-spot though. We could certainly have a discussion about whether this sort of behavior falls within what would be considered "core" - i.e. something that 80%-ish of the systems that deal with questionnaires would be able to handle.
Donna Truran (Jan 30 2017 at 02:47):
@Lloyd McKenzie that's great Lloyd... this will work well enough for the mock-up/demonstration stuff I'm doing at the moment... we can get more elegant when we have more time :-) appreciate your help.... cheers
Grahame Grieve (Feb 06 2017 at 03:45):
I think that this space rapidly falls into an unmanageable are of super complexity
Grahame Grieve (Feb 06 2017 at 03:46):
one thing we could do to make this manageable is to define a cda-hook operation that you use to decide whether a question is enabled, and whether a more refined value set for possible answers can be presented based on other answers
Glory Kim (Oct 31 2019 at 16:59):
Is it possible to create a valueSet that has enableWhen options? For example, I'm working on a questionnaire that has a section on 'communicable diseases'. It consists of 10 items (i.e. pregnancy, sleep apnea, diabetes, etc). Ideally, I was hoping to make the valueSet consist of these 10 items + additional logic. If the patient says 'yes' to pregnancy, then an enableWhen logic would ask "How many months?" And, if the patient also selects 'diabetes', it would cause another question to appear under it such as "What is your blood sugar?"
Lloyd McKenzie (Oct 31 2019 at 17:01):
That sounds like the enableWhen is tied to specific answers, not to a value set. It's certainly fine if the list of choices is a value set. If you want to tie enabling to membership of the answer in a particular value set (e.g. if one of the selected concommittent meds was an ACE inhibitor), you could do that with the enableWhenExpression extension
Glory Kim (Oct 31 2019 at 18:55):
Thanks Lloyd. I've found the extension here (http://build.fhir.org/ig/HL7/sdc/expressions.html) but am unsure how to actually use the expression extension. Clicking on the enableWhenExpression
leads me to a 404. For example, what is it's canonical url and how can I reference it?
Lloyd McKenzie (Oct 31 2019 at 18:57):
It's not yet available at the canonical URL - we need to publish the next version of SDC before that can happen - which is now looking like December or January. The link is here: http://build.fhir.org/ig/HL7/sdc/extension-sdc-questionnaire-enableWhenExpression.html
Lloyd McKenzie (Oct 31 2019 at 18:58):
It allows you to use FHIRPath.
Last updated: Apr 12 2022 at 19:14 UTC