FHIR Chat · Questionnaire Response example · questionnaire

Stream: questionnaire

Topic: Questionnaire Response example


view this post on Zulip Kashyap Jois (Feb 15 2021 at 12:44):

In the Questionnaire Response of f201-lifelines, answers with linkId 1, 3.1 and 3.2 are of type valueString while the Questionnaire f201-lifelines example expects a valueBoolean . Is this correct?

view this post on Zulip Lloyd McKenzie (Feb 15 2021 at 15:18):

No. Can you submit a technical correction?

view this post on Zulip Kashyap Jois (Feb 16 2021 at 08:27):

Done! link

view this post on Zulip Kashyap Jois (Feb 22 2021 at 08:28):

In this example I cannot understand why the item with link id vitaminKgiven has "item" as part of the "answer". What is the reason for the structure to allow items to be within answers?

view this post on Zulip Lloyd McKenzie (Feb 22 2021 at 14:58):

When you have questions that are nested beneath questions, they are always tied to the answer. That's because if the parent item allows multiple answers, you answer the child questions for each answer for the parent question.

view this post on Zulip Jing Tang (Feb 23 2021 at 09:32):

Thanks @Lloyd McKenzie!

But doesn't that violate the rule here: https://www.hl7.org/fhir/questionnaireresponse.html#link ? or are we treating items under a parent item and items under an answer to that parent item the same way?

I think from a implenter's perspective, there is just this extra step while creating a questionnaire response: rather than blindly mirror the structure of the questionnaire, you just have to make sure the questionnaire response are nested in the right answer.

Additionally, if the enable when statement is more complicated (e.g. enabled if A or B is selected), then do we keep the response where it is (under the questionnaire item) or under the answer (e.g. under A or under B)?

view this post on Zulip Kashyap Jois (Feb 23 2021 at 11:46):

Thanks @Lloyd McKenzie This was kind of tricky to understand, there seems to be no documentation mentioning this. We assumed that the nested item would appear as it does in the questionnaire i.e. part of the parent item and not within the parent items answer .

view this post on Zulip Lloyd McKenzie (Feb 23 2021 at 14:37):

Agree that we need better documentation here. SDC has some, but this should be reflected in the core resources. The base rule is that for Questions, you always nest beneath answer and for groups, you nest directly beneath the item. In both cases, the hierarchy is retained. The reason for the difference is that when there are multiple answers for the parent question, you need to do the nesting for each answer.

view this post on Zulip Lloyd McKenzie (Feb 23 2021 at 14:38):

Can one of you submit a change request for us to surface this in the core specification?

view this post on Zulip Jing Tang (Feb 23 2021 at 14:49):

i synced up with kashyap who showed me an example of why we need to nest items under answer -- so please do disregard what i said earlier. thanks @Lloyd McKenzie

view this post on Zulip Jing Tang (Feb 23 2021 at 14:49):

Lloyd McKenzie said:

Can one of you submit a change request for us to surface this in the core specification?

happy to take this

view this post on Zulip Jing Tang (Feb 23 2021 at 15:21):

https://jira.hl7.org/browse/FHIR-31357

view this post on Zulip Lloyd McKenzie (Feb 23 2021 at 15:23):

Thanks!

view this post on Zulip Paul Lynch (Feb 25 2021 at 15:55):

Lloyd McKenzie said:

The reason for the difference is that when there are multiple answers for the parent question, you need to do the nesting for each answer.

I don't think that was necessary. An alternative design would have been to repeat the question's item for each answer, and nest under the item, as you do for a group. But, either approach works if clearly documented.

view this post on Zulip Lloyd McKenzie (Feb 25 2021 at 17:20):

If you repeat the item, you have to repeat the text. It also makes tracking cardinality of answers harder.

view this post on Zulip Kashyap Jois (Oct 26 2021 at 13:09):

Just adding this image here. It was created for ease of understanding this slightly complicated concept of nesting in the Questionnaire and Questionnaire Response.
QuestionnaireResponseTree.jpg

cc @Jing Tang

view this post on Zulip Lloyd McKenzie (Oct 26 2021 at 13:16):

That looks correct

view this post on Zulip Jing Tang (Oct 26 2021 at 17:21):

thanks @Kashyap Jois for sharing - this diagram would be great for the community to understand the structure of repeated items in Quesetionnaire vs QR. @Lloyd McKenzie should we consider adding this (or something similar to this) to the IG's documentation? :)

view this post on Zulip Lloyd McKenzie (Oct 26 2021 at 19:06):

We could. Would someone like to submit a change request proposing that? :)

view this post on Zulip Kashyap Jois (Oct 27 2021 at 10:28):

Lloyd McKenzie said:

We could. Would someone like to submit a change request proposing that? :)

Sure , I'll submit a change request :)

view this post on Zulip Kashyap Jois (Oct 27 2021 at 12:59):

https://jira.hl7.org/browse/FHIR-34184 Here is the change request @Lloyd McKenzie

view this post on Zulip Paul Lynch (Oct 27 2021 at 20:12):

@Kashyap Jois For completeness, you might want to add items where type=group (with cases for repeats=true and false), because groups don't have answers.

view this post on Zulip Kashyap Jois (Oct 28 2021 at 07:02):

QuestionnaireResponseTree.jpg @Paul Lynch please have a look. I have improved the diagram to include type==group also

view this post on Zulip Kashyap Jois (Oct 28 2021 at 07:09):

Also here is the source QuestionnaireResponseTree.drawio

view this post on Zulip Lloyd McKenzie (Oct 28 2021 at 14:36):

I don't see any nesting within answers - which is something we definitely need to highlight.

view this post on Zulip Paul Lynch (Oct 28 2021 at 17:48):

That looks right to me-- thanks.

view this post on Zulip Tilo Christ (Oct 31 2021 at 20:57):

I'm rebuilding the internals of my filler to support the picture. Two questions:

  • with all these groupings and repetitions, there can be a questionnaire response where several items have the same linkId. What is the behaviour for enableWhen, which identifies questions through a linkId? Only look upwards from the current item to the top?
  • @Lloyd McKenzie what are you referring to with the "nesting within answers"? Is this picture still incomplete?

view this post on Zulip Lloyd McKenzie (Nov 01 2021 at 02:51):

As it says in the comment for enableWhen.question, "If multiple question occurrences are present for the same question (same linkId), then this refers to the nearest question occurrence reachable by tracing first the "ancestor" axis and then the "preceding" axis and then the "following" axis."
Yes. Questions can be nested within questions, in which case, the nesting happens within each answer

view this post on Zulip Tilo Christ (Nov 01 2021 at 09:02):

Thanks, I had missed that there are comments, I shouldn't be reading specs at 1am. Is the "nesting" something different than the situation shown with "Item_1" and "Item_2" in the diagram?

view this post on Zulip Lloyd McKenzie (Nov 01 2021 at 14:23):

Um, nope. My brain didn't expect that design of a form, so I didn't notice. All is good - and thank you!

view this post on Zulip Kashyap Jois (Nov 01 2021 at 14:30):

Just saw your response editing this message, since I cannot delete it.


Last updated: Apr 12 2022 at 19:14 UTC