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

!= operator bug within formbuilder #23

Open
abdullah-git1 opened this issue Aug 25, 2021 · 3 comments
Open

!= operator bug within formbuilder #23

abdullah-git1 opened this issue Aug 25, 2021 · 3 comments

Comments

@abdullah-git1
Copy link

When trying to use the != operator within the form builder in the conditional show logic section, there seems to be no way to specify a specific value. When uploading a questionnaire json that contains a != associated with a value, the json output changes it to =

@plynchnlm
Copy link
Member

Please look at the following Questionnaire, built with the formbuilder, which uses != and which still has != when imported from a file.

{
  "status": "draft",
  "resourceType": "Questionnaire",
  "meta": {
    "profile": [
      "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire|2.7"
    ],
    "tag": [
      {
        "code": "lformsVersion: 29.1.2"
      }
    ]
  },
  "item": [
    {
      "type": "string",
      "code": [
        {
          "code": "q1",
          "display": "q1"
        }
      ],
      "required": false,
      "linkId": "q1",
      "text": "q1"
    },
    {
      "type": "string",
      "code": [
        {
          "code": "q2",
          "display": "q2"
        }
      ],
      "required": false,
      "linkId": "q2",
      "text": "q2",
      "enableWhen": [
        {
          "answerString": "z",
          "question": "q1",
          "operator": "!="
        }
      ]
    }
  ]
}

If you can make a small test case that shows the problem you are describing, please post it here.

@ruscoder
Copy link

@plynchnlm I confirm that there is a bug with that when the question (q1) has type choice.

{
  "meta": {
    "profile": [
      "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire|2.7"
    ],
    "tag": [
      {
        "code": "lformsVersion: 29.2.1"
      }
    ]
  },
  "status": "draft",
  "resourceType": "Questionnaire",
  "item": [
    {
      "type": "choice",
      "code": [
        {
          "code": "q1",
          "display": "q1"
        }
      ],
      "extension": [
        {
          "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
          "valueCodeableConcept": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/questionnaire-item-control",
                "code": "drop-down",
                "display": "Drop down"
              }
            ],
            "text": "Drop down"
          }
        }
      ],
      "required": false,
      "linkId": "q1",
      "text": "q1",
      "answerOption": [
        {
          "valueCoding": {
            "code": "test",
            "display": "Test"
          }
        },
        {
          "valueCoding": {
            "code": "test2",
            "display": "Test2"
          }
        }
      ]
    },
    {
      "type": "string",
      "code": [
        {
          "code": "q2",
          "display": "q2"
        }
      ],
      "required": false,
      "linkId": "q2",
      "text": "q2",
      "enableWhen": [
        {
          "answerCoding": {
            "code": "test"
          },
          "question": "q1",
          "operator": "="
        }
      ]
    }
  ]
}

Try to switch between = and != for q2

@plynchnlm
Copy link
Member

Thanks for the test case. We've confirmed the bug, and found that it also exists in the new version (a rewrite) that are planning to release soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants