Structured Data Capture, published by HL7 International / FHIR Infrastructure. This guide is not an authorized publication; it is the continuous build for version 4.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/sdc/ and changes regularly. See the Directory of published versions
| Official URL: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtract | Version: 4.0.0 | |||
| Standards status: Draft Draft as of 2025-10-22 | Maturity Level: 0 | Computable Name: TemplateExtractExtension | ||
| Other Identifiers: OID:2.16.840.1.113883.4.642.40.17.42.85 | ||||
Specifies a reference to a contained resource template (or set of resources for a repeating item) to be extracted from this item once the QuestionnaireResponse is complete. The template will be cloned into the output extraction bundle, and any template values will be replaced with the values from the QuestionnaireResponse. Optionally the fullUrl and other Bundle.entry.request properties can be also included.
Context of Use
This extension may be used on the following element(s)
Questionnaire
Questionnaire.item
Using this extension marks the point in a questionnaire at which a new resource will be created using the template-based extraction process.
When defined at the root of a questionnaire, the resource will be created even if there are no answers, and then iteratively processing the template properties will populate any further properties not covered by the base template.
When defined on a repeating item, a new resource will be created for each iteration of the item in the QuestionnaireResponse answers, if there is no answer in the QuestionnaireResponse, then no resource is created.
Before this extension is processed, any sdc-questionnaire-allocateId extensions will be processed.
Additional details on the use of this extension can be found on the Data Extraction page.
After the resource is created, and all the properties have been extracted from the item answers in the QuestionnaireResponse, the bundle.entry properties can be populated:
request.method - if the resource created has no Id property, then the method will be POST, otherwise it will be PUTrequest.url - if the resource is being updated, then the url will be the resource type and the Id property e.g. Patient/123,
otherwise it will be the resource type e.g. Patientrequest.ifNoneMatch - the ifNoneMatch value to use (default is none)request.ifModifiedSince - the ifModifiedSince value to use (default is none)request.ifMatch - the ifMatch value to use (default is none)request.ifNoneExist - the ifNoneExist value to use (default is none)fullUrl - the fullUrl value to use, if the expression is missing, or evaluates to empty, then assign a new uuid.Usage info
Usages:
You can also check for usages in the FHIR IG Statistics
Description Differentials, Snapshots, and other representations.
| Name | Flags | Card. | Type | Description & Constraints Filter: ![]() ![]() |
|---|---|---|---|---|
![]() |
0..* | Extension | Establishes extract context for a Questionnaire/item using an extraction template resource | |
![]() ![]() |
1..* | Extension | Extension | |
![]() ![]() |
Content/Rules for all slices | |||
![]() ![]() ![]() |
1..1 | Extension | Reference to contained resource template | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "template" | |
![]() ![]() ![]() ![]() |
1..1 | Reference() {c} | Contained reference to the resource template | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the fullUrl property in the `Bundle.entry` (uri/string result) | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "fullUrl" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the resourceId property (string result) | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "resourceId" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the ifNoneMatch property (string result) | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "ifNoneMatch" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the ifModifiedSince property (instant result) | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "ifModifiedSince" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the ifMatch property (string result) | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "ifMatch" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the ifNoneExist property (string result) | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "ifNoneExist" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() |
1..1 | uri | "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtract" | |
![]() ![]() |
0..0 | |||
Documentation for this format | ||||
| Name | Flags | Card. | Type | Description & Constraints Filter: ![]() ![]() |
|---|---|---|---|---|
![]() |
0..* | Extension | Establishes extract context for a Questionnaire/item using an extraction template resource | |
![]() ![]() |
0..1 | string | Unique id for inter-element referencing | |
![]() ![]() |
1..* | Extension | Extension Slice: Unordered, Open by value:url | |
![]() ![]() ![]() |
1..1 | Extension | Reference to contained resource template | |
![]() ![]() ![]() ![]() |
0..1 | string | Unique id for inter-element referencing | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "template" | |
![]() ![]() ![]() ![]() |
1..1 | Reference() {c} | Contained reference to the resource template | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the fullUrl property in the `Bundle.entry` (uri/string result) | |
![]() ![]() ![]() ![]() |
0..1 | string | Unique id for inter-element referencing | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "fullUrl" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the resourceId property (string result) | |
![]() ![]() ![]() ![]() |
0..1 | string | Unique id for inter-element referencing | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "resourceId" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the ifNoneMatch property (string result) | |
![]() ![]() ![]() ![]() |
0..1 | string | Unique id for inter-element referencing | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "ifNoneMatch" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the ifModifiedSince property (instant result) | |
![]() ![]() ![]() ![]() |
0..1 | string | Unique id for inter-element referencing | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "ifModifiedSince" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the ifMatch property (string result) | |
![]() ![]() ![]() ![]() |
0..1 | string | Unique id for inter-element referencing | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "ifMatch" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the ifNoneExist property (string result) | |
![]() ![]() ![]() ![]() |
0..1 | string | Unique id for inter-element referencing | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "ifNoneExist" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() |
1..1 | uri | "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtract" | |
Documentation for this format | ||||
| Id | Grade | Path(s) | Description | Expression |
| ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children |
hasValue() or (children().count() > id.count())
|
| ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both |
extension.exists() != value.exists()
|
Summary
Complex Extension: Specifies a reference to a contained resource template (or set of resources for a repeating item) to be extracted from this item once the QuestionnaireResponse is complete. The template will be cloned into the output extraction bundle, and any template values will be replaced with the values from the QuestionnaireResponse. Optionally the fullUrl and other Bundle.entry.request properties can be also included.
Maturity: 0
Differential ViewDifferential View
| Name | Flags | Card. | Type | Description & Constraints Filter: ![]() ![]() |
|---|---|---|---|---|
![]() |
0..* | Extension | Establishes extract context for a Questionnaire/item using an extraction template resource | |
![]() ![]() |
1..* | Extension | Extension | |
![]() ![]() |
Content/Rules for all slices | |||
![]() ![]() ![]() |
1..1 | Extension | Reference to contained resource template | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "template" | |
![]() ![]() ![]() ![]() |
1..1 | Reference() {c} | Contained reference to the resource template | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the fullUrl property in the `Bundle.entry` (uri/string result) | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "fullUrl" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the resourceId property (string result) | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "resourceId" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the ifNoneMatch property (string result) | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "ifNoneMatch" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the ifModifiedSince property (instant result) | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "ifModifiedSince" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the ifMatch property (string result) | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "ifMatch" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the ifNoneExist property (string result) | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "ifNoneExist" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() |
1..1 | uri | "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtract" | |
![]() ![]() |
0..0 | |||
Documentation for this format | ||||
Snapshot View
| Name | Flags | Card. | Type | Description & Constraints Filter: ![]() ![]() |
|---|---|---|---|---|
![]() |
0..* | Extension | Establishes extract context for a Questionnaire/item using an extraction template resource | |
![]() ![]() |
0..1 | string | Unique id for inter-element referencing | |
![]() ![]() |
1..* | Extension | Extension Slice: Unordered, Open by value:url | |
![]() ![]() ![]() |
1..1 | Extension | Reference to contained resource template | |
![]() ![]() ![]() ![]() |
0..1 | string | Unique id for inter-element referencing | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "template" | |
![]() ![]() ![]() ![]() |
1..1 | Reference() {c} | Contained reference to the resource template | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the fullUrl property in the `Bundle.entry` (uri/string result) | |
![]() ![]() ![]() ![]() |
0..1 | string | Unique id for inter-element referencing | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "fullUrl" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the resourceId property (string result) | |
![]() ![]() ![]() ![]() |
0..1 | string | Unique id for inter-element referencing | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "resourceId" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the ifNoneMatch property (string result) | |
![]() ![]() ![]() ![]() |
0..1 | string | Unique id for inter-element referencing | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "ifNoneMatch" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the ifModifiedSince property (instant result) | |
![]() ![]() ![]() ![]() |
0..1 | string | Unique id for inter-element referencing | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "ifModifiedSince" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the ifMatch property (string result) | |
![]() ![]() ![]() ![]() |
0..1 | string | Unique id for inter-element referencing | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "ifMatch" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() ![]() |
0..1 | Extension | A fhirpath expression to evaluate to populate the ifNoneExist property (string result) | |
![]() ![]() ![]() ![]() |
0..1 | string | Unique id for inter-element referencing | |
![]() ![]() ![]() ![]() |
0..0 | |||
![]() ![]() ![]() ![]() |
1..1 | uri | "ifNoneExist" | |
![]() ![]() ![]() ![]() |
1..1 | string | Fhirpath Expression value | |
![]() ![]() |
1..1 | uri | "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtract" | |
Documentation for this format | ||||
| Id | Grade | Path(s) | Description | Expression |
| ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children |
hasValue() or (children().count() > id.count())
|
| ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both |
extension.exists() != value.exists()
|
Summary
Complex Extension: Specifies a reference to a contained resource template (or set of resources for a repeating item) to be extracted from this item once the QuestionnaireResponse is complete. The template will be cloned into the output extraction bundle, and any template values will be replaced with the values from the QuestionnaireResponse. Optionally the fullUrl and other Bundle.entry.request properties can be also included.
Maturity: 0
Other representations of profile: CSV, Excel, Schematron