<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="Profile-Consent" />
  <url value="https://health.gov.on.ca/idms/fhir/StructureDefinition/IDMS-TermsOfUseConsent" />
  <name value="TOUConsent" />
  <title value="IDMS - Consent to Terms of Use" />
  <status value="draft" />
  <fhirVersion value="5.0.0" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Consent" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Consent" />
  <derivation value="constraint" />
  <differential>
    <element id="Consent.identifier">
      <path value="Consent.identifier" />
      <max value="0" />
    </element>
    <element id="Consent.status">
      <path value="Consent.status" />
      <definition value="#### **_`IDMS:  This is FHIR mandatory, it will always be active.`_**" />
    </element>
    <element id="Consent.category">
      <path value="Consent.category" />
      <definition value="#### **_`IDMS:  The type of consent,  logon or submitting.`_** &#xD;&#xA;&#xD;&#xA;&#xD;&#xA;A classification of the type of consents found in the statement. This element supports indexing and retrieval of consent statements." />
      <max value="0" />
    </element>
    <element id="Consent.subject">
      <path value="Consent.subject" />
      <max value="0" />
    </element>
    <element id="Consent.date">
      <path value="Consent.date" />
      <definition value="#### **_`IDMS:  Date the consent instance was agreed to..`_**" />
      <min value="1" />
    </element>
    <element id="Consent.period">
      <path value="Consent.period" />
      <max value="0" />
    </element>
    <element id="Consent.grantor">
      <path value="Consent.grantor" />
      <max value="0" />
    </element>
    <element id="Consent.grantee">
      <path value="Consent.grantee" />
      <definition value="#### **_`IDMS:  Who agreed to the consent. This is reference to a PractitionerRole`_** &#xD;&#xA;&#xD;&#xA;The entity responsible for complying with the Consent Directive, including any obligations or limitations on authorizations and enforcement of prohibitions." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
      </type>
    </element>
    <element id="Consent.manager">
      <path value="Consent.manager" />
      <max value="0" />
    </element>
    <element id="Consent.controller">
      <path value="Consent.controller" />
      <max value="0" />
    </element>
    <element id="Consent.sourceAttachment">
      <path value="Consent.sourceAttachment" />
      <max value="0" />
    </element>
    <element id="Consent.sourceReference">
      <path value="Consent.sourceReference" />
      <definition value="#### **_`IDMS: Reference to the Terms of Use that was consented to.`_** &#xD;&#xA;&#xD;&#xA;A reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/DocumentReference" />
      </type>
    </element>
    <element id="Consent.sourceReference.reference">
      <path value="Consent.sourceReference.reference" />
      <definition value="#### **_`IDMS:  Reference to the Terms of Use that was consented to.`_** &#xD;&#xA;&#xD;&#xA;A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources." />
      <max value="1" />
    </element>
    <element id="Consent.sourceReference.type">
      <path value="Consent.sourceReference.type" />
      <definition value="#### **_`IDMS:  The type of Terms of Use,  General or Submitting.`_**" />
      <min value="1" />
    </element>
    <element id="Consent.sourceReference.identifier">
      <path value="Consent.sourceReference.identifier" />
      <definition value="#### **_`IDMS:  The identifier for the TOU the was consented to. This is the  DocumentReference.indentifier.value of the TOU. example: TOU-LOGONv1.0`_**" />
      <min value="1" />
    </element>
    <element id="Consent.sourceReference.display">
      <path value="Consent.sourceReference.display" />
      <max value="0" />
    </element>
    <element id="Consent.regulatoryBasis">
      <path value="Consent.regulatoryBasis" />
      <max value="0" />
    </element>
    <element id="Consent.policyBasis">
      <path value="Consent.policyBasis" />
      <max value="0" />
    </element>
    <element id="Consent.policyText">
      <path value="Consent.policyText" />
      <max value="0" />
    </element>
    <element id="Consent.verification">
      <path value="Consent.verification" />
      <max value="0" />
    </element>
    <element id="Consent.decision">
      <path value="Consent.decision" />
      <max value="0" />
    </element>
    <element id="Consent.provision">
      <path value="Consent.provision" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>