Stream: implementers
Topic: Complex Questionnaire
Grey Faulkenberry (Nov 16 2020 at 17:41):
I was hoping to get some guidance towards complex questionnaire construction. I'm working on the PRAPARE Survey (pdf is here: https://www.nachc.org/wp-content/uploads/2018/05/PRAPARE_One_Pager_Sept_2016.pdf). The second question gives a codified list of choices (that part is straight forward), what I'm not sure how to do is "other". Using the form builder (https://lhcformbuilder.nlm.nih.gov/ -> Add Item -> Search for Prapare -> import) it displays the options as you would expect. Any choice (or multiple) can be selected, and even "other" has a code associated with it. However, in the actual survey, if you select "other" you have the option to enter free text. Does FHIR have a way to specify this kind of answer? I can certainly create logic to, for instance, anytime there is an "other" codified answer, if it's chosen by the user display a text box. However, that would be idiosyncratic to my renderer, and not following official FHIR specifications. I've looked through the FHIR documents online (including advanced form rendering and advanced form behavior and calculation), and I couldn't find this kind of behavior defined anywhere. Does anyone have experience with this?
Elliot Silver (Nov 16 2020 at 21:14):
I think an open-choice question type supports this.
Grey Faulkenberry (Nov 16 2020 at 21:26):
That was my impression as well, but I couldn't find an example of implementation. Is it supposed to be understood by the renderer that if the type is open-choice, they should provide a free-text option? Or is there another way to specify this in FHIR? Also, if I want to cascade so that only if "other" is chosen does it provide the text box, am I going to have to have each answer as a separate item and then use enableWhen?
Elliot Silver (Nov 16 2020 at 21:49):
My expectation (without proof) is that an open-choice gets rendered as:
- (_) Option 1
- (_) Option 2
- (_) Other: [_______]
And the result goes into a CodeableConcept, which supports either the coded options or the text other option.
@Lloyd McKenzie?
Elliot Silver (Nov 16 2020 at 21:50):
I don't think a separate "other" item is needed.
Lloyd McKenzie (Nov 16 2020 at 21:53):
Typically you'd represent this with a child question that had an enableWhen based on the answer being 'Other'. I'm pretty sure there's an example of that in the SDC implementation guide somewhere, but I don't remember exactly where. @Joee Garcia, you've been digging in them more recently than I :)
Grey Faulkenberry (Nov 16 2020 at 22:05):
OK, so then the idea would be something like this:
"item1": [
"type": "choice",
"linkId": "firstQuestion",
"answerOption": [
AnswerOption 1,
AnswerOption 2,
AnswerOption Other
],
"item1.1": [
{
"type": "string",
"enableWhen": [
{
"answerCoding": Other,
"question": "firstQuestion",
"operator": "="
}
],```
Lloyd McKenzie (Nov 16 2020 at 22:26):
Exactly
Lloyd McKenzie (Nov 16 2020 at 22:26):
And if the first question is repeating, there'd potentially be a child question for each answer (provided it was enabled for that answer)
Elliot Silver (Nov 16 2020 at 22:29):
Oh, that's not what I was expecting at all. What's the value of open-choice vs. choice then?
Grey Faulkenberry (Nov 16 2020 at 22:32):
So there's no reason a child item's enableWhen can't refer to the parent item? I only ask because the lhc form builder (https://lhcformbuilder.nlm.nih.gov/) won't allow it (I realize that's not the official FHIR spec, but I still wanted to be sure).
Grey Faulkenberry (Nov 16 2020 at 23:05):
Also, another question about preferred syntax. I have the following question:
How many family members, including yourself, do you currently live with? ____________
[ ] I choose not to answer this question
The answer is an integer. But there is also an option to choose not to answer. Would this be best represented by a group (the question) and then two sub-items (one for the integer answer and one to allow choosing not to answer). Or would it be better to represent this as a single question, with an integer answer, and then a sub-item to allow the choice not to answer?
Lloyd McKenzie (Nov 16 2020 at 23:08):
Open choice allows you to just have an answer where you convey a string instead of one of the choices (rather than as a sub-answer to a specific choice)
Lloyd McKenzie (Nov 16 2020 at 23:09):
EnableWhen can absolutely refer to a parent element
Lloyd McKenzie (Nov 16 2020 at 23:10):
My leaning would be a group. But it's more a question of style. I don't think there's a clear right/wrong.
Elliot Silver (Nov 16 2020 at 23:10):
Lloyd McKenzie said:
Open choice allows you to just have an answer where you convey a string instead of one of the choices (rather than as a sub-answer to a specific choice)
So, open choice gives you this?:
- (_) A
- (_) B
- (_) [__________]
Lloyd McKenzie (Nov 16 2020 at 23:11):
Yes
Elliot Silver (Nov 16 2020 at 23:15):
Well neither choice nor open-choice look like great solutions. With choice, if you have an answer value set, then it needs to contain an "other" value, which I've been led to believe is bad from a terminology point of view. If you use open-choice, then there is no lead-in text for the string, which is poor user interface.
Lloyd McKenzie (Nov 16 2020 at 23:31):
I wouldn
Lloyd McKenzie (Nov 16 2020 at 23:32):
I wouldn't worry about terminology practice in a Questionnaire. You're going to do all sorts of things that are focused on user interface. You can (and should) transform data when migrating it to resources
Grahame Grieve (Nov 16 2020 at 23:32):
I think it's not so binary
Elliot Silver (Nov 16 2020 at 23:35):
Well, using choice then means I either include an "Other" value in my base valueset or I define a new valueset, just for use in the questionnaire, that includes my base valueset plus one "Other" value. Neither seem pretty. And neither allow me to use SDC observation data extraction.
Last updated: Apr 12 2022 at 19:14 UTC