<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 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="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>
    </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, _0_ SHALL be used as default value." />
      <alias value="BVOSoort" />
      <min value="1" />
      <max value="1" />
      <binding>
        <strength value="required" />
        <valueSet value="http://medmij.nl/fhir/ValueSet/MercuriusHealthScreeningType" />
      </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 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." />
      <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" />
      <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>
    </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>
    </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 (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>
  </differential>
</StructureDefinition>