Release 5 Draft Ballot

This page is part of the FHIR Specification (v4.6.0: R5 Draft Ballot). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions

Extension: targetInvariant

FHIR Infrastructure Work Group Maturity Level: 1InformativeUse Context: Any

URL for this extension:

http://hl7.org/fhir/StructureDefinition/cqf-targetInvariant

Status: draft. Extension maintained by: Health Level Seven, Inc. - CDS WG

Specifies an invariant that is enforced in the context of an instantiated resource.

Comment:

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.

Context of Use: Use on Element ID Element

Extension Content

Summary

NameFlagsCard.TypeDescription & Constraintsdoco
.. targetInvariant0..*ExtensionURL = http://hl7.org/fhir/StructureDefinition/cqf-targetInvariant
targetInvariant: Specifies an invariant that is enforced in the context of an instantiated resource.


Use on Element ID Element
... key1..1idA unique identifier for the invariant (unique in the context of the resource).

... requirements0..1stringA brief description of why the invariant is necessary or appropriate.

... severity1..1codeWhether the invariant indicates an error condition or a warning.


doco Documentation for this format

Full Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. extension0..*ExtensionURL = http://hl7.org/fhir/StructureDefinition/cqf-targetInvariant
targetInvariant: Specifies an invariant that is enforced in the context of an instantiated resource.


Use on Element ID Element
... extension 0..*ExtensionAdditional content defined by implementations
Slice: Unordered, Open by value:url
... extension:key 1..1ExtensionUnique identifier
.... id 0..1stringUnique id for inter-element referencing
.... extension 0..0
.... url 1..1uri"key"
.... value[x] 1..1idValue of extension
... extension:requirements 0..1ExtensionWhy the invariant is defined
.... id 0..1stringUnique id for inter-element referencing
.... extension 0..0
.... url 1..1uri"requirements"
.... value[x] 1..1stringValue of extension
.... id 0..1stringUnique id for inter-element referencing
.... extension 0..0
.... url 1..1uri"severity"
.... value[x] 1..1codeValue of extension
Binding: ConstraintSeverity (required)
... extension:expression 1..1ExtensionThe invariant expression
.... id 0..1stringUnique id for inter-element referencing
.... extension 0..0
.... url 1..1uri"expression"
.... value[x] 1..1ExpressionValue of extension
... url 1..1uri"http://hl7.org/fhir/StructureDefinition/cqf-targetInvariant"
... value[x] 0..0
.... valueBase64Binarybase64Binary
.... valueBooleanboolean
.... valueCanonicalcanonical(Any)
.... valueCodecode
.... valueDatedate
.... valueDateTimedateTime
.... valueDecimaldecimal
.... valueIdid
.... valueInstantinstant
.... valueIntegerinteger
.... valueInteger64integer64
.... valueMarkdownmarkdown
.... valueOidoid
.... valuePositiveIntpositiveInt
.... valueStringstring
.... valueTimetime
.... valueUnsignedIntunsignedInt
.... valueUriuri
.... valueUrlurl
.... valueUuiduuid
.... valueAddressAddress
.... valueAgeAge
.... valueAnnotationAnnotation
.... valueAttachmentAttachment
.... valueCodeableConceptCodeableConcept
.... valueCodingCoding
.... valueContactPointContactPoint
.... valueCountCount
.... valueDistanceDistance
.... valueDurationDuration
.... valueHumanNameHumanName
.... valueIdentifierIdentifier
.... valueMoneyMoney
.... valuePeriodPeriod
.... valueQuantityQuantity
.... valueRangeRange
.... valueRatioRatio
.... valueReferenceReference(Any)
.... valueSampledDataSampledData
.... valueSignatureSignature
.... valueTimingTiming
.... valueContactDetailContactDetail
.... valueContributorContributor
.... valueDataRequirementDataRequirement
.... valueExpressionExpression
.... valueParameterDefinitionParameterDefinition
.... valueRelatedArtifactRelatedArtifact
.... valueTriggerDefinitionTriggerDefinition
.... valueUsageContextUsageContext
.... valueDosageDosage
.... valueMetaMeta

doco Documentation for this format

XML Template

<!-- targetInvariant -->doco

<extension xmlns="http://hl7.org/fhir"
     url="http://hl7.org/fhir/StructureDefinition/cqf-targetInvariant" >
 <-- extension sliced by value:url  in the specified orderOpen-->
 <extension url="key"> ?? 1..1 Extension  <!-- ?? 1..1 Unique identifier -->
  <valueId value="[id]"/><!-- ?? 1..1 Value of extension -->
 </extension>
 <extension url="requirements"> ?? 0..1 Extension  <!-- ?? 0..1 Why the invariant is defined -->
  <valueString value="[string]"/><!-- ?? 1..1 Value of extension -->
 </extension>
 <extension url="severity"> ?? 1..1 Extension  <!-- ?? 1..1 error | warning -->
  <valueCode value="[code]"/><!-- ?? 1..1 Value of extension -->
 </extension>
 <extension url="expression"> ?? 1..1 Extension  <!-- ?? 1..1 The invariant expression -->
  <valueExpression><!-- ?? 1..1 Expression 
      Value of extension --></valueExpression>
 </extension>
</extension>

JSON Template

{ // targetInvariant
    "extension" : [ //  sliced by value:url  in the specified order, Open 
      { // Unique identifier // C? R! 
        // from Element: extension
        "extension" : [ //  sliced by value:url  in the specified order, Open ]
        "url" : "key", // R! 
        "valueId" : "<id>" // C? R! Value of extension
      },
      { // Why the invariant is defined // C?
        // from Element: extension
        "extension" : [ //  sliced by value:url  in the specified order, Open ]
        "url" : "requirements", // R! 
        "valueString" : "<string>" // C? R! Value of extension
      },
      { // error | warning // C? R! 
        // from Element: extension
        "extension" : [ //  sliced by value:url  in the specified order, Open ]
        "url" : "severity", // R! 
        "valueCode" : "<code>" // C? R! Value of extension
      },
      { // The invariant expression // C? R! 
        // from Element: extension
        "extension" : [ //  sliced by value:url  in the specified order, Open ]
        "url" : "expression", // R! 
        "valueExpression" : { Expression } // C? R! Value of extension
      }
    ],
    "url" : "http://hl7.org/fhir/StructureDefinition/cqf-targetInvariant", // R! 
// value[x]: Value of extension. One of these 51:
  }

Summary

NameFlagsCard.TypeDescription & Constraintsdoco
.. targetInvariant0..*ExtensionURL = http://hl7.org/fhir/StructureDefinition/cqf-targetInvariant
targetInvariant: Specifies an invariant that is enforced in the context of an instantiated resource.


Use on Element ID Element
... key1..1idA unique identifier for the invariant (unique in the context of the resource).

... requirements0..1stringA brief description of why the invariant is necessary or appropriate.

... severity1..1codeWhether the invariant indicates an error condition or a warning.


doco Documentation for this format

Full Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. extension0..*ExtensionURL = http://hl7.org/fhir/StructureDefinition/cqf-targetInvariant
targetInvariant: Specifies an invariant that is enforced in the context of an instantiated resource.


Use on Element ID Element
... extension 0..*ExtensionAdditional content defined by implementations
Slice: Unordered, Open by value:url
... extension:key 1..1ExtensionUnique identifier
.... id 0..1stringUnique id for inter-element referencing
.... extension 0..0
.... url 1..1uri"key"
.... value[x] 1..1idValue of extension
... extension:requirements 0..1ExtensionWhy the invariant is defined
.... id 0..1stringUnique id for inter-element referencing
.... extension 0..0
.... url 1..1uri"requirements"
.... value[x] 1..1stringValue of extension
.... id 0..1stringUnique id for inter-element referencing
.... extension 0..0
.... url 1..1uri"severity"
.... value[x] 1..1codeValue of extension
Binding: ConstraintSeverity (required)
... extension:expression 1..1ExtensionThe invariant expression
.... id 0..1stringUnique id for inter-element referencing
.... extension 0..0
.... url 1..1uri"expression"
.... value[x] 1..1ExpressionValue of extension
... url 1..1uri"http://hl7.org/fhir/StructureDefinition/cqf-targetInvariant"
... value[x] 0..0
.... valueBase64Binarybase64Binary
.... valueBooleanboolean
.... valueCanonicalcanonical(Any)
.... valueCodecode
.... valueDatedate
.... valueDateTimedateTime
.... valueDecimaldecimal
.... valueIdid
.... valueInstantinstant
.... valueIntegerinteger
.... valueInteger64integer64
.... valueMarkdownmarkdown
.... valueOidoid
.... valuePositiveIntpositiveInt
.... valueStringstring
.... valueTimetime
.... valueUnsignedIntunsignedInt
.... valueUriuri
.... valueUrlurl
.... valueUuiduuid
.... valueAddressAddress
.... valueAgeAge
.... valueAnnotationAnnotation
.... valueAttachmentAttachment
.... valueCodeableConceptCodeableConcept
.... valueCodingCoding
.... valueContactPointContactPoint
.... valueCountCount
.... valueDistanceDistance
.... valueDurationDuration
.... valueHumanNameHumanName
.... valueIdentifierIdentifier
.... valueMoneyMoney
.... valuePeriodPeriod
.... valueQuantityQuantity
.... valueRangeRange
.... valueRatioRatio
.... valueReferenceReference(Any)
.... valueSampledDataSampledData
.... valueSignatureSignature
.... valueTimingTiming
.... valueContactDetailContactDetail
.... valueContributorContributor
.... valueDataRequirementDataRequirement
.... valueExpressionExpression
.... valueParameterDefinitionParameterDefinition
.... valueRelatedArtifactRelatedArtifact
.... valueTriggerDefinitionTriggerDefinition
.... valueUsageContextUsageContext
.... valueDosageDosage
.... valueMetaMeta

doco Documentation for this format

XML Template

<!-- targetInvariant -->doco

<extension xmlns="http://hl7.org/fhir"
     url="http://hl7.org/fhir/StructureDefinition/cqf-targetInvariant" >
 <-- extension sliced by value:url  in the specified orderOpen-->
 <extension url="key"> ?? 1..1 Extension  <!-- ?? 1..1 Unique identifier -->
  <valueId value="[id]"/><!-- ?? 1..1 Value of extension -->
 </extension>
 <extension url="requirements"> ?? 0..1 Extension  <!-- ?? 0..1 Why the invariant is defined -->
  <valueString value="[string]"/><!-- ?? 1..1 Value of extension -->
 </extension>
 <extension url="severity"> ?? 1..1 Extension  <!-- ?? 1..1 error | warning -->
  <valueCode value="[code]"/><!-- ?? 1..1 Value of extension -->
 </extension>
 <extension url="expression"> ?? 1..1 Extension  <!-- ?? 1..1 The invariant expression -->
  <valueExpression><!-- ?? 1..1 Expression 
      Value of extension --></valueExpression>
 </extension>
</extension>

JSON Template

{ // targetInvariant
    "extension" : [ //  sliced by value:url  in the specified order, Open 
      { // Unique identifier // C? R! 
        // from Element: extension
        "extension" : [ //  sliced by value:url  in the specified order, Open ]
        "url" : "key", // R! 
        "valueId" : "<id>" // C? R! Value of extension
      },
      { // Why the invariant is defined // C?
        // from Element: extension
        "extension" : [ //  sliced by value:url  in the specified order, Open ]
        "url" : "requirements", // R! 
        "valueString" : "<string>" // C? R! Value of extension
      },
      { // error | warning // C? R! 
        // from Element: extension
        "extension" : [ //  sliced by value:url  in the specified order, Open ]
        "url" : "severity", // R! 
        "valueCode" : "<code>" // C? R! Value of extension
      },
      { // The invariant expression // C? R! 
        // from Element: extension
        "extension" : [ //  sliced by value:url  in the specified order, Open ]
        "url" : "expression", // R! 
        "valueExpression" : { Expression } // C? R! Value of extension
      }
    ],
    "url" : "http://hl7.org/fhir/StructureDefinition/cqf-targetInvariant", // R! 
// value[x]: Value of extension. One of these 51:
  }

 

Constraints

  • ele-1: All FHIR elements must have a @value or children (xpath: @value|f:*|h:div)
  • ext-1: Must have either extensions or value[x], not both (xpath: exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')]))
  • ele-1: On Extension.extension: All FHIR elements must have a @value or children (xpath on Extension.extension: @value|f:*|h:div)
  • ext-1: On Extension.extension: Must have either extensions or value[x], not both (xpath on Extension.extension: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")]))
  • ele-1: On Extension.extension: All FHIR elements must have a @value or children (xpath on Extension.extension: @value|f:*|h:div)
  • ext-1: On Extension.extension: Must have either extensions or value[x], not both (xpath on Extension.extension: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")]))
  • ele-1: On Extension.extension.extension: All FHIR elements must have a @value or children (xpath on Extension.extension.extension: @value|f:*|h:div)
  • ext-1: On Extension.extension.extension: Must have either extensions or value[x], not both (xpath on Extension.extension.extension: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")]))
  • ele-1: On Extension.extension.value[x]: All FHIR elements must have a @value or children (xpath on Extension.extension.value[x]: @value|f:*|h:div)
  • ele-1: On Extension.extension: All FHIR elements must have a @value or children (xpath on Extension.extension: @value|f:*|h:div)
  • ext-1: On Extension.extension: Must have either extensions or value[x], not both (xpath on Extension.extension: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")]))
  • ele-1: On Extension.extension.extension: All FHIR elements must have a @value or children (xpath on Extension.extension.extension: @value|f:*|h:div)
  • ext-1: On Extension.extension.extension: Must have either extensions or value[x], not both (xpath on Extension.extension.extension: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")]))
  • ele-1: On Extension.extension.value[x]: All FHIR elements must have a @value or children (xpath on Extension.extension.value[x]: @value|f:*|h:div)
  • ele-1: On Extension.extension: All FHIR elements must have a @value or children (xpath on Extension.extension: @value|f:*|h:div)
  • ext-1: On Extension.extension: Must have either extensions or value[x], not both (xpath on Extension.extension: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")]))
  • ele-1: On Extension.extension.extension: All FHIR elements must have a @value or children (xpath on Extension.extension.extension: @value|f:*|h:div)
  • ext-1: On Extension.extension.extension: Must have either extensions or value[x], not both (xpath on Extension.extension.extension: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")]))
  • ele-1: On Extension.extension.value[x]: All FHIR elements must have a @value or children (xpath on Extension.extension.value[x]: @value|f:*|h:div)
  • ele-1: On Extension.extension: All FHIR elements must have a @value or children (xpath on Extension.extension: @value|f:*|h:div)
  • ext-1: On Extension.extension: Must have either extensions or value[x], not both (xpath on Extension.extension: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")]))
  • ele-1: On Extension.extension.extension: All FHIR elements must have a @value or children (xpath on Extension.extension.extension: @value|f:*|h:div)
  • ext-1: On Extension.extension.extension: Must have either extensions or value[x], not both (xpath on Extension.extension.extension: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")]))
  • ele-1: On Extension.extension.value[x]: All FHIR elements must have a @value or children (xpath on Extension.extension.value[x]: @value|f:*|h:div)
  • ele-1: On Extension.value[x]: All FHIR elements must have a @value or children (xpath on Extension.value[x]: @value|f:*|h:div)