{
  "resourceType": "StructureDefinition",
  "id": "profile-Observation-alert-base",
  "url": "https://bpcs.exchange/fhir/StructureDefinition/profile-Observation-alert-base",
  "name": "ObservationAlertBase",
  "title": "Observation Alert Base Profile",
  "status": "active",
  "experimental": false,
  "description": "An abstract profile that for alert and special handling observation that covers common elements independent of type of operation",
  "fhirVersion": "5.0.0",
  "mapping": [
    {
      "identity": "BPCS",
      "name": "Internal BPCS API"
    }
  ],
  "kind": "resource",
  "abstract": true,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation.id",
        "path": "Observation.id",
        "comment": "This will be a concatenation of the odbNum or applicationNum with '-' then the alert or special handling observation code.",
        "min": 1,
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "AlertSpecialHandlingDTO.recCreateCustomTimestamp"
          }
        ]
      },
      {
        "id": "Observation.status",
        "path": "Observation.status",
        "patternCode": "final",
        "mustSupport": true
      },
      {
        "id": "Observation.category",
        "path": "Observation.category",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Observation.category:alertSH",
        "path": "Observation.category",
        "sliceName": "alertSH",
        "short": "Alert vs. Special Handling",
        "min": 1,
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://bpcs.exchange/fhir/ValueSet/vs-NoteCode-alert-category"
        },
        "mapping": [
          {
            "identity": "BPCS",
            "map": "ApplicationNoteDTO.category, AlertSpecialHandlingDTO.category"
          }
        ]
      },
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "short": "Note type",
        "comment": "The binding is extensible to allow for the addition of new codes.  Codes must be found in the current expansion of the value set.",
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "valueSet": "https://bpcs.exchange/fhir/ValueSet/vs-NoteCode-alert"
        },
        "mapping": [
          {
            "identity": "BPCS",
            "map": "ApplicationNoteDTO.activity, AlertSpecialHandlingDTO.activity"
          }
        ]
      },
      {
        "id": "Observation.subject",
        "path": "Observation.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Reference-rest"
            ],
            "targetProfile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Patient-search",
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Group"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "ApplicationNoteDTO.applicationNum, AlertSpecialHandlingDTO.applicationNum"
          }
        ]
      },
      {
        "id": "Observation.focus",
        "path": "Observation.focus",
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Reference-rest"
            ],
            "targetProfile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-Coverage-family"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "ApplicationNoteDTO.applicationNum, AlertSpecialHandlingDTO.applicationNum"
          }
        ]
      },
      {
        "id": "Observation.effective[x]",
        "path": "Observation.effective[x]",
        "min": 1,
        "type": [
          {
            "code": "dateTime",
            "profile": [
              "https://bpcs.exchange/fhir/StructureDefinition/profile-dateTime-date"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "ApplicationNoteDTO.activityDate"
          }
        ]
      },
      {
        "id": "Observation.issued",
        "path": "Observation.issued",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "ApplicationNoteDTO.activityDate"
          }
        ]
      },
      {
        "id": "Observation.value[x]",
        "path": "Observation.value[x]",
        "min": 1,
        "type": [
          {
            "code": "boolean"
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "AlertSpecialHandlingDTO.selected"
          }
        ]
      }
    ]
  }
}