<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://karolinskafhirserver.org/fhir/StructureDefinition/KarolinskaGenomicReport" />
  <name value="KarolinskaGenomicReport" />
  <status value="draft" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="DiagnosticReport" />
  <baseDefinition value="http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/genomic-report" />
  <derivation value="constraint" />
  <differential>
    <element id="DiagnosticReport.extension:workflow-relatedArtifact">
      <path value="DiagnosticReport.extension" />
      <sliceName value="workflow-relatedArtifact" />
      <max value="0" />
    </element>
    <element id="DiagnosticReport.identifier">
      <path value="DiagnosticReport.identifier" />
      <definition value="Laboratory Case ID - Assigned by the performer of the report" />
    </element>
    <element id="DiagnosticReport.basedOn">
      <path value="DiagnosticReport.basedOn" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/ServiceRequest" />
      </type>
    </element>
    <element id="DiagnosticReport.basedOn.type">
      <path value="DiagnosticReport.basedOn.type" />
      <fixedUri value="ServiceRequest" />
    </element>
    <element id="DiagnosticReport.basedOn.identifier.value">
      <path value="DiagnosticReport.basedOn.identifier.value" />
      <definition value="Reference to the referral using the referral ID. Might be relevant when the report is part of the total genomic flow, from referral to referral answer." />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.basedOn.identifier.period">
      <path value="DiagnosticReport.basedOn.identifier.period" />
      <max value="0" />
    </element>
    <element id="DiagnosticReport.status">
      <path value="DiagnosticReport.status" />
      <fixedCode value="Completed" />
    </element>
    <element id="DiagnosticReport.category:Genetics">
      <path value="DiagnosticReport.category" />
      <sliceName value="Genetics" />
    </element>
    <element id="DiagnosticReport.category:Genetics.coding.code">
      <path value="DiagnosticReport.category.coding.code" />
      <min value="1" />
      <fixedCode value="Clinical Genomic" />
    </element>
    <element id="DiagnosticReport.code.coding">
      <path value="DiagnosticReport.code.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="DiagnosticReport.code.coding.code">
      <path value="DiagnosticReport.code.coding.code" />
      <definition value="405824009 | genetiskt test |&#xD;&#xA;&#xD;&#xA;A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." />
      <min value="1" />
      <fixedCode value="405824009" />
    </element>
    <element id="DiagnosticReport.subject">
      <path value="DiagnosticReport.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://karolinskafhirserver.org/fhir/StructureDefinition/KarolinskaPatient" />
      </type>
    </element>
    <element id="DiagnosticReport.subject.identifier.value">
      <path value="DiagnosticReport.subject.identifier.value" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.encounter">
      <path value="DiagnosticReport.encounter" />
      <max value="0" />
    </element>
    <element id="DiagnosticReport.effective[x]">
      <path value="DiagnosticReport.effective[x]" />
      <max value="0" />
    </element>
    <element id="DiagnosticReport.performer">
      <path value="DiagnosticReport.performer" />
      <definition value="The diagnostic service that is responsible for issuing the report.&#xD;&#xA;&#xD;&#xA;If resultInterpreter is used. Then the performer should be the organisation who performed the analysis." />
    </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;This report can include the interpreted variants. If so, it is probably the interpreter of the Genomic Study who is the performer of the Genomic Report." />
    </element>
    <element id="DiagnosticReport.specimen">
      <path value="DiagnosticReport.specimen" />
      <requirements value="Not used since the specimen is described in the GenomicStudy profile." />
      <max value="0" />
    </element>
    <element id="DiagnosticReport.result">
      <path value="DiagnosticReport.result" />
      <requirements value="Not used in MVP but might be used in future if the full result, including interpreted variants, should be represented using FHIR." />
    </element>
    <element id="DiagnosticReport.imagingStudy">
      <path value="DiagnosticReport.imagingStudy" />
      <max value="0" />
    </element>
    <element id="DiagnosticReport.media">
      <path value="DiagnosticReport.media" />
      <max value="0" />
    </element>
    <element id="DiagnosticReport.conclusion">
      <path value="DiagnosticReport.conclusion" />
      <comment value="Not used in MVP but might be included if the scope is growing to include the result." />
    </element>
    <element id="DiagnosticReport.conclusionCode">
      <path value="DiagnosticReport.conclusionCode" />
      <max value="0" />
    </element>
    <element id="DiagnosticReport.presentedForm">
      <path value="DiagnosticReport.presentedForm" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>