FHIR Extensions Pack
5.1.0-snapshot1 - Working Copy International flag

This page is part of the FHIR Core Extensions Registry (v5.1.0-snapshot1: Release 5.1) based on FHIR (HL7® FHIR® Standard) v5.0.0. The current version which supersedes this version is 1.0.0. For a full list of available versions, see the Directory of published versions

: FML Conversion for AllergyIntolerance: R4 to R5 - XML Representation

Page standards status: Trial-use Maturity Level: 1

Raw xml | Download



<StructureMap xmlns="http://hl7.org/fhir">
  <id value="AllergyIntolerance4to5"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><pre class="fml">
<span style="color: #cc00cc">/// <b>url</b> = </span><span style="color: blue">'http://hl7.org/fhir/StructureMap/AllergyIntolerance4to5'</span>
<span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'AllergyIntolerance4to5'</span>
<span style="color: #cc00cc">/// <b>title</b> = </span><span style="color: blue">'FML Conversion for AllergyIntolerance: R4 to R5'</span>
<span style="color: #cc00cc">/// <b>status</b> = </span><span style="color: blue">'active'</span>

<b>conceptmap</b><span style="color: navy"> &quot;</span>AllergyIntoleranceCategory<span style="color: navy">&quot; {
</span><b>  prefix </b>s<span style="color: navy"> = &quot;</span><a href="http://hl7.org/fhir/R4/codesystem-allergy-intolerance-category.html" title="AllergyIntoleranceCategory">http://hl7.org/fhir/4.0/allergy-intolerance-category</a><span style="color: navy">&quot;
</span><b>  prefix </b>t<span style="color: navy"> = &quot;</span><a href="http://hl7.org/fhir/R5/codesystem-allergy-intolerance-category.html" title="Allergy Intolerance Category">http://hl7.org/fhir/allergy-intolerance-category</a><span style="color: navy">&quot;
</span>
  s<span style="color: navy">:</span>food <b>-</b> t<span style="color: navy">:</span>food
  s<span style="color: navy">:</span>medication <b>-</b> t<span style="color: navy">:</span>medication
  s<span style="color: navy">:</span>environment <b>-</b> t<span style="color: navy">:</span>environment
  s<span style="color: navy">:</span>biologic <b>-</b> t<span style="color: navy">:</span>biologic
<span style="color: navy">}

</span><b>conceptmap</b><span style="color: navy"> &quot;</span>AllergyIntoleranceCriticality<span style="color: navy">&quot; {
</span><b>  prefix </b>s<span style="color: navy"> = &quot;</span><a href="http://hl7.org/fhir/R4/codesystem-allergy-intolerance-criticality.html" title="AllergyIntoleranceCriticality">http://hl7.org/fhir/4.0/allergy-intolerance-criticality</a><span style="color: navy">&quot;
</span><b>  prefix </b>t<span style="color: navy"> = &quot;</span><a href="http://hl7.org/fhir/R5/codesystem-allergy-intolerance-criticality.html" title="Allergy Intolerance Criticality">http://hl7.org/fhir/allergy-intolerance-criticality</a><span style="color: navy">&quot;
</span>
  s<span style="color: navy">:</span>low <b>-</b> t<span style="color: navy">:</span>low
  s<span style="color: navy">:</span>high <b>-</b> t<span style="color: navy">:</span>high
  s<span style="color: navy">:</span>&quot;unable-to-assess&quot; <b>-</b> t<span style="color: navy">:</span><span style="color: navy">&quot;</span>unable-to-assess<span style="color: navy">&quot;</span>
<span style="color: navy">}

</span><b>conceptmap</b><span style="color: navy"> &quot;</span>AllergyIntoleranceSeverity<span style="color: navy">&quot; {
</span><b>  prefix </b>s<span style="color: navy"> = &quot;</span><a href="http://hl7.org/fhir/R4/codesystem-reaction-event-severity.html" title="AllergyIntoleranceSeverity">http://hl7.org/fhir/4.0/reaction-event-severity</a><span style="color: navy">&quot;
</span><b>  prefix </b>t<span style="color: navy"> = &quot;</span><a href="http://hl7.org/fhir/R5/codesystem-reaction-event-severity.html" title="Allergy Intolerance Severity">http://hl7.org/fhir/reaction-event-severity</a><span style="color: navy">&quot;
</span>
  s<span style="color: navy">:</span>mild <b>-</b> t<span style="color: navy">:</span>mild
  s<span style="color: navy">:</span>moderate <b>-</b> t<span style="color: navy">:</span>moderate
  s<span style="color: navy">:</span>severe <b>-</b> t<span style="color: navy">:</span>severe
<span style="color: navy">}

</span><b>uses</b><span style="color: navy"> &quot;</span><a href="http://hl7.org/fhir/R4/allergyintolerance.html" title="AllergyIntolerance">http://hl7.org/fhir/4.0/StructureDefinition/AllergyIntolerance</a><span style="color: navy">&quot; </span><b>alias </b>AllergyIntoleranceR4 <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> &quot;</span><a href="http://hl7.org/fhir/R5/allergyintolerance.html" title="AllergyIntolerance">http://hl7.org/fhir/StructureDefinition/AllergyIntolerance</a><span style="color: navy">&quot; </span><b>alias </b>AllergyIntoleranceR5 <b>as </b><b>target</b>

<b>imports</b><span style="color: navy"> &quot;</span>http://hl7.org/fhir/StructureMap/*4to5<span style="color: navy">&quot;
</span>
<b>group </b>AllergyIntolerance<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>AllergyIntoleranceR4, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>AllergyIntoleranceR5<span style="color: navy">)</span><b> extends </b>DomainResource<b> &lt;&lt;type+&gt;&gt;</b><span style="color: navy"> {
</span>  src.identifier<span style="color: navy"><b> -&gt; </b></span>tgt.identifier<span style="color: navy">;</span>
  src.clinicalStatus<span style="color: navy"><b> -&gt; </b></span>tgt.clinicalStatus<span style="color: navy">;</span>
  src.verificationStatus<span style="color: navy"><b> -&gt; </b></span>tgt.verificationStatus<span style="color: navy">;</span>
  src.type<b> as </b><span style="color: maroon">s</span><b> where </b>type = 'allergy'<span style="color: navy"><b> -&gt; </b></span> tgt.type = <b>create</b><span style="color: navy">(</span><span style="color: blue">'CodeableConcept'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">t</span><span style="color: navy">, </span> t.coding = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">tc</span><span style="color: navy">, </span> tc.system = <span style="color: blue">'http://hl7.org/fhir/allergy-intolerance-type'</span><span style="color: navy">, </span> tc.code = <span style="color: blue">'allergy'</span><span style="color: navy">, </span> tc.display = <span style="color: blue">'Allergy'</span><span style="color: navy">;</span>
  src.type<b> as </b><span style="color: maroon">s</span><b> where </b>type = 'intolerance'<span style="color: navy"><b> -&gt; </b></span> tgt.type = <b>create</b><span style="color: navy">(</span><span style="color: blue">'CodeableConcept'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">t</span><span style="color: navy">, </span> t.coding = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">tc</span><span style="color: navy">, </span> tc.system = <span style="color: blue">'http://hl7.org/fhir/allergy-intolerance-type'</span><span style="color: navy">, </span> tc.code = <span style="color: blue">'intolerance'</span><span style="color: navy">, </span> tc.display = <span style="color: blue">'Intolerance'</span><span style="color: navy">;</span>
  src.category<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tgt.category = <b>translate</b><span style="color: navy">(</span><span style="color: maroon">v</span><span style="color: navy">, </span><span style="color: blue">'#AllergyIntoleranceCategory'</span><span style="color: navy">, </span><span style="color: blue">'code'</span><span style="color: navy">)</span><span style="color: navy">;</span>
  src.criticality<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tgt.criticality = <b>translate</b><span style="color: navy">(</span><span style="color: maroon">v</span><span style="color: navy">, </span><span style="color: blue">'#AllergyIntoleranceCriticality'</span><span style="color: navy">, </span><span style="color: blue">'code'</span><span style="color: navy">)</span><span style="color: navy">;</span>
  src.code<span style="color: navy"><b> -&gt; </b></span>tgt.code<span style="color: navy">;</span>
  src.patient<span style="color: navy"><b> -&gt; </b></span>tgt.patient<span style="color: navy">;</span>
  src.encounter<span style="color: navy"><b> -&gt; </b></span>tgt.encounter<span style="color: navy">;</span>
  src.onset<span style="color: navy"> : </span>dateTime<span style="color: navy"><b> -&gt; </b></span>tgt.onset<span style="color: navy">;</span>
  src.onset<span style="color: navy"> : </span>Age<span style="color: navy"><b> -&gt; </b></span>tgt.onset<span style="color: navy">;</span>
  src.onset<span style="color: navy"> : </span>Period<span style="color: navy"><b> -&gt; </b></span>tgt.onset<span style="color: navy">;</span>
  src.onset<span style="color: navy"> : </span>Range<span style="color: navy"><b> -&gt; </b></span>tgt.onset<span style="color: navy">;</span>
  src.onset<span style="color: navy"> : </span>string<span style="color: navy"><b> -&gt; </b></span>tgt.onset<span style="color: navy">;</span>
  src.recordedDate<span style="color: navy"><b> -&gt; </b></span>tgt.recordedDate<span style="color: navy">;</span>
  src.recorder<b> as </b><span style="color: maroon">s</span><span style="color: navy"><b> -&gt; </b></span>tgt.participant<b> as </b><span style="color: maroon">t</span><b> then </b>AllergyIntoleranceRecorder<span style="color: navy">(</span><span style="color: maroon">s</span><span style="color: navy">, </span><span style="color: maroon">t</span><span style="color: navy">)</span><span style="color: navy">;</span>
  src.asserter<b> as </b><span style="color: maroon">s</span><span style="color: navy"><b> -&gt; </b></span>tgt.participant<b> as </b><span style="color: maroon">t</span><b> then </b>AllergyIntoleranceAsserter<span style="color: navy">(</span><span style="color: maroon">s</span><span style="color: navy">, </span><span style="color: maroon">t</span><span style="color: navy">)</span><span style="color: navy">;</span>
  src.lastOccurrence<span style="color: navy"><b> -&gt; </b></span>tgt.lastOccurrence<span style="color: navy">;</span>
  src.note<span style="color: navy"><b> -&gt; </b></span>tgt.note<span style="color: navy">;</span>
  src.reaction<b> as </b><span style="color: maroon">s</span><span style="color: navy"><b> -&gt; </b></span>tgt.reaction<b> as </b><span style="color: maroon">t</span><b> then </b>AllergyIntoleranceReaction<span style="color: navy">(</span><span style="color: maroon">s</span><span style="color: navy">, </span><span style="color: maroon">t</span><span style="color: navy">)</span><span style="color: navy">;</span>
<span style="color: navy">}

</span><span style="color: navy">// </span><span style="color: green">group AllergyIntoleranceParticipant(source src, target tgt) extends BackboneElement {</span>
<span style="color: #b36b00" title="This element was not defined prior to R5">// src.function -&gt; tgt.function;</span>
<span style="color: #b36b00" title="This element was not defined prior to R5">// src.actor -&gt; tgt.actor;</span>
<span style="color: navy">// </span><span style="color: green">}</span>
<b>group </b>AllergyIntoleranceRecorder<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span>, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy">)</span><b> extends </b>BackboneElement<span style="color: navy"> {
</span>  src.reference<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span> tgt.function = <b>create</b><span style="color: navy">(</span><span style="color: blue">'CodeableConcept'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">t</span><span style="color: navy">, </span> t.coding = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">tc</span><span style="color: navy">, </span> tc.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/provenance-participant-type'</span><span style="color: navy">, </span> tc.code = <span style="color: blue">'enterer'</span><span style="color: navy">, </span> tc.display = <span style="color: blue">'Enterer'</span><span style="color: navy">;</span>
  src<b> as </b><span style="color: maroon">s</span><span style="color: navy"><b> -&gt; </b></span>tgt.actor<b> as </b><span style="color: maroon">t</span><b> then </b>Reference<span style="color: navy">(</span><span style="color: maroon">s</span><span style="color: navy">, </span><span style="color: maroon">t</span><span style="color: navy">)</span> <i>&quot;recorderReference&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>AllergyIntoleranceAsserter<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span>, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy">)</span><b> extends </b>BackboneElement<span style="color: navy"> {
</span>  src.reference<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span> tgt.function = <b>create</b><span style="color: navy">(</span><span style="color: blue">'CodeableConcept'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">t</span><span style="color: navy">, </span> t.coding = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">tc</span><span style="color: navy">, </span> tc.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/provenance-participant-type'</span><span style="color: navy">, </span> tc.code = <span style="color: blue">'author'</span><span style="color: navy">, </span> tc.display = <span style="color: blue">'Author'</span><span style="color: navy">;</span>
  src<b> as </b><span style="color: maroon">s</span><span style="color: navy"><b> -&gt; </b></span>tgt.actor<b> as </b><span style="color: maroon">t</span><b> then </b>Reference<span style="color: navy">(</span><span style="color: maroon">s</span><span style="color: navy">, </span><span style="color: maroon">t</span><span style="color: navy">)</span> <i>&quot;asserterReference&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>AllergyIntoleranceReaction<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span>, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy">)</span><b> extends </b>BackboneElement<span style="color: navy"> {
</span>  src.substance<span style="color: navy"><b> -&gt; </b></span>tgt.substance<span style="color: navy">;</span>
  src.manifestation<span style="color: navy"><b> -&gt; </b></span>tgt.manifestation<span style="color: navy">;</span>
  src.description<span style="color: navy"><b> -&gt; </b></span>tgt.description<span style="color: navy">;</span>
  src.onset<span style="color: navy"><b> -&gt; </b></span>tgt.onset<span style="color: navy">;</span>
  src.severity<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tgt.severity = <b>translate</b><span style="color: navy">(</span><span style="color: maroon">v</span><span style="color: navy">, </span><span style="color: blue">'#AllergyIntoleranceSeverity'</span><span style="color: navy">, </span><span style="color: blue">'code'</span><span style="color: navy">)</span><span style="color: navy">;</span>
  src.exposureRoute<span style="color: navy"><b> -&gt; </b></span>tgt.exposureRoute<span style="color: navy">;</span>
  src.note<span style="color: navy"><b> -&gt; </b></span>tgt.note<span style="color: navy">;</span>
<span style="color: navy">}

</span></pre></div>
  </text>
  <contained>
    <ConceptMap>
      <id value="AllergyIntoleranceCategory"/>
      <status value="active"/>
      <group>
        <source value="http://hl7.org/fhir/4.0/allergy-intolerance-category"/>
        <target value="http://hl7.org/fhir/allergy-intolerance-category"/>
        <element>
          <code value="food"/>
          <target>
            <code value="food"/>
            <relationship value="related-to"/>
          </target>
        </element>
        <element>
          <code value="medication"/>
          <target>
            <code value="medication"/>
            <relationship value="related-to"/>
          </target>
        </element>
        <element>
          <code value="environment"/>
          <target>
            <code value="environment"/>
            <relationship value="related-to"/>
          </target>
        </element>
        <element>
          <code value="biologic"/>
          <target>
            <code value="biologic"/>
            <relationship value="related-to"/>
          </target>
        </element>
      </group>
    </ConceptMap>
  </contained>
  <contained>
    <ConceptMap>
      <id value="AllergyIntoleranceCriticality"/>
      <status value="active"/>
      <group>
        <source
                value="http://hl7.org/fhir/4.0/allergy-intolerance-criticality"/>
        <target value="http://hl7.org/fhir/allergy-intolerance-criticality"/>
        <element>
          <code value="low"/>
          <target>
            <code value="low"/>
            <relationship value="related-to"/>
          </target>
        </element>
        <element>
          <code value="high"/>
          <target>
            <code value="high"/>
            <relationship value="related-to"/>
          </target>
        </element>
        <element>
          <code value="unable-to-assess"/>
          <target>
            <code value="unable-to-assess"/>
            <relationship value="related-to"/>
          </target>
        </element>
      </group>
    </ConceptMap>
  </contained>
  <contained>
    <ConceptMap>
      <id value="AllergyIntoleranceSeverity"/>
      <status value="active"/>
      <group>
        <source value="http://hl7.org/fhir/4.0/reaction-event-severity"/>
        <target value="http://hl7.org/fhir/reaction-event-severity"/>
        <element>
          <code value="mild"/>
          <target>
            <code value="mild"/>
            <relationship value="related-to"/>
          </target>
        </element>
        <element>
          <code value="moderate"/>
          <target>
            <code value="moderate"/>
            <relationship value="related-to"/>
          </target>
        </element>
        <element>
          <code value="severe"/>
          <target>
            <code value="severe"/>
            <relationship value="related-to"/>
          </target>
        </element>
      </group>
    </ConceptMap>
  </contained>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
    <valueCode value="fhir"/>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
    <valueInteger value="1">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom">
        <valueCanonical
                        value="http://hl7.org/fhir/extensions/ImplementationGuide/hl7.fhir.uv.extensions"/>
      </extension>
    </valueInteger>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
    <valueCode value="trial-use">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom">
        <valueCanonical
                        value="http://hl7.org/fhir/extensions/ImplementationGuide/hl7.fhir.uv.extensions"/>
      </extension>
    </valueCode>
  </extension>
  <url value="http://hl7.org/fhir/StructureMap/AllergyIntolerance4to5"/>
  <version value="5.1.0-snapshot1"/>
  <name value="AllergyIntolerance4to5"/>
  <title value="FML Conversion for AllergyIntolerance: R4 to R5"/>
  <status value="active"/>
  <date value="2024-03-12T13:30:10+11:00"/>
  <publisher value="HL7 International / FHIR Infrastructure"/>
  <contact>
    <telecom>
      <system value="url"/>
      <value value="http://www.hl7.org/Special/committees/fiwg"/>
    </telecom>
  </contact>
  <description value="FMLConversionforAllergyIntoleranceR4toR5"/>
  <jurisdiction>
    <coding>
      <system value="http://unstats.un.org/unsd/methods/m49/m49.htm"/>
      <code value="001"/>
    </coding>
  </jurisdiction>
  <structure>
    <url
         value="http://hl7.org/fhir/4.0/StructureDefinition/AllergyIntolerance"/>
    <mode value="source"/>
    <alias value="AllergyIntoleranceR4"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/AllergyIntolerance"/>
    <mode value="target"/>
    <alias value="AllergyIntoleranceR5"/>
  </structure>
  <import value="http://hl7.org/fhir/StructureMap/*4to5"/>
  <group>
    <name value="AllergyIntolerance"/>
    <extends value="DomainResource"/>
    <typeMode value="type-and-types"/>
    <input>
      <name value="src"/>
      <type value="AllergyIntoleranceR4"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="AllergyIntoleranceR5"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="identifier"/>
      <source>
        <context value="src"/>
        <element value="identifier"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="identifier"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="clinicalStatus"/>
      <source>
        <context value="src"/>
        <element value="clinicalStatus"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="clinicalStatus"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="verificationStatus"/>
      <source>
        <context value="src"/>
        <element value="verificationStatus"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="verificationStatus"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="type"/>
      <source>
        <context value="src"/>
        <element value="type"/>
        <variable value="s"/>
        <condition value="type = 'allergy'"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="type"/>
        <variable value="t"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CodeableConcept"/>
        </parameter>
      </target>
      <target>
        <context value="t"/>
        <element value="coding"/>
        <variable value="tc"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Coding"/>
        </parameter>
      </target>
      <target>
        <context value="tc"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="http://hl7.org/fhir/allergy-intolerance-type"/>
        </parameter>
      </target>
      <target>
        <context value="tc"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="allergy"/>
        </parameter>
      </target>
      <target>
        <context value="tc"/>
        <element value="display"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Allergy"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="type"/>
      <source>
        <context value="src"/>
        <element value="type"/>
        <variable value="s"/>
        <condition value="type = 'intolerance'"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="type"/>
        <variable value="t"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CodeableConcept"/>
        </parameter>
      </target>
      <target>
        <context value="t"/>
        <element value="coding"/>
        <variable value="tc"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Coding"/>
        </parameter>
      </target>
      <target>
        <context value="tc"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="http://hl7.org/fhir/allergy-intolerance-type"/>
        </parameter>
      </target>
      <target>
        <context value="tc"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="intolerance"/>
        </parameter>
      </target>
      <target>
        <context value="tc"/>
        <element value="display"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Intolerance"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="category"/>
      <source>
        <context value="src"/>
        <element value="category"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="category"/>
        <transform value="translate"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
        <parameter>
          <valueString value="#AllergyIntoleranceCategory"/>
        </parameter>
        <parameter>
          <valueString value="code"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="criticality"/>
      <source>
        <context value="src"/>
        <element value="criticality"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="criticality"/>
        <transform value="translate"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
        <parameter>
          <valueString value="#AllergyIntoleranceCriticality"/>
        </parameter>
        <parameter>
          <valueString value="code"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="code"/>
      <source>
        <context value="src"/>
        <element value="code"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="code"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="patient"/>
      <source>
        <context value="src"/>
        <element value="patient"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="patient"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="encounter"/>
      <source>
        <context value="src"/>
        <element value="encounter"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="encounter"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="onsetDateTime"/>
      <source>
        <context value="src"/>
        <type value="dateTime"/>
        <element value="onset"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="onset"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="onsetAge"/>
      <source>
        <context value="src"/>
        <type value="Age"/>
        <element value="onset"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="onset"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="onsetPeriod"/>
      <source>
        <context value="src"/>
        <type value="Period"/>
        <element value="onset"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="onset"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="onsetRange"/>
      <source>
        <context value="src"/>
        <type value="Range"/>
        <element value="onset"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="onset"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="onsetString"/>
      <source>
        <context value="src"/>
        <type value="string"/>
        <element value="onset"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="onset"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="recordedDate"/>
      <source>
        <context value="src"/>
        <element value="recordedDate"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="recordedDate"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="recorder"/>
      <source>
        <context value="src"/>
        <element value="recorder"/>
        <variable value="s"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="participant"/>
        <variable value="t"/>
      </target>
      <dependent>
        <name value="AllergyIntoleranceRecorder"/>
        <parameter>
          <valueId value="s"/>
        </parameter>
        <parameter>
          <valueId value="t"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="asserter"/>
      <source>
        <context value="src"/>
        <element value="asserter"/>
        <variable value="s"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="participant"/>
        <variable value="t"/>
      </target>
      <dependent>
        <name value="AllergyIntoleranceAsserter"/>
        <parameter>
          <valueId value="s"/>
        </parameter>
        <parameter>
          <valueId value="t"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="lastOccurrence"/>
      <source>
        <context value="src"/>
        <element value="lastOccurrence"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="lastOccurrence"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="note"/>
      <source>
        <context value="src"/>
        <element value="note"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="note"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="reaction"/>
      <source>
        <context value="src"/>
        <element value="reaction"/>
        <variable value="s"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="reaction"/>
        <variable value="t"/>
      </target>
      <dependent>
        <name value="AllergyIntoleranceReaction"/>
        <parameter>
          <valueId value="s"/>
        </parameter>
        <parameter>
          <valueId value="t"/>
        </parameter>
      </dependent>
    </rule>
  </group>
  <group>
    <name value="AllergyIntoleranceRecorder"/>
    <extends value="BackboneElement"/>
    <documentation
                   value="group AllergyIntoleranceParticipant(source src, target tgt) extends BackboneElement {
src.function -&gt; tgt.function;
src.actor -&gt; tgt.actor;
}"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="reference"/>
      <source>
        <context value="src"/>
        <element value="reference"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="function"/>
        <variable value="t"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CodeableConcept"/>
        </parameter>
      </target>
      <target>
        <context value="t"/>
        <element value="coding"/>
        <variable value="tc"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Coding"/>
        </parameter>
      </target>
      <target>
        <context value="tc"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="http://terminology.hl7.org/CodeSystem/provenance-participant-type"/>
        </parameter>
      </target>
      <target>
        <context value="tc"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="enterer"/>
        </parameter>
      </target>
      <target>
        <context value="tc"/>
        <element value="display"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Enterer"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="recorderReference"/>
      <source>
        <context value="src"/>
        <variable value="s"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="actor"/>
        <variable value="t"/>
      </target>
      <dependent>
        <name value="Reference"/>
        <parameter>
          <valueId value="s"/>
        </parameter>
        <parameter>
          <valueId value="t"/>
        </parameter>
      </dependent>
    </rule>
  </group>
  <group>
    <name value="AllergyIntoleranceAsserter"/>
    <extends value="BackboneElement"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="reference"/>
      <source>
        <context value="src"/>
        <element value="reference"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="function"/>
        <variable value="t"/>
        <transform value="create"/>
        <parameter>
          <valueString value="CodeableConcept"/>
        </parameter>
      </target>
      <target>
        <context value="t"/>
        <element value="coding"/>
        <variable value="tc"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Coding"/>
        </parameter>
      </target>
      <target>
        <context value="tc"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="http://terminology.hl7.org/CodeSystem/provenance-participant-type"/>
        </parameter>
      </target>
      <target>
        <context value="tc"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="author"/>
        </parameter>
      </target>
      <target>
        <context value="tc"/>
        <element value="display"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="Author"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="asserterReference"/>
      <source>
        <context value="src"/>
        <variable value="s"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="actor"/>
        <variable value="t"/>
      </target>
      <dependent>
        <name value="Reference"/>
        <parameter>
          <valueId value="s"/>
        </parameter>
        <parameter>
          <valueId value="t"/>
        </parameter>
      </dependent>
    </rule>
  </group>
  <group>
    <name value="AllergyIntoleranceReaction"/>
    <extends value="BackboneElement"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="substance"/>
      <source>
        <context value="src"/>
        <element value="substance"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="substance"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="manifestation"/>
      <source>
        <context value="src"/>
        <element value="manifestation"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="manifestation"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="description"/>
      <source>
        <context value="src"/>
        <element value="description"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="description"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="onset"/>
      <source>
        <context value="src"/>
        <element value="onset"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="onset"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="severity"/>
      <source>
        <context value="src"/>
        <element value="severity"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="severity"/>
        <transform value="translate"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
        <parameter>
          <valueString value="#AllergyIntoleranceSeverity"/>
        </parameter>
        <parameter>
          <valueString value="code"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="exposureRoute"/>
      <source>
        <context value="src"/>
        <element value="exposureRoute"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="exposureRoute"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="note"/>
      <source>
        <context value="src"/>
        <element value="note"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="note"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
  </group>
</StructureMap>