<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="Expression" />
  <meta>
    <lastUpdated value="2019-11-01T09:29:23.356+11:00" />
  </meta>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
    <valueCode value="trial-use" />
  </extension>
  <url value="http://hl7.org/fhir/StructureDefinition/Expression" />
  <version value="4.0.1" />
  <name value="Expression" />
  <status value="draft" />
  <date value="2019-11-01T09:29:23+11:00" />
  <publisher value="HL7 FHIR Standard" />
  <contact>
    <telecom>
      <system value="url" />
      <value value="http://hl7.org/fhir" />
    </telecom>
  </contact>
  <description value="Base StructureDefinition for Expression Type: A expression that is evaluated in a specified context and returns a value. The context of use of the expression must specify the context in which the expression is evaluated, and how the result of the expression is used." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <kind value="complex-type" />
  <abstract value="false" />
  <type value="Expression" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Element" />
  <derivation value="specialization" />
  <snapshot>
    <element id="Expression">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="trial-use" />
      </extension>
      <path value="Expression" />
      <short value="An expression that can be used to generate a value" />
      <definition value="A expression that is evaluated in a specified context and returns a value. The context of use of the expression must specify the context in which the expression is evaluated, and how the result of the expression is used." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Expression" />
        <min value="0" />
        <max value="*" />
      </base>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="exp-1" />
        <severity value="error" />
        <human value="An expression or a reference must be provided" />
        <expression value="expression.exists() or reference.exists()" />
        <xpath value="exists(f:expression) or exists(f:reference)" />
        <source value="http://hl7.org/fhir/StructureDefinition/Expression" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="Expression.id">
      <path value="Expression.id" />
      <representation value="xmlAttr" />
      <short value="Unique id for inter-element referencing" />
      <definition value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Element.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type">
          <valueUrl value="string" />
        </extension>
        <code value="http://hl7.org/fhirpath/System.String" />
      </type>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="Expression.extension">
      <path value="Expression.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="open" />
      </slicing>
      <short value="Additional content defined by implementations" />
      <definition value="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 manageable, 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 value="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 value="extensions" />
      <alias value="user content" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Element.extension" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Extension" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="ext-1" />
        <severity value="error" />
        <human value="Must have either extensions or value[x], not both" />
        <expression value="extension.exists() != value.exists()" />
        <xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
        <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Expression.description">
      <path value="Expression.description" />
      <short value="Natural language description of the condition" />
      <definition value="A brief, natural language description of the condition that effectively communicates the intended semantics." />
      <comment value="Note that FHIR strings SHALL NOT exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Expression.description" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="Expression.name">
      <path value="Expression.name" />
      <short value="Short name assigned to expression for reuse" />
      <definition value="A short name assigned to the expression to allow for multiple reuse of the expression in the context where it is defined." />
      <comment value="RFC 4122" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Expression.name" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="id" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="Expression.language">
      <path value="Expression.language" />
      <short value="text/cql | text/fhirpath | application/x-fhir-query | etc." />
      <definition value="The media type of the language for the expression." />
      <comment value="Note that FHIR strings SHALL NOT exceed 1MB in size" />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Expression.language" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet">
          <valueCanonical value="http://www.rfc-editor.org/bcp/bcp13.txt" />
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="ExpressionLanguage" />
        </extension>
        <strength value="extensible" />
        <description value="The media type of the expression language." />
        <valueSet value="http://hl7.org/fhir/ValueSet/expression-language" />
      </binding>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="Expression.expression">
      <path value="Expression.expression" />
      <short value="Expression in specified language" />
      <definition value="An expression in the specified language that returns a value." />
      <comment value="Note that FHIR strings SHALL NOT exceed 1MB in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Expression.expression" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="Expression.reference">
      <path value="Expression.reference" />
      <short value="Where the expression is found" />
      <definition value="A URI that defines where the expression is found." />
      <comment value="If both a reference and an expression is found, the reference SHALL point to the same expression." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Expression.reference" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="uri" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <isSummary value="true" />
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
  </snapshot>
  <differential>
    <element id="Expression">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="trial-use" />
      </extension>
      <path value="Expression" />
      <short value="An expression that can be used to generate a value" />
      <definition value="A expression that is evaluated in a specified context and returns a value. The context of use of the expression must specify the context in which the expression is evaluated, and how the result of the expression is used." />
      <min value="0" />
      <max value="*" />
      <constraint>
        <key value="exp-1" />
        <severity value="error" />
        <human value="An expression or a reference must be provided" />
        <expression value="expression.exists() or reference.exists()" />
        <xpath value="exists(f:expression) or exists(f:reference)" />
      </constraint>
    </element>
    <element id="Expression.description">
      <path value="Expression.description" />
      <short value="Natural language description of the condition" />
      <definition value="A brief, natural language description of the condition that effectively communicates the intended semantics." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
    </element>
    <element id="Expression.name">
      <path value="Expression.name" />
      <short value="Short name assigned to expression for reuse" />
      <definition value="A short name assigned to the expression to allow for multiple reuse of the expression in the context where it is defined." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="id" />
      </type>
      <isSummary value="true" />
    </element>
    <element id="Expression.language">
      <path value="Expression.language" />
      <short value="text/cql | text/fhirpath | application/x-fhir-query | etc." />
      <definition value="The media type of the language for the expression." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="code" />
      </type>
      <isSummary value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet">
          <valueCanonical value="http://www.rfc-editor.org/bcp/bcp13.txt" />
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="ExpressionLanguage" />
        </extension>
        <strength value="extensible" />
        <description value="The media type of the expression language." />
        <valueSet value="http://hl7.org/fhir/ValueSet/expression-language" />
      </binding>
    </element>
    <element id="Expression.expression">
      <path value="Expression.expression" />
      <short value="Expression in specified language" />
      <definition value="An expression in the specified language that returns a value." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
      <isSummary value="true" />
    </element>
    <element id="Expression.reference">
      <path value="Expression.reference" />
      <short value="Where the expression is found" />
      <definition value="A URI that defines where the expression is found." />
      <comment value="If both a reference and an expression is found, the reference SHALL point to the same expression." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="uri" />
      </type>
      <isSummary value="true" />
    </element>
  </differential>
</StructureDefinition>