<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="http://apiframework.dedalus.eu/fhir/StructureDefinition/activityDefinition-targetTaskProfile" />
  <name value="activityDefinition-targetTaskProfile" />
  <status value="active" />
  <experimental value="false" />
  <description value="Dedalus API Framework extension for ActivityDefinition, allows to specify, as part of an activty definition, the FHIR Profile that the task created with this definition as a base should be compliant to, in terms of mandatory elements and other constraints." />
  <fhirVersion value="3.0.1" />
  <kind value="complex-type" />
  <abstract value="false" />
  <contextType value="resource" />
  <context value="ActivityDefinition" />
  <type value="Extension" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Extension" />
  <derivation value="constraint" />
  <differential>
    <element id="Extension">
      <path value="Extension" />
      <short value="Optional Extensions Element" />
      <definition value="Optional Extension Element - found in all resources." />
      <base>
        <path value="Element" />
        <min value="0" />
        <max value="*" />
      </base>
      <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')])" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
    </element>
    <element id="Extension.url">
      <path value="Extension.url" />
      <fixedUri value="http://apiframework.dedalus.eu/fhir/StructureDefinition/activityDefinition-targetTaskProfile" />
    </element>
    <element id="Extension.value[x]:valueReference">
      <path value="Extension.valueReference" />
      <sliceName value="valueReference" />
      <requirements value="Reference to the FHIR Profile for the Task resource. This reference, as an exception to the API Framework Practices, has .reference as mandatory since it is assumed that the system managing the activty defintion also manages the related task profiles, so it is safe to assume that they can be linked by urls." />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/StructureDefinition" />
      </type>
    </element>
    <element id="Extension.value[x]:valueReference.reference">
      <path value="Extension.valueReference.reference" />
      <requirements value="This reference, as an exception to the API Framework Practices, has .reference as mandatory since it is assumed that the system managing the activty defintion also manages the related task profiles, so it is safe to assume that they can be linked by urls." />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>