<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="profile-allergyintolerance" />
  <url value="https://fhir.synapxe.sg/StructureDefinition/profile-allergyintolerance" />
  <name value="AllergyIntolerance" />
  <title value="Allergy Intolerance Profile" />
  <status value="active" />
  <publisher value="Synapxe" />
  <description value="This resource will be used to store the clinical assessment of an allergy or intolerance." />
  <fhirVersion value="5.0.0" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="AllergyIntolerance" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/AllergyIntolerance" />
  <derivation value="constraint" />
  <differential>
    <element id="AllergyIntolerance.extension:reportingFlag">
      <path value="AllergyIntolerance.extension" />
      <sliceName value="reportingFlag" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/ext-reportingFlag" />
      </type>
    </element>
    <element id="AllergyIntolerance.extension:assertedDate">
      <path value="AllergyIntolerance.extension" />
      <sliceName value="assertedDate" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/ext-assertedDate" />
      </type>
    </element>
    <element id="AllergyIntolerance.extension:informationSource">
      <path value="AllergyIntolerance.extension" />
      <sliceName value="informationSource" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/ext-informationSource" />
      </type>
    </element>
    <element id="AllergyIntolerance.extension:ADRAlertIndicator">
      <path value="AllergyIntolerance.extension" />
      <sliceName value="ADRAlertIndicator" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/ext-ADRAlertIndicator" />
      </type>
    </element>
    <element id="AllergyIntolerance.identifier">
      <path value="AllergyIntolerance.identifier" />
      <max value="1" />
      <type>
        <code value="Identifier" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-identifier" />
      </type>
    </element>
    <element id="AllergyIntolerance.type.coding.system">
      <path value="AllergyIntolerance.type.coding.system" />
      <patternUri value="http://hl7.org/fhir/allergy-intolerance-type" />
    </element>
    <element id="AllergyIntolerance.criticality.extension:criticality">
      <path value="AllergyIntolerance.criticality.extension" />
      <sliceName value="criticality" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/ext-criticality" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="AllergyIntolerance.code">
      <path value="AllergyIntolerance.code" />
      <binding>
        <strength value="preferred" />
        <description value="The clinical status of the allergy or intolerance." />
      </binding>
    </element>
    <element id="AllergyIntolerance.code.extension">
      <path value="AllergyIntolerance.code.extension" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.code.coding.version">
      <path value="AllergyIntolerance.code.coding.version" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.patient">
      <path value="AllergyIntolerance.patient" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.synapxe.sg/StructureDefinition/profile-patient" />
      </type>
    </element>
    <element id="AllergyIntolerance.patient.reference">
      <path value="AllergyIntolerance.patient.reference" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.patient.type">
      <path value="AllergyIntolerance.patient.type" />
      <min value="1" />
      <patternUri value="Patient" />
    </element>
    <element id="AllergyIntolerance.patient.identifier">
      <path value="AllergyIntolerance.patient.identifier" />
      <min value="1" />
      <type>
        <code value="Identifier" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-identifier-nric" />
      </type>
    </element>
    <element id="AllergyIntolerance.encounter">
      <path value="AllergyIntolerance.encounter" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.synapxe.sg/StructureDefinition/profile-encounter" />
        <aggregation value="contained" />
      </type>
    </element>
    <element id="AllergyIntolerance.onset[x]">
      <path value="AllergyIntolerance.onset[x]" />
      <type>
        <code value="dateTime" />
      </type>
      <type>
        <code value="Age" />
      </type>
      <type>
        <code value="Period" />
      </type>
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="AllergyIntolerance.participant.id">
      <path value="AllergyIntolerance.participant.id" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.participant.extension:system">
      <path value="AllergyIntolerance.participant.extension" />
      <sliceName value="system" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/ext-system" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="AllergyIntolerance.participant.modifierExtension">
      <path value="AllergyIntolerance.participant.modifierExtension" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.participant.function">
      <path value="AllergyIntolerance.participant.function" />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept" />
      </type>
      <binding>
        <strength value="required" />
        <description value="Allergy intolerance participant function." />
        <valueSet value="http://hl7.org/fhir/ValueSet/provenance-participant-type" />
      </binding>
    </element>
    <element id="AllergyIntolerance.participant.function.extension">
      <path value="AllergyIntolerance.participant.function.extension" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.participant.actor">
      <path value="AllergyIntolerance.participant.actor" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.synapxe.sg/StructureDefinition/profile-practitioner" />
      </type>
    </element>
    <element id="AllergyIntolerance.participant.actor.id">
      <path value="AllergyIntolerance.participant.actor.id" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.participant.actor.extension">
      <path value="AllergyIntolerance.participant.actor.extension" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.participant.actor.type">
      <path value="AllergyIntolerance.participant.actor.type" />
      <patternUri value="Practitioner" />
    </element>
    <element id="AllergyIntolerance.participant.actor.identifier">
      <path value="AllergyIntolerance.participant.actor.identifier" />
      <type>
        <code value="Identifier" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-identifier" />
      </type>
    </element>
    <element id="AllergyIntolerance.participant.actor.identifier.system">
      <path value="AllergyIntolerance.participant.actor.identifier.system" />
      <patternUri value="https://fhir.synapxe.sg/NamingSystem/mcr" />
    </element>
    <element id="AllergyIntolerance.note">
      <path value="AllergyIntolerance.note" />
      <max value="1" />
    </element>
    <element id="AllergyIntolerance.reaction">
      <path value="AllergyIntolerance.reaction" />
      <max value="1" />
    </element>
    <element id="AllergyIntolerance.reaction.id">
      <path value="AllergyIntolerance.reaction.id" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.reaction.extension:reactionOutcome">
      <path value="AllergyIntolerance.reaction.extension" />
      <sliceName value="reactionOutcome" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/ext-reactionOutcome" />
      </type>
    </element>
    <element id="AllergyIntolerance.reaction.extension:ADROutcome">
      <path value="AllergyIntolerance.reaction.extension" />
      <sliceName value="ADROutcome" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/ext-ADROutcome" />
      </type>
    </element>
    <element id="AllergyIntolerance.reaction.substance">
      <path value="AllergyIntolerance.reaction.substance" />
      <binding>
        <strength value="required" />
        <description value="The substance that is responsible for the allergic reaction." />
      </binding>
    </element>
    <element id="AllergyIntolerance.reaction.substance.extension:substanceDetails">
      <path value="AllergyIntolerance.reaction.substance.extension" />
      <sliceName value="substanceDetails" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/ext-substance-details" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="AllergyIntolerance.reaction.severity.extension:reactionSeverity">
      <path value="AllergyIntolerance.reaction.severity.extension" />
      <sliceName value="reactionSeverity" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/ext-reactionSeverity" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="AllergyIntolerance.reaction.exposureRoute">
      <path value="AllergyIntolerance.reaction.exposureRoute" />
      <type>
        <code value="CodeableConcept" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept" />
      </type>
      <binding>
        <strength value="required" />
        <description value="The route by which the allergic exposure occurred." />
      </binding>
    </element>
    <element id="AllergyIntolerance.reaction.exposureRoute.extension">
      <path value="AllergyIntolerance.reaction.exposureRoute.extension" />
      <max value="0" />
    </element>
    <element id="AllergyIntolerance.reaction.note">
      <path value="AllergyIntolerance.reaction.note" />
      <type>
        <code value="Annotation" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-annotation" />
      </type>
    </element>
  </differential>
</StructureDefinition>