Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questionnaire AnswerOption optionExclusive Extension does not work in Popup #2436

Closed
asad-zaman opened this issue Feb 11, 2024 · 2 comments · Fixed by #2438
Closed

Questionnaire AnswerOption optionExclusive Extension does not work in Popup #2436

asad-zaman opened this issue Feb 11, 2024 · 2 comments · Fixed by #2438
Assignees
Labels
effort:small Small effort - 2 days P2 Medium priority issue type:enhancement New feature or request

Comments

@asad-zaman
Copy link
Contributor

Describe the bug
optionExclusive feature has been implemented here #1281. However, when options appear in a popup (if there are more than ten items), this doesn't work.

Component
SDC library

To Reproduce
This questionnaire doesn't work as expected when choosing an option with optionExclusive extension. e.g. No Problem.

{
  "resourceType": "Questionnaire",
  "item": [
    {
      "linkId": "9b585e14-2d7c-4391-8c89-01f5474c3f9c",
      "type": "choice",
      "text": "Reason for Referral",
      "required": true,
      "repeats": true,
      "answerOption": [
        {
          "valueCoding": {
            "id": "0b2e1881-b37f-4f9f-8abe-fbc172b15307",
            "code": "pregnancy_problems",
            "system": "urn:uuid:fca5e3c1-1f62-4d7c-97a4-f03303c1a659",
            "display": "Pregnancy Problems"
          }
        },
        {
          "valueCoding": {
            "id": "82ea21c8-15d7-483e-8283-e536b888da91",
            "code": "delivery_problems",
            "system": "urn:uuid:fca5e3c1-1f62-4d7c-97a4-f03303c1a659",
            "display": "Delivery Problems"
          }
        },
        {
          "valueCoding": {
            "id": "f1b7fbe8-4cbe-4361-c8dd-bc37452ecf44",
            "code": "pnc_problem",
            "system": "urn:uuid:fca5e3c1-1f62-4d7c-97a4-f03303c1a659",
            "display": "PNC Problems"
          }
        },
        {
          "valueCoding": {
            "id": "ce21d4d6-fa94-4ca9-8235-6b40d7bdd938",
            "code": "child_problems",
            "system": "urn:uuid:fca5e3c1-1f62-4d7c-97a4-f03303c1a659",
            "display": "Child Problems"
          }
        },
        {
          "valueCoding": {
            "id": "2052cb16-bb05-4402-8bab-836316de529b",
            "code": "adolescent_problems",
            "system": "urn:uuid:fca5e3c1-1f62-4d7c-97a4-f03303c1a659",
            "display": "Adolescent Problems"
          }
        },
        {
          "valueCoding": {
            "id": "22dad9d8-6573-4e6d-ce52-31f44d78f1b9",
            "code": "problems_eyes",
            "system": "urn:uuid:fca5e3c1-1f62-4d7c-97a4-f03303c1a659",
            "display": "Eye Problems"
          }
        },
        {
          "valueCoding": {
            "id": "7c1a5f41-52b5-42c2-af33-930e7660ffcf",
            "code": "diabetes",
            "system": "urn:uuid:fca5e3c1-1f62-4d7c-97a4-f03303c1a659",
            "display": "Diabetes"
          }
        },
        {
          "valueCoding": {
            "id": "44c78729-a0d2-4eca-8a79-e3bdf190d30c",
            "code": "high_blood_pressure",
            "system": "urn:uuid:fca5e3c1-1f62-4d7c-97a4-f03303c1a659",
            "display": "High Blood Pressure"
          }
        },
        {
          "valueCoding": {
            "id": "66d5589c-fac0-4af6-85a9-3d1c0aed7708",
            "code": "problems_with_birth_control",
            "system": "urn:uuid:fca5e3c1-1f62-4d7c-97a4-f03303c1a659",
            "display": "Birth Control Problems"
          }
        },
        {
          "valueCoding": {
            "id": "ca32b68f-e942-45e6-87d4-9db8c50f53cd",
            "code": "cataract_problem",
            "system": "urn:uuid:fca5e3c1-1f62-4d7c-97a4-f03303c1a659",
            "display": "Cataract Problems"
          }
        },
        {
          "valueCoding": {
            "id": "98e6fa08-ab4e-4348-8e7a-f5c6f05721b2",
            "code": "other",
            "system": "urn:uuid:fca5e3c1-1f62-4d7c-97a4-f03303c1a659",
            "display": "Others"
          }
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-optionExclusive",
              "valueBoolean": true
            }
          ],
          "valueCoding": {
            "id": "7aa8e7b4-20e2-401a-913c-973ecd7e1ebc",
            "code": "no_problem",
            "system": "urn:uuid:fca5e3c1-1f62-4d7c-97a4-f03303c1a659",
            "display": "No Problem"
          }
        }
      ],
      "extension": [
        {
          "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
          "valueCodeableConcept": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/ValueSet/questionnaire-item-control",
                "code": "check-box"
              }
            ]
          }
        }
      ]
    }
  ]
}

Expected behavior
Above questionnaire should work and deselect other options when selecting the option with optionExclusive extension and vice versa.

Screenshots
Screen_recording_20240211_113543

Would you like to work on the issue?
A PR is created which resolves the issue.

@MJ1998
Copy link
Collaborator

MJ1998 commented Feb 12, 2024

Hi @asad-zaman
Thanks for raising this.

I understand this issue and I also looked at your code.
I am wondering how many options do you generally have to show ?
Asking this because if its much greater than few 10s of data then the solution may change.

@MJ1998 MJ1998 self-assigned this Feb 14, 2024
@asad-zaman
Copy link
Contributor Author

Hello @MJ1998,
In some cases, I have to present 11 to 13 options, otherwise less than 10

@github-project-automation github-project-automation bot moved this from New to Complete in Android FHIR SDK Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:small Small effort - 2 days P2 Medium priority issue type:enhancement New feature or request
Projects
Status: Complete
3 participants