FHIR resources in EBMEDS

SelfCareQuestionnaire

Inherits from: Questionnaire

FHIR profile: SelfCareQuestionnaire

The FHIR Questionnaire resource is a general way of describing, you guessed it, questionnaires.

Example

An example resource is:

{
  "resourceType":"Questionnaire",
  "language":"fi",
  "url":"https://www.ebmeds.org/form/api/FHIR/forms/export/107/550",
  "version":"v0.9.3",
  "status":"active",
  "date":"2017-10-11T11:45:49.036Z",
  "publisher":"© Kustannus Oy Duodecim, 2017",
  "copyright":"© Kustannus Oy Duodecim, 2017",
  "identifier":[
    {
      "system":"https://duodecim.fi/fhir/sid/vkt-questionnaire-id",
      "value":"107"
    }
  ],
  "title":"Hengitystietulehdusoireiden oirearvio",
  "text":{
    "status":"generated",
    "div":"<div xmlns=\"http://www.w3.org/1999/xhtml\">Neuvova oirearviolomake, joka auttaa hengitystieinfektion oireita potevaa henkilöä arvioimaan ammattiavun tarvetta ja omahoidon mahdollisuuksia</div>"
  },
  "extension":[
    {
      "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)"
        }
      ]
    }
  ],
  "item":[
    {
      "linkId":"introduction",
      "text":"Introductory text of the questionnaire. Also a container item. Has no answer, but contains other items. The text is written in markdown, so it may contain [links](https://ebmeds.org).",
      "type":"group",
      "item":[
        {
          "linkId": "266",
          "type": "display",
          "text": "A display-type question in the Questionnaire, has no answer but must also be present in the QuestionnaireResponse according to the FHIR spec."
        },
        {
          "linkId":"3",
          "type":"decimal",
          "text":"A question with a numeric answer. (For example, age.)",
          "required":true,
          "code":[
            {
              "system":"http://loinc.org",
              "code":"21612-7"
            }
          ],
          "extension":[
            {
              "url":"http://hl7.org/fhir/StructureDefinition/minValue",
              "valueDecimal":10
            },
            {
              "url":"http://hl7.org/fhir/StructureDefinition/maxValue",
              "valueDecimal":99
            }
          ]
        },
        {
          "linkId":"306",
          "required":true,
          "text":"'Check box' type multiple choice questions may naturally have > 1 answers.",
          "type":"choice",
          "repeats":true,
          "option":[
            {
              "valueCoding":{
                "id":"452",
                "display":"First option."
              }
            },
            {
              "valueCoding":{
                "id":"453",
                "display":"Second option."
              }
            },
            {
              "valueCoding":{
                "id":"453",
                "display":"None of the above."
              },
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-optionExclusive",
                  "valueBoolean": true
                }
              ]
            }
          ]
        },
        {
          "linkId":"305",
          "required":true,
          "text":"A 'radio button' type multiple choice question. In the QuestionnaireResponse, looks identical to a checkbox answer with one answer checked.",
          "type":"choice",
          "repeats":false,
          "option":[
            {
              "valueCoding":{
                "id":"462",
                "display":"First option."
              }
            },
            {
              "valueCoding":{
                "id":"463",
                "display":"Second option."
              }
            },
            {
              "valueCoding":{
                "id":"464",
                "display":"Third option."
              }
            }
          ]
        },
        {
          "linkId": "23",
          "required": true,
          "text": "A boolean-type question. In the Questionnaire this question contains display logic, i.e. the question is only visible when certain other questions have been answered in a certain way. In this example, the numerical answer in question ID 3 must be between 15 and 99.",
          "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": "<"
              }
            }
          ]
        }
      ]
    }
  ]
}

With the fields:

Questionnaire items

The example Questionnaire above contains an assortment of the most common variants of a question item: the different question types, as well as the usage display logic (enableWhen) and custom extensions.

The fields in item are as follows.

Questionnaire extensions

See the extensions page.

SelfCareQuestionnaireResponse

Inherits from: QuestionnaireResponse

FHIR profile: SelfCareQuestionnaireResponse

The SelfCareQuestionnaireResponse is the counterpart to a Questionnaire: it contains the answers that the user has provided. This can be sent to EBMEDS for decision support.

Here is a complete example:

{
  "resourceType": "QuestionnaireResponse",
  "id": "0685d814-f4af-41a3-8547-5c7e5f97c923",
  "questionnaire": {
    "identifier": {
      "system": "https://duodecim.fi/fhir/sid/vkt-questionnaire-id",
      "value": "21"
    }
  },
  "status": "completed",
  "item": [
    {
      "linkId": "introduction",
      "text": "Introductory text of the questionnaire. Also a container item. Has no answer, but contains other items. The text is written in markdown, so it may contain [links](https://ebmeds.org).",
      "item": [
        {
          "linkId": "266",
          "text": "A display-type question in the Questionnaire, has no answer but must also be present in the QuestionnaireResponse according to the FHIR spec."
        },
        {
          "linkId": "3",
          "text": "A question with a numeric answer. (For example, age.)",
          "answer": [
            {
              "valueDecimal": 45
            }
          ]
        },
        {
          "linkId": "306",
          "text": "'Check box' type multiple choice questions may naturally have > 1 answers.",
          "answer": [
            {
              "valueCoding": {
                "id": "452"
              }
            },
            {
              "valueCoding": {
                "id": "453"
              }
            }
          ]
        },
        {
          "linkId": "305",
          "text": "A 'radio button' type multiple choice question. In the QuestionnaireResponse, looks identical to a checkbox answer with one answer checked.",
          "answer": [
            {
              "valueCoding": {
                "id": "462"
              }
            }
          ]
        },
        {
          "linkId": "23",
          "text": "A boolean-type question. In the Questionnaire this question contains display logic, i.e. the question is only visible when certain other questions have been answered in a certain way. In this example, the numerical answer in question ID 3 must be between 15 and 99.",
          "answer": [
            {
              "valueBoolean": true
            }
          ]
        }
      ]
    }
  ]
}

So the structure has the following fields:

SelfCareActivityDefinition

Inherits from: ActivityDefinition

FHIR profile: SelfCareActivityDefinition

The main point of the FHIR resource SelfCareActivityDefinition is to describe an action. In the traditional CDS context the primary unit is the reminder, an informative message that may have an encoded action suggestion attached to it. In the self-care context it is the other way around: we return actions that have messages attached to them.

In practice, this means that if several reminders suggest the same action, only one SelfCareActivityDefinition is returned, with several reminder texts attached to it. This also means that the card structure of CDS hooks becomes meaningless, see the discussion at the bottom of this page.

Data model

The ActivityDefinitions in the selfcare-* hooks separate the reminder texts from their suggested actions. Given a set of reminders, each with 0 or more suggested actions attached to them, the reminder texts and actions are split up into several SelfCareActivityDefinitions:

  1. Zero or one ActivityDefinition containing the code system https://duodecim.fi/fhir/stu3/CodeSystem/activity-definition-custom-actions and the code read-reminder. This resource contains all reminder texts with severity level reminder in its topic.text field.
  2. Zero or one ActivityDefinition containing the code system https://duodecim.fi/fhir/stu3/CodeSystem/activity-definition-custom-actions and the code read-prompt. This resource contains all reminder texts with severity level prompt in its topic.text field.
  3. Zero or one ActivityDefinition containing the code system https://duodecim.fi/fhir/stu3/CodeSystem/activity-definition-custom-actions and the code read-alert. This resource contains all reminder texts with severity level alert in its topic.text field.
  4. Zero or more ActivityDefinition containing any other code system and code, representing the actual actions.

In other words: ActivityDefinitions of type 1-3 may or may not be present, but at least one of them contains at least one reminder text. See below for an example.

Code systems

These code systems are used when coding an ActivityDefinition. See the code systems page for more detailed information.

Restrictions

Some restrictions have been put in place to simplify data processing, using the SelfCareActivityDefinition profile.

Example

Below is an example of the two kinds of SelfCareActivityDefinitions (one describing an action, one containing reminder texts) in a CDS response:

{
  "cards": [
    {
      "summary": "Selfcare action suggestions",
      "indicator": "info",
      "source": {
        "name": "EBMEDS v2.0.6",
        "url": "https://ebmeds.org/version/v2.0.6/data-version/v0.9.2"
      },
      "suggestions": [
        {
          "resourceType": "ActivityDefinition",
          "status": "active",
          "copyright": "Kustannus Oy Duodecim, 2017",
          "participant": [
            {
              "type": "patient"
            }
          ],
          "kind": "Observation",
          "code": {
            "coding": [
              {
                "code": "ADA001-P1",
                "system": "http://91.202.112.142/codeserver/pages/classification-view-page.xhtml?classificationKey=2023&versionKey=2283",
                "display": "Yleislääkärin päivystyksen palvelut - Hoidetaan päivystyksenä"
              }
            ]
          }
        },
        {
          "resourceType": "ActivityDefinition",
          "status": "active",
          "copyright": "Kustannus Oy Duodecim, 2017",
          "participant": [
            {
              "type": "patient"
            }
          ],
          "kind": "CommunicationRequest",
          "code": {
            "coding": [
              {
                "system": "https://duodecim.fi/fhir/stu3/CodeSystem/activity-definition-custom-actions",
                "code": "read-reminder",
                "display": "Lue muistutteet"
              }
            ]
          },
          "topic": [
            {
              "text": "Oireesi voivat johtua virtsatietulehduksesta, joka voi olla munuaistasoinen. Hakeudu päivystysvastaanotolle.",
              "coding": [
                {
                  "system": "https://duodecim.fi/fhir/stu3/CodeSystem/reminder-id",
                  "code": "46bea5c0-c18e-4e78-a20c-06974bae60f7",
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

And the fields are described as follows.

SelfCareObservation

Inherits from: Observation

FHIR profile: SelfCareObservation

A very simple resource describing some new observation made about the patient from the basis of his or her patient data.

Example

{
  "status": "final",
  "code": {
    "coding": [
      {
        "system": "https://duodecim.fi/fhir/stu3/CodeSystem/custom-observations",
        "code": "potential-extra-years"
      }
    ]
  },
  "effectiveDateTime": "2018-04-25T11:13:56.894Z",
  "valueQuantity": {
    "unit": "a",
    "value": 5
  }
}

And the fields are the following:

SelfCareRiskAssessment

Inherits from: RiskAssessment

FHIR profile: SelfCareRiskAssessment

A resource describing some newly calculated risk regarding the patient, from the basis of his or her patient data. The risk is always associated with a certain outcome (with a diagnosis code or similar), and the age range in years for which this risk is applicable for this particular patient. The risk probability is always given as a decimal between 0 and 1.

Example

{
  "status": "final",
  "prediction": [
    "outcome": {
      "coding": [{
        "system": "http://snomed.info/sct",
        "code": "414545008"
      }]
    },
    "probabilityDecimal": 0.40,
    "whenRange": {
      "low": {
        "value": 52,
        "unit": "a"
      },
      "high": {
        "value": 62,
        "unit": "a"
      }
    }
  ]
}

And the fields are the following:

Resources for general CDS

At the moment, EBMEDS best supports questionnaire-based decision support in FHIR, using the resources described above. For a full-blown CDS service, a large range of other clinical data about a person can and should be included. The resources for describing these is in a very experimental stage, and the profiles will probably change once real-world use is initiated. The documentation is therefore still mostly in the profiles themselves: