Skip to content

smart-forms/unsupported-template-extract-context ​

error Reports a templateExtractContext Smart Forms ignores because it is not a valueString.

What it checks ​

Runs only when compat selects template-extract. In each template Smart Forms extracts, a contained resource referenced by the first #id template slice of an item's templateExtract, a templateExtractContext with a valueExpression and no valueString is reported, when it is the first templateExtractContext in its extension array. Every extension array in the template is checked, at any depth, including primitive extensions and resources contained in the template, except modifierExtension.

Example ​

When Smart Forms extracts this template, it ignores this templateExtractContext because it reads only valueString, so the values below it are extracted without this context.

fsh
Instance: unsupported-template-extract-context-fhirpath-context
InstanceOf: Questionnaire
Usage: #example
* status = #draft
* item[0].linkId = "bp"
* item[=].type = #group
* item[=].text = "Blood pressure"
* item[=].extension[+].url = "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtract"
* item[=].extension[=].extension[0].url = "template"
* item[=].extension[=].extension[=].valueReference.reference = "#fhirpath-context"
* item[=].item[0].linkId = "systolic"
* item[=].item[=].type = #decimal
* contained[0] = unsupported-template-extract-context-fhirpath-context-contained-1

Instance: unsupported-template-extract-context-fhirpath-context-contained-1
InstanceOf: Observation
Usage: #inline
* id = "fhirpath-context"
* status = #final
* code.text = "Blood pressure"
* component[0].code.text = "Systolic"
* component[0].extension[0].url = "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractContext"
* component[0].extension[0].valueExpression.language = #text/fhirpath
* component[0].extension[0].valueExpression.expression = "item.where(linkId = 'systolic')"