<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="cyehr-sd-consentehroptout-r4" />
  <url value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-consentehroptout-r4" />
  <name value="CYEHRSDConsentEHROptOut" />
  <title value="Cyprus EHR Opt-Out Consent profile" />
  <status value="draft" />
  <publisher value="eHealth Lab (University of Cyprus)" />
  <contact>
    <name value="eHealth Lab (University of Cyprus)" />
    <telecom>
      <system value="email" />
      <value value="ehealthl@ucy.ac.cy" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="The use-case of this profile is to indicate that a citizen has provided the consent to opt-out from the national EHR system of Cyprus. This means the healthcare providers shall not be able to access the patient's EHR data as long as this consent is active." />
  <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.meta">
      <path value="Consent.meta" />
    </element>
    <element id="Consent.meta.profile">
      <path value="Consent.meta.profile" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Consent.meta.profile:CyprusEHRProfile">
      <path value="Consent.meta.profile" />
      <sliceName value="CyprusEHRProfile" />
      <min value="1" />
      <max value="1" />
      <fixedCanonical value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-consentehroptout-r4" />
    </element>
    <element id="Consent.identifier">
      <path value="Consent.identifier" />
      <short value="NeHA Opt-Out Consent Identifier" />
      <definition value="Unique identifier for this copy of the Consent Statement.&#xD;&#xA;&#xD;&#xA;CyprusEHR: This is the unique identifier for this copy of the National eHealth Authority (NeHA) opt-out consent statement." />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.identifier.use">
      <path value="Consent.identifier.use" />
      <min value="1" />
      <fixedCode value="official" />
    </element>
    <element id="Consent.identifier.system">
      <path value="Consent.identifier.system" />
      <min value="1" />
      <fixedUri value="urn:oid:2.16.840.1.113883.3.9143.5.2.2" />
    </element>
    <element id="Consent.identifier.value">
      <path value="Consent.identifier.value" />
      <comment value="If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986.  The value's primary purpose is computational mapping.  As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.)  A value formatted for human display can be conveyed using the [Rendered Value extension](extension-rendered-value.html). Identifier.value is to be treated as case sensitive unless knowledge of the Identifier.system allows the processer to be confident that non-case-sensitive processing is safe.&#xD;&#xA;&#xD;&#xA;CyprusEHR: A globally unique number assigned by the national integrated EHR system of Cyprus to each opt-out consent provided by the patient to NeHA." />
      <min value="1" />
    </element>
    <element id="Consent.status">
      <path value="Consent.status" />
      <comment value="This element is labeled as a modifier because the status contains the codes rejected and entered-in-error that mark the Consent as not currently valid.&#xD;&#xA;&#xD;&#xA;CyprusEHR: Can be active (if the patient has signed an opt-out consent form following the related law provisions with NeHA approval) or inactive (if the patient withdraws the previously signed opt-out consent with NeHA approval)." />
      <mustSupport value="true" />
    </element>
    <element id="Consent.scope">
      <path value="Consent.scope" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <patternCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/consentscope" />
          <code value="patient-privacy" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Consent.scope.coding">
      <path value="Consent.scope.coding" />
      <min value="1" />
    </element>
    <element id="Consent.scope.coding.system">
      <path value="Consent.scope.coding.system" />
      <min value="1" />
    </element>
    <element id="Consent.scope.coding.code">
      <path value="Consent.scope.coding.code" />
      <min value="1" />
    </element>
    <element id="Consent.scope.coding.display">
      <path value="Consent.scope.coding.display" />
      <min value="1" />
    </element>
    <element id="Consent.category">
      <path value="Consent.category" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <patternCodeableConcept>
        <coding>
          <system value="http://loinc.org" />
          <code value="59284-0" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Consent.category.coding">
      <path value="Consent.category.coding" />
      <min value="1" />
    </element>
    <element id="Consent.category.coding.system">
      <path value="Consent.category.coding.system" />
      <min value="1" />
    </element>
    <element id="Consent.category.coding.code">
      <path value="Consent.category.coding.code" />
      <min value="1" />
    </element>
    <element id="Consent.category.coding.display">
      <path value="Consent.category.coding.display" />
      <min value="1" />
    </element>
    <element id="Consent.patient">
      <path value="Consent.patient" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Consent.dateTime">
      <path value="Consent.dateTime" />
      <definition value="When this  Consent was issued / created / indexed.&#xD;&#xA;&#xD;&#xA;CyprusEHR: when this consent was approved by NeHA." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.performer">
      <path value="Consent.performer" />
      <comment value="Commonly, the patient the consent pertains to is the consentor, but particularly for young and old people, it may be some other person - e.g. a legal guardian.&#xD;&#xA;&#xD;&#xA;CyprusEHR: Reference the NeHA organization and either the Patient or the atient's legal representatives who signed the opt-out consent." />
      <min value="2" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-patient" />
        <targetProfile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-organization-r4" />
        <targetProfile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-legalrepresentative-r4" />
      </type>
    </element>
    <element id="Consent.performer.reference">
      <path value="Consent.performer.reference" />
      <min value="1" />
    </element>
    <element id="Consent.organization">
      <path value="Consent.organization" />
      <comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.&#xD;&#xA;&#xD;&#xA;CyprusEHR: Reference to NeHA organization." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-organization-r4" />
      </type>
    </element>
    <element id="Consent.organization.reference">
      <path value="Consent.organization.reference" />
      <min value="1" />
    </element>
    <element id="Consent.source[x]">
      <path value="Consent.source[x]" />
      <min value="1" />
      <type>
        <code value="Attachment" />
      </type>
    </element>
    <element id="Consent.source[x].contentType">
      <path value="Consent.source[x].contentType" />
      <fixedCode value="application/pdf" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.source[x].language">
      <path value="Consent.source[x].language" />
      <comment value="Note that FHIR strings SHALL NOT exceed 1MB in size&#xD;&#xA;&#xD;&#xA;CyprusEHR: Use the following languages: Greek or English." />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <description value="A human language as defined by eHDSI." />
        <valueSet value="http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsilanguage" />
      </binding>
    </element>
    <element id="Consent.source[x].data">
      <path value="Consent.source[x].data" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.source[x].title">
      <path value="Consent.source[x].title" />
      <fixedString value="National EHR of Cyprus: Opt-out Consent" />
      <mustSupport value="true" />
    </element>
    <element id="Consent.policy">
      <path value="Consent.policy" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Consent.policy.authority">
      <path value="Consent.policy.authority" />
      <comment value="see http://en.wikipedia.org/wiki/Uniform_resource_identifier&#xD;&#xA;&#xD;&#xA;CyprusEHR: The National eHealth Autority." />
      <fixedUri value="http://www.neha.gov.cy/moh/neha/neha.nsf/home_en/home_en?openform" />
    </element>
    <element id="Consent.policy.uri">
      <path value="Consent.policy.uri" />
      <comment value="This element is for discoverability / documentation and does not modify or qualify the policy rules.&#xD;&#xA;&#xD;&#xA;CyprusEHR: The policy of opt-out from national EHR system of Cyprus. Temporarily the current eHealth law is given as fixed value but in the future it must be replaced by a more specific policy defining explicitely what is the content of the opt-out consent." />
      <fixedUri value="http://www.cylaw.org/nomoi/enop/non-ind/2019_1_59/index.html" />
    </element>
    <element id="Consent.policyRule">
      <path value="Consent.policyRule" />
      <min value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode" />
          <code value="OPTOUT" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Consent.policyRule.coding">
      <path value="Consent.policyRule.coding" />
      <min value="1" />
    </element>
    <element id="Consent.policyRule.coding.system">
      <path value="Consent.policyRule.coding.system" />
      <min value="1" />
    </element>
    <element id="Consent.policyRule.coding.code">
      <path value="Consent.policyRule.coding.code" />
      <min value="1" />
    </element>
    <element id="Consent.policyRule.coding.display">
      <path value="Consent.policyRule.coding.display" />
      <min value="1" />
    </element>
    <element id="Consent.verification">
      <path value="Consent.verification" />
      <comment value="CyprusEHR: Not to be used for eHealth4U." />
    </element>
    <element id="Consent.provision">
      <path value="Consent.provision" />
      <comment value="CyprusEHR: Not to be used for eHealth4U." />
    </element>
    <element id="Consent.provision.actor.role">
      <path value="Consent.provision.actor.role" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
    </element>
    <element id="Consent.provision.action">
      <path value="Consent.provision.action" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
    </element>
    <element id="Consent.provision.code">
      <path value="Consent.provision.code" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
    </element>
    <element id="Consent.provision.provision">
      <path value="Consent.provision.provision" />
      <contentReference value="http://hl7.org/fhir/StructureDefinition/Consent#Consent.provision" />
    </element>
  </differential>
</StructureDefinition>