{
  "resourceType": "StructureDefinition",
  "id": "Flag",
  "meta": {
    "lastUpdated": "2021-01-01T21:58:31.578+00:00"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-category",
      "valueString": "Base.Management"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
      "valueCode": "trial-use"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
      "valueInteger": 1
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category",
      "valueCode": "patient"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
      "valueCode": "pc"
    },
    {
      "url": "http://hl7.org/fhir/build/StructureDefinition/entered-in-error-status",
      "valueCode": ".status = entered-in-error"
    }
  ],
  "url": "http://hl7.org/fhir/StructureDefinition/Flag",
  "version": "4.6.0",
  "name": "Flag",
  "status": "draft",
  "date": "2021-01-01T21:58:31+00:00",
  "publisher": "Health Level Seven International (Patient Care)",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://hl7.org/fhir"
        }
      ]
    },
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://www.hl7.org/Special/committees/patientcare/index.cfm"
        }
      ]
    }
  ],
  "description": "Prospective warnings of potential issues when providing care to the patient.",
  "fhirVersion": "4.6.0",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Flag",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/DomainResource",
  "derivation": "specialization",
  "differential": {
    "element": [
      {
        "id": "Flag",
        "path": "Flag",
        "short": "Key information to flag to healthcare providers",
        "definition": "Prospective warnings of potential issues when providing care to the patient.",
        "alias": [
          "Barriers to Care",
          "Alert",
          "Warning"
        ],
        "min": 0,
        "max": "*",
        "mapping": [
          {
            "identity": "rim",
            "map": "Observation[classCode=ISSUE, moodCode=EVN]"
          },
          {
            "identity": "w5",
            "map": "workflow.encounter"
          }
        ]
      },
      {
        "id": "Flag.identifier",
        "path": "Flag.identifier",
        "short": "Business identifier",
        "definition": "Business identifiers assigned to this flag by the performer or other systems which remain constant as the resource is updated and propagates from server to server.",
        "comment": "This is a business identifier, not a resource identifier (see [discussion](resource.html#identifiers)).  It is best practice for the identifier to only appear on a single resource instance, however business practices may occasionally dictate that multiple resource instances with the same identifier can exist - possibly even with different resource types.  For example, multiple Patient and a Person resource instance might share the same social insurance number.",
        "requirements": "Allows identification of the flag as it is known by various participating systems and in a way that remains consistent across servers.",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Identifier"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.identifier"
          },
          {
            "identity": "rim",
            "map": ".id"
          }
        ]
      },
      {
        "id": "Flag.status",
        "path": "Flag.status",
        "short": "active | inactive | entered-in-error",
        "definition": "Supports basic workflow.",
        "comment": "This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ],
        "isModifier": true,
        "isModifierReason": "This element is labelled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid",
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "FlagStatus"
            }
          ],
          "strength": "required",
          "description": "Indicates whether this flag is active and needs to be displayed to a user, or whether it is no longer needed or was entered in error.",
          "valueSet": "http://hl7.org/fhir/ValueSet/flag-status"
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.status"
          },
          {
            "identity": "rim",
            "map": ".status"
          }
        ]
      },
      {
        "id": "Flag.category",
        "path": "Flag.category",
        "short": "Clinical, administrative, etc.",
        "definition": "Allows a flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context.",
        "comment": "The value set will often need to be adjusted based on local business rules and usage context.",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "FlagCategory"
            }
          ],
          "strength": "example",
          "description": "A general category for flags for filtering/display purposes.",
          "valueSet": "http://hl7.org/fhir/ValueSet/flag-category"
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.class"
          },
          {
            "identity": "rim",
            "map": ".code"
          }
        ]
      },
      {
        "id": "Flag.code",
        "path": "Flag.code",
        "short": "Coded or textual message to display to user",
        "definition": "The coded value or textual component of the flag to display to the user.",
        "comment": "If non-coded, use CodeableConcept.text.  This element should always be included in the narrative.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "FlagCode"
            }
          ],
          "strength": "example",
          "description": "Detail codes identifying specific flagged issues.",
          "valueSet": "http://hl7.org/fhir/ValueSet/flag-code"
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.what[x]"
          },
          {
            "identity": "rim",
            "map": ".value"
          }
        ]
      },
      {
        "id": "Flag.subject",
        "extension": [
          {
            "url": "http://hl7.org/fhir/build/StructureDefinition/committee-notes",
            "valueString": "GF#20380."
          }
        ],
        "path": "Flag.subject",
        "short": "Who/What is flag about?",
        "definition": "The patient, location, group, organization, or practitioner etc. this is about record this flag is associated with.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://hl7.org/fhir/StructureDefinition/Location",
              "http://hl7.org/fhir/StructureDefinition/Group",
              "http://hl7.org/fhir/StructureDefinition/Organization",
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.org/fhir/StructureDefinition/PractitionerRole",
              "http://hl7.org/fhir/StructureDefinition/PlanDefinition",
              "http://hl7.org/fhir/StructureDefinition/Medication",
              "http://hl7.org/fhir/StructureDefinition/Procedure"
            ]
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.subject[x]"
          },
          {
            "identity": "rim",
            "map": ".participation[typeCode=SBJ].role[classCode=PAT | LOCE | ASSIGNED]"
          },
          {
            "identity": "w5",
            "map": "FiveWs.subject"
          }
        ]
      },
      {
        "id": "Flag.period",
        "path": "Flag.period",
        "short": "Time period when flag is active",
        "definition": "The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Period"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.context"
          }
        ]
      },
      {
        "id": "Flag.encounter",
        "path": "Flag.encounter",
        "short": "Alert relevant during encounter",
        "definition": "This alert is only relevant during the encounter.",
        "comment": "If both Flag.encounter and Flag.period are valued, then Flag.period.start shall not be before Encounter.period.start and Flag.period.end shall not be after Encounter.period.end.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Encounter"
            ]
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.context"
          }
        ]
      },
      {
        "id": "Flag.author",
        "path": "Flag.author",
        "short": "Flag creator",
        "definition": "The person, organization or device that created the flag.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Device",
              "http://hl7.org/fhir/StructureDefinition/Organization",
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.org/fhir/StructureDefinition/PractitionerRole"
            ]
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.author"
          },
          {
            "identity": "rim",
            "map": ".participation[typeCode=AUT].role"
          }
        ]
      }
    ]
  }
}