<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="mitz-base-consent" />
  <language value="nl-NL" />
  <url value="http://vzvz.nl/fhir/otv/StructureDefinition/mitz-base-consent" />
  <version value="4.0.0-beta.1" />
  <name value="MitzBaseConsent" />
  <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="This is the base profile of the Mitz Consent profiles. &#xA;This profile is not intended to be instantiated." />
  <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="true" />
  <type value="Consent" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Consent" />
  <derivation value="constraint" />
  <differential>
    <element id="Consent.meta">
      <path value="Consent.meta" />
      <min value="1" />
    </element>
    <element id="Consent.meta.profile">
      <path value="Consent.meta.profile" />
      <comment value="The profile is required" />
      <min value="1" />
    </element>
    <element id="Consent.scope">
      <path value="Consent.scope" />
      <short value="Consent type" />
      <definition value="Type of consent given" />
      <fixedCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/consentscope" />
          <code value="patient-privacy" />
        </coding>
      </fixedCodeableConcept>
    </element>
    <element id="Consent.category">
      <path value="Consent.category" />
      <comment value="Category is required but actual data category is defined by the gegevenscategorie or situation code. Therefore fixed value INFA." />
      <max value="1" />
    </element>
    <element id="Consent.category.coding">
      <path value="Consent.category.coding" />
      <fixedCoding>
        <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode" />
        <code value="INFA" />
      </fixedCoding>
    </element>
    <element id="Consent.patient">
      <path value="Consent.patient" />
      <comment value="Add the patient object as a reference to allow adding a birthdate" />
      <min value="1" />
    </element>
    <element id="Consent.patient.reference">
      <path value="Consent.patient.reference" />
      <min value="1" />
    </element>
    <element id="Consent.dateTime">
      <path value="Consent.dateTime" />
      <short value="Consent registration date" />
      <definition value="Date and time of consent registration or current date and time if the registration moment is unknown." />
      <min value="1" />
    </element>
    <element id="Consent.organization">
      <path value="Consent.organization" />
      <comment value="This element is not used because it would always contain Mitz as custodian. &#xA;This does not provide any added value." />
    </element>
    <element id="Consent.source[x]">
      <path value="Consent.source[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="Consent.source[x]:sourceReference">
      <path value="Consent.source[x]" />
      <sliceName value="sourceReference" />
      <comment value="It is possible to add a reference to the documentation that supports this consent, but the added value is slim." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Consent" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/DocumentReference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Contract" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse" />
      </type>
    </element>
    <element id="Consent.policyRule">
      <path value="Consent.policyRule" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://vzvz.nl/fhir/otv/ValueSet/policyrule-codes" />
      </binding>
    </element>
    <element id="Consent.provision.type">
      <path value="Consent.provision.type" />
      <definition value="Action  to take - permit or deny. Consent is given (permit) or denied (deny) when status is 'active'. &#xA;    When status is inactive, the provision element is absent." />
      <min value="1" />
    </element>
    <element id="Consent.provision.period">
      <path value="Consent.provision.period" />
      <short value="Validity of consent" />
      <definition value="Period during which the consent is valid" />
    </element>
    <element id="Consent.provision.period.start">
      <path value="Consent.provision.period.start" />
      <comment value="The start should only be entered when it is noted during registration in which case it is usually equal to the registration date and time." />
    </element>
    <element id="Consent.provision.period.end">
      <path value="Consent.provision.period.end" />
      <definition value="Optional end date and time of consent. If empty, the consent is given indefinitely." />
    </element>
    <element id="Consent.provision.actor">
      <path value="Consent.provision.actor" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="role" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Consent.provision.actor:raadplegend">
      <path value="Consent.provision.actor" />
      <sliceName value="raadplegend" />
      <short value="Person and Organization or application requesting information" />
      <definition value="A reference to the organization requesting consent information in case of a care provider." />
      <alias value="Raadplegende zorgaanbieder" />
      <min value="1" />
      <max value="*" />
    </element>
    <element id="Consent.provision.actor:raadplegend.role">
      <path value="Consent.provision.actor.role" />
      <fixedCodeableConcept>
        <coding>
          <system value="http://dicom.nema.org/resources/ontology/DCM" />
          <code value="110152" />
        </coding>
      </fixedCodeableConcept>
    </element>
    <element id="Consent.provision.actor:raadplegend.reference">
      <path value="Consent.provision.actor.reference" />
      <short value="Organization resource" />
      <definition value="A reference to the organization resource this consent relates to" />
      <comment value="Use a reference to an organization to provide the organization type.&#xA;      Set the organization type using the Nictiz RoleCodeNLZorgaanbiederType Codesystem (see https://simplifier.net/Nictiz-R4-zib2020/organization-type/~overview)" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
        <targetProfile value="http://nictiz.nl/fhir/StructureDefinition/nl-core-HealthcareProvider-Organization" />
      </type>
    </element>
    <element id="Consent.provision.actor:dossierhoudend">
      <path value="Consent.provision.actor" />
      <sliceName value="dossierhoudend" />
      <short value="Custodian of the medical record" />
      <definition value="Organization resource referring to a specific organization or specific type of organization that has the requested information" />
      <alias value="Dossierhoudende zorgaanbieder" />
      <min value="0" />
      <max value="1" />
    </element>
    <element id="Consent.provision.actor:dossierhoudend.role">
      <path value="Consent.provision.actor.role" />
      <fixedCodeableConcept>
        <coding>
          <system value="http://dicom.nema.org/resources/ontology/DCM" />
          <code value="110153" />
        </coding>
      </fixedCodeableConcept>
    </element>
    <element id="Consent.provision.actor:dossierhoudend.reference">
      <path value="Consent.provision.actor.reference" />
      <short value="Organization resource" />
      <definition value="A reference to the organization resource this consent relates to" />
      <comment value="Use a reference to an organization to provide the organization type.&#xA;      Set the organization type using the Nictiz RoleCodeNLZorgaanbiederType Codesystem (see https://simplifier.net/Nictiz-R4-zib2020/organization-type/~overview)" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
        <targetProfile value="http://nictiz.nl/fhir/StructureDefinition/nl-core-HealthcareProvider-Organization" />
      </type>
    </element>
    <element id="Consent.provision.code">
      <path value="Consent.provision.code" />
      <short value="Data category" />
      <definition value="This code indicates the data category the consent pertains to" />
    </element>
  </differential>
</StructureDefinition>