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