FHIR Chat · QuestionnaireResponse item.item vs item.answer.item · questionnaire

Stream: questionnaire

Topic: QuestionnaireResponse item.item vs item.answer.item


view this post on Zulip Vladimir Smirnov (Nov 14 2018 at 16:21):

I'm really confused by the difference between the QuestionnaireResponse item.item and item.answer.item. What are the intended use cases for each?

Suppose we have some nested item structure in the Questionnaire, and all questions collect a single answer. Then the QuestionnaireResponse should exactly mirror the structure of the Questionnaire, using the item.item field every time.
pasted image

But once we have repeating groups, it is not clear how to provide answers for these in the QuestionnaireResponse. In case of repeating non-group items, we create multiple answers (it has 0..* cardinality). Is the item.answer.item intended to accomondate repeating groups? If so, what should be the linkId of every repeating item.answer.item? The item containing multiple answer.items should already have the linkId of the corresponding Questionnaire.item. Do the item.answer.items all bear the same linkId repeatedly?
pasted image

view this post on Zulip Lloyd McKenzie (Nov 14 2018 at 16:27):

item.item is used when the parent is a group (and thus will not have answers). item.answer.item is used when the parent is a question (and thus will have an answer). However, that's a really good question and it would be good to make that clear in the spec. Can you submit a change request for us to make that clear - and perhaps even add an invariant that enforces it

view this post on Zulip Vladimir Smirnov (Nov 15 2018 at 09:32):

But how do we handle repeating group answers?

Repeating regular item answers yield multiple answers in QuestionnaireResponse.item:
pasted image

Repeating group containing nested items, does it yield nested answer items under repeating QuestionnaireResponse.item.answer?
pasted image

If this is the correct approach, do the repeating group's nested answer items share the same linkId as in this example?

view this post on Zulip Lloyd McKenzie (Nov 15 2018 at 10:15):

A repreating group can only contain child items (representing child questions or groups). Descendant questions can have answers, but groups will never directly have answers. All items in the QuestionnaireResponse will share the linkId of the item they correspond to in the Questionnaire. So all repetitions of a particular group (or of a question appearing in different group repetitions) will have the same linkId.

view this post on Zulip Vladimir Smirnov (Nov 15 2018 at 12:26):

So is this the correct structure for the QuestionnaireResponse?
pasted image

view this post on Zulip Lloyd McKenzie (Nov 15 2018 at 13:00):

yes


Last updated: Apr 12 2022 at 19:14 UTC