<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="path-Request" />
  <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-Request" />
  <name value="PathRequest" />
  <title value="path Request" />
  <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="Request for a pathology study to be performed by a certain laboratory." />
  <purpose value="This ServiceRequest resource represents the Request Clinical Information Model (CIM) for patient use cases in the context of Pathology." />
  <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>
  <mapping>
    <identity value="medmij-core-dataset-120-20260923" />
    <name value="Dataset MedMij R4 Core 1.2.0 20260923" />
  </mapping>
  <mapping>
    <identity value="path-dataset-100-alpha3-20260923" />
    <name value="Dataset Pathologie MedMij 1.0.0-alpha.3 20260923" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="ServiceRequest" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/ServiceRequest" />
  <derivation value="constraint" />
  <differential>
    <element id="ServiceRequest">
      <path value="ServiceRequest" />
      <short value="Request" />
      <definition value="Request for a pathology study to be performed by a certain laboratory." />
      <alias value="Aanvraag" />
      <alias value="referral" />
      <alias value="referral request" />
      <alias value="transfer of care request" />
      <constraint>
        <key value="path-Request-1" />
        <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-Request" />
      </constraint>
      <mapping>
        <identity value="path-dataset-100-alpha3-20260923" />
        <map value="path-dataelement-6" />
        <comment value="Request" />
      </mapping>
    </element>
    <element id="ServiceRequest.meta">
      <path value="ServiceRequest.meta" />
      <min value="1" />
    </element>
    <element id="ServiceRequest.meta.tag">
      <path value="ServiceRequest.meta.tag" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="ServiceRequest.meta.tag:careType">
      <path value="ServiceRequest.meta.tag" />
      <sliceName value="careType" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <short value="CareType" />
      <definition value="The type of the healthcare provider responsible for the delivered care, or more specifically, the specialty of the department and/or health professional that delivered care. It enables patients and systems to interpret the origin and context of medical data." />
      <comment value="Note that the `careType` slice is a slice on `.meta.tag`, which might not be immediately clear based on the rendering." />
      <alias value="Zorgtype" />
      <min value="1" />
      <max value="*" />
      <binding>
        <strength value="required" />
        <valueSet value="http://decor.nictiz.nl/fhir/ValueSet/2.16.840.1.113883.2.4.3.11.60.40.2.17.2.4--20200901000000" />
      </binding>
      <mapping>
        <identity value="medmij-core-dataset-120-20260923" />
        <map value="medmij-core-dataelement-123" />
        <comment value="CareType" />
      </mapping>
    </element>
    <element id="ServiceRequest.meta.tag:careType/pathology">
      <path value="ServiceRequest.meta.tag" />
      <sliceName value="careType/pathology" />
      <comment value="Note that the `pathology` slice is a reslice of the `careType` slice, which might not be immediately clear based on the rendering." />
      <min value="1" />
      <max value="1" />
      <patternCoding>
        <system value="urn:oid:2.16.840.1.113883.2.4.6.7" />
        <code value="0388" />
      </patternCoding>
    </element>
    <element id="ServiceRequest.identifier">
      <path value="ServiceRequest.identifier" />
      <slicing>
        <discriminator>
          <type value="profile" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="ServiceRequest.identifier:requestIdentifier">
      <path value="ServiceRequest.identifier" />
      <sliceName value="requestIdentifier" />
      <short value="IdentificationNumber / RequestIdentifier" />
      <definition value="Identifier of the request for a pathology study." />
      <comment value="Even though the ReportIdentifier (i.e. _rapnaam_, mercurius-core-rubriek-3) is assigned by the laboratory doing the analysis (and thus not by the requester), the RequestIdentifier is populated with its value as well, as the request and report are always directly linked to each other in Mercurius. In particular, 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="Identificatienummer" />
      <alias value="AanvraagIdentificatienummer" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Identifier" />
        <profile value="http://medmij.nl/fhir/StructureDefinition/path-Report.ReportIdentifier" />
      </type>
    </element>
    <element id="ServiceRequest.status">
      <path value="ServiceRequest.status" />
      <patternCode value="completed" />
    </element>
    <element id="ServiceRequest.intent">
      <path value="ServiceRequest.intent" />
      <patternCode value="order" />
    </element>
    <element id="ServiceRequest.category">
      <path value="ServiceRequest.category" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="3" />
    </element>
    <element id="ServiceRequest.category:pathology">
      <path value="ServiceRequest.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="ServiceRequest.category:requestType">
      <path value="ServiceRequest.category" />
      <sliceName value="requestType" />
      <short value="RequestType" />
      <definition value="This typing of the examination provides additional context for the request." />
      <comment value="When the RequestType concept has an empty value, _normaal_ SHALL be used as default value." />
      <alias value="SoortAanvraag" />
      <min value="1" />
      <max value="1" />
      <binding>
        <strength value="required" />
        <valueSet value="http://medmij.nl/fhir/ValueSet/MercuriusRequestType" />
      </binding>
      <mapping>
        <identity value="mercurius-core-dataset-2-0" />
        <map value="mercurius-core-rubriek-89" />
        <comment value="soortaanvraag" />
      </mapping>
    </element>
    <element id="ServiceRequest.category:healthScreeningType">
      <path value="ServiceRequest.category" />
      <sliceName value="healthScreeningType" />
      <short value="HealthScreeningType" />
      <definition value="Type of national trial for this request." />
      <comment value="When the HealthScreeningType concept has an empty value, code _0_ from the MercuriusHealthScreeningType code system SHALL be used as default value." />
      <alias value="BVOSoort" />
      <min value="1" />
      <max value="1" />
      <binding>
        <strength value="required" />
        <description value="Use ConceptMap MercuriusHealthScreeningType-to-HealthScreeningType to translate terminology from the functional model to profile terminology in ValueSet HealthScreeningType." />
        <valueSet value="http://medmij.nl/fhir/ValueSet/HealthScreeningType">
          <extension url="http://hl7.org/fhir/StructureDefinition/11179-permitted-value-conceptmap">
            <valueCanonical value="http://medmij.nl/fhir/ConceptMap/MercuriusHealthScreeningType-to-HealthScreeningType" />
          </extension>
        </valueSet>
      </binding>
      <mapping>
        <identity value="mercurius-core-dataset-2-0" />
        <map value="mercurius-core-rubriek-97" />
        <comment value="bvosoort" />
      </mapping>
    </element>
    <element id="ServiceRequest.code">
      <path value="ServiceRequest.code" />
      <comment value="If the requested 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 CT code _1348332002_ SHALL be used as `.code`. Likewise, if the study is of type histology (in which case the ReportIdentifier starts with _T_), SNOMED CT code _252416005_ SHALL be used instead. Studies for which the ReportIdentifier starts with _S_ (i.e. autopsies) are out of scope." />
      <min value="1" />
    </element>
    <element id="ServiceRequest.code.coding">
      <path value="ServiceRequest.code.coding" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="ServiceRequest.code.coding:cytology">
      <path value="ServiceRequest.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-Request-1" />
    </element>
    <element id="ServiceRequest.code.coding:histology">
      <path value="ServiceRequest.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-Request-1" />
    </element>
    <element id="ServiceRequest.subject">
      <path value="ServiceRequest.subject" />
      <short value="Patient" />
      <definition value="The patient as subject of the information." />
      <alias value="Patiënt" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://medmij.nl/fhir/StructureDefinition/path-Patient" />
      </type>
      <mapping>
        <identity value="medmij-core-dataset-120-20260923" />
        <map value="medmij-core-dataelement-116" />
        <comment value="Patient" />
      </mapping>
    </element>
    <element id="ServiceRequest.requester">
      <path value="ServiceRequest.requester" />
      <short value="Requester" />
      <definition value="Requester of the pathology study." />
      <alias value="Aanvrager" />
      <alias value="orderer" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
        <targetProfile value="http://medmij.nl/fhir/StructureDefinition/path-Request.Requester" />
      </type>
      <mapping>
        <identity value="path-dataset-100-alpha3-20260923" />
        <map value="path-dataelement-7" />
        <comment value="Requester" />
      </mapping>
    </element>
    <element id="ServiceRequest.reasonCode">
      <path value="ServiceRequest.reasonCode" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="ServiceRequest.reasonCode.text">
      <path value="ServiceRequest.reasonCode.text" />
      <short value="ClinicalQuestion" />
      <definition value="Clinical request information." />
      <alias value="KlinischeVraag" />
      <min value="1" />
      <mapping>
        <identity value="mercurius-core-dataset-2-0" />
        <map value="mercurius-core-rubriek-139" />
        <comment value="klinischevraag" />
      </mapping>
    </element>
    <element id="ServiceRequest.specimen">
      <path value="ServiceRequest.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, precisely one Specimen is referenced here, as the primary specimen and sample coincide in that case." />
      <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>
      <mapping>
        <identity value="path-dataset-100-alpha3-20260923" />
        <map value="path-dataelement-8" />
        <comment value="Specimen" />
      </mapping>
      <mapping>
        <identity value="path-dataset-100-alpha3-20260923" />
        <map value="path-dataelement-15" />
        <comment value="Sample" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>