{
  "resourceType": "StructureDefinition",
  "url": "http://fhir.healthbc.org/StructureDefinition/AllergyIntolerance",
  "version": "1.0",
  "name": "ca-bc-careconnect-allergy-intolerance",
  "status": "active",
  "date": "2021-07-13",
  "fhirVersion": "3.0.2",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/w5",
      "name": "W5 Mapping"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "AllergyIntolerance",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "AllergyIntolerance.id",
        "path": "AllergyIntolerance.id",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.meta",
        "path": "AllergyIntolerance.meta",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.implicitRules",
        "path": "AllergyIntolerance.implicitRules",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.language",
        "path": "AllergyIntolerance.language",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.text",
        "path": "AllergyIntolerance.text",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.extension",
        "path": "AllergyIntolerance.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "AllergyIntolerance.extension:reportedByCode",
        "path": "AllergyIntolerance.extension",
        "sliceName": "reportedByCode",
        "short": "Source of the reported adverse reaction",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": "http://fhir.healthbc.org/StructureDefinition/ca-bc-careconnect-reported-by-code-extension"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.extension:medicationReference",
        "path": "AllergyIntolerance.extension",
        "sliceName": "medicationReference",
        "short": "The medication for which there was an adverse reaction.",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "http://fhir.healthbc.org/StructureDefinition/ca-bc-careconnect-allergy-intolerance-medication-reference-extension"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.extension:medicationReference.valueReference:valueReference",
        "path": "AllergyIntolerance.extension.valueReference",
        "sliceName": "valueReference",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://fhir.healthbc.org/StructureDefinition/ca-bc-careconnect-medication",
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "AllergyIntolerance.identifier",
        "path": "AllergyIntolerance.identifier",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.type",
        "path": "AllergyIntolerance.type",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.criticality",
        "path": "AllergyIntolerance.criticality",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.code.id",
        "path": "AllergyIntolerance.code.id",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.code.coding",
        "path": "AllergyIntolerance.code.coding",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.patient",
        "path": "AllergyIntolerance.patient",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Patient",
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "AllergyIntolerance.patient.id",
        "path": "AllergyIntolerance.patient.id",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.patient.identifier",
        "path": "AllergyIntolerance.patient.identifier",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.patient.display",
        "path": "AllergyIntolerance.patient.display",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.onset[x]",
        "path": "AllergyIntolerance.onset[x]",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.recorder",
        "path": "AllergyIntolerance.recorder",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.asserter",
        "path": "AllergyIntolerance.asserter",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.lastOccurrence",
        "path": "AllergyIntolerance.lastOccurrence",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.note.id",
        "path": "AllergyIntolerance.note.id",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.note.author[x]:authorReference",
        "path": "AllergyIntolerance.note.authorReference",
        "sliceName": "authorReference",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Practitioner",
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "AllergyIntolerance.note.author[x]:authorReference.id",
        "path": "AllergyIntolerance.note.authorReference.id",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.note.author[x]:authorReference.identifier",
        "path": "AllergyIntolerance.note.authorReference.identifier",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.reaction",
        "path": "AllergyIntolerance.reaction",
        "max": "0"
      }
    ]
  }
}