<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="cyehr-sd-diagnosticreport-r4" />
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
    <valueInteger value="2">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom">
        <valueCanonical value="http://hl7.org/fhir/uv/ips/ImplementationGuide/ig-uv-ips" />
      </extension>
    </valueInteger>
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
    <valueCode value="trial-use">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom">
        <valueCanonical value="http://hl7.org/fhir/uv/ips/ImplementationGuide/ig-uv-ips" />
      </extension>
    </valueCode>
  </extension>
  <url value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-diagnosticreport-r4" />
  <name value="CYEHRSDDiagnosticReport" />
  <title value="Cyprus Diagnostic Report profile" />
  <status value="draft" />
  <publisher value="eHealth4U" />
  <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="This profile represents a report for diagnostic test and procedure for the needs of the national Cyprus EHR system." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="DiagnosticReport" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DiagnosticReport" />
  <derivation value="constraint" />
  <differential>
    <element id="DiagnosticReport.basedOn">
      <path value="DiagnosticReport.basedOn" />
      <comment value="Note: Usually there is one test request for each result, however in some circumstances multiple test requests may be represented using a single test result resource. Note that there are also cases where one request leads to multiple reports.&#xD;&#xA;&#xD;&#xA;CyprusEHR: Not to be used in the context of Cyprus EHR." />
    </element>
    <element id="DiagnosticReport.status">
      <path value="DiagnosticReport.status" />
      <fixedCode value="final" />
    </element>
    <element id="DiagnosticReport.category">
      <path value="DiagnosticReport.category" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.category.coding.system">
      <path value="DiagnosticReport.category.coding.system" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.category.coding.code">
      <path value="DiagnosticReport.category.coding.code" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.category.coding.display">
      <path value="DiagnosticReport.category.coding.display" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.code">
      <path value="DiagnosticReport.code" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.code.coding">
      <path value="DiagnosticReport.code.coding" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="DiagnosticReport.code.coding.system">
      <path value="DiagnosticReport.code.coding.system" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.code.coding.code">
      <path value="DiagnosticReport.code.coding.code" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.code.coding.display">
      <path value="DiagnosticReport.code.coding.display" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.code.coding:codeXeHealthLaboratory">
      <path value="DiagnosticReport.code.coding" />
      <sliceName value="codeXeHealthLaboratory" />
      <min value="1" />
      <max value="1" />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.eu/fhir/ig/xeh/ValueSet/lab-studyType-xeh" />
      </binding>
    </element>
    <element id="DiagnosticReport.subject">
      <path value="DiagnosticReport.subject" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Group" />
        <targetProfile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.subject.reference">
      <path value="DiagnosticReport.subject.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.encounter">
      <path value="DiagnosticReport.encounter" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.effective[x]">
      <path value="DiagnosticReport.effective[x]" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.effective[x].extension">
      <path value="DiagnosticReport.effective[x].extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="DiagnosticReport.effective[x].extension:data-absent-reason">
      <path value="DiagnosticReport.effective[x].extension" />
      <sliceName value="data-absent-reason" />
      <short value="effective[x] absence reason" />
      <definition value="Provides a reason why the effectiveTime is missing." />
      <min value="0" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/data-absent-reason" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.performer">
      <path value="DiagnosticReport.performer" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/CareTeam" />
        <targetProfile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-practitionerrolehealthcareassociate-r4" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.performer.reference">
      <path value="DiagnosticReport.performer.reference" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.resultsInterpreter">
      <path value="DiagnosticReport.resultsInterpreter" />
      <comment value="Might not be the same entity that takes responsibility for the clinical report.&#xD;&#xA;&#xD;&#xA;CyprusEHR: Not to be used in the context of Cyprus EHR." />
    </element>
    <element id="DiagnosticReport.specimen">
      <path value="DiagnosticReport.specimen" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Specimen" />
        <targetProfile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-specimen-r4" />
      </type>
      <mustSupport value="false" />
    </element>
    <element id="DiagnosticReport.specimen.reference">
      <path value="DiagnosticReport.specimen.reference" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.result">
      <path value="DiagnosticReport.result" />
      <slicing>
        <discriminator>
          <type value="profile" />
          <path value="resolve()" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <short value="Observation results included in the diagnostic report." />
      <definition value="Observation results included in the diagnostic report." />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.result:observation-results">
      <path value="DiagnosticReport.result" />
      <sliceName value="observation-results" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-sd-observationresults" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.result:observation-results.reference">
      <path value="DiagnosticReport.result.reference" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.imagingStudy.reference">
      <path value="DiagnosticReport.imagingStudy.reference" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.media">
      <path value="DiagnosticReport.media" />
      <comment value="CyprusEHR: Not to be used in the context of Cyprus EHR." />
    </element>
    <element id="DiagnosticReport.conclusion">
      <path value="DiagnosticReport.conclusion" />
      <mustSupport value="true" />
    </element>
    <element id="DiagnosticReport.presentedForm">
      <path value="DiagnosticReport.presentedForm" />
      <comment value="&quot;application/pdf&quot; is recommended as the most reliable and interoperable in this context.&#xD;&#xA;&#xD;&#xA;CyprusEHR: For Phase II all laboratory/imaging reports will be given as pdf files by using this field. For Phase III the results and conclusion elements shall be used instead." />
    </element>
  </differential>
</StructureDefinition>