FHIR Chat · Definition-based extraction · questionnaire

Stream: questionnaire

Topic: Definition-based extraction


view this post on Zulip Jose Costa Teixeira (Mar 10 2021 at 14:13):

For activating Definition-based extraction, I think we need to add an extension
http://hl7.org/fhir/uv/sdc/2019May/extension-sdc-questionnaire-itemContext.html
what goes into the value of that extension?

view this post on Zulip Lloyd McKenzie (Mar 10 2021 at 16:45):

Typically a FHIRPath

view this post on Zulip Jose Costa Teixeira (Mar 10 2021 at 16:59):

Path to where?

view this post on Zulip Lloyd McKenzie (Mar 10 2021 at 17:22):

From the context associated with the containing item to the context associated with this item.

view this post on Zulip Jose Costa Teixeira (Mar 10 2021 at 20:08):

I have an questionnaire q1 that I want to use to populate a patient profile p1 and 2 observations o1 and o2
at the top level of q1, do I need to add that extension? Or I need to populate this extension for each questionnaire item that I want to map to the patient/observation?

view this post on Zulip Lloyd McKenzie (Mar 10 2021 at 20:50):

You'd have a context for your overall Questionnaire and then you'd establish separate context for each of the two Observation questions.

view this post on Zulip Jose Costa Teixeira (Mar 10 2021 at 20:57):

what is the context for the overall questionnaire?

view this post on Zulip Jose Costa Teixeira (Mar 10 2021 at 20:57):

Patient?

view this post on Zulip Jose Costa Teixeira (Mar 10 2021 at 20:58):

so I put that extension 3 times? one where the value is ..../MyPatient, another ..../MyObservation1, and ..../MyObservation2 ?

view this post on Zulip Lloyd McKenzie (Mar 10 2021 at 22:41):

You can have itemContext for the Questionnaire as a whole too. That context might be a query

view this post on Zulip Paul Lynch (Mar 10 2021 at 23:47):

The current extension name is itemExtractionContext, and is at http://build.fhir.org/ig/HL7/sdc/StructureDefinition-sdc-questionnaire-itemExtractionContext.html.

view this post on Zulip Paul Lynch (Mar 10 2021 at 23:51):

I think the Patient might be set with the launchContext extension, in which case itemExtractContext for the patient would be a very simple FHIRPath that just said "%patient".

view this post on Zulip Fred Hersch (Aug 04 2021 at 13:31):

@Lloyd McKenzie @Jose Costa Teixeira

Looking for some help here: We are using a Definition based extraction approach to extract the data from the questionnaire response.
In this example:

  • Questionnaire has an item to record the body temperature.
  • We also need to update the Observation.code while extracting questionnaire responses for body temperature.

A couple of questions:

  • What is the correct way to extract the code?
  • Can it be within the root item? - example 1 below - if so, what is the correct expression?
  • Or should we use hidden field to extract like in example 2 below
  • In general is there best practice for extracting the QuantityValue with the code system etc

Example 1

{
      "text": "Temperature",
      "type": "group",
      "linkId": "5.0.0",
      "extension": [
        {
          "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemExtractionContext",
          "valueExpression": {
            "language": "application/x-fhir-query",
            "expression": "Observation",
            "name": "temperature"
          }
        },
      "definition": "http://hl7.org/fhir/StructureDefinition/Observation#observation.code",
      "code" : [
       {
          "code" : "8310-5",
          "display" : "Temperature",
          "system" : "http://loinc.org"
       }
      ],
        {
          "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
          "valueCodeableConcept": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/questionnaire-item-control",
                "code": "page",
                "display": "Page"
              }
            ],
            "text": "Page"
          }
        }
      ],
      "item": [
        {
          "text": "Add instructions for capturing temperature",
          "type": "display",
          "linkId": "5.1.0"
        },
        {
          "linkId": "5.2.0",
          "type": "group",
          "definition": "http://hl7.org/fhir/StructureDefinition/Observation#Observation.valueQuantity",
          "extension": [
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemExtractionContext",
              "valueExpression": {
                "language": "application/x-fhir-query",
                "expression": "Quantity",
                "name": "quantity"
              }
            }
          ],
          "item": [
            {
              "definition": "http://hl7.org/fhir/StructureDefinition/Observation#Observation.valueQuantity.value",
              "text": "Record temperature",
              "type": "decimal",
              "linkId": "5.2.1",
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/minValue",
                  "valueDecimal": 35.0
                },
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/maxValue",
                  "valueDecimal": 45.0
                }
              ]
            },
            {
              "text": "Unit",
              "type": "choice",
              "linkId": "5.2.2",
              "required": true,
              "definition": "http://hl7.org/fhir/StructureDefinition/Observation#Observation.valueQuantity.code",
              "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"
                  }
                }
              ],
              "answerOption": [
                {
                  "valueCoding": {
                    "code": "F",
                    "display": "F"
                  }
                },
                {
                  "valueCoding": {
                    "code": "C",
                    "display": "C"
                  }
                }
              ]
            }
          ]
        },
      ]
    },

Example 2:

"item": [
            {
              "definition": "http://hl7.org/fhir/StructureDefinition/Observation#Observation.code.coding",
              "type": "group",
              "linkId": "5.3.1",
              "extension": [
                {
                  "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemExtractionContext",
                  "valueExpression": {
                    "language": "application/x-fhir-query",
                    "expression": "Coding",
                    "name": "coding"
                  }
                }
              ],
              "item": [
                {
                  "definition": "http://hl7.org/fhir/StructureDefinition/Observation#Observation.code.coding.code",
                  "type": "string",
                  "linkId": "5.3.1.1",
                  "initial": [
                    {
                      "valueString": "8310-5"
                    }
                  ]
                },
                {
                  "definition": "http://hl7.org/fhir/StructureDefinition/Observation#Observation.code.coding.system",
                  "type": "string",
                  "linkId": "5.3.1.2",
                  "initial": [
                    {
                      "valueString": "http://loinc.org"
                    }
                  ]
                },
                {
                  "definition": "http://hl7.org/fhir/StructureDefinition/Observation#Observation.code.coding.display",
                  "type": "string",
                  "linkId": "5.3.1.3",
                  "initial": [
                    {
                      "valueString": "Temperature"
                    }
                  ]
                }
              ]

Any general best practice or examples would be super helpful!

Thanks in advance

cc: @Aditya Kurkure @Jing Tang @Peter Lubell-Doughtie

view this post on Zulip Lloyd McKenzie (Aug 04 2021 at 14:23):

See response here: https://chat.fhir.org/#narrow/stream/179255-questionnaire/topic/Need.20advice.20on.20how.20to.20add.20Observation.2Ecode.20in.20questionnaire


Last updated: Apr 12 2022 at 19:14 UTC