Skip to content

Issue with showing a multi-select list of check-boxes #161

@chtirrell

Description

@chtirrell

Hello!

I'm attempting to render a questionnaire that has a list of non-mutually exclusive choices that I want to show as a single group, where the user can select zero, one, or more values from the set of choices. I'd to display it as a list of values and checkboxes, where each value can be selected and unselected.

Here's an example of what I'm trying to accomplish.
Image

I've attempted several different approaches and below you'll see my attempt to hack it without success. Can someone point me in the right direction of how/if this can be accomplished? Huge thanks in advance!

Best,

Charles

{
  "resourceType": "Questionnaire",
  "meta": {
    "profile": [
      "http://hl7.org/fhir/4.0/StructureDefinition/Questionnaire"
    ]
  },
  "title": "Test Form",
  "status": "draft",
  "item": [
    {
    "type": "group",
    "text": "Select all that apply:",
    "item": [
    {
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
                  "valueCodeableConcept" : {
                    "coding" : [
                      {
                        "system" : "http://hl7.org/fhir/questionnaire-item-control",
                        "code" : "check-box",
                        "display" : "Check-box"
                      }
                    ],
                    "text" : "A control where choices are listed with a box beside them. The box can be toggled to select or de-select a given choice. Multiple selections may be possible."
                  }
                }
              ],
              "linkId" : "2.4.2",
              "text" : "Choice 1",
              "type" : "choice",
              "answerOption" : [
                {
                  "valueCoding" : {
                    "system" : "http://example.org/CodeSystem/conditions",
                    "code" : "choice1",
                    "display" : " "
                  }
                }
              ]
            },
    {
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
                  "valueCodeableConcept" : {
                    "coding" : [
                      {
                        "system" : "http://hl7.org/fhir/questionnaire-item-control",
                        "code" : "check-box",
                        "display" : "Check-box"
                      }
                    ],
                    "text" : "A control where choices are listed with a box beside them. The box can be toggled to select or de-select a given choice. Multiple selections may be possible."
                  }
                }
              ],
              "text" : "Choice 2",
              "type" : "choice",
              "answerOption" : [
                {
                  "valueCoding" : {
                    "code" : "choice2",
                    "display" : " "
                  }
                }
              ]
            }
          ]
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions