Release 4

Extension: constraint

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

URL for this extension:

http://hl7.org/fhir/StructureDefinition/questionnaire-constraint

Status: draft. Extension maintained by: HL7

An invariant that must be satisfied before responses to the questionnaire can be considered "complete".

Comment:

This maps to the ElementDefinition.constraint element.

Context of Use: Use on Element ID Questionnaire, Element ID Questionnaire.item or Element ID Questionnaire.item.item

Extension Content

Summary

NameFlagsCard.TypeDescription & Constraintsdoco
.. constraint0..*ExtensionURL = http://hl7.org/fhir/StructureDefinition/questionnaire-constraint
constraint: An invariant that must be satisfied before responses to the questionnaire can be considered "complete".


Use on Element ID Questionnaire, Element ID Questionnaire.item or Element ID Questionnaire.item.item
... key1..1idUnique id for the constraint within the questionnaire.

... requirements0..1stringAn explanation of why this extension is required (for documentation purposes).

... severity1..1codeIndicates how serious violating the invariant is.

... expression1..1stringThe FHIRPath expression of the rule for computable interpretation.

... human1..1stringA free text expression of the rule to display to the user if the rule is violated.

... location0..*stringRelative paths to the questions this rule is enforced against.


doco Documentation for this format

Full Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. extension0..*ExtensionURL = http://hl7.org/fhir/StructureDefinition/questionnaire-constraint
constraint: An invariant that must be satisfied before responses to the questionnaire can be considered "complete".


Use on Element ID Questionnaire, Element ID Questionnaire.item or Element ID Questionnaire.item.item
... extension I0..*ExtensionAdditional content defined by implementations
Slice: Unordered, Open by value:url
... extension:key I1..1ExtensionUnique identifier
.... extension I0..0
.... url 1..1uri"key"
.... value[x] I1..1idValue of extension
... extension:requirements I0..1ExtensionWhy needed
.... extension I0..0
.... url 1..1uri"requirements"
.... value[x] I1..1stringValue of extension
... extension:severity I1..1Extensionerror|warning
.... extension I0..0
.... url 1..1uri"severity"
.... value[x] I1..1codeValue of extension
Binding: ConstraintSeverity (required)
... extension:expression I1..1ExtensionFormal rule
.... extension I0..0
.... url 1..1uri"expression"
.... value[x] I1..1stringValue of extension
... extension:human I1..1ExtensionHuman-readable rule
.... extension I0..0
.... url 1..1uri"human"
.... value[x] I1..1stringValue of extension
... extension:location I0..*ExtensionRelative path to elements
.... extension I0..0
.... url 1..1uri"location"
.... value[x] I1..1stringValue of extension
... url 1..1uri"http://hl7.org/fhir/StructureDefinition/questionnaire-constraint"
... value[x] I0..0
.... valueBase64Binarybase64Binary
.... valueBooleanboolean
.... valueCanonicalcanonical()
.... valueCodecode
.... valueDatedate
.... valueDateTimedateTime
.... valueDecimaldecimal
.... valueIdid
.... valueInstantinstant
.... valueIntegerinteger
.... 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()
.... valueSampledDataSampledData
.... valueSignatureSignature
.... valueTimingTiming
.... valueContactDetailContactDetail
.... valueContributorContributor
.... valueDataRequirementDataRequirement
.... valueExpressionExpression
.... valueParameterDefinitionParameterDefinition
.... valueRelatedArtifactRelatedArtifact
.... valueTriggerDefinitionTriggerDefinition
.... valueUsageContextUsageContext
.... valueDosageDosage
.... valueMetaMeta

doco Documentation for this format

XML Template

<!-- constraint -->doco

<extension xmlns="http://hl7.org/fhir"
     url="http://hl7.org/fhir/StructureDefinition/questionnaire-constraint" >
 <-- 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 needed -->
  <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 Formal rule -->
  <valueString value="[string]"/><!-- ?? 1..1 Value of extension -->
 </extension>
 <extension url="human"> ?? 1..1 Extension  <!-- ?? 1..1 Human-readable rule -->
  <valueString value="[string]"/><!-- ?? 1..1 Value of extension -->
 </extension>
 <extension url="location"> ?? 0..* Extension  <!-- ?? 0..* Relative path to elements -->
  <valueString value="[string]"/><!-- ?? 1..1 Value of extension -->
 </extension>
</extension>

JSON Template

{ // constraint
    "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 needed // 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
      },
      { // Formal rule // C? R! 
        // from Element: extension
        "extension" : [ //  sliced by value:url  in the specified order, Open ]
        "url" : "expression", // R! 
        "valueString" : "<string>" // C? R! Value of extension
      },
      { // Human-readable rule // C? R! 
        // from Element: extension
        "extension" : [ //  sliced by value:url  in the specified order, Open ]
        "url" : "human", // R! 
        "valueString" : "<string>" // C? R! Value of extension
      },
      { // Relative path to elements // C?
        // from Element: extension
        "extension" : [ //  sliced by value:url  in the specified order, Open ]
        "url" : "location", // R! 
        "valueString" : "<string>" // C? R! Value of extension
      }
    ],
    "url" : "http://hl7.org/fhir/StructureDefinition/questionnaire-constraint", // R! 
// value[x]: Value of extension. One of these 50:
  }

Summary

NameFlagsCard.TypeDescription & Constraintsdoco
.. constraint0..*ExtensionURL = http://hl7.org/fhir/StructureDefinition/questionnaire-constraint
constraint: An invariant that must be satisfied before responses to the questionnaire can be considered &quot;complete&quot;.


Use on Element ID Questionnaire, Element ID Questionnaire.item or Element ID Questionnaire.item.item
... key1..1idUnique id for the constraint within the questionnaire.

... requirements0..1stringAn explanation of why this extension is required (for documentation purposes).

... severity1..1codeIndicates how serious violating the invariant is.

... expression1..1stringThe FHIRPath expression of the rule for computable interpretation.

... human1..1stringA free text expression of the rule to display to the user if the rule is violated.

... location0..*stringRelative paths to the questions this rule is enforced against.


doco Documentation for this format

Full Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. extension0..*ExtensionURL = http://hl7.org/fhir/StructureDefinition/questionnaire-constraint
constraint: An invariant that must be satisfied before responses to the questionnaire can be considered &quot;complete&quot;.


Use on Element ID Questionnaire, Element ID Questionnaire.item or Element ID Questionnaire.item.item
... extension I0..*ExtensionAdditional content defined by implementations
Slice: Unordered, Open by value:url
... extension:key I1..1ExtensionUnique identifier
.... extension I0..0
.... url 1..1uri"key"
.... value[x] I1..1idValue of extension
... extension:requirements I0..1ExtensionWhy needed
.... extension I0..0
.... url 1..1uri"requirements"
.... value[x] I1..1stringValue of extension
... extension:severity I1..1Extensionerror|warning
.... extension I0..0
.... url 1..1uri"severity"
.... value[x] I1..1codeValue of extension
Binding: ConstraintSeverity (required)
... extension:expression I1..1ExtensionFormal rule
.... extension I0..0
.... url 1..1uri"expression"
.... value[x] I1..1stringValue of extension
... extension:human I1..1ExtensionHuman-readable rule
.... extension I0..0
.... url 1..1uri"human"
.... value[x] I1..1stringValue of extension
... extension:location I0..*ExtensionRelative path to elements
.... extension I0..0
.... url 1..1uri"location"
.... value[x] I1..1stringValue of extension
... url 1..1uri"http://hl7.org/fhir/StructureDefinition/questionnaire-constraint"
... value[x] I0..0
.... valueBase64Binarybase64Binary
.... valueBooleanboolean
.... valueCanonicalcanonical()
.... valueCodecode
.... valueDatedate
.... valueDateTimedateTime
.... valueDecimaldecimal
.... valueIdid
.... valueInstantinstant
.... valueIntegerinteger
.... 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()
.... valueSampledDataSampledData
.... valueSignatureSignature
.... valueTimingTiming
.... valueContactDetailContactDetail
.... valueContributorContributor
.... valueDataRequirementDataRequirement
.... valueExpressionExpression
.... valueParameterDefinitionParameterDefinition
.... valueRelatedArtifactRelatedArtifact
.... valueTriggerDefinitionTriggerDefinition
.... valueUsageContextUsageContext
.... valueDosageDosage
.... valueMetaMeta

doco Documentation for this format

XML Template

<!-- constraint -->doco

<extension xmlns="http://hl7.org/fhir"
     url="http://hl7.org/fhir/StructureDefinition/questionnaire-constraint" >
 <-- 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 needed -->
  <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 Formal rule -->
  <valueString value="[string]"/><!-- ?? 1..1 Value of extension -->
 </extension>
 <extension url="human"> ?? 1..1 Extension  <!-- ?? 1..1 Human-readable rule -->
  <valueString value="[string]"/><!-- ?? 1..1 Value of extension -->
 </extension>
 <extension url="location"> ?? 0..* Extension  <!-- ?? 0..* Relative path to elements -->
  <valueString value="[string]"/><!-- ?? 1..1 Value of extension -->
 </extension>
</extension>

JSON Template

{ // constraint
    "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 needed // 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
      },
      { // Formal rule // C? R! 
        // from Element: extension
        "extension" : [ //  sliced by value:url  in the specified order, Open ]
        "url" : "expression", // R! 
        "valueString" : "<string>" // C? R! Value of extension
      },
      { // Human-readable rule // C? R! 
        // from Element: extension
        "extension" : [ //  sliced by value:url  in the specified order, Open ]
        "url" : "human", // R! 
        "valueString" : "<string>" // C? R! Value of extension
      },
      { // Relative path to elements // C?
        // from Element: extension
        "extension" : [ //  sliced by value:url  in the specified order, Open ]
        "url" : "location", // R! 
        "valueString" : "<string>" // C? R! Value of extension
      }
    ],
    "url" : "http://hl7.org/fhir/StructureDefinition/questionnaire-constraint", // R! 
// value[x]: Value of extension. One of these 50:
  }

 

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.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)