{
  "resourceType": "StructureDefinition",
  "id": "PatientAllergy",
  "url": "http://hl7.org/fhir/us/bser/StructureDefinition/PatientAllergy",
  "name": "BSeR Patient Allergy",
  "status": "draft",
  "publisher": "Hi3 Solutions",
  "contact": [
    {
      "name": "AbdulMalik Shakir",
      "telecom": [
        {
          "system": "phone",
          "value": "6266444491",
          "use": "work"
        },
        {
          "system": "email",
          "value": "abdulmalik.shakir@hi3solutions.com",
          "use": "work"
        }
      ]
    }
  ],
  "kind": "resource",
  "abstract": false,
  "contextType": "resource",
  "context": [
    "AllergyIntolerance"
  ],
  "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",
        "short": "id",
        "definition": "MAY contain zero or one [0..1] id (CONF:4383-819).",
        "min": 0,
        "max": "1"
      },
      {
        "id": "AllergyIntolerance.meta",
        "path": "AllergyIntolerance.meta",
        "short": "meta",
        "definition": "MAY contain zero or one [0..1] meta (CONF:4383-818).",
        "min": 0,
        "max": "1"
      },
      {
        "id": "AllergyIntolerance.meta.profile",
        "path": "AllergyIntolerance.meta.profile",
        "short": "profile",
        "definition": "The meta, if present, SHALL contain exactly one [1..1] profile=\"http://hl7.org/fhir/us/bser/StructureDefinition/PatientAllergy\" (CONF:4383-820).",
        "min": 1,
        "max": "1",
        "patternString": "http://hl7.org/fhir/us/bser/StructureDefinition/PatientAllergy"
      },
      {
        "id": "AllergyIntolerance.verificationStatus",
        "path": "AllergyIntolerance.verificationStatus",
        "short": "verificationStatus",
        "definition": "SHALL contain exactly one [1..1] verificationStatus, which SHALL be selected from ValueSet Allergy-verification-status http://hl7.org/fhir/ValueSet/allergy-verification-status DYNAMIC (CONF:4383-294).",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ],
        "binding": {
          "strength": "required",
          "valueSetReference": {
            "reference": "http://hl7.org/fhir/ValueSet/allergy-verification-status",
            "display": "Allergy-verification-status"
          }
        }
      },
      {
        "id": "AllergyIntolerance.type",
        "path": "AllergyIntolerance.type",
        "short": "type",
        "definition": "SHALL contain exactly one [1..1] type, which SHALL be selected from ValueSet Allergy-intolerance-type http://hl7.org/fhir/ValueSet/allergy-intolerance-type DYNAMIC (CONF:4383-295).",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ],
        "binding": {
          "strength": "required",
          "valueSetReference": {
            "reference": "http://hl7.org/fhir/ValueSet/allergy-intolerance-type",
            "display": "Allergy-intolerance-type"
          }
        }
      },
      {
        "id": "AllergyIntolerance.code",
        "path": "AllergyIntolerance.code",
        "short": "code",
        "definition": "SHALL contain exactly one [1..1] code, which SHALL be selected from ValueSet Allergyintolerance-code http://hl7.org/fhir/ValueSet/allergyintolerance-code DYNAMIC (CONF:4383-296).",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "strength": "required",
          "valueSetReference": {
            "reference": "http://hl7.org/fhir/ValueSet/allergyintolerance-code",
            "display": "Allergyintolerance-code"
          }
        }
      },
      {
        "id": "AllergyIntolerance.patient",
        "path": "AllergyIntolerance.patient",
        "short": "patient",
        "definition": "SHALL contain exactly one [1..1] =\"BSeR Patient\"BSeR Patient (identifier: http://hl7.org/fhir/us/bser/StructureDefinition/PatientRole) (CONF:4383-292).",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/us/bser/StructureDefinition/PatientRole"
          }
        ],
        "patternString": "BSeR Patient"
      },
      {
        "id": "AllergyIntolerance.onset[x]",
        "path": "AllergyIntolerance.onset[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "short": "onset[x]",
        "definition": "MAY contain zero or one [0..1] onset[x], where onset[x] is one of (CONF:4383-293)",
        "min": 0,
        "max": "1"
      },
      {
        "id": "AllergyIntolerance.onset[x]:onsetDateTime",
        "path": "AllergyIntolerance.onsetDateTime",
        "sliceName": "onsetDateTime",
        "short": "onsetDateTime",
        "definition": "onsetDateTime (CONF:4383-297)"
      },
      {
        "id": "AllergyIntolerance.onset[x]:onsetAge",
        "path": "AllergyIntolerance.onsetAge",
        "sliceName": "onsetAge",
        "short": "onsetAge",
        "definition": "or onsetAge (CONF:4383-298)"
      },
      {
        "id": "AllergyIntolerance.reaction",
        "path": "AllergyIntolerance.reaction",
        "short": "reaction",
        "definition": "SHALL contain at least one [1..*] reaction (CONF:4383-299).",
        "min": 1,
        "max": "*"
      },
      {
        "id": "AllergyIntolerance.reaction.substance",
        "path": "AllergyIntolerance.reaction.substance",
        "short": "substance",
        "definition": "Such reactions SHALL contain exactly one [1..1] substance, which SHALL be selected from ValueSet Substance-code http://hl7.org/fhir/ValueSet/substance-code DYNAMIC (CONF:4383-300).",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "strength": "required",
          "valueSetReference": {
            "reference": "http://hl7.org/fhir/ValueSet/substance-code",
            "display": "Substance-code"
          }
        }
      },
      {
        "id": "AllergyIntolerance.reaction.manifestation",
        "path": "AllergyIntolerance.reaction.manifestation",
        "short": "manifestation",
        "definition": "Such reactions SHALL contain at least one [1..*] manifestation, which SHALL be selected from ValueSet Clinical-findings http://hl7.org/fhir/ValueSet/clinical-findings DYNAMIC (CONF:4383-301).",
        "min": 1,
        "max": "*",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "strength": "required",
          "valueSetReference": {
            "reference": "http://hl7.org/fhir/ValueSet/clinical-findings",
            "display": "Clinical-findings"
          }
        }
      },
      {
        "id": "AllergyIntolerance.reaction.severity",
        "path": "AllergyIntolerance.reaction.severity",
        "short": "severity",
        "definition": "Such reactions SHALL contain exactly one [1..1] severity, which SHALL be selected from ValueSet Reaction-event-severity http://hl7.org/fhir/ValueSet/reaction-event-severity DYNAMIC (CONF:4383-302).",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ],
        "binding": {
          "strength": "required",
          "valueSetReference": {
            "reference": "http://hl7.org/fhir/ValueSet/reaction-event-severity",
            "display": "Reaction-event-severity"
          }
        }
      }
    ]
  }
}