{
  "resourceType": "StructureDefinition",
  "id": "allergyintolerance-ca-core",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
      "valueInteger": 2
    }
  ],
  "url": "http://fhir.infoway-inforoute.ca/cacore/StructureDefinition/allergyintolerance-ca-core",
  "version": "1.1.0",
  "name": "AllergyIntoleranceCACore",
  "title": "AllergyIntolerance (CA-Core)",
  "status": "active",
  "experimental": false,
  "date": "2025-03-31",
  "publisher": "Canada Health Infoway",
  "contact": [
    {
      "name": "National Standards Release Centre",
      "telecom": [
        {
          "system": "url",
          "value": "http://www.infoway-inforoute.ca"
        },
        {
          "system": "email",
          "value": "standards@infoway-inforoute.ca"
        }
      ]
    }
  ],
  "description": "This profile applies constraints to the AllergyIntolerance resource for CA Core+ to support the documentation of allergies and intolerances in the pan-Canadian context. It includes expectations for coded substances, reactions, and severity.",
  "jurisdiction": [
    {
      "coding": [
        {
          "code": "CA",
          "system": "urn:iso:std:iso:3166"
        }
      ]
    }
  ],
  "copyright": "Copyright © 2025+ Canada Health Infoway. All rights reserved. [Terms of Use and License Agreements](https://ic.infoway-inforoute.ca/en/about/tou). [Privacy Policy](https://www.infoway-inforoute.ca/en/legal/privacy-policy).",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "CACDI",
      "name": "Canadian Core Data for Interoperability (CACDI)",
      "comment": "Mapping for AllergyIntoleranceCACore to  Canadian Core Data for Interoperability (CACDI)."
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "AllergyIntolerance",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "AllergyIntolerance.extension",
        "path": "AllergyIntolerance.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "AllergyIntolerance.extension:abatement",
        "path": "AllergyIntolerance.extension",
        "sliceName": "abatement",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/allergyintolerance-abatement"
            ]
          }
        ]
      },
      {
        "id": "AllergyIntolerance.code",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/obligation",
            "extension": [
              {
                "url": "code",
                "valueCode": "MAY:populate-if-known"
              },
              {
                "url": "actor",
                "valueCanonical": "http://fhir.infoway-inforoute.ca/ca-core/ActorDefinition/producer"
              }
            ]
          },
          {
            "extension": [
              {
                "url": "code",
                "valueCode": "SHALL:no-error"
              },
              {
                "url": "actor",
                "valueCanonical": "http://fhir.infoway-inforoute.ca/ca-core/ActorDefinition/consumer"
              }
            ],
            "url": "http://hl7.org/fhir/StructureDefinition/obligation"
          }
        ],
        "path": "AllergyIntolerance.code",
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "http://fhir.infoway-inforoute.ca/cacore/StructureDefinition/codeableconcept-ca-core"
            ]
          }
        ],
        "binding": {
          "strength": "preferred",
          "valueSet": "https://fhir.infoway-inforoute.ca/ValueSet/pharmaceuticalbiologicproductandsubstancecode",
          "extension": [
            {
              "url": "http://hl7.org/fhir/tools/StructureDefinition/additional-binding",
              "extension": [
                {
                  "url": "purpose",
                  "valueCode": "candidate"
                },
                {
                  "url": "valueSet",
                  "valueCanonical": "https://fhir.infoway-inforoute.ca/ValueSet/prescriptionmedicinalproduct"
                },
                {
                  "url": "documentation",
                  "valueMarkdown": "Canadian Clinical Drug Data Set CCDD"
                }
              ]
            },
            {
              "extension": [
                {
                  "url": "purpose",
                  "valueCode": "candidate"
                },
                {
                  "url": "valueSet",
                  "valueCanonical": "https://fhir.infoway-inforoute.ca/ValueSet/ICD10CA"
                },
                {
                  "url": "documentation",
                  "valueMarkdown": "International Classifications of Disease ICD 10 CA Codes"
                }
              ],
              "url": "http://hl7.org/fhir/tools/StructureDefinition/additional-binding"
            },
            {
              "extension": [
                {
                  "url": "purpose",
                  "valueCode": "candidate"
                },
                {
                  "url": "valueSet",
                  "valueCanonical": "https://fhir.infoway-inforoute.ca/ValueSet/LicensedNaturalHealthProducts"
                },
                {
                  "url": "documentation",
                  "valueMarkdown": "ValusSet of Licensed Natural Health Products"
                }
              ],
              "url": "http://hl7.org/fhir/tools/StructureDefinition/additional-binding"
            }
          ]
        },
        "mapping": [
          {
            "identity": "CACDI",
            "map": "Allergy or Intolerance"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.patient",
        "path": "AllergyIntolerance.patient",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.infoway-inforoute.ca/cacore/StructureDefinition/patient-ca-core"
            ]
          }
        ]
      },
      {
        "id": "AllergyIntolerance.encounter",
        "path": "AllergyIntolerance.encounter",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.infoway-inforoute.ca/cacore/StructureDefinition/encounter-ca-core"
            ]
          }
        ]
      },
      {
        "id": "AllergyIntolerance.onset[x]",
        "path": "AllergyIntolerance.onset[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "AllergyIntolerance.onset[x]:onsetDateTime",
        "path": "AllergyIntolerance.onset[x]",
        "sliceName": "onsetDateTime",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.recorder",
        "path": "AllergyIntolerance.recorder",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.infoway-inforoute.ca/cacore/StructureDefinition/practitioner-ca-core",
              "http://fhir.infoway-inforoute.ca/cacore/StructureDefinition/practitionerRole-ca-core",
              "http://fhir.infoway-inforoute.ca/cacore/StructureDefinition/patient-ca-core",
              "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
            ]
          }
        ]
      },
      {
        "id": "AllergyIntolerance.asserter",
        "path": "AllergyIntolerance.asserter",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.infoway-inforoute.ca/cacore/StructureDefinition/practitioner-ca-core",
              "http://fhir.infoway-inforoute.ca/cacore/StructureDefinition/practitionerRole-ca-core",
              "http://fhir.infoway-inforoute.ca/cacore/StructureDefinition/patient-ca-core",
              "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
            ]
          }
        ]
      },
      {
        "id": "AllergyIntolerance.reaction",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/obligation",
            "extension": [
              {
                "url": "code",
                "valueCode": "MAY:populate-if-known"
              },
              {
                "url": "actor",
                "valueCanonical": "http://fhir.infoway-inforoute.ca/ca-core/ActorDefinition/producer"
              }
            ]
          },
          {
            "extension": [
              {
                "url": "code",
                "valueCode": "SHALL:no-error"
              },
              {
                "url": "actor",
                "valueCanonical": "http://fhir.infoway-inforoute.ca/ca-core/ActorDefinition/consumer"
              }
            ],
            "url": "http://hl7.org/fhir/StructureDefinition/obligation"
          }
        ],
        "path": "AllergyIntolerance.reaction"
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/obligation",
            "extension": [
              {
                "url": "code",
                "valueCode": "MAY:populate-if-known"
              },
              {
                "url": "actor",
                "valueCanonical": "http://fhir.infoway-inforoute.ca/ca-core/ActorDefinition/producer"
              }
            ]
          },
          {
            "extension": [
              {
                "url": "code",
                "valueCode": "SHALL:no-error"
              },
              {
                "url": "actor",
                "valueCanonical": "http://fhir.infoway-inforoute.ca/ca-core/ActorDefinition/consumer"
              }
            ],
            "url": "http://hl7.org/fhir/StructureDefinition/obligation"
          }
        ],
        "path": "AllergyIntolerance.reaction.manifestation",
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "http://fhir.infoway-inforoute.ca/cacore/StructureDefinition/codeableconcept-ca-core"
            ]
          }
        ],
        "binding": {
          "strength": "preferred",
          "valueSet": "https://fhir.infoway-inforoute.ca/ValueSet/clinicalfindingcode"
        },
        "mapping": [
          {
            "identity": "CACDI",
            "map": "Allergy or Intolerance Reaction"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation.coding",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/obligation",
            "extension": [
              {
                "url": "code",
                "valueCode": "MAY:populate-if-known"
              },
              {
                "url": "actor",
                "valueCanonical": "http://fhir.infoway-inforoute.ca/ca-core/ActorDefinition/producer"
              }
            ]
          },
          {
            "extension": [
              {
                "url": "code",
                "valueCode": "SHALL:no-error"
              },
              {
                "url": "actor",
                "valueCanonical": "http://fhir.infoway-inforoute.ca/ca-core/ActorDefinition/consumer"
              }
            ],
            "url": "http://hl7.org/fhir/StructureDefinition/obligation"
          }
        ],
        "path": "AllergyIntolerance.reaction.manifestation.coding"
      }
    ]
  }
}