<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="tumor-measurement" />
  <url value="https://www.vision-zero-oncology.de/fhir/StructureDefinition/tumor-measurement" />
  <name value="TumorMeasurement" />
  <title value="Profile Tumor Measurment" />
  <status value="draft" />
  <description value="Profile for recording measurements of a tumor like the longest diameter or volume. The resource can be used for different measurement methods (e.g. methods in pathology, radiology or physical exams)." />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </mapping>
  <mapping>
    <identity value="sct-concept" />
    <uri value="http://snomed.info/conceptdomain" />
    <name value="SNOMED CT Concept Domain Binding" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <mapping>
    <identity value="sct-attr" />
    <uri value="http://snomed.org/attributebinding" />
    <name value="SNOMED CT Attribute Binding" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Observation" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Observation" />
  <derivation value="constraint" />
  <differential>
    <element id="Observation">
      <path value="Observation" />
      <constraint>
        <key value="must-have-focus-or-specimen-invariant" />
        <severity value="error" />
        <human value="Either `focus` OR `specimen` MUST be populated" />
        <expression value="(focus.exists() or specimen.exists()) and (focus.exists() and specimen.exists()).not()" />
        <source value="https://www.vision-zero-oncology.de/fhir/StructureDefinition/tumor-measurement" />
      </constraint>
    </element>
    <element id="Observation.code">
      <path value="Observation.code" />
      <patternCodeableConcept>
        <coding>
          <system value="http://loinc.org" />
          <code value="21889-1" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="Observation.subject">
      <path value="Observation.subject" />
      <short value="The patient whose tumor was measured." />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.focus">
      <path value="Observation.focus" />
      <short value="Identifies a tumor that has NOT been removed from the body" />
      <definition value="Reference to a BodyStructure resource conforming to Tumor." />
      <comment value="Use **only** when the tumor **has not** been removed from the body. If the tumor has been removed, use `specimen` instead and leave `focus` empty." />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.vision-zero-oncology.de/fhir/StructureDefinition/tumor" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.effective[x]">
      <path value="Observation.effective[x]" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.method">
      <path value="Observation.method" />
      <short value="Method for measuring the tumor" />
      <definition value="Method for measuring the tumor" />
      <comment value="Tumors are typically measured via gross pathology after excision, or via diagnostic imaging or physical exam prior to removal. If `specimen` is set, `method` is expected to be a &quot;gross pathology&quot; code. If `focus` is set, `method` is expected to be a type of diagnostic imaging or physical exam." />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="https://www.vision-zero-oncology.de/fhir/ValueSet/tumor-measurement-methods" />
      </binding>
    </element>
    <element id="Observation.specimen">
      <path value="Observation.specimen" />
      <short value="Identifies a tumor that has been removed from the body" />
      <definition value="Reference to a Specimen resource." />
      <comment value="Use **only** when the tumor **has** been removed from the body. If the tumor has been not removed, use `focus` instead and leave `specimen` empty." />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component">
      <path value="Observation.component" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="code" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component:longestDimension">
      <path value="Observation.component" />
      <sliceName value="longestDimension" />
      <short value="Longest tumor dimension (mm)" />
      <definition value="The longest tumor dimension in mm." />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Observation.component:longestDimension.code">
      <path value="Observation.component.code" />
      <patternCodeableConcept>
        <coding>
          <system value="http://loinc.org" />
          <code value="33728-7" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.component:longestDimension.value[x]">
      <path value="Observation.component.value[x]" />
      <type>
        <code value="Quantity" />
      </type>
      <binding>
        <strength value="required" />
        <valueSet value="https://www.vision-zero-oncology.de/fhir/ValueSet/tumor-size-units" />
      </binding>
    </element>
    <element id="Observation.component:shortAxis">
      <path value="Observation.component" />
      <sliceName value="shortAxis" />
      <short value="short axis of the tumor lesion (mm or cm)" />
      <definition value="short axis in mm or cm." />
      <min value="0" />
      <max value="1" />
    </element>
    <element id="Observation.component:shortAxis.code">
      <path value="Observation.component.code" />
      <patternCodeableConcept>
        <coding>
          <system value="http://loinc.org" />
          <code value="33729-5" />
          <display value="Size additional dimension in Tumor" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.component:shortAxis.value[x]">
      <path value="Observation.component.value[x]" />
      <type>
        <code value="Quantity" />
      </type>
      <binding>
        <strength value="required" />
        <valueSet value="https://www.vision-zero-oncology.de/fhir/ValueSet/tumor-size-units" />
      </binding>
    </element>
    <element id="Observation.component:area">
      <path value="Observation.component" />
      <sliceName value="area" />
      <short value="area of the tumor (mm²)" />
      <definition value="tumor area in mm²." />
      <min value="0" />
      <max value="1" />
    </element>
    <element id="Observation.component:area.value[x]">
      <path value="Observation.component.value[x]" />
      <type>
        <code value="Quantity" />
      </type>
      <binding>
        <strength value="required" />
        <valueSet value="https://www.vision-zero-oncology.de/fhir/ValueSet/tumor-area-units" />
      </binding>
    </element>
    <element id="Observation.component:volume">
      <path value="Observation.component" />
      <sliceName value="volume" />
      <short value="tumor volume (ml)" />
      <definition value="Tumor volume in ml." />
      <min value="0" />
      <max value="1" />
    </element>
    <element id="Observation.component:volume.value[x]">
      <path value="Observation.component.value[x]" />
      <type>
        <code value="Quantity" />
      </type>
      <binding>
        <strength value="required" />
        <valueSet value="https://www.vision-zero-oncology.de/fhir/ValueSet/tumor-volume-units" />
      </binding>
    </element>
  </differential>
</StructureDefinition>