extract-complex-template2
type: Questionnaire
node role: treeRoot
id:
  v: extract-complex-template2
meta:
  profile:
    v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-extr-template
    l: sdc-questionnaire-extr-template
language:
  v: en
text:
  status:
    v: extensions
  div:
    v: Generated Narrative: Questionnaire extract-complex-template2 Profile: Extractable Questionnaire - Template LinkID Text Cardinality Type Description & Constraints<img src="[binary]" alt="doco" style="background-color: inherit"/> SDCQuestionnaireExtrTemplate Example Questionnaire demonstrating extraction using the template approach Questionnaire http://hl7.org/fhir/uv/sdc/Questionnaire/extract-complex-template2#4.0.0 #xD; patient Patient Information 0..1 group #xD; name Name 0..* group #xD; given Given Name(s) 0..* string #xD; family Family/Surname 0..1 string #xD; gender Gender 0..1 choice Value Set: AdministrativeGender #xD; dob Date of Birth 0..1 date #xD; ihi National Identifier (IHI) 0..1 string #xD; mobile-phone Mobile Phone number 0..1 string #xD; contacts Contacts 0..* group #xD; contact-name Name 0..1 string #xD; relationship Relationship 0..1 choice Value Set: Patient Contact Relationship #xD; phone Phone 0..1 string #xD; obs Observations 0..1 group #xD; height What is your current height (m) 0..1 decimal #xD; weight What is your current weight (kg) 0..1 decimal #xD; complication Have you had a Sigmoidoscopy Complication (concern with invasive procedure, for example) 0..1 boolean #xD; <img src="[binary]" alt="doco" style="background-color: inherit"/> Documentation for this format Contained Resources Bundle #bunExtract Bundle bunExtract of type transaction Entry 1 - fullUrl = urn:uuid:6f6177d2-13ee-4d27-b0e8-3eaf663dd031 Resource Patient: Generated Narrative: Patient null Unknown, DoB Unknown ( National Identifier (IHI): ?ngen-9?) Contact Detail ph: -unknown-(Mobile) Request: POST Patient#xD; If-Match = Patient?_name=urn:uuid:6f6177d2-13ee-4d27-b0e8-3eaf663dd031#xD; Entry 2 - fullUrl = urn:uuid:6f6177d2-13ee-4d27-b0e8-3eaf663dd032 Resource RelatedPerson: Generated Narrative: RelatedPerson patient: urn:uuid:6f6177d2-13ee-4d27-b0e8-3eaf663dd031 relationship: name: null telecom: ph: -unknown-(Mobile) Request: POST RelatedPerson#xD; Entry 3 - fullUrl = urn:uuid:6…
contained: Bundle
  id:
    v: bunExtract
  type:
    v: transaction
  entry:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractContext
        l: sdc-questionnaire-templateExtractContext
      value: String
        v: item.where(linkId = 'patient')
    request:
      method:
        v: POST
      url:
        v: Patient
        l: Patient
  entry:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractContext
        l: sdc-questionnaire-templateExtractContext
      value: String
        v: item.where(linkId = 'contacts')
    request:
      method:
        v: POST
      url:
        v: RelatedPerson
        l: RelatedPerson
  entry:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractContext
        l: sdc-questionnaire-templateExtractContext
      value: String
        v: item.where(linkId = 'obs').item.where(linkId = 'height')
    request:
      method:
        v: POST
      url:
        v: Observation
        l: Observation
  entry:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractContext
        l: sdc-questionnaire-templateExtractContext
      value: String
        v: item.where(linkId = 'obs').item.where(linkId = 'weight')
    request:
      method:
        v: POST
      url:
        v: Observation
        l: Observation
  entry:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractContext
        l: sdc-questionnaire-templateExtractContext
      value: String
        v: item.where(linkId = 'obs').item.where(linkId = 'complication')
    request:
      method:
        v: POST
      url:
        v: Observation
        l: Observation
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/artifact-versionAlgorithm
    l: artifact-versionAlgorithm
  value: Coding
    system:
      v: http://hl7.org/fhir/version-algorithm
      l: version-algorithm
    code:
      v: semver
extension:
  url:
    v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractBundle
    l: sdc-questionnaire-templateExtractBundle
  value: Reference
    l: bunExtract
    reference:
      v: #bunExtract
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-wg
    l: structuredefinition-wg
  value: Code
    v: fhir
url:
  v: http://hl7.org/fhir/uv/sdc/Questionnaire/extract-complex-template2
  l: extract-complex-template2
identifier:
  system:
    v: urn:ietf:rfc:3986
    l: 3986
  value:
    v: urn:oid:2.16.840.1.113883.4.642.40.17.35.35
version:
  v: 4.0.0
name:
  v: SDCQuestionnaireExtrTemplate
title:
  v: Complex Extract Demonstration - Template Bundle
status:
  v: draft
experimental:
  v: true
date:
  v: 2026-03-24T16:31:45+11:00
publisher:
  v: HL7 International / FHIR Infrastructure
contact:
  name:
    v: HL7 International / FHIR Infrastructure
  telecom:
    system:
      v: url
    value:
      v: http://www.hl7.org/Special/committees/fiwg
contact:
  telecom:
    system:
      v: url
    value:
      v: http://www.hl7.org/Special/committees/fiwg
description:
  v: Example Questionnaire demonstrating extraction using the template approach
jurisdiction:
  coding:
    system:
      v: http://unstats.un.org/unsd/methods/m49/m49.htm
      l: m49.htm
    code:
      v: 001
    display:
      v: World
item:
  link id:
    v: patient
  text:
    v: Patient Information
  type:
    v: group
  item:
    link id:
      v: name
    text:
      v: Name
    type:
      v: group
    repeats:
      v: true
    item:
      link id:
        v: given
      text:
        v: Given Name(s)
      type:
        v: string
      repeats:
        v: true
    item:
      link id:
        v: family
      text:
        v: Family/Surname
      type:
        v: string
  item:
    link id:
      v: gender
    text:
      v: Gender
    type:
      v: choice
    answer value set:
      v: http://hl7.org/fhir/ValueSet/administrative-gender
      l: administrative-gender
  item:
    link id:
      v: dob

urn:…
type: Patient
language:
  v: en
identifier:
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractContext
      l: sdc-questionnaire-templateExtractContext
    value: String
      v: item.where(linkId = 'ihi').answer.value
  type:
    text:
      v: National Identifier (IHI)
  system:
    v: http://example.org/nhio
    l: nhio
  value:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
        l: sdc-questionnaire-templateExtractValue
      value: String
        v: first()
name:
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractContext
      l: sdc-questionnaire-templateExtractContext
    value: String
      v: item.where(linkId = 'name')
  text:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
        l: sdc-questionnaire-templateExtractValue
      value: String
        v: item.where(linkId='given' or linkId='family').answer.value.join(' ')
  family:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
        l: sdc-questionnaire-templateExtractValue
      value: String
        v: item.where(linkId = 'family').answer.value.first()
  given:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
        l: sdc-questionnaire-templateExtractValue
      value: String
        v: item.where(linkId = 'given').answer.value
telecom:
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractContext
      l: sdc-questionnaire-templateExtractContext
    value: String
      v: item.where(linkId = 'mobile-phone').answer.value
  system:
    v: phone
  value:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
        l: sdc-questionnaire-templateExtractValue
      value: String
        v: first()
  use:
    v: mobile
gender:
  v: unknown
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
      l: sdc-questionnaire-templateExtractValue
    value: String
      v: item.where(linkId = 'gender').answer.value.first().code

urn:…
type: RelatedPerson
language:
  v: en
relationship:
  coding:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
        l: sdc-questionnaire-templateExtractValue
      value: String
        v: item.where(linkId = 'relationship').answer.value.first()
name:
  text:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
        l: sdc-questionnaire-templateExtractValue
      value: String
        v: item.where(linkId = 'contact-name').answer.value.first()
telecom:
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractContext
      l: sdc-questionnaire-templateExtractContext
    value: String
      v: item.where(linkId = 'phone').answer.value
  system:
    v: phone
  value:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
        l: sdc-questionnaire-templateExtractValue
      value: String
        v: first()
  use:
    v: mobile

urn:…
type: Observation
language:
  v: en
status:
  v: final
category:
  coding:
    system:
      v: http://terminology.hl7.org/CodeSystem/observation-category
      l: observation-category
    code:
      v: vital-signs
code:
  coding: https://loinc.org/rdf/8302-2
    system:
      v: http://loinc.org
      l: loinc.org
    code:
      v: 8302-2
    display:
      v: Body height
effective: DateTime
  v: 1900-01-01
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
      l: sdc-questionnaire-templateExtractValue
    value: String
      v: %resource.authored
issued:
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
      l: sdc-questionnaire-templateExtractValue
    value: String
      v: %resource.authored
performer:
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
      l: sdc-questionnaire-templateExtractValue
    value: String
      v: %resource.author
value: Quantity
  value:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
        l: sdc-questionnaire-templateExtractValue
      value: String
        v: answer.value * 100
  unit:
    v: cm
  system:
    v: http://unitsofmeasure.org
    l: unitsofmeasure.org
  code:
    v: cm
derived from:
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractContext
      l: sdc-questionnaire-templateExtractContext
    value: String
      v: %resource.id
  reference:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
        l: sdc-questionnaire-templateExtractValue
      value: String
        v: 'QuestionnaireResponse/' + %resource.id

urn:…
type: Observation
language:
  v: en
status:
  v: final
category:
  coding:
    system:
      v: http://terminology.hl7.org/CodeSystem/observation-category
      l: observation-category
    code:
      v: vital-signs
code:
  coding: https://loinc.org/rdf/29463-7
    system:
      v: http://loinc.org
      l: loinc.org
    code:
      v: 29463-7
    display:
      v: Weight
effective: DateTime
  v: 1900-01-01
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
      l: sdc-questionnaire-templateExtractValue
    value: String
      v: %resource.authored
issued:
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
      l: sdc-questionnaire-templateExtractValue
    value: String
      v: %resource.authored
performer:
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
      l: sdc-questionnaire-templateExtractValue
    value: String
      v: %resource.author
value: Quantity
  value:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
        l: sdc-questionnaire-templateExtractValue
      value: String
        v: answer.value
  unit:
    v: kg
  system:
    v: http://unitsofmeasure.org
    l: unitsofmeasure.org
  code:
    v: kg
derived from:
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractContext
      l: sdc-questionnaire-templateExtractContext
    value: String
      v: %resource.id
  reference:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
        l: sdc-questionnaire-templateExtractValue
      value: String
        v: 'QuestionnaireResponse/' + %resource.id

urn:…
type: Observation
language:
  v: en
status:
  v: final
code:
  coding:
    system:
      v: http://example.org/sdh/demo/CodeSystem/cc-screening-codes
      l: cc-screening-codes
    code:
      v: sigmoidoscopy-complication
effective: DateTime
  v: 1900-01-01
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
      l: sdc-questionnaire-templateExtractValue
    value: String
      v: %resource.authored
issued:
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
      l: sdc-questionnaire-templateExtractValue
    value: String
      v: %resource.authored
performer:
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
      l: sdc-questionnaire-templateExtractValue
    value: String
      v: %resource.author
value: Boolean
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
      l: sdc-questionnaire-templateExtractValue
    value: String
      v: answer.value
derived from:
  extension:
    url:
      v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractContext
      l: sdc-questionnaire-templateExtractContext
    value: String
      v: %resource.id
  reference:
    extension:
      url:
        v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-templateExtractValue
        l: sdc-questionnaire-templateExtractValue
      value: String
        v: 'QuestionnaireResponse/' + %resource.id

v: Date of Birth

v: date

link id:
  v: ihi
text:
  v: National Identifier (IHI)
type:
  v: string

link id:
  v: mobile-phone
text:
  v: Mobile Phone number
type:
  v: string

link id:
  v: contacts
text:
  v: Contacts
type:
  v: group
repeats:
  v: true
item:
  link id:
    v: contact-name
  text:
    v: Name
  type:
    v: string
item:
  link id:
    v: relationship
  text:
    v: Relationship
  type:
    v: choice
  answer value set:
    v: http://hl7.org/fhir/ValueSet/patient-contactrelationship
    l: patient-contactrelationship
item:
  link id:
    v: phone
  text:
    v: Phone
  type:
    v: string

link id:
  v: obs
text:
  v: Observations
type:
  v: group
item:
  link id:
    v: height
  text:
    v: What is your current height (m)
  type:
    v: decimal
item:
  link id:
    v: weight
  text:
    v: What is your current weight (kg)
  type:
    v: decimal
item:
  link id:
    v: complication
  text:
    v: Have you had a Sigmoidoscopy Complication (concern with invasive procedure, for example)
  type:
    v: boolean