<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="el-observation-tonometryEvaluation" />
  <url value="http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-observation-tonometryEvaluation" />
  <version value="1.0.0" />
  <name value="ELTonometryEvaluation" />
  <title value="EL Tonometry Evaluation Profile" />
  <status value="draft" />
  <description value="The profile for Tonometry Evaluation ." />
  <fhirVersion value="4.0.1" />
  <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="tactice-requires-code" />
        <severity value="error" />
        <human value="Tactile Tonometry requires a coded value." />
        <expression value="method = 'tactile'&#xA;   implies&#xA;      (note.exists() or (value as CodeableConcept).exists() or (component.value as CodeableConcept).exists()) and (value as Quantity).exists().not() and (component.value as Quantity).exists().not()" />
        <source value="http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-observation-tonometryEvaluation" />
      </constraint>
      <constraint>
        <key value="goldmann-requires-quantity" />
        <severity value="error" />
        <human value="Goldmann Tonometry requires a quantity value." />
        <expression value="method = 'goldmann'&#xA;   implies&#xA;      (note.exists() or (value as Quantity).exists() or (component.value as Quantity).exists()) and (value as CodeableConcept).exists().not() and (component.value as CodeableConcept).exists().not()" />
        <source value="http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-observation-tonometryEvaluation" />
      </constraint>
    </element>
    <element id="Observation.meta.extension">
      <path value="Observation.meta.extension" />
      <min value="1" />
    </element>
    <element id="Observation.meta.extension:organization">
      <path value="Observation.meta.extension" />
      <sliceName value="organization" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-meta-organization-extension" />
      </type>
    </element>
    <element id="Observation.meta.tag">
      <path value="Observation.meta.tag" />
      <binding>
        <strength value="required" />
        <valueSet value="http://fhir.essilorluxottica.com/fhir/ValueSet/el-metatag-vs" />
      </binding>
    </element>
    <element id="Observation.status">
      <path value="Observation.status" />
      <patternCode value="final" />
    </element>
    <element id="Observation.category">
      <path value="Observation.category" />
      <patternCodeableConcept>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/observation-category" />
          <code value="exam" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.code">
      <path value="Observation.code" />
      <patternCodeableConcept>
        <coding>
          <system value="http://fhir.essilorluxottica.com/fhir/CodeSystem/el-sectioncode-cs" />
          <code value="tonometryEvaluation" />
          <display value="Tonometry Evaluation" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Observation.subject">
      <path value="Observation.subject" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-patient" />
      </type>
    </element>
    <element id="Observation.encounter">
      <path value="Observation.encounter" />
      <min value="1" />
    </element>
    <element id="Observation.effective[x]">
      <path value="Observation.effective[x]" />
      <type>
        <code value="dateTime" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.value[x]">
      <path value="Observation.value[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <type>
        <code value="Quantity" />
      </type>
      <type>
        <code value="CodeableConcept" />
      </type>
    </element>
    <element id="Observation.value[x]:valueCodeableConcept">
      <path value="Observation.value[x]" />
      <sliceName value="valueCodeableConcept" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <strength value="required" />
        <valueSet value="http://fhir.essilorluxottica.com/fhir/ValueSet/el-observation-tonometryTactileObservation-vs" />
      </binding>
    </element>
    <element id="Observation.value[x]:valueQuantity">
      <path value="Observation.value[x]" />
      <sliceName value="valueQuantity" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Quantity" />
      </type>
    </element>
    <element id="Observation.value[x]:valueQuantity.code">
      <path value="Observation.value[x].code" />
      <patternCode value="mm[Hg]" />
    </element>
    <element id="Observation.bodySite">
      <path value="Observation.bodySite" />
      <binding>
        <strength value="required" />
        <valueSet value="http://fhir.essilorluxottica.com/fhir/ValueSet/el-eyelocation-single-vs" />
      </binding>
    </element>
    <element id="Observation.method">
      <path value="Observation.method" />
      <binding>
        <strength value="required" />
        <valueSet value="http://fhir.essilorluxottica.com/fhir/ValueSet/el-observation-tonometryEvaluationMethod-vs" />
      </binding>
    </element>
  </differential>
</StructureDefinition>