FHIR Chat · Questionnaire - Choosing "Other - Specify" · Canadian eReferral

Stream: Canadian eReferral

Topic: Questionnaire - Choosing "Other - Specify"


view this post on Zulip Tim Berezny (Aug 05 2021 at 14:11):

It's common to have a form where you can select from one or many options, and also have an "other - specify" field, where it then displays a text box.

Is the best way to handle this in the Questionnaire to create an ADDITIONAL question (string) which displays conditionally depending on if the user chooses "Other - specify" in the original question? Or is there another standard approach available?

view this post on Zulip Lloyd McKenzie (Aug 05 2021 at 15:00):

That is the standard mechanism. The additional "please specify" question would be a 'child' of the base question, meaning that if you pick 'other' multiple times, there'll be a "please specify" question and answer for each.

view this post on Zulip Tim Berezny (Aug 05 2021 at 16:07):

Just to make sure i'm super clear on this:
Let's say that you've got 10 options you can choose from, and you can have a "please specify for each".

In the questionnaire I'd have an additional 10 sub-items, and each of them would have an enableWhen based on the paren item, one for each question?

view this post on Zulip Lloyd McKenzie (Aug 05 2021 at 16:25):

In the Questionnaire, you'd have one "please specify" item of type string with an enableWhen tied to whatever items you want it triggered for. In the QuestionnaireResponse, you'd have a child item with that linkId beneath each answer that needed it.

view this post on Zulip Brian Postlethwaite (Aug 06 2021 at 05:10):

This demo form is an example of that
image.png
https://sqlonfhir-r4.azurewebsites.net/fhir/Questionnaire/1e4bed6f833f46ddb08d45528ad4bb80

view this post on Zulip Tim Berezny (Aug 12 2021 at 18:54):

Thanks, that's a big help. I gave it a try here with a questionnaireResponse where the user chooses 3 items from a risk of a dozen risk issues, and adds comments to 2 of them, does this look right?

"item": [
    {
        "linkId": "risk-issues",
        "text": "Risk Issues",
        "answer": [
            {
                "valueCoding": {
                    "code": "smoker",
                    "display": "Smoker",
                    "userSelected": true
                },
                "item": [
                    {
                        "linkId": "smoker-comment",
                        "text": "Smoker - comment",
                        "answer": [
                            {
                                "valueString": "5 packs a day"
                            }
                        ]
                    }
                ]
            },
            {
                "valueCoding": {
                    "code": "pregnant",
                    "display": "Pregnant",
                    "userSelected": true
                },
                "item": [
                    {
                        "linkId": "pregnant-comment",
                        "text": "Pregnant - Comment",
                        "answer": [
                            {
                                "valueString": "In 2nd trimester"
                            }
                        ]
                    }
                ]
            },
            {
                "valueCoding": {
                    "code": "diabetes",
                    "display": "Diabetes",
                    "userSelected": true
                }
            },
        ]
    }
]

view this post on Zulip Brian Postlethwaite (Aug 13 2021 at 00:23):

Depending on the Questionnaire, but that could be right.

view this post on Zulip Tim Berezny (Aug 16 2021 at 13:14):

Thanks Brian.

@Lloyd McKenzie is the sample data structure above what you meant by "you'd have a child item with that linkId beneath each answer that needed it."?

view this post on Zulip Lloyd McKenzie (Aug 16 2021 at 15:27):

yes


Last updated: Apr 12 2022 at 19:14 UTC