Questionnaire - Repeating Groups - What is the correct format?

When using “repeats” on a Questionnaire to generate the Response below, which would be correct — OPTION#1 or OPTION#2?

Questionnaire - OPTION#1

            "linkId": "2",
            "text": "Family member health information",
            "type": "group",
            "repeats": true,
            "item": [
              {
                "linkId": "2.1",
                "type": "group",

Questionnaire - OPTION#2

            "linkId": "2",
            "text": "Family member health information",
            "type": "group",
            "item": [
              {
                "linkId": "2.1",
                "type": "group",
                "repeats": true,

Questionnaire Response

      "linkId": "2",
      "text": "Family member health information",
      "item": [
        {
          "linkId": "2.1",
          "item": [
        {
          "linkId": "2.1",
          "item": [
1 Like

Option 2 would correspond your response. The ‘repeats=true’ needs to appear on the element that can have multiple repetitions.

1 Like

Hmmmm how does that match with this though from the fhir repeats spec?

The resulting QuestionnaireResponse will be populated the same way regardless of rendering - one ‘question’ item with multiple answer values.

Is the ‘group’ sort of a different question item?

@lloyd thanks for prompt reply.
The issue we’re having is that OPTION 1 is used in one of the official examples in the specs [Example response to the SDC-LOINC USSG Family History questionnaire]

  • In this example item “linkId”: “2” is marked with repeats:true (in Questionnaire)
  • while it is actually “linkId”: “2.1” that repeats multiple times in (Questionnaire-Response)

Would you be able to comment on why is this example not following the spec (Option 2)?

@Cameron_Strandberg: Repeating groups appear multiple times. Repeating questions have multiple answers

@Andrej: I see numerous items with linkId=“2”. There are no items with linkId of “2.1”. Are you looking at the current build? http://build.fhir.org/ig/HL7/sdc/Bundle-questionnaire-sdc-profile-example-ussg-fht.html

I’m looking at the official site (release 4) example:
http://hl7.org/fhir/questionnaireresponse-example-ussg-fht-answers.json.html (Questionnaire-Response)
is that not something that should be matching the specs (on the same site)?

(associated Questionnaire: http://hl7.org/fhir/questionnaire-profile-example-ussg-fht.json.html)

Hmm. Yes, in the core spec that’s definitely broken. It’s odd that the validator didn’t flag it. I’ve submitted a change request to get it fixed. (And sorry for the confusion.)

2 Likes

Thanks very much Lloyd! Your rapid responses have been very helpful.

1 Like