Questionnaire extensions

self-care-instructions

Contains the sub-extension instruction-text. Has a string value which is a markdown string containing a link to long-form self-care instructions.

Example:

{
  "url":"https://duodecim.fi/fhir/extensions/self-care-instructions",
  "extension":[
    {
      "url":"instruction-text",
      "valueString":"[Itsehoito-ohje](http://www.terveyskirjasto.fi/terveyskirjasto/tk.koti?p_artikkeli=dlk01167)"
    }
  ]
}

displayCategory

Question with type: 'display' require a few more subcategories, which is the purpose of this HL7 extension. The allowed values are:

Example:

[
  {
    "linkId":"14",
    "text":"# A subtitle",
    "type":"display",
    "extension":[
      {
        "url":"http://hl7.org/fhir/StructureDefinition/questionnaire-displayCategory",
        "valueString":"subtitle"
      }
    ]
  },
  {
    "linkId":"15",
    "text":"Things are really bad.",
    "type":"display",
    "extension":[
      {
        "url":"http://hl7.org/fhir/StructureDefinition/questionnaire-displayCategory",
        "valueString":"terminus"
      }
    ]
  }
]

minValue

Extension by HL7 to specify a minimum value for a numerical question. Is often seen together with maxValue.

Example:

{
  "linkId":"15",
  "text":"Give the length of your foot.",
  "type":"decimal",
  "extension":[
    {
      "url": "http://hl7.org/fhir/StructureDefinition/minValue",
      "valueDecimal": 15.3
    }
  ]
}

maxValue

Extension by HL7 to specify a maximum value for a numerical question. Is often seen together with minValue.

Example:

{
  "linkId":"15",
  "text":"Give your age.",
  "type":"decimal",
  "extension":[
    {
      "url": "http://hl7.org/fhir/StructureDefinition/maxValue",
      "valueDecimal": 100.3
    }
  ]
}

There is some special UI logic required to handle a multiple choice question with the choice "none of the above". For this we use an extension that marks one of the choices as exclusive:

optionExclusive

HL7 extension to specify that a multiple choice answer is exclusive, i.e. in a 'checkbox' multiple choice question, if you check this answer, all other options are taken to be unchecked, and should be greyed out in the UI. Mainly used for 'none of the above' types of answer choices.

Example:

{
  "valueCoding":{
    "id": "-1",
    "display": "None of the above",
    "extension": [
      {
        "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-optionExclusive",
        "valueBoolean": true
      }
    ]
  }
}

maxDecimalPlaces

For questions of type decimal, specifies an integer value signifying the maximum number of decimal places that a user is allowed to fill in for his answer. If the extension is not present, the value is taken to be infinity. If the value is 0, the question type should be integer instead.

{
  "linkId":"15",
  "text":"Give your age with 2 decimal precision.",
  "type":"decimal",
  "extension":[
    {
      "url": "http://hl7.org/fhir/StructureDefinition/maxDecimalPlaces",
      "valueInteger": 2
    }
  ]
}

enable-when-operator

The display logic conditions in Questionnaire.item.enableWhen are given in an array. By default, the question should be visible when any of the listed conditions are true. This extension takes a string value AND, OR, NOT. They should be interpreted in the following manner:

The same extension may be present multiple times in a condition, to construct e.g. AND NOT.

Example:

{
  "linkId": "23",
  "required": true,
  "type": "boolean",
  "enableWhen": [
    {
      "question": "3",
      "answerQuantity": {
        "value": 15,
        "comparator": ">"
      }
    },
    {
      "question": "3",
      "extension": [
        {
          "url": "https://duodecim.fi/fhir/extensions/enable-when-operator",
          "valueString": "AND"
        }
      ],
      "answerQuantity": {
        "value": 99,
        "comparator": "<"
      }
    }
  ]
}