{
  "resourceType": "StructureDefinition",
  "id": "profile-Observation-note-base",
  "url": "https://bpcs.exchange/fhir/StructureDefinition/profile-Observation-note-base",
  "name": "ObservationNoteBase",
  "title": "Observation Note Base Profile",
  "status": "active",
  "experimental": false,
  "description": "An abstract profile that for observation notes 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.status",
        "path": "Observation.status",
        "comment": "This SHALL be 'final' when recording a new note",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://bpcs.exchange/fhir/ValueSet/vs-ObservationNoteStatus"
        }
      },
      {
        "id": "Observation.category",
        "path": "Observation.category",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Observation.category:note",
        "path": "Observation.category",
        "sliceName": "note",
        "short": "This is a 'note'",
        "min": 1,
        "max": "1",
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://loinc.org",
              "code": "34109-9"
            }
          ]
        }
      },
      {
        "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"
        }
      },
      {
        "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 (when it's an odbNum)"
          }
        ]
      },
      {
        "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 (when it's actually an application number)"
          }
        ]
      },
      {
        "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.value[x]",
        "path": "Observation.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "closed"
        },
        "short": "Note text",
        "min": 1,
        "type": [
          {
            "code": "string"
          },
          {
            "code": "boolean"
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "BPCS",
            "map": "ApplicationNoteDTO.note"
          }
        ]
      },
      {
        "id": "Observation.value[x]:valueBoolean",
        "path": "Observation.value[x]",
        "sliceName": "valueBoolean",
        "type": [
          {
            "code": "boolean"
          }
        ],
        "patternBoolean": true,
        "mustSupport": true
      },
      {
        "id": "Observation.value[x]:valueString",
        "path": "Observation.value[x]",
        "sliceName": "valueString",
        "type": [
          {
            "code": "string"
          }
        ],
        "mustSupport": true
      }
    ]
  }
}