<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="Observation-pathology-uv-ips" />
  <meta>
    <versionId value="1" />
    <lastUpdated value="2018-03-08T16:05:00.196+00:00" />
  </meta>
  <url value="http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-pathology-uv-ips" />
  <version value="0.2" />
  <name value="ObservationPathologyUvIps" />
  <title value="Observation (Results: pathology)" />
  <status value="active" />
  <experimental value="false" />
  <date value="2018-03-21" />
  <publisher value="HL7 International" />
  <description value="This profile constrains the Observation resource to represent results produced by pathology studies in a patient summary" />
  <purpose value="This profile constrains the Observation resource to represent a pathology in vitro study. In case of a multiple-observation study, the results of the study appear as sub-observations. In this case this top-level Observation acts as a grouper of all the observations belonging to the study.  The top-level observation may carry a conclusion in the value element and or a global interpretation by the producer of the study, in the comment element." />
  <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" />
      <short value="Laboratory result for a simple test or for a panel/study" />
      <definition value="This observation may represent the result of a simple laboratory test such as hematocrit or it may group the set of results produced by a multi-test study or panel such as a complete blood count, a dynamic function test, a urine specimen study. In the latter case, the observation carries the overall conclusion of the study and references the atomic results of the study  as &quot;has-member&quot; child observations" />
      <comment value="Represents either a lab simple observation or the group of observations produced by a laboratory study." />
      <mustSupport value="true" />
    </element>
    <element id="Observation.id">
      <path value="Observation.id" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.meta">
      <path value="Observation.meta" />
      <mustSupport value="false" />
    </element>
    <!-- Meta.profile is specified in order to provide a mechanism for downstream disambiguation of the profile used for 
			resource creation in cases where there is overlap between the profile constraints (e.g., the profiles differ only by 
			extensible value set bindings).  The 'meta' and 'meta.profile' elements are not required and are not designated as 
			mustSupport (this information is not required to be sent, and if received it can be ignored by the receiving system
			unless it is deemed to be useful).  Generally it is best to avoid relying on a declared profile. but it is available
			if and when it is needed.
		-->
    <element id="Observation.meta.profile">
      <path value="Observation.meta.profile" />
      <fixedCanonical value="http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-pathology-uv-ips" />
      <mustSupport value="false" />
    </element>
    <element id="Observation.status">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint">
        <valueString value="default: final" />
      </extension>
      <path value="Observation.status" />
      <definition value="The status of the result value. Only final results feed patient summaries." />
      <fixedCode value="final" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.category">
      <path value="Observation.category" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <definition value="A code that classifies the general type of observation being made. In this profile, fixed to &quot;laboratory&quot;." />
      <comment value="&quot;laboratory&quot; includes laboratory medicine and pathology" />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.category:laboratory">
      <path value="Observation.category" />
      <sliceName value="laboratory" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <patternCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/observation-category" />
          <code value="laboratory" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="Observation.code">
      <path value="Observation.code" />
      <definition value="Describes what was observed. Sometimes this is called the observation &quot;name&quot;.  In this profile this code represents either a simple laboratory test or a laboratory study with multiple child observations" />
      <comment value="In the context of this Observation-laboratory-uv-ips profile, when the observation plays the role of a grouper of member sub-observations, the code represent the group (for instance a panel code). In case no code is available, at least a text shall be provided." />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <mustSupport value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="ObservationCode" />
        </extension>
        <strength value="extensible" />
        <valueSet value="http://hl7.org/fhir/uv/ips/ValueSet/pathology-and-vital-signs-observations" />
      </binding>
    </element>
    <element id="Observation.subject">
      <path value="Observation.subject" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/uv/ips/StructureDefinition/Patient-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.subject.reference">
      <path value="Observation.subject.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.effective[x]">
      <path value="Observation.effective[x]" />
      <min value="1" />
      <max value="1" />
      <constraint>
        <key value="ips-1" />
        <severity value="error" />
        <human value="Datetime must be at least to day." />
        <expression value="$this.ofType(dateTime).empty() or ($this as dateTime).toString().length() &gt;= 8" />
        <xpath value="not(boolean(effectiveDateTime)) or f:matches(effectiveDateTime,/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/)" />
      </constraint>
      <mustSupport value="true" />
    </element>
    <element id="Observation.effective[x]:data-absent-reason">
      <path value="Observation.effective[x].extension" />
      <short value="effective[x] absence reason" />
      <definition value="Provides a reason why the effectiveTime is missing." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/data-absent-reason" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.effective[x]:effectiveDateTime">
      <path value="Observation.effective[x]" />
      <sliceName value="effectiveDateTime" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="dateTime" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.effective[x]:effectivePeriod">
      <path value="Observation.effective[x]" />
      <sliceName value="effectivePeriod" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Period" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.effective[x]:effectiveTiming">
      <path value="Observation.effective[x]" />
      <sliceName value="effectiveTiming" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Timing" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.effective[x]:effectiveInstant">
      <path value="Observation.effective[x]" />
      <sliceName value="effectiveInstant" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="instant" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.performer">
      <path value="Observation.performer" />
      <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://hl7.org/fhir/uv/ips/StructureDefinition/Organization-laboratory-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.performer.reference">
      <path value="Observation.performer.reference" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.value[x]">
      <path value="Observation.value[x]" />
      <type>
        <code value="string" />
      </type>
      <type>
        <code value="Range" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/Range-uv-ips" />
      </type>
      <type>
        <code value="Ratio" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/Ratio-uv-ips" />
      </type>
      <type>
        <code value="time" />
      </type>
      <type>
        <code value="dateTime" />
      </type>
      <type>
        <code value="Period" />
      </type>
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <type>
        <code value="Quantity" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/Quantity-uv-ips" />
      </type>
      <condition value="value" />
      <constraint>
        <key value="ips-2" />
        <severity value="error" />
        <human value="if no &quot;hasMember&quot; element is present then Observation must have a&quot; value&quot;" />
        <expression value="hasValue() or hasMember.exists" />
      </constraint>
      <mustSupport value="true" />
      <binding>
        <strength value="example" />
        <valueSet value="http://hl7.org/fhir/uv/ips/ValueSet/result-coded-value-pathology-uv-ips" />
      </binding>
    </element>
    <element id="Observation.dataAbsentReason">
      <path value="Observation.dataAbsentReason" />
      <max value="0" />
      <mustSupport value="false" />
    </element>
    <element id="Observation.interpretation">
      <path value="Observation.interpretation" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.specimen">
      <path value="Observation.specimen" />
      <comment value="The specimen is often implied by the observation code. &#xD;&#xA;In the context of this Observation-laboratory-uv-ips profile, specimen should be provided only when it is not implied by the Observation.code, and when further information about the specimen needs to be captured (such as specimen source body site). &#xD;&#xA;In case of a laboratory panel/study using a single specimen , which needs  further description (like a CSF microbiology study), the specimen is introduced by this element.&#xD;&#xA;In case of a dynamic function test using multiple specimens, each specimen shall be further described, if needed, within the sub-observation that was produced on this specimen." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/uv/ips/StructureDefinition/Specimen-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.specimen.reference">
      <path value="Observation.specimen.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.referenceRange">
      <path value="Observation.referenceRange" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.referenceRange.low">
      <path value="Observation.referenceRange.low" />
      <type>
        <code value="Quantity" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/SimpleQuantity-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.referenceRange.high">
      <path value="Observation.referenceRange.high" />
      <type>
        <code value="Quantity" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/SimpleQuantity-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.referenceRange.type">
      <path value="Observation.referenceRange.type" />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.referenceRange.appliesTo">
      <path value="Observation.referenceRange.appliesTo" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.referenceRange.age">
      <path value="Observation.referenceRange.age" />
      <type>
        <code value="Range" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/Range-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.hasMember">
      <path value="Observation.hasMember" />
      <definition value="A  reference to another Observation profiled by Observation-pathology-uv-ips. The target observation is considered as a sub-observation of the current one, which plays the role of a grouper" />
      <comment value="This element is used in the context of international patient summary when there is a need to group a collection of observations, because they belong to the same panel, or because they share a common interpretation comment, or a common media attachment (illustrative image or graph). In these cases, the current observation profiled as observation-laboratory-uv-trillium2 is the grouper, and its set of sub-observations are related observations  using the type &quot;has-member&quot; and the profile observation-member-laboratory-uv-trillium2." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-pathology-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.hasMember.reference">
      <path value="Observation.hasMember.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.derivedFrom">
      <path value="Observation.derivedFrom" />
      <definition value="A  reference to another Observation, which is constrained to valueAttachment, in order to convey an illustrative media content." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/uv/ips/StructureDefinition/Media-observation-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.derivedFrom.reference">
      <path value="Observation.derivedFrom.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component">
      <path value="Observation.component" />
      <max value="0" />
      <mustSupport value="false" />
    </element>
  </differential>
</StructureDefinition>