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