<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="cyehr-sd-practitionerlicense-r4" />
  <url value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-practitionerlicense-r4" />
  <name value="CYEHRSDPractitionerLicense" />
  <title value="Cyprus EHR Practitioner License profile" />
  <status value="draft" />
  <publisher value="eHealth4U" />
  <contact>
    <name value="eHealth Lab" />
    <telecom>
      <system value="email" />
      <value value="ehealthl@ucy.ac.cy" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="This profile represents the legal license of practicing medicine or nursing as bestowed either by a specified government-approved professional association or a government agency. A Practitioner SHALL have CYEHRSDPractitionerLicense.active = true to act  like a doctor or a nurse in the CYEHR system." />
  <purpose value="In Cyprus, medical doctors, nurses and midwives must have a license to legally practise. Medical doctors get their medical license by the Cyprus Medical Association. The nurses and midwives get their license by the Cyprus Nurses and Midwives Association." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="PractitionerRole" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
  <derivation value="constraint" />
  <differential>
    <element id="PractitionerRole">
      <path value="PractitionerRole" />
      <short value="The legal license to practice for medical doctors and nurses" />
      <definition value="A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time.&#xD;&#xA;&#xD;&#xA;CyprusEHR: The practitioner role license indicates whether the referenced medical practitioner has or hasn't  the legal right to practice in Cyprus. It also states which specialties the referenced medical practitioner is allowed to practice." />
      <constraint>
        <key value="cyehr-practitionerlicense-1" />
        <severity value="error" />
        <human value="If identifier is cyMedicalAssociationRegister then the code shall be 'Medical doctors' and specialty shall be medicalSpecialty" />
        <expression value="identifier.where(system = 'urn:oid:2.16.840.1.113883.3.9143.2.1.11').exists() implies (code.coding.code = '221' and specialty.coding.code.memberOf('http://hl7.org/fhir/ValueSet/c80-practice-codes'))" />
      </constraint>
      <constraint>
        <key value="cyehr-practitionerlicense-2" />
        <severity value="error" />
        <human value="If identifier is cyNursesMidwivesAssociationRegister then the code shall be 'Nursing and midwifery professionals' and specialty shall be nursingCategories" />
        <expression value="identifier.where(system = 'urn:oid:2.16.840.1.113883.3.9143.2.1.15').exists() implies (code.coding.code = '222' and specialty.coding.code.memberOf('http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-nursingcategories'))" />
      </constraint>
    </element>
    <element id="PractitionerRole.meta">
      <path value="PractitionerRole.meta" />
    </element>
    <element id="PractitionerRole.meta.profile">
      <path value="PractitionerRole.meta.profile" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="PractitionerRole.meta.profile:CyprusEHRProfile">
      <path value="PractitionerRole.meta.profile" />
      <sliceName value="CyprusEHRProfile" />
      <min value="1" />
      <max value="1" />
      <fixedCanonical value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-practitionerlicense-r4" />
    </element>
    <element id="PractitionerRole.identifier">
      <path value="PractitionerRole.identifier" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="PractitionerRole.identifier:cyMedicalAssociationRegister">
      <path value="PractitionerRole.identifier" />
      <sliceName value="cyMedicalAssociationRegister" />
      <short value="Cyprus Medical Association Register" />
      <definition value="Business Identifiers that are specific to a role/location.&#xD;&#xA;&#xD;&#xA;CyprusEHR: Cyprus Medical Association (CMA) is the professional organisation of doctors in Cyprus which controls entry to the register, and suspending or removing members when necessary." />
      <max value="1" />
      <patternIdentifier>
        <use value="official" />
        <system value="urn:oid:2.16.840.1.113883.3.9143.2.1.11" />
      </patternIdentifier>
    </element>
    <element id="PractitionerRole.identifier:cyMedicalAssociationRegister.use">
      <path value="PractitionerRole.identifier.use" />
      <mustSupport value="true" />
    </element>
    <element id="PractitionerRole.identifier:cyMedicalAssociationRegister.system">
      <path value="PractitionerRole.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="PractitionerRole.identifier:cyMedicalAssociationRegister.value">
      <path value="PractitionerRole.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="PractitionerRole.identifier:cyMedicalAssociationRegister.assigner.reference">
      <path value="PractitionerRole.identifier.assigner.reference" />
      <min value="1" />
    </element>
    <element id="PractitionerRole.identifier:cyNursesMidwivesAssociationRegister">
      <path value="PractitionerRole.identifier" />
      <sliceName value="cyNursesMidwivesAssociationRegister" />
      <short value="Cyprus Nurses and Midwives Association Registry" />
      <definition value="Business Identifiers that are specific to a role/location.&#xD;&#xA;&#xD;&#xA;CyprusEHR: Cyprus Nurses and Midwives Association Registry (CNMA) is the professional organisation of nurses and midwives in Cyprus which controls entry to the register, and suspending or removing members when necessary." />
      <max value="1" />
      <patternIdentifier>
        <use value="official" />
        <system value="urn:oid:2.16.840.1.113883.3.9143.2.1.15" />
      </patternIdentifier>
    </element>
    <element id="PractitionerRole.identifier:cyNursesMidwivesAssociationRegister.use">
      <path value="PractitionerRole.identifier.use" />
      <mustSupport value="true" />
    </element>
    <element id="PractitionerRole.identifier:cyNursesMidwivesAssociationRegister.system">
      <path value="PractitionerRole.identifier.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="PractitionerRole.identifier:cyNursesMidwivesAssociationRegister.value">
      <path value="PractitionerRole.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="PractitionerRole.identifier:cyNursesMidwivesAssociationRegister.assigner.reference">
      <path value="PractitionerRole.identifier.assigner.reference" />
      <min value="1" />
    </element>
    <element id="PractitionerRole.active">
      <path value="PractitionerRole.active" />
      <short value="Whether this practicing license in active status" />
      <definition value="Whether this practitioner role record is in active use.&#xD;&#xA;&#xD;&#xA;CyprusEHR: The state of the practicing license indicating whether the license is active or inactivated." />
      <comment value="CyprusEHR: A Pratctitioner SHALL only be able to access a patient's EHR data if and only if there is a PractitionerRoleLicense with an element &quot;active&quot; = true. In any other case, the Practitioner is forbidden access to all patients' data." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="PractitionerRole.practitioner">
      <path value="PractitionerRole.practitioner" />
      <short value="The Practitioner who is being licensed with this resource" />
      <definition value="Practitioner that is able to provide the defined services for the organization.&#xD;&#xA;&#xD;&#xA;CyprusEHR: The Practitioner who owns the license of practice. In case the license is active, the Practitioner has the legal right to practice in the Republic of Cyprus. In any other case, the Practitioner should not be able to provide any services and therefore, the access to the patients' data shall be forbidden." />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-practitioner-r4" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="PractitionerRole.practitioner.reference">
      <path value="PractitionerRole.practitioner.reference" />
      <min value="1" />
    </element>
    <element id="PractitionerRole.organization">
      <path value="PractitionerRole.organization" />
      <short value="The organization which bestowes the practicing license" />
      <definition value="The organization where the Practitioner performs the roles associated.&#xD;&#xA;&#xD;&#xA;CyprusEHR: The organization which bestowes the practicing license. In Cyprus these organizations are the Cyprus Medical Association or Cyprus Nurse and Midwives Association." />
      <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 SHALL link the license only to the following organizations: Cyprus Medical Association (and all the related local associations) and Cyprus Nurses &amp; Midwives Assocation." />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
        <targetProfile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-organization-r4" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="PractitionerRole.organization.reference">
      <path value="PractitionerRole.organization.reference" />
      <min value="1" />
    </element>
    <element id="PractitionerRole.code">
      <path value="PractitionerRole.code" />
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.&#xD;&#xA;&#xD;&#xA;CyprusEHR: Use the iscoCode slice to describe the role of a doctor (221) or nurse (222) practitioner. For medical secretaries use the SNOMED CT 394572006 code." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <binding>
        <strength value="required" />
        <description value="The role that this practitioner is licensed to practice" />
        <valueSet value="http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsihealthcareprofessionalrole" />
      </binding>
    </element>
    <element id="PractitionerRole.code.coding">
      <path value="PractitionerRole.code.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="PractitionerRole.code.coding.system">
      <path value="PractitionerRole.code.coding.system" />
      <min value="1" />
    </element>
    <element id="PractitionerRole.code.coding.code">
      <path value="PractitionerRole.code.coding.code" />
      <min value="1" />
    </element>
    <element id="PractitionerRole.code.coding.display">
      <path value="PractitionerRole.code.coding.display" />
      <min value="1" />
    </element>
    <element id="PractitionerRole.specialty">
      <path value="PractitionerRole.specialty" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <definition value="Specific specialty of the practitioner.&#xD;&#xA;&#xD;&#xA;CyprusEHR: The specialties and the sub-specialties that are included in the practicing license of a practitioner. The practitioner is allowed to practice only these specialties and sub-specialties in the Republic of Cyprus." />
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.&#xD;&#xA;&#xD;&#xA;CyprusEHR: In Greek specialty = ειδικότητα, sub-specialty = εξειδίκευση" />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <binding>
        <strength value="extensible" />
      </binding>
    </element>
    <element id="PractitionerRole.specialty:medicalSpecialty">
      <path value="PractitionerRole.specialty" />
      <sliceName value="medicalSpecialty" />
      <short value="The licensed specialties and sub-specialties of the practitioner" />
      <definition value="Specific specialty of the practitioner.&#xD;&#xA;&#xD;&#xA;CyprusEHR: The specialties and the sub-specialties that are included in the practicing license of a medical doctor. The doctor is allowed to practice only these specialties and sub-specialties in the Republic of Cyprus." />
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.&#xD;&#xA;&#xD;&#xA;CyprusEHR: In Greek specialty = ειδικότητα, sub-specialty = εξειδίκευση" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <binding>
        <strength value="required" />
        <description value="Medical Specialties" />
      </binding>
    </element>
    <element id="PractitionerRole.specialty:medicalSpecialty.coding">
      <path value="PractitionerRole.specialty.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="PractitionerRole.specialty:medicalSpecialty.coding.system">
      <path value="PractitionerRole.specialty.coding.system" />
      <min value="1" />
    </element>
    <element id="PractitionerRole.specialty:medicalSpecialty.coding.code">
      <path value="PractitionerRole.specialty.coding.code" />
      <min value="1" />
    </element>
    <element id="PractitionerRole.specialty:medicalSpecialty.coding.display">
      <path value="PractitionerRole.specialty.coding.display" />
      <min value="1" />
    </element>
    <element id="PractitionerRole.specialty:nurseSpecialty">
      <path value="PractitionerRole.specialty" />
      <sliceName value="nurseSpecialty" />
      <short value="The licensed nursing categories of the practitioner" />
      <definition value="Specific specialty of the practitioner.&#xD;&#xA;&#xD;&#xA;CyprusEHR: The specialties and the sub-specialties that are included in the practicing license of a nurse. The nurse is allowed to practice only these specialties in the Republic of Cyprus." />
      <max value="3" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <binding>
        <strength value="required" />
        <description value="The categories of the nurses in the Republic of Cyprus" />
        <valueSet value="http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-nursingcategories" />
      </binding>
    </element>
    <element id="PractitionerRole.specialty:nurseSpecialty.coding">
      <path value="PractitionerRole.specialty.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="PractitionerRole.specialty:nurseSpecialty.coding.system">
      <path value="PractitionerRole.specialty.coding.system" />
      <min value="1" />
    </element>
    <element id="PractitionerRole.specialty:nurseSpecialty.coding.code">
      <path value="PractitionerRole.specialty.coding.code" />
      <min value="1" />
    </element>
    <element id="PractitionerRole.specialty:nurseSpecialty.coding.display">
      <path value="PractitionerRole.specialty.coding.display" />
      <min value="1" />
    </element>
    <element id="PractitionerRole.location">
      <path value="PractitionerRole.location" />
      <max value="0" />
    </element>
    <element id="PractitionerRole.healthcareService">
      <path value="PractitionerRole.healthcareService" />
      <max value="0" />
    </element>
    <element id="PractitionerRole.availableTime">
      <path value="PractitionerRole.availableTime" />
      <max value="0" />
    </element>
    <element id="PractitionerRole.notAvailable">
      <path value="PractitionerRole.notAvailable" />
      <max value="0" />
    </element>
    <element id="PractitionerRole.availabilityExceptions">
      <path value="PractitionerRole.availabilityExceptions" />
      <max value="0" />
    </element>
    <element id="PractitionerRole.endpoint.reference">
      <path value="PractitionerRole.endpoint.reference" />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>