{
  "resourceType": "StructureDefinition",
  "id": "pr-allergy-intolerance",
  "meta": {
    "source": "https://www.icanbwell.com/fhir_profile_definitions",
    "security": [
      {
        "system": "https://www.icanbwell.com/owner",
        "code": "bwell"
      },
      {
        "system": "https://www.icanbwell.com/access",
        "code": "bwell"
      }
    ]
  },
  "url": "https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-allergy-intolerance",
  "version": "1.00",
  "name": "AllergyIntolerance",
  "title": "Profile: Allergy Intolerance",
  "status": "active",
  "experimental": false,
  "date": "2022-07-27",
  "publisher": "b.Well Connected Health",
  "description": "Allergies and reactions",
  "jurisdiction": [
    {
      "coding": [
        {
          "system": "urn:iso:std:iso:3166",
          "code": "US",
          "display": "United States of America"
        }
      ],
      "text": "United States of America"
    }
  ],
  "fhirVersion": "4.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "AllergyIntolerance",
  "baseDefinition": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "AllergyIntolerance",
        "path": "AllergyIntolerance"
      },
      {
        "id": "AllergyIntolerance.id",
        "path": "AllergyIntolerance.id"
      },
      {
        "id": "AllergyIntolerance.meta",
        "path": "AllergyIntolerance.meta",
        "label": "meta",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Meta"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.meta.source",
        "path": "AllergyIntolerance.meta.source",
        "sliceName": "meta-source",
        "label": "meta",
        "short": "uri of the data source",
        "definition": "Typically the data owner's URL followed by a source/file description",
        "requirements": "mandatory for all resources in bWell's FHIR Server",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "uri"
          }
        ],
        "example": [
          {
            "label": "example of meta.source",
            "valueUri": "https://www.icanbwell.com/provider-directory"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.meta.security",
        "path": "AllergyIntolerance.meta.security",
        "sliceName": "meta-security",
        "label": "meta",
        "short": "security tags representing the data's owner, vendor, and accessibility",
        "definition": "data owner: \n \n data vendor: \n \n data access: ",
        "requirements": "/owner & /access are mandatory for all resources in bWell's FHIR Server",
        "min": 1,
        "max": "*",
        "type": [
          {
            "code": "Coding"
          }
        ],
        "example": [
          {
            "label": "example of data owner security tag",
            "valueCoding": {
              "system": "https://www.icanbwell.com/owner",
              "code": "bwell"
            }
          },
          {
            "label": "example of data access security tag",
            "valueCoding": {
              "system": "https://www.icanbwell.com/access",
              "code": "bwell"
            }
          },
          {
            "label": "example of data vendor security tag",
            "valueCoding": {
              "system": "https://www.icanbwell.com/vendor",
              "code": "bwell"
            }
          }
        ]
      },
      {
        "id": "de-identifier",
        "path": "AllergyIntolerance.identifier",
        "label": "identifier",
        "slicing": {
          "description": "slice by types",
          "rules": "open"
        },
        "short": "a value to identify the resource by",
        "type": [
          {
            "code": "Identifier"
          }
        ]
      },
      {
        "id": "identifier.id",
        "path": "AllergyIntolerance.identifier.id",
        "label": "identifier",
        "short": "set case-by-case",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "identifier.use",
        "path": "AllergyIntolerance.identifier.use",
        "label": "identifier",
        "short": "usual | official | temp | secondary | old (If known)",
        "definition": "The purpose of this identifier.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.clinicalStatus",
        "path": "AllergyIntolerance.clinicalStatus",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.verificationStatus",
        "path": "AllergyIntolerance.verificationStatus",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.type",
        "path": "AllergyIntolerance.type",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.category",
        "path": "AllergyIntolerance.category",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "code"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.criticality",
        "path": "AllergyIntolerance.criticality",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.code",
        "path": "AllergyIntolerance.code",
        "short": "The allergen",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "example": [
          {
            "label": "allergy-snomed",
            "valueCodeableConcept": {
              "coding": [
                {
                  "system": "http://snomed.info/sct",
                  "code": "227493005",
                  "display": "Cashew nuts"
                }
              ],
              "text": "Cashews"
            }
          }
        ]
      },
      {
        "id": "AllergyIntolerance.patient",
        "path": "AllergyIntolerance.patient",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-patient"
            ]
          }
        ]
      },
      {
        "id": "AllergyIntolerance.onsetDateTime",
        "path": "AllergyIntolerance.onset[x]",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.recordedDate",
        "path": "AllergyIntolerance.recordedDate",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.recorder",
        "path": "AllergyIntolerance.recorder",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.asserter",
        "path": "AllergyIntolerance.asserter",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.lastOccurrence",
        "path": "AllergyIntolerance.lastOccurrence",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.reaction",
        "path": "AllergyIntolerance.reaction",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "BackboneElement"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.reaction.id",
        "path": "AllergyIntolerance.reaction.id",
        "min": 1,
        "max": "1"
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation",
        "path": "AllergyIntolerance.reaction.manifestation",
        "min": 1,
        "max": "*",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.reaction.description",
        "path": "AllergyIntolerance.reaction.description",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.reaction.onset",
        "path": "AllergyIntolerance.reaction.onset",
        "short": "Onset of the particular reaction (not of the actual allergy)",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "AllergyIntolerance.reaction.severity",
        "path": "AllergyIntolerance.reaction.severity",
        "short": "Severity of the particular reaction (not of the actual allergy)",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ]
      }
    ]
  }
}