cqf-targetInvariant
type: StructureDefinition
node role: treeRoot
id:
  v: cqf-targetInvariant
text:
  status:
    v: extensions
  div:
    v: Generated Narrative: StructureDefinition cqf-targetInvariant Name Flags Card. Type Description & Constraints<img src="[binary]" alt="doco" style="background-color: inherit"/> Extension 0..* Extension A constraint on the target resource #xD; Slices for extension Content/Rules for all slices #xD; extension:key 1..1 Extension Unique identifier #xD; extension 0..0 Extension #xD; url 1..1 uri "key" #xD; value[x] 1..1 id Value of extension #xD; extension:requirements 0..1 Extension Why the invariant is defined #xD; extension 0..0 Extension #xD; url 1..1 uri "requirements" #xD; value[x] 1..1 string Value of extension #xD; extension:severity 1..1 Extension error | warning #xD; extension 0..0 Extension #xD; url 1..1 uri "severity" #xD; value[x] 1..1 code Value of extension Binding: ConstraintSeverity (required) #xD; extension:expression 1..1 Extension The invariant expression #xD; extension 0..0 Extension #xD; url 1..1 uri "expression" #xD; value[x] 1..1 Expression Value of extension #xD; url 1..1 uri "http://hl7.org/fhir/StructureDefinition/cqf-targetInvariant" #xD; value[x] 0..0 Value of extension #xD; <img src="[binary]" alt="doco" style="background-color: inherit"/> Documentation for this format
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-wg
    l: structuredefinition-wg
  value: Code
    v: cds
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm
    l: structuredefinition-fmm
  value: Integer
    v: 2
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status
    l: structuredefinition-standards-status
  value: Code
    v: deprecated
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status-reason
        l: structuredefinition-standards-status-reason
      value: Markdown
        v: Use the `targetConstraint` extension instead. Specifies an invariant that is enforced on instantiated resources. This extension can be applied to any element of a definitional resource (such as ActivityDefinition or Measure) and indicates that the invariant should be enforced on resources that are instantiated from the definition. For example, this extension can be used to define a constraint such as `numerator count must be less than or equal to denominator count`
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics
    l: structuredefinition-type-characteristics
  value: Code
    v: can-bind
url:
  v: http://hl7.org/fhir/StructureDefinition/cqf-targetInvariant
  l: cqf-targetInvariant
identifier:
  system:
    v: urn:ietf:rfc:3986
    l: 3986
  value:
    v: urn:oid:2.16.840.1.113883.4.642.5.1694
version:
  v: 5.3.0-ballot-tc1
name:
  v: TargetInvariant
title:
  v: Target invariant
status:
  v: retired
experimental:
  v: false
date:
  v: 2015-05-30
publisher:
  v: HL7 International / Clinical Decision Support
contact:
  telecom:
    system:
      v: url
    value:
      v: http://www.hl7.org/Special/committees/dss
description:
  v: DEPRECATED: Use the `targetConstraint` extension instead. Specifies an invariant that is enforced on instantiated resources. This extension can be applied to any element of a definitional resource (such as ActivityDefinition or Measure) and indicates that the invariant should be enforced on resources that are instantiated from the definition. For example, this extension can be used to define a constraint such as `numerator count must be less than or equal to denominator count`.
jurisdiction:
  coding:
    system:
      v: http://unstats.un.org/unsd/methods/m49/m49.htm
      l: m49.htm
    code:
      v: 001
purpose:
  v: This extension allows invariants to be specified as part of definitional resources as an alternative to having to define a profile to enforce the constraint.
fhir version:
  v: 5.0.0
mapping:
  identity:
    v: rim
  uri:
    v: http://hl7.org/v3
    l: v3
  name:
    v: RIM Mapping
kind:
  v: complex-type
abstract:
  v: false
context:
  type:
    v: element
  expression:
    v: ActivityDefinition
context:
  type:
    v: element
  expression:
    v: ActivityDefinition.code
context:
  extension:
    extension:
      url:
        v: startFhirVersion
        l: startFhirVersion
      value: Code
        v: 4.0
    url:
      v: http://hl7.org/fhir/StructureDefinition/version-specific-use
      l: version-specific-use
  type:
    v: element
  expression:
    v: ActivityDefinition.intent
context:
  extension:
    extension:
      url:
        v: startFhirVersion
        l: startFhirVersion
      value: Code
        v: 4.0
    url:
      v: http://hl7.org/fhir/StructureDefinition/version-specific-use
      l: version-specific-use
  type:
    v: element
  expression:
    v: ActivityDefinition.priority
context:
  extension:
    extension:
      url:
        v: startFhirVersion
        l: startFhirVersion
      value: Code
        v: 4.0
    url:
      v: http://hl7.org/fhir/StructureDefinition/version-specific-use
      l: version-specific-use
  type:
    v: element
  expression:
    v: ActivityDefinition.doNotPerform
context:
  type:
    v: element
  expression:
    v: ActivityDefinition.timing[x]
context:
  extension:
    extension:
      url:
        v: startFhirVersion
        l: startFhirVersion
      value: Code
        v: 5.0
    url:
      v: http://hl7.org/fhir/StructureDefinition/version-specific-use
      l: version-specific-use
  type:
    v: element
  expression:
    v: ActivityDefinition.asNeeded[x]
context:
  type:
    v: element
  expression:
    v: ActivityDefinition.location
context:
  type:
    v: element
  expression:
    v: ActivityDefinition.participant
context:
  type:
    v: element
  expression:
    v: ActivityDefinition.product[x]
context:
  type:
    v: element
  expression:
    v: ActivityDefinition.quantity
context:
  type:
    v: element
  expression:
    v: ActivityDefinition.dosage
context:
  type:
    v: element
  expression:
    v: ActivityDefinition.bodySite
context:
  type:
    v: element

v: ActivityDefinition.dynamicValue

type:
  v: element
expression:
  v: Measure

type:
  v: element
expression:
  v: Measure.group

type:
  v: element
expression:
  v: Measure.group.population

type:
  v: element
expression:
  v: Measure.group.stratifier

type:
  v: element
expression:
  v: Measure.supplementalData

type:
  v: element
expression:
  v: PlanDefinition

type:
  v: element
expression:
  v: PlanDefinition.goal

type:
  v: element
expression:
  v: PlanDefinition.goal.target

extension:
  extension:
    url:
      v: startFhirVersion
      l: startFhirVersion
    value: Code
      v: 5.0
  url:
    v: http://hl7.org/fhir/StructureDefinition/version-specific-use
    l: version-specific-use
type:
  v: element
expression:
  v: PlanDefinition.actor

type:
  v: element
expression:
  v: PlanDefinition.action

type:
  v: element
expression:
  v: Questionnaire

type:
  v: element
expression:
  v: Questionnaire.item

v: Extension
l: Extension

v: constraint

extension:
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version
    l: snapshot-base-version
  value: String
    v: 5.0.0
element:
  id:
    v: Extension
  path:
    v: Extension
  short:
    v: A constraint on the target resource
  definition:
    v: Specifies an invariant that is enforced in the context of an instantiated resource.
  comment:
    v: Can be used on any definitional artifact to define an invariant that is enforced in the context of an instantiated resource. The invariant expression will have access to `%target` and `%definition` variables, where target is the instantiated resource, and definition is the definition used to instantiate.
  min:
    v: 0
  max:
    v: *
  base:
    path:
      v: Extension
    min:
      v: 0
    max:
      v: *
  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())
    source:
      v: http://hl7.org/fhir/StructureDefinition/Element
      l: 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()
    source:
      v: http://hl7.org/fhir/StructureDefinition/Extension
      l: 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:
      url:
        v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
        l: structuredefinition-fhir-type
      value: Url
        v: id
        l: id
    code:
      v: http://hl7.org/fhirpath/System.String
      l: System.String
  condition:
    v: ele-1
  is modifier:
    v: false
  is summary:
    v: false
  mapping:
    identity:
      v: rim
    map:
      v: n/a
element:
  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: Additional content defined by implementations
  definition:
    v: May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
  comment:
    v: There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
  alias:
    v: extensions
  alias:
    v: user content
  min:
    v: 3
  max:
    v: *
  base:
    path:
      v: Element.extension
    min:
      v: 0
    max:
      v: *
  type:
    code:
      v: Extension
      l: 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())
    source:
      v: http://hl7.org/fhir/StructureDefinition/Element
      l: 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()
    source:
      v: http://hl7.org/fhir/StructureDefinition/Extension
      l: Extension
  is modifier:
    v: false
  is summary:
    v: false
  mapping:
    identity:
      v: rim
    map:
      v: n/a
element:
  id:
    v: Extension.extension:key
  path:
    v: Extension.extension
  slice name:
    v: key
  short:
    v: Unique identifier
  definition:
    v: A unique identifier for the invariant (unique in the context of the resource).
  comment:
    v: Any error or outcome messages or warnings should include this id to allow the source of the message to be determined.
  min:
    v: 1
  max:
    v: 1
  base:
    path:
      v: Element.extension
    min:
      v: 0
    max:
      v: *
  type:
    code:
      v: Extension
      l: Extension
  constraint:
    key:
      v: ele-1

v: error

v: All FHIR elements must have a @value or children

v: hasValue() or (children().count() > id.count())

key:
  v: ext-1
severity:
  v: error
human:
  v: Must have either extensions or value[x], not both
expression:
  v: extension.exists() != value.exists()
source:
  v: http://hl7.org/fhir/StructureDefinition/Extension
  l: Extension

v: false

v: false

id:
  v: Extension.extension:key.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
      l: structuredefinition-fhir-type
    value: Url
      v: id
      l: id
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
condition:
  v: ele-1
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: Extension.extension:key.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
    l: 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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: 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()
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false

id:
  v: Extension.extension:key.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:
  code:
    v: uri
    l: uri
fixed: Uri
  v: key
  l: key
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: Extension.extension:key.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/R5/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: id
    l: id
condition:
  v: ext-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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: Extension.extension:requirements
path:
  v: Extension.extension
slice name:
  v: requirements
short:
  v: Why the invariant is defined
definition:
  v: A brief description of why the invariant is necessary or appropriate.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: 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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: 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()
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false

id:
  v: Extension.extension:requirements.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
      l: structuredefinition-fhir-type
    value: Url
      v: id
      l: id
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
condition:
  v: ele-1
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: Extension.extension:requirements.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
    l: 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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: 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()
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false

id:
  v: Extension.extension:requirements.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:
  code:
    v: uri
    l: uri
fixed: Uri
  v: requirements
  l: requirements
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: Extension.extension:requirements.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/R5/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
    l: string
condition:
  v: ext-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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: Extension.extension:severity
path:
  v: Extension.extension
slice name:
  v: severity
short:
  v: error | warning
definition:
  v: Whether the invariant indicates an error condition or a warning.
min:
  v: 1
max:
  v: 1
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: 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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: 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()
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false

id:
  v: Extension.extension:severity.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
      l: structuredefinition-fhir-type
    value: Url
      v: id
      l: id
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
condition:
  v: ele-1
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: Extension.extension:severity.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
    l: 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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: 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()
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false

id:
  v: Extension.extension:severity.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:
  code:
    v: uri
    l: uri
fixed: Uri
  v: severity
  l: severity
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: Extension.extension:severity.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/R5/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: code
    l: code
condition:
  v: ext-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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
binding:
  extension:
    url:
      v: http://hl7.org/fhir/tools/StructureDefinition/binding-definition
      l: binding-definition
    value: Markdown
      v: SHALL applications comply with this constraint?
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: ConstraintSeverity
  strength:
    v: required
  value set:
    v: http://hl7.org/fhir/ValueSet/constraint-severity
    l: constraint-severity
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: Extension.extension:expression
path:
  v: Extension.extension
slice name:
  v: expression
short:
  v: The invariant expression
definition:
  v: An expression providing a formal representation of the invariant condition.
comment:
  v: The expression will have access to `%target` (the resource that was instantiated) and `%definition` (the definition for the instantiated resource).
min:
  v: 1
max:
  v: 1
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: 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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: 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()
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: 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
      l: structuredefinition-fhir-type
    value: Url
      v: id
      l: id
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
condition:
  v: ele-1
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
    l: 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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: 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()
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: 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:
  code:
    v: uri
    l: uri
fixed: Uri
  v: expression
  l: 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/R5/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
    l: Expression
condition:
  v: ext-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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: 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
      l: structuredefinition-fhir-type
    value: Url
      v: uri
      l: uri
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
fixed: Uri
  v: http://hl7.org/fhir/StructureDefinition/cqf-targetInvariant
  l: cqf-targetInvariant
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/R5/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
    l: base64Binary
type:
  code:
    v: boolean
    l: boolean
type:
  code:
    v: canonical
    l: canonical
type:
  code:
    v: code
    l: code
type:
  code:
    v: date
    l: date
type:
  code:
    v: dateTime
    l: dateTime
type:
  code:
    v: decimal
    l: decimal
type:
  code:
    v: id
    l: id
type:
  code:
    v: instant
    l: instant
type:
  code:
    v: integer
    l: integer
type:
  code:
    v: integer64
    l: integer64
type:
  code:
    v: markdown
    l: markdown
type:
  code:
    v: oid
    l: oid
type:
  code:
    v: positiveInt
    l: positiveInt
type:
  code:
    v: string
    l: string
type:
  code:
    v: time
    l: time
type:
  code:
    v: unsignedInt
    l: unsignedInt
type:
  code:
    v: uri
    l: uri
type:
  code:
    v: url
    l: url
type:
  code:
    v: uuid
    l: uuid
type:
  code:
    v: Address
    l: Address
type:
  code:
    v: Age
    l: Age
type:
  code:
    v: Annotation
    l: Annotation
type:
  code:
    v: Attachment
    l: Attachment
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
type:
  code:
    v: CodeableReference
    l: CodeableReference
type:
  code:
    v: Coding
    l: Coding
type:
  code:
    v: ContactPoint
    l: ContactPoint
type:
  code:
    v: Count
    l: Count
type:
  code:
    v: Distance
    l: Distance
type:
  code:
    v: Duration
    l: Duration
type:
  code:
    v: HumanName
    l: HumanName
type:
  code:
    v: Identifier
    l: Identifier
type:
  code:
    v: Money
    l: Money
type:
  code:
    v: Period
    l: Period
type:
  code:
    v: Quantity
    l: Quantity
type:
  code:
    v: Range
    l: Range
type:
  code:
    v: Ratio
    l: Ratio
type:
  code:
    v: RatioRange
    l: RatioRange
type:
  code:
    v: Reference
    l: Reference
type:
  code:
    v: SampledData
    l: SampledData
type:
  code:
    v: Signature
    l: Signature
type:
  code:
    v: Timing
    l: Timing
type:
  code:
    v: ContactDetail
    l: ContactDetail
type:
  code:
    v: DataRequirement
    l: DataRequirement
type:
  code:
    v: Expression
    l: Expression

code:
  v: ParameterDefinition
  l: ParameterDefinition

code:
  v: RelatedArtifact
  l: RelatedArtifact

code:
  v: TriggerDefinition
  l: TriggerDefinition

code:
  v: UsageContext
  l: UsageContext

code:
  v: Availability
  l: Availability

code:
  v: ExtendedContactDetail
  l: ExtendedContactDetail

code:
  v: Dosage
  l: Dosage

code:
  v: Meta
  l: Meta

v: ext-1

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())
source:
  v: http://hl7.org/fhir/StructureDefinition/Element
  l: Element

v: false

v: false

identity:
  v: rim
map:
  v: N/A

element:
  id:
    v: Extension
  path:
    v: Extension
  short:
    v: A constraint on the target resource
  definition:
    v: Specifies an invariant that is enforced in the context of an instantiated resource.
  comment:
    v: Can be used on any definitional artifact to define an invariant that is enforced in the context of an instantiated resource. The invariant expression will have access to `%target` and `%definition` variables, where target is the instantiated resource, and definition is the definition used to instantiate.
  min:
    v: 0
  max:
    v: *
element:
  id:
    v: Extension.extension:key
  path:
    v: Extension.extension
  slice name:
    v: key
  short:
    v: Unique identifier
  definition:
    v: A unique identifier for the invariant (unique in the context of the resource).
  comment:
    v: Any error or outcome messages or warnings should include this id to allow the source of the message to be determined.
  min:
    v: 1
  max:
    v: 1
  type:
    code:
      v: Extension
      l: Extension
element:
  id:
    v: Extension.extension:key.extension
  path:
    v: Extension.extension.extension
  max:
    v: 0
element:
  id:
    v: Extension.extension:key.url
  path:
    v: Extension.extension.url
  type:
    code:
      v: uri
      l: uri
  fixed: Uri
    v: key
    l: key
element:
  id:
    v: Extension.extension:key.value[x]
  path:
    v: Extension.extension.value[x]
  min:
    v: 1
  type:
    code:
      v: id
      l: id
element:
  id:
    v: Extension.extension:requirements
  path:
    v: Extension.extension
  slice name:
    v: requirements
  short:
    v: Why the invariant is defined
  definition:
    v: A brief description of why the invariant is necessary or appropriate.
  min:
    v: 0
  max:
    v: 1
  type:
    code:
      v: Extension
      l: Extension
element:
  id:
    v: Extension.extension:requirements.extension
  path:
    v: Extension.extension.extension
  max:
    v: 0
element:
  id:
    v: Extension.extension:requirements.url
  path:
    v: Extension.extension.url
  type:
    code:
      v: uri
      l: uri
  fixed: Uri
    v: requirements
    l: requirements
element:
  id:
    v: Extension.extension:requirements.value[x]
  path:
    v: Extension.extension.value[x]
  min:
    v: 1
  type:
    code:
      v: string
      l: string
element:
  id:
    v: Extension.extension:severity
  path:
    v: Extension.extension
  slice name:
    v: severity
  short:
    v: error | warning
  definition:
    v: Whether the invariant indicates an error condition or a warning.
  min:
    v: 1
  max:
    v: 1
  type:
    code:
      v: Extension
      l: Extension
element:
  id:
    v: Extension.extension:severity.extension
  path:
    v: Extension.extension.extension
  max:
    v: 0
element:
  id:
    v: Extension.extension:severity.url
  path:
    v: Extension.extension.url
  type:
    code:
      v: uri
      l: uri
  fixed: Uri
    v: severity
    l: severity
element:
  id:
    v: Extension.extension:severity.value[x]
  path:
    v: Extension.extension.value[x]
  min:
    v: 1
  type:
    code:
      v: code
      l: code
  binding:
    extension:
      url:
        v: http://hl7.org/fhir/tools/StructureDefinition/binding-definition
        l: binding-definition
      value: Markdown
        v: SHALL applications comply with this constraint?
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
        l: elementdefinition-bindingName
      value: String
        v: ConstraintSeverity
    strength:
      v: required
    value set:
      v: http://hl7.org/fhir/ValueSet/constraint-severity
      l: constraint-severity
element:
  id:
    v: Extension.extension:expression
  path:
    v: Extension.extension
  slice name:
    v: expression
  short:
    v: The invariant expression
  definition:
    v: An expression providing a formal representation of the invariant condition.
  comment:
    v: The expression will have access to `%target` (the resource that was instantiated) and `%definition` (the definition for the instantiated resource).
  min:
    v: 1
  max:
    v: 1
  type:
    code:
      v: Extension
      l: Extension

id:
  v: Extension.extension:expression.extension
path:
  v: Extension.extension.extension
max:
  v: 0

id:
  v: Extension.extension:expression.url
path:
  v: Extension.extension.url
type:
  code:
    v: uri
    l: uri
fixed: Uri
  v: expression
  l: expression

id:
  v: Extension.extension:expression.value[x]
path:
  v: Extension.extension.value[x]
min:
  v: 1
type:
  code:
    v: Expression
    l: Expression

id:
  v: Extension.url
path:
  v: Extension.url
fixed: Uri
  v: http://hl7.org/fhir/StructureDefinition/cqf-targetInvariant
  l: cqf-targetInvariant

id:
  v: Extension.value[x]
path:
  v: Extension.value[x]
min:
  v: 0
max:
  v: 0