<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://Ex2.org/fhir/StructureDefinition/Ex2Observation" />
  <name value="Ex2Observation" />
  <status value="draft" />
  <description value="Observation profile for Exercise 2" />
  <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" />
      <definition value="Observation profile for Exercise 2" />
      <constraint>
        <key value="gareth-obs-1" />
        <severity value="error" />
        <human value="Must complete value or note" />
        <expression value="valueofType(quantity).exists() or note.exists()" />
      </constraint>
    </element>
    <element id="Observation.extension">
      <path value="Observation.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Observation.extension:LateralityExtension">
      <path value="Observation.extension" />
      <sliceName value="LateralityExtension" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://Ex3.org/fhir/StructureDefinition/Ex3LateralityExtension" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="Observation.extension:LateralityExtension.value[x]">
      <path value="Observation.extension.value[x]" />
      <code>
        <system value="http://snomed.info/sct" />
        <code value="272741003" />
        <display value="Laterality (attribute)" />
      </code>
    </element>
    <element id="Observation.identifier">
      <path value="Observation.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.identifier:NHSNumber">
      <path value="Observation.identifier" />
      <sliceName value="NHSNumber" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.identifier:NHSNumber.system">
      <path value="Observation.identifier.system" />
      <min value="1" />
      <fixedUri value="https://fhir.nhs.uk/Id/nhs-number" />
    </element>
    <element id="Observation.identifier:NHSNumber.value">
      <path value="Observation.identifier.value" />
      <min value="1" />
    </element>
    <element id="Observation.identifier:sliceIdentifier">
      <path value="Observation.identifier" />
      <sliceName value="sliceIdentifier" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.identifier:sliceIdentifier.system">
      <path value="Observation.identifier.system" />
      <min value="1" />
    </element>
    <element id="Observation.identifier:sliceIdentifier.value">
      <path value="Observation.identifier.value" />
      <min value="1" />
    </element>
    <element id="Observation.status">
      <path value="Observation.status" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.code.coding.system">
      <path value="Observation.code.coding.system" />
      <fixedUri value="Snomed URL" />
    </element>
    <element id="Observation.code.coding.code">
      <path value="Observation.code.coding.code" />
      <fixedCode value="118230007" />
    </element>
    <element id="Observation.code.coding.display">
      <path value="Observation.code.coding.display" />
      <fixedString value="Hearing finding (finding)" />
    </element>
    <element id="Observation.subject">
      <path value="Observation.subject" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://Ex2.org/fhir/StructureDefinition/Ex2Patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.effective[x]">
      <path value="Observation.effective[x]" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.value[x]">
      <path value="Observation.value[x]" />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <condition value="gareth-obs-1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.note">
      <path value="Observation.note" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.note.text">
      <path value="Observation.note.text" />
      <condition value="gareth-obs-1" />
    </element>
    <element id="Observation.method">
      <path value="Observation.method" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.device">
      <path value="Observation.device" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.derivedFrom">
      <path value="Observation.derivedFrom" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component.referenceRange">
      <path value="Observation.component.referenceRange" />
      <contentReference value="http://hl7.org/fhir/StructureDefinition/Observation#Observation.referenceRange" />
    </element>
  </differential>
</StructureDefinition>