Skip to content

Questionnaire problem cases#4

Open
mlaletina95 wants to merge 1 commit intobeda-software:mainfrom
mlaletina95:questionnaire-problem-cases
Open

Questionnaire problem cases#4
mlaletina95 wants to merge 1 commit intobeda-software:mainfrom
mlaletina95:questionnaire-problem-cases

Conversation

@mlaletina95
Copy link
Copy Markdown

@mlaletina95 mlaletina95 commented Apr 9, 2026

  • calculated-options (CSIRO Bug: calculated choice from answerOption (pulse-rate-band) is not computed)
          "text": "Pulse rate band (calculated choice)",
          "type": "choice",
          "linkId": "pulse-rate-band",
          "readOnly": true,
          "extension": [
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression",
              "valueExpression": {
                "language": "text/fhirpath",
                "expression": "iif(\n  %resource.repeat(item).where(linkId='pulse-input').answer.valueInteger.exists(),\n  %qitem.answerOption.valueCoding.where(\n    code = iif(\n      %resource.repeat(item).where(linkId='pulse-input').answer.valueInteger.first() < 60,\n      'low',\n      iif(\n        %resource.repeat(item).where(linkId='pulse-input').answer.valueInteger.first() > 110,\n        'high',\n        'normal'\n      )\n    )\n  ).first(),\n  %qitem.answerOption.valueCoding.where(code='unknown').first()\n)"
              }
            }
          ],
          "answerOption": [
            {
              "valueCoding": {
                "code": "unknown",
                "system": "http://example.org/fhir/CodeSystem/pulse-band",
                "display": "—"
              }
            },
            {
              "valueCoding": {
                "code": "low",
                "system": "http://example.org/fhir/CodeSystem/pulse-band",
                "display": "Low (<60 bpm)"
              }
            },
            {
              "valueCoding": {
                "code": "normal",
                "system": "http://example.org/fhir/CodeSystem/pulse-band",
                "display": "Normal (60–110 bpm)"
              }
            },
            {
              "valueCoding": {
                "code": "high",
                "system": "http://example.org/fhir/CodeSystem/pulse-band",
                "display": "High (>110 bpm)"
              }
            }
          ]
        },
        {
          "text": "Tachycardia (> 110) (calculated boolean)",
          "type": "boolean",
          "linkId": "is-tachycardia",
          "readOnly": true,
          "extension": [
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression",
              "valueExpression": {
                "language": "text/fhirpath",
                "expression": "iif(\n  %resource.repeat(item).where(linkId='pulse-input').answer.valueInteger.exists(),\n  %resource.repeat(item).where(linkId='pulse-input').answer.valueInteger.first() > 110,\n  false\n)"
              }
            }
          ]
        }
      ],
      "text": "CalculatedExpression examples (different answer types)",
      "type": "group",
      "linkId": "calculated-section"
    }
  • score-calculation (LHC Bug: weighted score (itemWeight sum) is not computed)

@ir4y LHC use this options for scores:

"extension": [
        {
          "url": "http://hl7.org/fhir/StructureDefinition/variable",
          "valueExpression": {
            "name": "a",
            "language": "text/fhirpath",
            "expression": "%questionnaire.item.where(linkId = '/matrix').item.where(linkId = '/matrix/69671-6').answerOption.where(valueCoding.code=%resource.item.where(linkId = '/matrix').item.where(linkId = '/matrix/69671-6').answer.valueCoding.code).extension.where(url='http://hl7.org/fhir/StructureDefinition/ordinalValue').valueDecimal",
            "extension": [
              {
                "url": "http://lhcforms.nlm.nih.gov/fhirExt/expression-editor-score-variable",
                "valueBoolean": true

https://lhcfhirtools.nlm.nih.gov/lhcforms

  • initial (EMR Bug: Questionnaire.item.initial defaults are not applied)

@mlaletina95 mlaletina95 force-pushed the questionnaire-problem-cases branch from 0d32a00 to acd669e Compare April 9, 2026 19:25
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

Successfully merging this pull request may close these issues.

1 participant