<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="CA-eReC-Consent" />
  <url value="http://fhir.infoway-inforoute.ca/io/CA-eReC/StructureDefinition/CA-eReC-Consent" />
  <name value="Consent" />
  <title value="Consent" />
  <status value="draft" />
  <description value="This profile on Consent is used to record whether a patient has consented or not to be notified about updates to the eReferral." />
  <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.status">
      <path value="Consent.status" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.scope">
      <path value="Consent.scope" />
      <patternCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/consentscope" />
          <code value="patient-privacy" />
          <display value="Privacy Consent" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="Consent.category">
      <path value="Consent.category" />
      <patternCodeableConcept>
        <coding>
          <system value="http://loinc.org" />
          <code value="59284-0" />
          <display value="Patient Consent" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="Consent.patient">
      <path value="Consent.patient" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.dateTime">
      <path value="Consent.dateTime" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.policyRule">
      <path value="Consent.policyRule" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision">
      <path value="Consent.provision" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.type">
      <path value="Consent.provision.type" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.provision.action">
      <path value="Consent.provision.action" />
      <min value="1" />
      <max value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/consentaction" />
          <code value="disclose" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>