<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="mitz-consent-notify" />
  <language value="nl-NL" />
  <url value="http://vzvz.nl/fhir/otv/StructureDefinition/mitz-consent-notify" />
  <version value="4.0.0-beta.1" />
  <name value="MitzConsentNotify" />
  <status value="draft" />
  <publisher value="VZVZ" />
  <contact>
    <name value="VZVZ" />
    <telecom>
      <system value="email" />
      <value value="standaardisatie@vzvz.nl" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="Notification of the care provider of the consent change by the patient.&#xA;This notification is the result of the subscription taken by the care provider." />
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166" />
      <code value="NL" />
      <display value="Netherlands" />
    </coding>
  </jurisdiction>
  <copyright value="VZVZ" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Consent" />
  <baseDefinition value="http://vzvz.nl/fhir/otv/StructureDefinition/mitz-base-consent" />
  <derivation value="constraint" />
  <differential>
    <element id="Consent.text">
      <path value="Consent.text" />
      <short value="Text representation of the consent, for human interpretation" />
      <definition value="A human-readable narrative that describes the consent" />
      <comment value="The text element is required, but will be filled by the Mitz server" />
      <min value="1" />
    </element>
    <element id="Consent.text.status">
      <path value="Consent.text.status" />
      <patternCode value="generated" />
    </element>
    <element id="Consent.status">
      <path value="Consent.status" />
      <definition value="Indicates the current state of this consent. &#xA;Inactive for unanswered consent questions, active for answered consent questions, regardless of the answer." />
    </element>
    <element id="Consent.policyRule">
      <path value="Consent.policyRule" />
      <comment value="PolicyRule needs to be present, therefore a fixed value to indicate Mitz is the provider" />
      <min value="1" />
    </element>
    <element id="Consent.policyRule.coding">
      <path value="Consent.policyRule.coding" />
      <min value="1" />
      <max value="1" />
      <fixedCoding>
        <system value="http://vzvz.nl/fhir/otv/CodeSystem/toestemmingbron" />
        <code value="MITZ" />
      </fixedCoding>
    </element>
    <element id="Consent.provision.actor">
      <path value="Consent.provision.actor" />
      <min value="2" />
    </element>
    <element id="Consent.provision.actor:raadplegend">
      <path value="Consent.provision.actor" />
      <sliceName value="raadplegend" />
      <comment value="For every organization type an actor with role 'Raadplegend' is created &#xA;    with a reference to an Organization type with the appropriate role type" />
    </element>
    <element id="Consent.provision.actor:dossierhoudend">
      <path value="Consent.provision.actor" />
      <sliceName value="dossierhoudend" />
      <definition value="The care provider whose subscription triggered this notification" />
      <min value="1" />
    </element>
    <element id="Consent.provision.purpose">
      <path value="Consent.provision.purpose" />
      <short value="Kind of treatment" />
      <definition value="Regular or emergency treatment" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Consent.provision.purpose.system">
      <path value="Consent.provision.purpose.system" />
      <min value="1" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/v3-ActReason" />
    </element>
    <element id="Consent.provision.purpose.code">
      <path value="Consent.provision.purpose.code" />
      <short value="Kind of treatment" />
      <definition value="TREAT for regular treatment or ETREAT in case of emergency" />
      <min value="1" />
    </element>
    <element id="Consent.provision.code">
      <path value="Consent.provision.code" />
      <definition value="The data category or categories the consent pertains to.&#xA;    In case there are multilpe data categories, the provision.type is valid for all of them." />
      <binding>
        <strength value="required" />
        <valueSet value="http://vzvz.nl/fhir/otv/ValueSet/gegevenscategorie" />
      </binding>
    </element>
  </differential>
</StructureDefinition>