Stream: implementers
Topic: QuestionnaireResponse with repeated group question
Andro Bermudez Serrano (Apr 13 2020 at 16:56):
How to fill a questionnaireresponse of a questionnaire with a group question with repeats: true?
Lloyd McKenzie (Apr 13 2020 at 18:16):
A group isn't a question. In the QuestionnaireResponse, you'd have 0..* items with the same linkId as the 'group' in the parent Questionnaire. Each repetition would contain child items corresponding to the answers to the questions for that group repetition. For example, if you had a group for 'active medication', you'd have one repetition of the group for each medication and child questions for each question about the medication (name, dose, prescriber, notes, etc.)
Andro Bermudez Serrano (Apr 13 2020 at 21:38):
Thanks for response.
Another doubt, given this questionnaire:
name: Family History
item:
- linkId: date
type: date
- linkId: member-history
text: Family Member
repeats: true
type: group
item:
- linkId: member-name
type: string
- linkId: member-condition
type: open-choice
We analyzed two ways for this case:
item:
- linkId: date
answer:
- valueDate: 2020-04-09
- linkId: member-history
item:
- linkId: member-name
answer:
- valueString: John
- linkId: member-condition
answer:
- valueString: Heart disease
- linkId: member-history
item:
- linkId: member-name
answer:
- valueString: Jane
- linkId: member-condition
answer:
- valueString: hypertension
vs
item:
- linkId: date
answer:
- valueDate: 2020-04-09
- linkId: member-history
item:
- linkId: member-history
item:
- linkId: member-name
answer:
- valueString: John
- linkId: member-condition
answer:
- valueString: Heart disease
- linkId: member-history
item:
- linkId: member-name
answer:
- valueString: Jane
- linkId: member-condition
answer:
- valueString: hypertension
We believe the second one easier to implement because both, the questionnaire and the response, has the same items cardinality.
Lloyd McKenzie (Apr 13 2020 at 21:43):
I'm not familiar with the syntax you're using. However, I believe the first is correct. You'd have two group repetitions, both with linkId=member-history
Eric Haas (Apr 13 2020 at 23:29):
YML (easy to read and edit version of JSON)
Patrick Werner (Apr 15 2020 at 12:08):
(I beg to differ on the easy part :wink: )
Last updated: Apr 12 2022 at 19:14 UTC