<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="va-pghd-observation-base-v1.0" />
  <url value="https://veteran.apps.va.gov/smart-pgd-fhir/v2/StructureDefinition/va-pghd-observation-base-v1.0" />
  <version value="1.0" />
  <name value="VAPghdObservationProfileBase" />
  <title value="VA PGHD Observation Base Profile for Mobile App Data" />
  <status value="active" />
  <date value="2022-08-01" />
  <description value="VA PGHD Observation base profile defining the common constraints for all PGHD observations. For example, the status is set to 'final'." />
  <purpose value="This is the PGHD observation base profile defining the common constraints for all PGHD observation profiles.  Other PGHD observation profiles should derive from this base profile." />
  <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" />
      <short value="PGHD Governance Rules for Observations" />
      <constraint>
        <key value="pghd-meta-tag-1" />
        <severity value="error" />
        <human value="An observation must have exactly one meta tag, with system = 'https://wiki.mobilehealth.va.gov/x/Onc1C', a code, and a display value" />
        <expression value="meta.tag.count() = 1 and meta.tag.exists(system = 'https://wiki.mobilehealth.va.gov/x/Onc1C' and code.exists() and display.exists())" />
      </constraint>
      <constraint>
        <key value="pghd-observation-status-1" />
        <severity value="error" />
        <human value="Observation status must be 'final'" />
        <expression value="status = 'final'" />
      </constraint>
      <constraint>
        <key value="pghd-observation-codesystem-1" />
        <severity value="warning" />
        <human value="CodeSystem url https://mobile.va.gov/fhir/codesystem/pghd is deprecated; use https://connectedcare.va.gov/pghd/code-system-v1.1 instead" />
        <expression value="(category.coding.exists(system = 'https://mobile.va.gov/fhir/codesystem/pghd') or code.coding.exists(system = 'https://mobile.va.gov/fhir/codesystem/pghd') or component.code.coding.exists(system = 'https://mobile.va.gov/fhir/codesystem/pghd')).not()" />
      </constraint>
    </element>
  </differential>
</StructureDefinition>