LHNCBC / formbuilder-lhcforms

Build LHC-Forms and FHIR Questionnaires
Other
28 stars 22 forks source link

Read-only repeating questions can be deleted #89

Closed whollervi closed 2 months ago

whollervi commented 2 months ago

Given the following questionnaire having a read-only, repeating question

{
  "resourceType": "Questionnaire",
  "title": "Repeating Questions Test",
  "status": "draft",
  "item": [
    {
      "type": "string",
      "linkId": "4935420545186",
      "text": "Question 1",
      "required": false,
      "repeats": true,
      "readOnly": true
    }
  ],
  "id": "80874dd2-b204-4363-a1c3-386c67f720ba"
}

and a questionnaire response with two answers.

{
    "resourceType": "QuestionnaireResponse",
    "id": "a48d4385-0422-43df-8140-ff79a603a1cf",
    "meta": {
        "profile": [
            "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse|2.7"
        ],
        "tag": [
            {
                "code": "lformsVersion: 34.0.1"
            }
        ],
        "lastUpdated": "2024-09-06T17:29:10.0265231+02:00",
        "versionId": "1"
    },
    "status": "completed",
    "authored": "2024-09-06T17:29:10.011+02:00",
    "item": [
        {
            "linkId": "4935420545186",
            "text": "Question 1",
            "answer": [
                {
                    "valueString": "answer 1"
                },
                {
                    "valueString": "answer 2"
                }
            ]
        }
    ],
    "questionnaire": "80874dd2-b204-4363-a1c3-386c67f720ba"
}

Although the question is read-only one can still add additional answers and even delete existing answers which in my opinion shouldn't be possible.

image

I am wondering what the expected rendering / interaction of a read-only, repeating question is.

What are your thoughts?

Thanks, Wolfgang

whollervi commented 2 months ago

Recreated the issue in the lforms repo (https://github.com/LHNCBC/lforms/issues/153#issue-2510936581) thus closing.