<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="Allergies" />
  <extension url="http://clinfhir.com/fhir/StructureDefinition/baseTypeForModel">
    <valueString value="AllergyIntolerance" />
  </extension>
  <url value="http://hapi.fhir.org/baseR4/StructureDefinition/Allergies" />
  <identifier>
    <system value="http://clinfhir.com" />
    <value value="author" />
  </identifier>
  <name value="Allergies" />
  <title value="Alleries Desc" />
  <status value="draft" />
  <date value="2022-04-27T13:24:14-04:00" />
  <publisher value="Test Pub" />
  <purpose value="vffv" />
  <keyword>
    <system value="http://fhir.hl7.org.nz/NamingSystem/application" />
    <code value="clinfhir" />
  </keyword>
  <kind value="logical" />
  <abstract value="false" />
  <type value="Allergies" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Element" />
  <derivation value="specialization" />
  <snapshot>
    <element id="Allergies">
      <path value="Allergies" />
      <label value="Allergies" />
      <definition value="No description" />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Allergies" />
        <min value="0" />
        <max value="1" />
      </base>
    </element>
    <element id="Allergies.identifier">
      <path value="Allergies.identifier" />
      <label value="identifier" />
      <short value="External ids for this item" />
      <definition value="Business identifiers assigned to this AllergyIntolerance by the performer or other systems which remain constant as the resource is updated and propagates from server to server." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Allergies.identifier" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Identifier" />
      </type>
      <type>
        <code value="Age" />
      </type>
      <mustSupport value="false" />
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.identifier|" />
      </mapping>
    </element>
    <element id="Allergies.clinicalStatus">
      <path value="Allergies.clinicalStatus" />
      <label value="clinicalStatus" />
      <short value="active | inactive | resolved" />
      <definition value="The clinical status of the allergy or intolerance." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Allergies.clinicalStatus" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="AllergyIntoleranceClinicalStatus" />
        </extension>
        <strength value="required" />
        <description value="The clinical status of the allergy or intolerance." />
        <valueSet value="http://hl7.org/fhir/ValueSet/allergyintolerance-clinical|4.0.1" />
      </binding>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.clinicalStatus|" />
      </mapping>
    </element>
    <element id="Allergies.verificationStatus">
      <path value="Allergies.verificationStatus" />
      <label value="verificationStatus" />
      <short value="unconfirmed | confirmed | refuted | entered-in-error" />
      <definition value="Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product)." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Allergies.verificationStatus" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="AllergyIntoleranceVerificationStatus" />
        </extension>
        <strength value="required" />
        <description value="Assertion about certainty associated with a propensity, or potential risk, of a reaction to the identified substance." />
        <valueSet value="http://hl7.org/fhir/ValueSet/allergyintolerance-verification|4.0.1" />
      </binding>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.verificationStatus|" />
      </mapping>
    </element>
    <element id="Allergies.type">
      <path value="Allergies.type" />
      <label value="type" />
      <short value="allergy | intolerance - Underlying mechanism (if known)" />
      <definition value="Identification of the underlying physiological mechanism for the reaction risk." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Allergies.type" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="AllergyIntoleranceType" />
        </extension>
        <strength value="required" />
        <description value="Identification of the underlying physiological mechanism for a Reaction Risk." />
        <valueSet value="http://hl7.org/fhir/ValueSet/allergy-intolerance-type|4.0.1" />
      </binding>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.type|" />
      </mapping>
    </element>
    <element id="Allergies.category">
      <path value="Allergies.category" />
      <label value="category" />
      <short value="food | medication | environment | biologic" />
      <definition value="Category of the identified substance." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Allergies.category" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="AllergyIntoleranceCategory" />
        </extension>
        <strength value="required" />
        <description value="Category of an identified substance associated with allergies or intolerances." />
        <valueSet value="http://hl7.org/fhir/ValueSet/allergy-intolerance-category|4.0.1" />
      </binding>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.category|" />
      </mapping>
    </element>
    <element id="Allergies.criticality">
      <path value="Allergies.criticality" />
      <label value="criticality" />
      <short value="low | high | unable-to-assess" />
      <definition value="Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Allergies.criticality" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="AllergyIntoleranceCriticality" />
        </extension>
        <strength value="required" />
        <description value="Estimate of the potential clinical harm, or seriousness, of a reaction to an identified substance." />
        <valueSet value="http://hl7.org/fhir/ValueSet/allergy-intolerance-criticality|4.0.1" />
      </binding>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.criticality|" />
      </mapping>
    </element>
    <element id="Allergies.code">
      <path value="Allergies.code" />
      <label value="code" />
      <short value="Code that identifies the allergy or intolerance" />
      <definition value="Code for an allergy or intolerance statement (either a positive or a negated/excluded statement).  This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., &quot;Latex&quot;), an allergy or intolerance condition (e.g., &quot;Latex allergy&quot;), or a negated/excluded code for a specific substance or class (e.g., &quot;No latex allergy&quot;) or a general or categorical negated statement (e.g.,  &quot;No known allergy&quot;, &quot;No known drug allergies&quot;).  Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Allergies.code" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="AllergyIntoleranceCode" />
        </extension>
        <strength value="example" />
        <description value="Type of the substance/product, allergy or intolerance condition, or negation/exclusion codes for reporting no known allergies." />
        <valueSet value="http://hl7.org/fhir/ValueSet/allergyintolerance-code" />
      </binding>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.code|" />
      </mapping>
    </element>
    <element id="Allergies.patient">
      <path value="Allergies.patient" />
      <label value="patient" />
      <short value="Who the sensitivity is for" />
      <definition value="The patient who has the allergy or intolerance." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Allergies.patient" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.patient|" />
      </mapping>
    </element>
    <element id="Allergies.encounter">
      <path value="Allergies.encounter" />
      <label value="encounter" />
      <short value="Encounter when the allergy or intolerance was asserted" />
      <definition value="The encounter when the allergy or intolerance was asserted." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Allergies.encounter" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Encounter" />
      </type>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.encounter|" />
      </mapping>
    </element>
    <element id="Allergies.onset[x]">
      <path value="Allergies.onset[x]" />
      <label value="onset[x]" />
      <short value="When allergy or intolerance was identified" />
      <definition value="Estimated or actual date,  date-time, or age when allergy or intolerance was identified." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Allergies.onset[x]" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <type>
        <code value="Age" />
      </type>
      <type>
        <code value="Period" />
      </type>
      <type>
        <code value="Range" />
      </type>
      <type>
        <code value="string" />
      </type>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.onset[x]|" />
      </mapping>
    </element>
    <element id="Allergies.recordedDate">
      <path value="Allergies.recordedDate" />
      <label value="recordedDate" />
      <short value="Date first version of the resource instance was recorded" />
      <definition value="The recordedDate represents when this particular AllergyIntolerance record was created in the system, which is often a system-generated date." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Allergies.recordedDate" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.recordedDate|" />
      </mapping>
    </element>
    <element id="Allergies.recorder">
      <path value="Allergies.recorder" />
      <label value="recorder" />
      <short value="Who recorded the sensitivity" />
      <definition value="Individual who recorded the record and takes responsibility for its content." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Allergies.recorder" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
      </type>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.recorder|" />
      </mapping>
    </element>
    <element id="Allergies.asserter">
      <path value="Allergies.asserter" />
      <label value="asserter" />
      <short value="Source of the information about the allergy" />
      <definition value="The source of the information about the allergy that is recorded." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Allergies.asserter" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/PractitionerRole" />
      </type>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.asserter|" />
      </mapping>
    </element>
    <element id="Allergies.lastOccurrence">
      <path value="Allergies.lastOccurrence" />
      <label value="lastOccurrence" />
      <short value="Date(/time) of last known occurrence of a reaction" />
      <definition value="Represents the date and/or time of the last known occurrence of a reaction event." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Allergies.lastOccurrence" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.lastOccurrence|" />
      </mapping>
    </element>
    <element id="Allergies.note">
      <path value="Allergies.note" />
      <label value="note" />
      <short value="Additional text not captured in other fields" />
      <definition value="Additional narrative about the propensity for the Adverse Reaction, not captured in other fields." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Allergies.note" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Annotation" />
      </type>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.note|" />
      </mapping>
    </element>
    <element id="Allergies.reaction">
      <path value="Allergies.reaction" />
      <label value="reaction" />
      <short value="Adverse Reaction Events linked to exposure to substance" />
      <definition value="Details about each adverse reaction event linked to exposure to the identified substance." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Allergies.reaction" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="BackboneElement" />
      </type>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.reaction|" />
      </mapping>
    </element>
    <element id="Allergies.reaction.substance">
      <path value="Allergies.reaction.substance" />
      <label value="substance" />
      <short value="Specific substance or pharmaceutical product considered to be responsible for event" />
      <definition value="Identification of the specific substance (or pharmaceutical product) considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'.  If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Allergies.reaction.substance" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="SubstanceCode" />
        </extension>
        <strength value="example" />
        <description value="Codes defining the type of the substance (including pharmaceutical products)." />
        <valueSet value="http://hl7.org/fhir/ValueSet/substance-code" />
      </binding>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.reaction.substance|" />
      </mapping>
    </element>
    <element id="Allergies.reaction.manifestation">
      <path value="Allergies.reaction.manifestation" />
      <label value="manifestation" />
      <short value="Clinical symptoms/signs associated with the Event" />
      <definition value="Clinical symptoms and/or signs that are observed or associated with the adverse reaction event." />
      <min value="1" />
      <max value="*" />
      <base>
        <path value="Allergies.reaction.manifestation" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="Manifestation" />
        </extension>
        <strength value="example" />
        <description value="Clinical symptoms and/or signs that are observed or associated with an Adverse Reaction Event." />
        <valueSet value="http://hl7.org/fhir/ValueSet/clinical-findings" />
      </binding>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.reaction.manifestation|" />
      </mapping>
    </element>
    <element id="Allergies.reaction.description">
      <path value="Allergies.reaction.description" />
      <label value="description" />
      <short value="Description of the event as a whole" />
      <definition value="Text description about the reaction as a whole, including details of the manifestation if required." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Allergies.reaction.description" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.reaction.description|" />
      </mapping>
    </element>
    <element id="Allergies.reaction.onset">
      <path value="Allergies.reaction.onset" />
      <label value="onset" />
      <short value="Date(/time) when manifestations showed" />
      <definition value="Record of the date and/or time of the onset of the Reaction." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Allergies.reaction.onset" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="dateTime" />
      </type>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.reaction.onset|" />
      </mapping>
    </element>
    <element id="Allergies.reaction.severity">
      <path value="Allergies.reaction.severity" />
      <label value="severity" />
      <short value="mild | moderate | severe (of event as a whole)" />
      <definition value="Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Allergies.reaction.severity" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="code" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="AllergyIntoleranceSeverity" />
        </extension>
        <strength value="required" />
        <description value="Clinical assessment of the severity of a reaction event as a whole, potentially considering multiple different manifestations." />
        <valueSet value="http://hl7.org/fhir/ValueSet/reaction-event-severity|4.0.1" />
      </binding>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.reaction.severity|" />
      </mapping>
    </element>
    <element id="Allergies.reaction.exposureRoute">
      <path value="Allergies.reaction.exposureRoute" />
      <label value="exposureRoute" />
      <short value="How the subject was exposed to the substance" />
      <definition value="Identification of the route by which the subject was exposed to the substance." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="Allergies.reaction.exposureRoute" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="RouteOfAdministration" />
        </extension>
        <strength value="example" />
        <description value="A coded concept describing the route or physiological path of administration of a therapeutic agent into or onto the body of a subject." />
        <valueSet value="http://hl7.org/fhir/ValueSet/route-codes" />
      </binding>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.reaction.exposureRoute|" />
      </mapping>
    </element>
    <element id="Allergies.reaction.note">
      <path value="Allergies.reaction.note" />
      <label value="note" />
      <short value="Text about event not captured in other fields" />
      <definition value="Additional text about the adverse reaction event not captured in other fields." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="Allergies.reaction.note" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Annotation" />
      </type>
      <mapping>
        <identity value="fhir" />
        <map value="AllergyIntolerance.reaction.note|" />
      </mapping>
    </element>
  </snapshot>
</StructureDefinition>