{
  "resourceType": "StructureDefinition",
  "url": "http://ehealth.bc.ca/fhir/StructureDefinition/ca-bc-eforms-profile-allergyIntolerance",
  "name": "AllergyIntolerance",
  "status": "draft",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "AllergyIntolerance",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "AllergyIntolerance.meta",
        "path": "AllergyIntolerance.meta"
      },
      {
        "id": "AllergyIntolerance.meta.profile",
        "path": "AllergyIntolerance.meta.profile",
        "comment": "Apply \"http://ehealth.bc.ca/fhir/StructureDefinition/ca-bc-eforms-profile-allergyIntolerance\"",
        "min": 1,
        "max": "1"
      },
      {
        "id": "AllergyIntolerance.implicitRules",
        "path": "AllergyIntolerance.implicitRules",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.language",
        "path": "AllergyIntolerance.language",
        "max": "0"
      },
      {
        "id": "AllergyIntolerance.verificationStatus.coding.system",
        "path": "AllergyIntolerance.verificationStatus.coding.system",
        "code": [
          {
            "system": "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification"
          }
        ],
        "min": 1
      },
      {
        "id": "AllergyIntolerance.verificationStatus.coding.code",
        "path": "AllergyIntolerance.verificationStatus.coding.code",
        "code": [
          {
            "code": "unfonfirmed",
            "display": "Unconfirmed"
          },
          {
            "code": "confirmed",
            "display": "Confirmed"
          },
          {
            "code": "refuted",
            "display": "Refuted"
          },
          {
            "code": "entered-in-error",
            "display": "Entered in Error"
          }
        ],
        "min": 1
      },
      {
        "id": "AllergyIntolerance.verificationStatus.coding.display",
        "path": "AllergyIntolerance.verificationStatus.coding.display",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.type",
        "path": "AllergyIntolerance.type",
        "code": [
          {
            "system": "http://hl7.org/fhir/allergy-intolerance-type"
          },
          {
            "code": "allergy",
            "display": "Allergy"
          },
          {
            "code": "intolerance",
            "display": "Intolerance"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.category",
        "path": "AllergyIntolerance.category",
        "code": [
          {
            "system": "http://hl7.org/fhir/allergy-intolerance-category",
            "code": "food",
            "display": "Food"
          },
          {
            "code": "medication",
            "display": "Medication"
          },
          {
            "code": "environment",
            "display": "Environment"
          },
          {
            "code": "biologic",
            "display": "Biologic"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.criticality",
        "path": "AllergyIntolerance.criticality",
        "code": [
          {
            "system": "http://hl7.org/fhir/allergy-intolerance-criticality"
          },
          {
            "code": "low",
            "display": "Low Risk"
          },
          {
            "code": "high",
            "display": "High Risk"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.code",
        "path": "AllergyIntolerance.code",
        "comment": "if AllergyIntolerance.code represents NullFlavor concept, then AllergyIntolerance.verificationStatus SHALL be present"
      },
      {
        "id": "AllergyIntolerance.code.coding",
        "path": "AllergyIntolerance.code.coding",
        "comment": "NotAsked: if AllergyIntolerance.code is a NullFlavor value, then AllergyIntolerance.clinicalStatus, AllergyIntolerance.verificationStatus, \r\nAllergyIntolerance.type, AllergyIntolerance.category, AllergyIntolerance.criticality SHALL NOT be present.  NoAllergy: if AllergyIntolerance.code is '716186003' No known allergy, then AllergyIntolerance.verificationStatus SHALL be one of the following: confirmed | refuted | entered-in-error",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.code.coding.code",
        "path": "AllergyIntolerance.code.coding.code",
        "code": [
          {
            "code": "NotAsked"
          },
          {
            "system": "https://fhir.infoway-inforoute.ca/valueSet/NullFlavor",
            "code": "NotAsked"
          },
          {
            "code": "NoAllergy"
          }
        ],
        "comment": "NotAsked: if AllergyIntolerance.code is a NullFlavor value, then AllergyIntolerance.clinicalStatus, AllergyIntolerance.verificationStatus, \r\nAllergyIntolerance.type, AllergyIntolerance.category, AllergyIntolerance.criticality SHALL NOT be present.  NoAllergy: if AllergyIntolerance.code is '716186003' No known allergy, then AllergyIntolerance.verificationStatus SHALL be one of the following: confirmed | refuted | entered-in-error"
      }
    ]
  }
}