<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="path-Report" />
  <text>
    <status value="empty" />
    <div xmlns="http://www.w3.org/1999/xhtml">No narrative is provided for definitional resources. A human-readable rendering can be found in the implementation guide(s) where this resource is used.</div>
  </text>
  <url value="http://medmij.nl/fhir/StructureDefinition/path-Report" />
  <name value="PathReport" />
  <title value="path Report" />
  <status value="draft" />
  <publisher value="MedMij" />
  <contact>
    <name value="MedMij" />
    <telecom>
      <system value="email" />
      <value value="info@medmij.nl" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="Pathology report which contains the findings and interpretation of a pathology study." />
  <purpose value="This DiagnosticReport resource represents the Report building block for patient use cases in the context of the information standard Pathology (Pathologie)." />
  <copyright value="Copyright and related rights waived via CC0, https://creativecommons.org/publicdomain/zero/1.0/. This does not apply to information from third parties, for example a medical terminology system. The implementer alone is responsible for identifying and obtaining any necessary licenses or authorizations to utilize third party IP in connection with the specification or otherwise." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="mercurius-core-dataset-2-0" />
    <name value="Mercurius Core Dataset 2.0" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="DiagnosticReport" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DiagnosticReport" />
  <derivation value="constraint" />
  <differential>
    <element id="DiagnosticReport">
      <path value="DiagnosticReport" />
      <short value="Report" />
      <definition value="Pathology report which contains the findings and interpretation of a pathology study." />
      <alias value="Verslag" />
      <alias value="Test" />
      <alias value="Result" />
      <alias value="Results" />
      <alias value="Labs" />
      <alias value="Laboratory" />
      <constraint>
        <key value="path-Report-1" />
        <severity value="error" />
        <human value="The identifier system of a report is of the form 'urn:oid:2.16.840.1.113883.2.4.3.23.3.N.1' where N is the lab number." />
        <expression value="identifier.system.startsWith('urn:oid:2.16.840.1.113883.2.4.3.23.3.').endsWith('.1')" />
        <source value="http://medmij.nl/fhir/StructureDefinition/path-Report" />
      </constraint>
      <constraint>
        <key value="path-Report-2" />
        <severity value="error" />
        <human value="Either a code for cytology or histology is present." />
        <expression value="code.coding.where(system = 'http://snomed.info/sct' and code = '1348332002').exists() xor code.coding.where(system = 'http://snomed.info/sct' and code = '252416005').exists()" />
        <source value="http://medmij.nl/fhir/StructureDefinition/path-Report" />
      </constraint>
    </element>
    <element id="DiagnosticReport.identifier">
      <path value="DiagnosticReport.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="DiagnosticReport.identifier:reportIdentifier">
      <path value="DiagnosticReport.identifier" />
      <sliceName value="reportIdentifier" />
      <short value="ReportIdentifier" />
      <definition value="Identifier of the pathology report assigned by the laboratory doing the analysis." />
      <comment value="This identifier attains a `.value` of the form _[TCSB]YY-nnnnn_ or _[TCSB]YY-nnnnnn_ (based on the laboratory the report originates from), e.g. T26-012345. The `.system` SHALL be of the form _urn:oid:2.16.840.1.113883.2.4.3.23.3.N.1_ where _N_ is the lab number (i.e. _labid_)." />
      <alias value="VerslagIdentificatienummer" />
      <alias value="Filler ID" />
      <alias value="Placer ID" />
      <min value="1" />
      <max value="1" />
      <condition value="path-Report-1" />
      <mapping>
        <identity value="mercurius-core-dataset-2-0" />
        <map value="mercurius-core-rubriek-3" />
        <comment value="rapnaam" />
      </mapping>
    </element>
    <element id="DiagnosticReport.identifier:reportIdentifier.system">
      <path value="DiagnosticReport.identifier.system" />
      <min value="1" />
      <condition value="path-Report-1" />
    </element>
    <element id="DiagnosticReport.identifier:reportIdentifier.value">
      <path value="DiagnosticReport.identifier.value" />
      <min value="1" />
    </element>
    <element id="DiagnosticReport.basedOn">
      <path value="DiagnosticReport.basedOn" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/ServiceRequest" />
        <targetProfile value="http://medmij.nl/fhir/StructureDefinition/path-Request" />
      </type>
    </element>
    <element id="DiagnosticReport.status">
      <path value="DiagnosticReport.status" />
      <patternCode value="final" />
    </element>
    <element id="DiagnosticReport.category">
      <path value="DiagnosticReport.category" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="DiagnosticReport.category:pathology">
      <path value="DiagnosticReport.category" />
      <sliceName value="pathology" />
      <min value="1" />
      <max value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="http://snomed.info/sct" />
          <code value="108257001" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="DiagnosticReport.code">
      <path value="DiagnosticReport.code" />
      <comment value="If the pathology study is of type cytology (which means that the ReportIdentifier (i.e. _rapnaam_, mercurius-core-rubriek-3) starts with either _B_ or _C_, corresponding to cervical cytology and other cytology, respectively), SNOMED code _1348332002_ SHALL be used as `.code`. Likewise, if the study is of type histology (in which case the ReportIdentifier starts with _T_), SNOMED code _252416005_ SHALL be used instead. Studies for which the ReportIdentifier starts with _S_ (i.e. autopsies) are out of scope." />
    </element>
    <element id="DiagnosticReport.code.coding">
      <path value="DiagnosticReport.code.coding" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="DiagnosticReport.code.coding:cytology">
      <path value="DiagnosticReport.code.coding" />
      <sliceName value="cytology" />
      <min value="0" />
      <max value="1" />
      <patternCoding>
        <system value="http://snomed.info/sct" />
        <code value="1348332002" />
      </patternCoding>
      <condition value="path-Report-2" />
    </element>
    <element id="DiagnosticReport.code.coding:histology">
      <path value="DiagnosticReport.code.coding" />
      <sliceName value="histology" />
      <min value="0" />
      <max value="1" />
      <patternCoding>
        <system value="http://snomed.info/sct" />
        <code value="252416005" />
      </patternCoding>
      <condition value="path-Report-2" />
    </element>
    <element id="DiagnosticReport.subject">
      <path value="DiagnosticReport.subject" />
      <short value="Patient" />
      <alias value="Patiënt" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://medmij.nl/fhir/StructureDefinition/path-Patient" />
      </type>
    </element>
    <element id="DiagnosticReport.effective[x]">
      <path value="DiagnosticReport.effective[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="DiagnosticReport.effective[x]:effectivePeriod">
      <path value="DiagnosticReport.effective[x]" />
      <sliceName value="effectivePeriod" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Period" />
      </type>
    </element>
    <element id="DiagnosticReport.effective[x]:effectivePeriod.start">
      <path value="DiagnosticReport.effective[x].start" />
      <short value="ReceivedDate" />
      <definition value="Date when specimen is received at the laboratory." />
      <alias value="DatumOntvangst" />
      <min value="1" />
      <mapping>
        <identity value="mercurius-core-dataset-2-0" />
        <map value="mercurius-core-rubriek-80" />
        <comment value="datumontvangst" />
      </mapping>
    </element>
    <element id="DiagnosticReport.effective[x]:effectivePeriod.end">
      <path value="DiagnosticReport.effective[x].end" />
      <short value="AuthorizationDate" />
      <definition value="Date of authorization." />
      <alias value="DatumAutorisatie" />
      <min value="1" />
      <mapping>
        <identity value="mercurius-core-dataset-2-0" />
        <map value="mercurius-core-rubriek-44" />
        <comment value="datumautorisatie" />
      </mapping>
    </element>
    <element id="DiagnosticReport.resultsInterpreter">
      <path value="DiagnosticReport.resultsInterpreter" />
      <short value="Authorizer" />
      <definition value="Name of the pathologist who has authorized the report." />
      <comment value="The actual mapping of the Authorizer concept is on `Practitioner.name[nameInformation].text`." />
      <alias value="Autorisator" />
      <alias value="Reported by" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
        <targetProfile value="http://nictiz.nl/fhir/StructureDefinition/nl-core-HealthProfessional-Practitioner" />
        <targetProfile value="http://nictiz.nl/fhir/StructureDefinition/nl-core-HealthProfessional-PractitionerRole" />
      </type>
      <mapping>
        <identity value="mercurius-core-dataset-2-0" />
        <map value="mercurius-core-rubriek-41" />
        <comment value="autorisator (implicit, actual mapping is on Practitioner.name[nameInformation].text)" />
      </mapping>
    </element>
    <element id="DiagnosticReport.specimen">
      <path value="DiagnosticReport.specimen" />
      <short value="Specimen" />
      <definition value="Specimen that will be examined by a laboratory." />
      <comment value="Both the primary specimen as well as the individual samples taken from that specimen are referenced here. If only a single sample is taken (i.e. the NumberOfSamples concept is equal to _1_), precisely one Specimen is referenced here, as the primary specimen and sample coincide in that case. If multiple samples have been taken from the primary specimen, the `.specimen` element contains _NumberOfSamples + 1_ references, one for the primary specimen and one for each sample." />
      <alias value="Monster" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Specimen" />
        <targetProfile value="http://medmij.nl/fhir/StructureDefinition/path-Request.Specimen" />
      </type>
    </element>
    <element id="DiagnosticReport.result">
      <path value="DiagnosticReport.result" />
      <slicing>
        <discriminator>
          <type value="profile" />
          <path value="resolve()" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="DiagnosticReport.result:clinicalInformation">
      <path value="DiagnosticReport.result" />
      <sliceName value="clinicalInformation" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://medmij.nl/fhir/StructureDefinition/path-Report.ClinicalInformation" />
      </type>
    </element>
    <element id="DiagnosticReport.result:macroscopy">
      <path value="DiagnosticReport.result" />
      <sliceName value="macroscopy" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://medmij.nl/fhir/StructureDefinition/path-Report.Macroscopy" />
      </type>
    </element>
    <element id="DiagnosticReport.result:microscopy">
      <path value="DiagnosticReport.result" />
      <sliceName value="microscopy" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://medmij.nl/fhir/StructureDefinition/path-Report.Microscopy" />
      </type>
    </element>
    <element id="DiagnosticReport.result:protocolData">
      <path value="DiagnosticReport.result" />
      <sliceName value="protocolData" />
      <short value="ProtocolData" />
      <definition value="Data from National Palga Protocols, created in the Palga Protocol Module." />
      <alias value="Protocoldata" />
      <alias value="Atomic Value" />
      <alias value="Result" />
      <alias value="Atomic result" />
      <alias value="Data" />
      <alias value="Test" />
      <alias value="Analyte" />
      <alias value="Battery" />
      <alias value="Organizer" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://medmij.nl/fhir/StructureDefinition/path-Report.ProtocolDataItem" />
      </type>
      <mapping>
        <identity value="mercurius-core-dataset-2-0" />
        <map value="mercurius-core-rubriek-308" />
        <comment value="protocoldata" />
      </mapping>
    </element>
    <element id="DiagnosticReport.conclusion">
      <path value="DiagnosticReport.conclusion" />
      <short value="Conclusion" />
      <definition value="Conclusion of the report." />
      <alias value="Conclusie" />
      <min value="1" />
      <mapping>
        <identity value="mercurius-core-dataset-2-0" />
        <map value="mercurius-core-rubriek-224" />
        <comment value="conclusie" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>