{
  "resourceType": "StructureDefinition",
  "id": "biobankcy-sd-allergyIntollerance",
  "url": "http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-allergyIntollerance",
  "name": "BIOBANKCYSDAllergyIntolerance",
  "title": "Profile: AllergyIntolerance (biobank.cy)",
  "status": "draft",
  "publisher": "biobank.cy",
  "contact": [
    {
      "name": "Molecular Medicine Research Center (MMRC)",
      "telecom": [
        {
          "system": "email",
          "value": "biobank@ucy.ac.cy",
          "use": "work"
        }
      ]
    }
  ],
  "description": "Represents an allergy of a donor (research subject) of the biobank.cy. The allergy can be self-reported by the patient or reported by a medical doctor or nurse.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "AllergyIntolerance",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "AllergyIntolerance",
        "path": "AllergyIntolerance",
        "definition": "Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance.\r\n\r\nCyprusEHR: This profile is designed to meet the requirements of the patient summary and the value sets from eHDSI."
      },
      {
        "id": "AllergyIntolerance.extension",
        "path": "AllergyIntolerance.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "AllergyIntolerance.extension:abatement-datetime",
        "path": "AllergyIntolerance.extension",
        "sliceName": "abatement-datetime",
        "short": "Date(/time) of the end date of a reaction.",
        "definition": "Date of resolution of the allergy (e.g. when the clinician deemed there is no longer any need to track the underlying condition)",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/uv/ips/StructureDefinition/abatement-dateTime-uv-ips"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "AllergyIntolerance.extension:abatement-datetime.url",
        "path": "AllergyIntolerance.extension.url",
        "fixedUri": "http://hl7.org/fhir/uv/ips/StructureDefinition/abatement-dateTime-uv-ips"
      },
      {
        "id": "AllergyIntolerance.type",
        "path": "AllergyIntolerance.type",
        "definition": "This element describes whether this condition refers to an allergy or non-allergy intolerance.",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "description": "Identification of the underlying physiological mechanism for a Reaction Risk. Use ConceptMap CYEHRCMAllergyTypeSnomed2HL7FHIR to map terminology used for internal use (CYEHRVSEHDSIAdverseEventType) to profile terminology in valueSet AllergyIntoleranceClinicalStatusCodes.",
          "valueSet": "http://hl7.org/fhir/ValueSet/allergy-intolerance-type|4.0.1",
          "_valueSet": {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/11179-permitted-value-conceptmap",
                "valueCanonical": "http://ig.ehealth4u.eu/fhir/ConceptMap/cyehr-cm-allergytype-snomed2hl7fhir"
              }
            ]
          }
        }
      },
      {
        "id": "AllergyIntolerance.type.extension",
        "path": "AllergyIntolerance.type.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "AllergyIntolerance.type.extension:eHDSIAdverseEventTypeCode",
        "path": "AllergyIntolerance.type.extension",
        "sliceName": "eHDSIAdverseEventTypeCode",
        "short": "eHDSI Adverse Event Type Code",
        "definition": "This extension is added here to include the required eHDSI value set.",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.\n\n CyprusEHR: The concept map between the FHIR bound value set and the eHDSIAdverseEventType value set is:\n\n | HL7 FHIR: | Allergy | Intolerance |\n|--\n| **eHDSI:** |  |  | \n| Allergic disposition  | X  |  |\n| Propensity to adverse reaction | X |  |\n| Intolerance | | X |\n\n\n **See:** http://ig.ehealth4u.eu/fhir/ConceptMap/cyehr-cm-allergytype-snomed2hl7fhir",
        "requirements": "CyprusEHR: The binding strength of the valueset of thi element is required with cardinality 0..1 and therefore using a different valueset to represent these values is not allowed. To address the need of having codes as used for the eHDSI services, we adopt the values set as defined by FHIR for this element and we also use an extra code to define in  more detail the value of this element. Therefore, allergy type can be described by the code \"allergy\" from the required FHIR valueset and  \"Propensity to adverse reaction\" or \"Allergic disposition\" from the eHDSI MVC value set.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-extracode"
            ]
          }
        ],
        "mustSupport": true,
        "isModifier": false
      },
      {
        "id": "AllergyIntolerance.type.extension:eHDSIAdverseEventTypeCode.url",
        "path": "AllergyIntolerance.type.extension.url",
        "fixedUri": "http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-extracode"
      },
      {
        "id": "AllergyIntolerance.type.extension:eHDSIAdverseEventTypeCode.value[x]",
        "path": "AllergyIntolerance.type.extension.value[x]",
        "short": "Binding to the eHDSI value set for \"Adverse Event Type\".",
        "definition": "Binding to include the required eHDSI value set. This covers additional values such as drug allergy, food allergy, allergy to substance etc.",
        "min": 1,
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsiadverseeventtype"
        }
      },
      {
        "id": "AllergyIntolerance.type.extension:eHDSIAdverseEventTypeCode.value[x].coding",
        "path": "AllergyIntolerance.type.extension.value[x].coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "AllergyIntolerance.type.extension:eHDSIAdverseEventTypeCode.value[x].coding.system",
        "path": "AllergyIntolerance.type.extension.value[x].coding.system",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.type.extension:eHDSIAdverseEventTypeCode.value[x].coding.code",
        "path": "AllergyIntolerance.type.extension.value[x].coding.code",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.type.extension:eHDSIAdverseEventTypeCode.value[x].coding.display",
        "path": "AllergyIntolerance.type.extension.value[x].coding.display",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.category",
        "path": "AllergyIntolerance.category",
        "mustSupport": true
      },
      {
        "id": "AllergyIntolerance.criticality",
        "path": "AllergyIntolerance.criticality",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://hl7.org/fhir/ValueSet/allergy-intolerance-criticality"
        }
      },
      {
        "id": "AllergyIntolerance.code",
        "path": "AllergyIntolerance.code",
        "short": "Codeable concept for allergy to drugs, no drugs or unknown allergy intolerance.",
        "min": 1,
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips"
            ]
          }
        ],
        "mustSupport": true,
        "binding": {
          "strength": "example",
          "description": "Code that identifies the allergy or intolerance"
        }
      },
      {
        "id": "AllergyIntolerance.code.coding",
        "path": "AllergyIntolerance.code.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "AllergyIntolerance.code.coding.system",
        "path": "AllergyIntolerance.code.coding.system",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.code.coding.code",
        "path": "AllergyIntolerance.code.coding.code",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.code.coding.display",
        "path": "AllergyIntolerance.code.coding.display",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.code.coding:allergyIntoleranceDrugs",
        "path": "AllergyIntolerance.code.coding",
        "sliceName": "allergyIntoleranceDrugs",
        "short": "Codes for \"drugs allergy\" from the eHDSI value set.",
        "definition": "Codes for \"drugs allergy\" from the eHDSI value set (Active Ingredient).",
        "binding": {
          "strength": "required",
          "description": "Codes for drugs.",
          "valueSet": "http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsiactiveingredient"
        }
      },
      {
        "id": "AllergyIntolerance.code.coding:allergyIntoleranceDrugs.system",
        "path": "AllergyIntolerance.code.coding.system",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.code.coding:allergyIntoleranceDrugs.code",
        "path": "AllergyIntolerance.code.coding.code",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.code.coding:allergyIntoleranceDrugs.display",
        "path": "AllergyIntolerance.code.coding.display",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.code.coding:allergyIntoleranceNoDrugs",
        "path": "AllergyIntolerance.code.coding",
        "sliceName": "allergyIntoleranceNoDrugs",
        "short": "Codes for \"no drugs allergy\" from the eHDSI value set.",
        "definition": "Codes for \"no drugs allergy\" from the eHDSI value set (Allergen no drug).",
        "binding": {
          "strength": "required",
          "description": "Codes for no drugs.",
          "valueSet": "http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsiallergennodrug"
        }
      },
      {
        "id": "AllergyIntolerance.code.coding:allergyIntoleranceNoDrugs.system",
        "path": "AllergyIntolerance.code.coding.system",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.code.coding:allergyIntoleranceNoDrugs.code",
        "path": "AllergyIntolerance.code.coding.code",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.code.coding:allergyIntoleranceNoDrugs.display",
        "path": "AllergyIntolerance.code.coding.display",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.code.coding:absentOrUnknownAllergyIntolerance",
        "path": "AllergyIntolerance.code.coding",
        "sliceName": "absentOrUnknownAllergyIntolerance",
        "short": "Codes for \"absent or unknown allergy intolerance\" from the eHDSI value set.",
        "definition": "Codes for \"absent or unknown allergy intolerance\" from the eHDSI value set (absent or unknown allergy).",
        "binding": {
          "strength": "required",
          "description": "negation/exclusion codes for reporting no known allergies or not available data.",
          "valueSet": "http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsiabsentorunknownallergy"
        }
      },
      {
        "id": "AllergyIntolerance.code.coding:absentOrUnknownAllergyIntolerance.system",
        "path": "AllergyIntolerance.code.coding.system",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.code.coding:absentOrUnknownAllergyIntolerance.code",
        "path": "AllergyIntolerance.code.coding.code",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.code.coding:absentOrUnknownAllergyIntolerance.display",
        "path": "AllergyIntolerance.code.coding.display",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.patient",
        "path": "AllergyIntolerance.patient",
        "comment": "For biobank.cy data warehouse use either the biobankcy-sd-citizen (if the patient receives biobank.cy services for diagnostic puprposes) or biobankcy-sd-donor (if the patient receives biobank.cy services for research purposes).\r\n\r\nFHIR core resrouce Patient is also included for storing patients received by other biobank or research organizations. In case this is not desired the FHIR core Patient resource should be removed from the target profiles.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-donor",
              "http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-citizen"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "AllergyIntolerance.patient.reference",
        "path": "AllergyIntolerance.patient.reference",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "AllergyIntolerance.encounter",
        "path": "AllergyIntolerance.encounter",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Encounter",
              "http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-visit"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "AllergyIntolerance.encounter.reference",
        "path": "AllergyIntolerance.encounter.reference",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.onset[x]",
        "path": "AllergyIntolerance.onset[x]",
        "type": [
          {
            "code": "dateTime"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "AllergyIntolerance.recorder",
        "path": "AllergyIntolerance.recorder",
        "comment": "For biobank.cy this shall be the nurse or any other practitioner who recorded this information.",
        "mustSupport": true
      },
      {
        "id": "AllergyIntolerance.recorder.reference",
        "path": "AllergyIntolerance.recorder.reference",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.reaction",
        "path": "AllergyIntolerance.reaction",
        "mustSupport": true
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation",
        "path": "AllergyIntolerance.reaction.manifestation",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation.coding",
        "path": "AllergyIntolerance.reaction.manifestation.coding",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation.coding.system",
        "path": "AllergyIntolerance.reaction.manifestation.coding.system",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation.coding.code",
        "path": "AllergyIntolerance.reaction.manifestation.coding.code",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation.coding.display",
        "path": "AllergyIntolerance.reaction.manifestation.coding.display",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation:allergyIntoleranceReactionManifestationGPSCode",
        "path": "AllergyIntolerance.reaction.manifestation",
        "sliceName": "allergyIntoleranceReactionManifestationGPSCode",
        "short": "eHDSI value set for reaction allergy.",
        "definition": "eHDSI value set for reaction allergy.",
        "min": 1,
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips"
            ]
          }
        ],
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsireactionallergy"
        }
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation:allergyIntoleranceReactionManifestationGPSCode.coding",
        "path": "AllergyIntolerance.reaction.manifestation.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation:allergyIntoleranceReactionManifestationGPSCode.coding.system",
        "path": "AllergyIntolerance.reaction.manifestation.coding.system",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation:allergyIntoleranceReactionManifestationGPSCode.coding.code",
        "path": "AllergyIntolerance.reaction.manifestation.coding.code",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation:allergyIntoleranceReactionManifestationGPSCode.coding.display",
        "path": "AllergyIntolerance.reaction.manifestation.coding.display",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.reaction.onset",
        "path": "AllergyIntolerance.reaction.onset",
        "mustSupport": true
      },
      {
        "id": "AllergyIntolerance.reaction.severity",
        "path": "AllergyIntolerance.reaction.severity",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "description": "Clinical assessment of the severity of a reaction event as a whole, potentially considering multiple different manifestations. Use ConceptMap CYEHRCMAllergyReactionSeveritySnomed2HL7FHIR to map terminology used for internal use (CYEHRVSEHDSISeverity) to profile terminology in valueSet AllergyIntoleranceSeverity.",
          "valueSet": "http://hl7.org/fhir/ValueSet/reaction-event-severity|4.0.1",
          "_valueSet": {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/11179-permitted-value-conceptmap",
                "valueCanonical": "http://ig.ehealth4u.eu/fhir/ConceptMap/cyehr-cm-allergyreactionseverity-snomed2hl7fhir"
              }
            ]
          }
        }
      },
      {
        "id": "AllergyIntolerance.reaction.severity.extension",
        "path": "AllergyIntolerance.reaction.severity.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "AllergyIntolerance.reaction.severity.extension:eHDSISeverityCode",
        "path": "AllergyIntolerance.reaction.severity.extension",
        "sliceName": "eHDSISeverityCode",
        "short": "eHDSI Severity Code",
        "definition": "This extension is added here to include the required eHDSI value set. This covers additional values such as \"life threatening severity\", \"mild to moderate\", \"moderate to severe\".",
        "comment": "The concept map between the FHIR bound value set and the eHDSISeverity value set is:\r\n\r\n|Severity| | | |\r\n|--\r\n| HL7 FHIR: | Mild | Moderate | Severe|\n| **eHDSI:** |  |  |  |  \n| Life threatening severity|   |  | X | \n|Mild| X |  |  | \n| Mild to moderate| | X |  | \n| Moderate |  | X |  |\r\n| Moderate to severe |  |  | X |\r\n| Severe|  |  | X |\r\n\r\n**See:** http://ig.ehealth4u.eu/fhir/ConceptMap/cyehr-cm-allergyreactionseverity-snomed2hl7fhir",
        "requirements": "CyprusEHR: The binding strength of the valueset of thi element is required with cardinality 0..1 and therefore using a different valueset to represent these values is not allowed. To address the need of having codes as used for the eHDSI services, we adopt the values set as defined by FHIR for this element and we also use an extra code to define in  more detail the value of this element. Therefore, reaction severity can be described by the code \"mild\" from the required FHIR valueset and \"Mild to moderate\" or \"Moderate\" from the eHDSI MVC value set.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-extracode"
            ]
          }
        ],
        "mustSupport": true,
        "isModifier": false
      },
      {
        "id": "AllergyIntolerance.reaction.severity.extension:eHDSISeverityCode.url",
        "path": "AllergyIntolerance.reaction.severity.extension.url",
        "fixedUri": "http://ig.ehealth4u.eu/fhir/StructureDefinition/cyehr-ext-extracode"
      },
      {
        "id": "AllergyIntolerance.reaction.severity.extension:eHDSISeverityCode.value[x]",
        "path": "AllergyIntolerance.reaction.severity.extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "http://ig.ehealth4u.eu/fhir/ValueSet/cyehr-vs-ehdsiseverity"
        }
      },
      {
        "id": "AllergyIntolerance.reaction.severity.extension:eHDSISeverityCode.value[x].coding",
        "path": "AllergyIntolerance.reaction.severity.extension.value[x].coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "AllergyIntolerance.reaction.severity.extension:eHDSISeverityCode.value[x].coding.system",
        "path": "AllergyIntolerance.reaction.severity.extension.value[x].coding.system",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.reaction.severity.extension:eHDSISeverityCode.value[x].coding.code",
        "path": "AllergyIntolerance.reaction.severity.extension.value[x].coding.code",
        "min": 1
      },
      {
        "id": "AllergyIntolerance.reaction.severity.extension:eHDSISeverityCode.value[x].coding.display",
        "path": "AllergyIntolerance.reaction.severity.extension.value[x].coding.display",
        "min": 1
      }
    ]
  }
}