sdc-questionnaire-contextExpression
type: StructureDefinition
node role: treeRoot
id:
  v: sdc-questionnaire-contextExpression
language:
  v: en
text:
  status:
    v: extensions
  div: Generated Narrative: StructureDefinition sdc-questionnaire-contextExpression Name Flags Card. Type Description & Constraints<img src="[binary]" alt="doco" style="background-color: inherit"/> <a href="StructureDefinition-sdc-questionnaire-contextExpression-definitions.html#Extension" title="A FHIR Query that resolves to one or more resources that can be displayed to the user to help provide context for answering a question. For example, if the question is "Has the patient discussed this issue on any visits in the past year?", the contextExpression might return the set of patient's encounters for the prior 12 month period to help jog the practitioner's memory.">Extension 0..* Extension Expression for information to guide answers #xD; extension 2..* Extension Extension #xD; Slices for extension Content/Rules for all slices #xD; extension:label 1..1 Extension Context label #xD; extension 0..0 #xD; url 1..1 uri "label" #xD; value[x] 1..1 string Value of extension #xD; extension:expression 1..1 Extension Context expression #xD; extension 0..0 #xD; url 1..1 uri "expression" #xD; value[x] 1..1 Expression Value of extension #xD; url 1..1 uri "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression" #xD; value[x] 0..0 #xD; <img src="[binary]" alt="doco" style="background-color: inherit"/> Documentation for this format
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-wg
  value: code
    v: fhir
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm
  value: integer
    v: 4
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom
      value: canonical
        v: http://hl7.org/fhir/uv/sdc/ImplementationGuide/hl7.fhir.uv.sdc
        link: http://hl7.org/fhir/uv/sdc/ImplementationGuide/hl7.fhir.uv.sdc
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status
  value: code
    v: trial-use
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom
      value: canonical
        v: http://hl7.org/fhir/uv/sdc/ImplementationGuide/hl7.fhir.uv.sdc
        link: http://hl7.org/fhir/uv/sdc/ImplementationGuide/hl7.fhir.uv.sdc
url:
  v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression
identifier:
  system:
    v: urn:ietf:rfc:3986
  value:
    v: urn:oid:2.16.840.1.113883.4.642.40.17.42.21
version:
  v: 4.0.0
name:
  v: ContextExpressionExtension
title:
  v: Answer Context Expression
status:
  v: active
date:
  v: 2025-10-22T20:08:54+00: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: A FHIR Query that resolves to one or more resources that can be displayed to the user to help provide context for answering a question. For example, if the question is "Has the patient discussed this issue on any visits in the past year?", the contextExpression might return the set of patient's encounters for the prior 12 month period to help jog the practitioner's memory. If there are multiple repetitions of this extension, then each is providing a distinct set of context. For example, one repetition might expose 'potentially relevant procedures' while another might expose 'potentially relevant encounters'.
jurisdiction:
  coding:
    system:
      v: http://unstats.un.org/unsd/methods/m49/m49.htm
    code:
      v: 001
    display:
      v: World
fhir version:
  v: 4.0.1
mapping:
  identity:
    v: rim
  uri:
    v: http://hl7.org/v3
  name:
    v: RIM Mapping
kind:
  v: complex-type
abstract:
  v: false
context:
  type:
    v: element
  expression:
    v: Questionnaire.item
context:
  type:
    v: element
  expression:
    v: ElementDefinition
type:
  v: Extension
base definition:
  v: http://hl7.org/fhir/StructureDefinition/Extension
  link: http://hl7.org/fhir/StructureDefinition/Extension
derivation:
  v: constraint
snapshot:
  extension:
    url:
      v: http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version
    value: string
      v: 4.0.1
  element:
    id:
      v: Extension
    path:
      v: Extension
    short:
      v: Expression for information to guide answers
    definition:
      v: A FHIR Query that resolves to one or more resources that can be displayed to the user to help provide context for answering a question. For example, if the question is "Has the patient discussed this issue on any visits in the past year?", the contextExpression might return the set of patient's encounters for the prior 12 month period to help jog the practitioner's memory.
    min:
      v: 0
    max:
      v: *
    base:
      path:
        v: Extension
      min:
        v: 0
      max:
        v: *
    condition:
      v: ele-1
    constraint:
      key:
        v: ele-1
      severity:
        v: error
      human:
        v: All FHIR elements must have a @value or children
      expression:
        v: hasValue() or (children().count() > id.count())
      xpath:
        v: @value|f:*|h:div
      source:
        v: http://hl7.org/fhir/StructureDefinition/Element
        link: http://hl7.org/fhir/StructureDefinition/Element
    constraint:
      key:
        v: ext-1
      severity:
        v: error
      human:
        v: Must have either extensions or value[x], not both
      expression:
        v: extension.exists() != value.exists()
      xpath:
        v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])
      source:
        v: http://hl7.org/fhir/StructureDefinition/Extension
        link: http://hl7.org/fhir/StructureDefinition/Extension
    is modifier:
      v: false
  element:
    id:
      v: Extension.id
    path:
      v: Extension.id
    representation:
      v: xmlAttr
    short:
      v: Unique id for inter-element referencing
    definition:
      v: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
    min:
      v: 0
    max:
      v: 1
    base:
      path:
        v: Element.id
      min:
        v: 0
      max:
        v: 1
    type:
      extension:
        value: url
      code:
        v: http://hl7.org/fhirpath/System.String
    is modifier:
      v: false
    is summary:
      v: false
    mapping:
      identity:
        v: rim
      map:
        v: n/a

url
v: string

id:
  v: Extension.extension
path:
  v: Extension.extension
slicing:
  discriminator:
    type:
      v: value
    path:
      v: url
  description:
    v: Extensions are always sliced by (at least) url
  rules:
    v: open
short:
  v: Extension
definition:
  v: An Extension
min:
  v: 2
max:
  v: *
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    link: http://hl7.org/fhir/StructureDefinition/Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    link: http://hl7.org/fhir/StructureDefinition/Extension
is modifier:
  v: false
is summary:
  v: false

id:
  v: Extension.extension:label
path:
  v: Extension.extension
slice name:
  v: label
short:
  v: Context label
definition:
  v: The text to display in the form filler user interface that explains what the returned context information means
min:
  v: 1
max:
  v: 1
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    link: http://hl7.org/fhir/StructureDefinition/Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    link: http://hl7.org/fhir/StructureDefinition/Extension
is modifier:
  v: false
is summary:
  v: false

id:
  v: Extension.extension:label.id
path:
  v: Extension.extension.id
representation:
  v: xmlAttr
short:
  v: Unique id for inter-element referencing
definition:
  v: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Element.id
  min:
    v: 0
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
    value: url
      v: string
  code:
    v: http://hl7.org/fhirpath/System.String
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: Extension.extension:label.extension
path:
  v: Extension.extension.extension
slicing:
  discriminator:
    type:
      v: value
    path:
      v: url
  description:
    v: Extensions are always sliced by (at least) url
  rules:
    v: open
short:
  v: Extension
definition:
  v: An Extension
min:
  v: 0
max:
  v: 0
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    link: http://hl7.org/fhir/StructureDefinition/Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    link: http://hl7.org/fhir/StructureDefinition/Extension
is modifier:
  v: false
is summary:
  v: false

id:
  v: Extension.extension:label.url
path:
  v: Extension.extension.url
representation:
  v: xmlAttr
short:
  v: identifies the meaning of the extension
definition:
  v: Source of the definition for the extension code - a logical name or a URL.
comment:
  v: The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.
min:
  v: 1
max:
  v: 1
base:
  path:
    v: Extension.url
  min:
    v: 1
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
    value: url
      v: uri
  code:
    v: http://hl7.org/fhirpath/System.String
fixed: uri
  v: label
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: Extension.extension:label.value[x]
path:
  v: Extension.extension.value[x]
short:
  v: Value of extension
definition:
  v: Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).
min:
  v: 1
max:
  v: 1
base:
  path:
    v: Extension.value[x]
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: string
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    link: http://hl7.org/fhir/StructureDefinition/Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: Extension.extension:expression
path:
  v: Extension.extension
slice name:
  v: expression
short:
  v: Context expression
definition:
  v: The computable rules that identify the contextual information to display to the user
min:
  v: 1
max:
  v: 1
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    link: http://hl7.org/fhir/StructureDefinition/Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    link: http://hl7.org/fhir/StructureDefinition/Extension
is modifier:
  v: false
is summary:
  v: false

id:
  v: Extension.extension:expression.id
path:
  v: Extension.extension.id
representation:
  v: xmlAttr
short:
  v: Unique id for inter-element referencing
definition:
  v: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Element.id
  min:
    v: 0
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
    value: url
      v: string
  code:
    v: http://hl7.org/fhirpath/System.String
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: Extension.extension:expression.extension
path:
  v: Extension.extension.extension
slicing:
  discriminator:
    type:
      v: value
    path:
      v: url
  description:
    v: Extensions are always sliced by (at least) url
  rules:
    v: open
short:
  v: Extension
definition:
  v: An Extension
min:
  v: 0
max:
  v: 0
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    link: http://hl7.org/fhir/StructureDefinition/Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    link: http://hl7.org/fhir/StructureDefinition/Extension
is modifier:
  v: false
is summary:
  v: false

id:
  v: Extension.extension:expression.url
path:
  v: Extension.extension.url
representation:
  v: xmlAttr
short:
  v: identifies the meaning of the extension
definition:
  v: Source of the definition for the extension code - a logical name or a URL.
comment:
  v: The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.
min:
  v: 1
max:
  v: 1
base:
  path:
    v: Extension.url
  min:
    v: 1
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
    value: url
      v: uri
  code:
    v: http://hl7.org/fhirpath/System.String
fixed: uri
  v: expression
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: Extension.extension:expression.value[x]
path:
  v: Extension.extension.value[x]
short:
  v: Value of extension
definition:
  v: Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).
min:
  v: 1
max:
  v: 1
base:
  path:
    v: Extension.value[x]
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Expression
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    link: http://hl7.org/fhir/StructureDefinition/Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: Extension.url
path:
  v: Extension.url
representation:
  v: xmlAttr
short:
  v: identifies the meaning of the extension
definition:
  v: Source of the definition for the extension code - a logical name or a URL.
comment:
  v: The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.
min:
  v: 1
max:
  v: 1
base:
  path:
    v: Extension.url
  min:
    v: 1
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
    value: url
      v: uri
  code:
    v: http://hl7.org/fhirpath/System.String
fixed: uri
  v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: Extension.value[x]
path:
  v: Extension.value[x]
short:
  v: Value of extension
definition:
  v: Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).
min:
  v: 0
max:
  v: 0
base:
  path:
    v: Extension.value[x]
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: base64Binary
type:
  code:
    v: boolean
type:
  code:
    v: canonical
type:
  code:
    v: code
type:
  code:
    v: date
type:
  code:
    v: dateTime
type:
  code:
    v: decimal
type:
  code:
    v: id
type:
  code:
    v: instant
type:
  code:
    v: integer
type:
  code:
    v: markdown
type:
  code:
    v: oid
type:
  code:
    v: positiveInt
type:
  code:
    v: string
type:
  code:
    v: time
type:
  code:
    v: unsignedInt
type:
  code:
    v: uri
type:
  code:
    v: url
type:
  code:
    v: uuid
type:
  code:
    v: Address
type:
  code:
    v: Age
type:
  code:
    v: Annotation
type:
  code:
    v: Attachment
type:
  code:
    v: CodeableConcept
type:
  code:
    v: Coding
type:
  code:
    v: ContactPoint
type:
  code:
    v: Count
type:
  code:
    v: Distance
type:
  code:
    v: Duration
type:
  code:
    v: HumanName
type:
  code:
    v: Identifier
type:
  code:
    v: Money
type:
  code:
    v: Period
type:
  code:
    v: Quantity
type:
  code:
    v: Range
type:
  code:
    v: Ratio
type:
  code:
    v: Reference
type:
  code:
    v: SampledData
type:
  code:
    v: Signature
type:
  code:
    v: Timing
type:
  code:
    v: ContactDetail
type:
  code:
    v: Contributor
type:
  code:
    v: DataRequirement
type:
  code:
    v: Expression
type:
  code:
    v: ParameterDefinition
type:
  code:
    v: RelatedArtifact
type:
  code:
    v: TriggerDefinition
type:
  code:
    v: UsageContext
type:
  code:
    v: Dosage
type:
  code:
    v: Meta
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    link: http://hl7.org/fhir/StructureDefinition/Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

element:
  id:
    v: Extension
  path:
    v: Extension
  short:
    v: Expression for information to guide answers
  definition:
    v: A FHIR Query that resolves to one or more resources that can be displayed to the user to help provide context for answering a question. For example, if the question is "Has the patient discussed this issue on any visits in the past year?", the contextExpression might return the set of patient's encounters for the prior 12 month period to help jog the practitioner's memory.
element:
  id:
    v: Extension.extension
  path:
    v: Extension.extension
  min:
    v: 2
element:
  id:
    v: Extension.extension:label
  path:
    v: Extension.extension
  slice name:
    v: label
  short:
    v: Context label
  definition:
    v: The text to display in the form filler user interface that explains what the returned context information means
  min:
    v: 1
  max:
    v: 1
element:
  id:
    v: Extension.extension:label.extension
  path:
    v: Extension.extension.extension
  max:
    v: 0
element:
  id:
    v: Extension.extension:label.url
  path:
    v: Extension.extension.url
  fixed: uri
    v: label
element:
  id:
    v: Extension.extension:label.value[x]
  path:
    v: Extension.extension.value[x]
  min:
    v: 1
  type:
    code:
      v: string
element:
  id:
    v: Extension.extension:expression
  path:
    v: Extension.extension
  slice name:
    v: expression
  short:
    v: Context expression
  definition:
    v: The computable rules that identify the contextual information to display to the user
  min:
    v: 1
  max:
    v: 1
element:
  id:
    v: Extension.extension:expression.extension
  path:
    v: Extension.extension.extension
  max:
    v: 0
element:
  id:
    v: Extension.extension:expression.url
  path:
    v: Extension.extension.url
  fixed: uri
    v: expression
element:
  id:
    v: Extension.extension:expression.value[x]
  path:
    v: Extension.extension.value[x]
  min:
    v: 1
  type:
    code:
      v: Expression
element:
  id:
    v: Extension.url
  path:
    v: Extension.url
  fixed: uri
    v: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-contextExpression
element:
  id:
    v: Extension.value[x]
  path:
    v: Extension.value[x]
  max:
    v: 0