<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://fhir.catsalut.cat/r4/mConnectaHES/StructureDefinition/HESConnecta_Observation" />
  <name value="HESConnecta_Observation" />
  <status value="draft" />
  <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.identifier">
      <path value="Observation.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.identifier.value">
      <path value="Observation.identifier.value" />
      <min value="1" />
    </element>
    <element id="Observation.basedOn">
      <path value="Observation.basedOn" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.catsalut.cat/r4/mConnectaHES/StructureDefinition/HESConnecta_ServiceRequest" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.basedOn.reference">
      <path value="Observation.basedOn.reference" />
      <min value="1" />
    </element>
    <element id="Observation.status">
      <path value="Observation.status" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.category">
      <path value="Observation.category" />
      <comment value="vertical del caso de uso en el que se enmarca la medida&#xD;&#xA;&#xD;&#xA;In addition to the required category valueset, this element allows various categorization schemes based on the owner’s definition of the category and effectively multiple categories can be used at once.  The level of granularity is defined by the category concepts in the value set." />
      <mustSupport value="true" />
    </element>
    <element id="Observation.code">
      <path value="Observation.code" />
      <comment value="// aquí indicaremos información adicional vital signs, por ejemplo...&#xD;&#xA;&#xD;&#xA;*All* code-value and, if present, component.code-component.value pairs need to be taken into account to correctly understand the meaning of the observation." />
      <mustSupport value="true" />
    </element>
    <element id="Observation.code.coding">
      <path value="Observation.code.coding" />
      <min value="1" />
    </element>
    <element id="Observation.code.coding.system">
      <path value="Observation.code.coding.system" />
      <min value="1" />
    </element>
    <element id="Observation.code.coding.code">
      <path value="Observation.code.coding.code" />
      <min value="1" />
    </element>
    <element id="Observation.code.coding.display">
      <path value="Observation.code.coding.display" />
      <min value="1" />
    </element>
    <element id="Observation.subject">
      <path value="Observation.subject" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.catsalut.cat/r4/mConnectaHES/StructureDefinition/HESConnecta_Patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.subject.identifier">
      <path value="Observation.subject.identifier" />
      <min value="1" />
    </element>
    <element id="Observation.subject.identifier.type">
      <path value="Observation.subject.identifier.type" />
      <min value="1" />
    </element>
    <element id="Observation.subject.identifier.type.coding.code">
      <path value="Observation.subject.identifier.type.coding.code" />
      <min value="1" />
      <fixedCode value="CIP-CatSalut" />
    </element>
    <element id="Observation.subject.identifier.type.coding.display">
      <path value="Observation.subject.identifier.type.coding.display" />
      <min value="1" />
      <fixedString value="Codi d'identificació personal únic del Servei Català de la Salut (CIP-CatSalut)" />
    </element>
    <element id="Observation.subject.identifier.system">
      <path value="Observation.subject.identifier.system" />
      <min value="1" />
      <fixedUri value="urn:oid:2.16.724.4.9.10.1" />
    </element>
    <element id="Observation.subject.identifier.value">
      <path value="Observation.subject.identifier.value" />
      <min value="1" />
    </element>
    <element id="Observation.effective[x]">
      <path value="Observation.effective[x]" />
      <type>
        <code value="dateTime" />
      </type>
      <type>
        <code value="Period" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.interpretation">
      <path value="Observation.interpretation" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.note">
      <path value="Observation.note" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.device">
      <path value="Observation.device" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.catsalut.cat/r4/mConnectaHES/StructureDefinition/HESConnecta-Device" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.device.reference">
      <path value="Observation.device.reference" />
      <min value="1" />
    </element>
    <element id="Observation.referenceRange">
      <path value="Observation.referenceRange" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component">
      <path value="Observation.component" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.component.code">
      <path value="Observation.component.code" />
      <binding>
        <strength value="preferred" />
      </binding>
    </element>
  </differential>
</StructureDefinition>