<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="Consent-StructureDefinition" />
  <text>
    <status value="generated" />
    <div xmlns="http://www.w3.org/1999/xhtml">
      <p>Defines constraints on the Consent resource to support research exemptions, encounter uniqueness, and verification.</p>
    </div>
  </text>
  <url value="https://pseudofrog.com/fhir/StructureDefinition/Consent" />
  <version value="0.1" />
  <name value="Consent" />
  <status value="draft" />
  <date value="2024-04-14T17:20:17.8695979+00:00" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Consent" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Consent" />
  <derivation value="constraint" />
  <differential>
    <element id="Consent.extension:extConsentResearchExemption">
      <path value="Consent.extension" />
      <sliceName value="extConsentResearchExemption" />
      <type>
        <code value="Extension" />
        <profile value="https://pseudofrog.com/fhir/StructureDefinition/ExtConsentResearchExemption" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Consent.extension:extConsentResearchExemption.extension">
      <path value="Consent.extension.extension" />
      <max value="2" />
    </element>
    <element id="Consent.category.coding.system">
      <path value="Consent.category.coding.system" />
      <min value="1" />
      <fixedUri value="https://pseudofrog.com/fhir/StructureDefinition/ConsentValueSet" />
    </element>
    <element id="Consent.performer">
      <path value="Consent.performer" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
      </type>
    </element>
    <element id="Consent.source[x]">
      <path value="Consent.source[x]" />
      <type>
        <code value="Attachment" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/DocumentReference" />
      </type>
    </element>
    <element id="Consent.verification.verifiedWith">
      <path value="Consent.verification.verifiedWith" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Encounter" />
      </type>
    </element>
    <element id="Consent.provision.period.start">
      <path value="Consent.provision.period.start" />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>