<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="SmartAL-Observation-Base" />
  <url value="http://alticelabs.com/fhir/StructureDefinition/SmartAL-Observation-Base" />
  <name value="SmartALObservationBase" />
  <title value="SmartAL Observation (Base)" />
  <status value="active" />
  <description value="Abstract base profile for all Observation resources sent to Glintt.&#xA;Defines common constraints shared by all observation types: identifier,&#xA;status, category, code, subject with Glintt viewer enrichment,&#xA;effectiveDateTime, performer, interpretation, and referenceRange.&#xA;&#xA;Interpretation and referenceRange are automatically enriched by MHR from&#xA;ObservationDefinition thresholds at creation time. They are NOT mandatory —&#xA;they are only present when a matching ObservationDefinition exists.&#xA;&#xA;Only Observations whose code matches the whitelist are synced:&#xA;- 8310-5 (Body Temperature)&#xA;- 59408-5 (SpO2)&#xA;- 8867-4 (Heart Rate)&#xA;- 9279-1 (Respiratory Rate)&#xA;- 85354-9 (Blood Pressure)&#xA;- 10000-F (Gait Group — custom LOINC)&#xA;- 10100-F (Cognition Group — custom LOINC)&#xA;- 20000-I (ECG+PCG Valvular Assessment — custom LOINC)&#xA;- 3000-G (Frailty Physical Assessment -- custom LOINC)&#xA;&#xA;Media and Device resources are stripped before sending to Glintt." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="true" />
  <type value="Observation" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Observation" />
  <derivation value="constraint" />
  <differential>
    <element id="Observation.meta.source">
      <path value="Observation.meta.source" />
      <short value="Source system that created this resource" />
      <definition value="Set to 'http://alticelabs.com/fhir' by the MetaSourceInterceptor for all&#xA;resources created via the internal backend (x-api-key). This value is used&#xA;by the GlinttSyncInterceptor as an allowlist — only resources with this&#xA;meta.source are synced to Glintt. Resources created by external partners&#xA;(e.g., P5) will have a different or absent meta.source and are excluded&#xA;from Glintt sync." />
    </element>
    <element id="Observation.identifier">
      <path value="Observation.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Observation.identifier:altice">
      <path value="Observation.identifier" />
      <sliceName value="altice" />
      <short value="Altice business identifier (UUID)" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.identifier:altice.system">
      <path value="Observation.identifier.system" />
      <min value="1" />
      <fixedUri value="http://alticelabs.com/fhir/identifiers/observation" />
    </element>
    <element id="Observation.identifier:altice.value">
      <path value="Observation.identifier.value" />
      <min value="1" />
    </element>
    <element id="Observation.status">
      <path value="Observation.status" />
      <fixedCode value="final" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.category">
      <path value="Observation.category" />
      <short value="Classification of observation type (vital-signs, exam, etc.)" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.code">
      <path value="Observation.code" />
      <mustSupport value="true" />
    </element>
    <element id="Observation.code.coding">
      <path value="Observation.code.coding" />
      <min value="1" />
    </element>
    <element id="Observation.subject">
      <path value="Observation.subject" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.subject.reference">
      <path value="Observation.subject.reference" />
      <min value="1" />
    </element>
    <element id="Observation.subject.identifier">
      <path value="Observation.subject.identifier" />
      <short value="Glintt viewer identifier for subject correlation" />
      <definition value="When sending to Glintt, the subject reference is enriched with the Patient's Glintt viewer identifier (system: https://glintt.com/viewer)." />
    </element>
    <element id="Observation.encounter">
      <path value="Observation.encounter" />
      <short value="Encounter during which this observation was made" />
    </element>
    <element id="Observation.effective[x]">
      <path value="Observation.effective[x]" />
      <min value="1" />
      <type>
        <code value="dateTime" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Observation.issued">
      <path value="Observation.issued" />
      <short value="Date/time this observation was made available" />
    </element>
    <element id="Observation.performer">
      <path value="Observation.performer" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
      </type>
    </element>
    <element id="Observation.interpretation">
      <path value="Observation.interpretation" />
      <short value="MHR-enriched interpretation code" />
      <definition value="Interpretation code (N, L, LL, H, HH) automatically enriched by MHR from ObservationDefinition thresholds at creation time. Only present when a matching ObservationDefinition exists." />
    </element>
    <element id="Observation.note">
      <path value="Observation.note" />
      <short value="Clinical notes about the observation" />
    </element>
    <element id="Observation.method">
      <path value="Observation.method" />
      <short value="How the observation was made (e.g., manual, device)" />
    </element>
    <element id="Observation.device">
      <path value="Observation.device" />
      <short value="Reference to the Device that produced this observation" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Device" />
      </type>
    </element>
    <element id="Observation.referenceRange">
      <path value="Observation.referenceRange" />
      <short value="MHR-enriched reference ranges" />
      <definition value="Reference ranges from matching ObservationDefinition, automatically added by MHR at creation time. Only present when a matching ObservationDefinition exists." />
    </element>
    <element id="Observation.derivedFrom">
      <path value="Observation.derivedFrom" />
      <short value="Related observations this observation is derived from" />
    </element>
  </differential>
</StructureDefinition>