<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="http://phr.kanta.fi/StructureDefinition/fiphr-consent" />
  <name value="FIPHRConsent" />
  <title value="Consent" />
  <status value="draft" />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Consent" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Consent" />
  <derivation value="constraint" />
  <snapshot />
  <differential>
    <element id="Consent.meta">
      <path value="Consent.meta" />
      <min value="1" />
    </element>
    <element id="Consent.meta.profile">
      <path value="Consent.meta.profile" />
      <min value="1" />
      <max value="1" />
      <fixedCanonical value="http://phr.kanta.fi/StructureDefinition/fiphr-consent" />
    </element>
    <element id="Consent.language">
      <path value="Consent.language" />
      <min value="1" />
      <binding>
        <strength value="required" />
      </binding>
    </element>
    <element id="Consent.text">
      <path value="Consent.text" />
      <min value="1" />
    </element>
    <element id="Consent.extension:creatingApplication">
      <path value="Consent.extension" />
      <sliceName value="creatingApplication" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://phr.kanta.fi/StructureDefinition/fiphr-ext-creatingapplication" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Consent.identifier">
      <path value="Consent.identifier" />
      <min value="1" />
    </element>
    <element id="Consent.category">
      <path value="Consent.category" />
      <binding>
        <strength value="required" />
        <valueSet value="http://phr.kanta.fi/ValueSet/fiphr-vs-consentcategory" />
      </binding>
    </element>
    <element id="Consent.category.coding">
      <path value="Consent.category.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Consent.category.coding.system">
      <path value="Consent.category.coding.system" />
      <min value="1" />
      <fixedUri value="http://phr.kanta.fi/fiphr-cs-consentcategory" />
    </element>
    <element id="Consent.category.coding.code">
      <path value="Consent.category.coding.code" />
      <min value="1" />
    </element>
    <element id="Consent.category.coding.display">
      <path value="Consent.category.coding.display" />
      <min value="1" />
    </element>
    <element id="Consent.patient">
      <path value="Consent.patient" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://phr.kanta.fi/StructureDefinition/fiphr-sd-patient" />
        <aggregation value="referenced" />
      </type>
    </element>
    <element id="Consent.dateTime">
      <path value="Consent.dateTime" />
      <min value="1" />
    </element>
    <element id="Consent.performer">
      <path value="Consent.performer" />
      <max value="0" />
    </element>
    <element id="Consent.verification">
      <path value="Consent.verification" />
      <max value="0" />
    </element>
    <element id="Consent.provision.extension:clientId">
      <path value="Consent.provision.extension" />
      <sliceName value="clientId" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://phr.kanta.fi/StructureDefinition/fiphr-ext-clientId" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Consent.provision.class">
      <path value="Consent.provision.class" />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/ValueSet/resource-types" />
      </binding>
    </element>
    <element id="Consent.provision.code.extension:resourceType">
      <path value="Consent.provision.code.extension" />
      <sliceName value="resourceType" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://phr.kanta.fi/StructureDefinition/fiphr-ext-resourceType" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Consent.provision.code.extension:resourceType.value[x]">
      <path value="Consent.provision.code.extension.value[x]" />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/ValueSet/resource-types" />
      </binding>
    </element>
    <element id="Consent.provision.code.coding">
      <path value="Consent.provision.code.coding" />
      <binding>
        <strength value="required" />
        <valueSet value="http://phr.kanta.fi/ValueSet/fiphr-vs-provisionCodes" />
      </binding>
    </element>
  </differential>
</StructureDefinition>