FHIR Cross-Version Mapping Pack
0.1.0 - Ballot for Release 5.1.0 International flag

FHIR Cross-Version Mapping Pack, published by HL7 International / FHIR Infrastructure. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/fhir-cross-version/ and changes regularly. See the Directory of published versions

: MedicationAdministration Transforms: R3 to R2 - XML Representation

Page standards status: Draft Maturity Level: 1

Raw xml | Download



<StructureMap xmlns="http://hl7.org/fhir">
  <id value="MedicationAdministration3to2"/>
  <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/MedicationAdministration3to2'</span>
<span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'MedicationAdministration3to2'</span>
<span style="color: #cc00cc">/// <b>title</b> = </span><span style="color: blue">'MedicationAdministration Transforms: R3 to R2'</span>
<span style="color: #cc00cc">/// <b>status</b> = </span><span style="color: blue">'active'</span>

<b>uses</b><span style="color: navy"> &quot;</span>http://hl7.org/fhir/3.0/MedicationAdministration<span style="color: navy">&quot; </span><b>alias </b>MedicationAdministration <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> &quot;</span>http://hl7.org/fhir/1.0/MedicationAdministration<span style="color: navy">&quot; </span><b>alias </b>MedicationAdministrationR2 <b>as </b><b>target</b>

<b>imports</b><span style="color: navy"> &quot;</span>http://hl7.org/fhir/StructureMap/*3to2<span style="color: navy">&quot;
</span>
<b>group </b>MedicationAdministration<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>MedicationAdministration, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>MedicationAdministrationR2<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 <i>&quot;MedicationAdministration-identifier&quot;</i><span style="color: navy">;</span>
  src.status<span style="color: navy"><b> -&gt; </b></span>tgt.status <i>&quot;MedicationAdministration-status&quot;</i><span style="color: navy">;</span>
  src.subject<span style="color: navy"><b> -&gt; </b></span>tgt.patient <i>&quot;MedicationAdministration-patient&quot;</i><span style="color: navy">;</span>
  src.performer<b> as </b><span style="color: maroon">vs0</span><b> then </b>mAdPerformer<span style="color: navy">(</span><span style="color: maroon">vs0</span><span style="color: navy">, </span><span style="color: maroon">tgt</span><span style="color: navy">)</span> <i>&quot;MedicationAdministration-performer&quot;</i><span style="color: navy">;</span>
  src.context<span style="color: navy"><b> -&gt; </b></span>tgt.encounter <i>&quot;MedicationAdministration-encounter&quot;</i><span style="color: navy">;</span>
  src.prescription<span style="color: navy"><b> -&gt; </b></span>tgt.prescription <i>&quot;MedicationAdministration-prescription&quot;</i><span style="color: navy">;</span>
  src.notGiven<span style="color: navy"><b> -&gt; </b></span>tgt.wasNotGiven <i>&quot;MedicationAdministration-notGiven&quot;</i><span style="color: navy">;</span>
  src.reasonNotGiven<span style="color: navy"><b> -&gt; </b></span>tgt.reasonNotGiven <i>&quot;MedicationAdministration-reasonNotGiven&quot;</i><span style="color: navy">;</span>
  src.effective<span style="color: navy"><b> -&gt; </b></span>tgt.effectiveTime <i>&quot;MedicationAdministration-effectiveTime&quot;</i><span style="color: navy">;</span>
  src.medication<span style="color: navy"><b> -&gt; </b></span>tgt.medication <i>&quot;MedicationAdministration-medication&quot;</i><span style="color: navy">;</span>
  src.device<span style="color: navy"><b> -&gt; </b></span>tgt.device <i>&quot;MedicationAdministration-device&quot;</i><span style="color: navy">;</span>
  src.note only_one<span style="color: navy"><b> -&gt; </b></span>tgt.note <i>&quot;MedicationAdministration-note&quot;</i><span style="color: navy">;</span>
  src.dosage<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -&gt; </b></span>tgt.dosage<b> as </b><span style="color: maroon">vt0</span><b> then </b>mAdDosage<span style="color: navy">(</span><span style="color: maroon">vs0</span><span style="color: navy">, </span><span style="color: maroon">vt0</span><span style="color: navy">)</span> <i>&quot;MedicationAdministration-dosage&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>mAdPerformer<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.actor<span style="color: navy"><b> -&gt; </b></span>tgt.practitioner <i>&quot;MedicationAdministration-performer-actor&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>mAdDosage<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>MedicationAdministrationR2, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>MedicationAdministration<span style="color: navy">)</span><b> extends </b>BackboneElement<span style="color: navy"> {
</span>  src.text<span style="color: navy"><b> -&gt; </b></span>tgt.text <i>&quot;dosage-text&quot;</i><span style="color: navy">;</span>
  src.site<span style="color: navy"><b> -&gt; </b></span>tgt.site <i>&quot;dosage-site&quot;</i><span style="color: navy">;</span>
  src.route<span style="color: navy"><b> -&gt; </b></span>tgt.route <i>&quot;dosage-route&quot;</i><span style="color: navy">;</span>
  src.method<span style="color: navy"><b> -&gt; </b></span>tgt.method <i>&quot;dosage-method&quot;</i><span style="color: navy">;</span>
  src.dose<span style="color: navy"><b> -&gt; </b></span>tgt.quantity <i>&quot;dosage-dose&quot;</i><span style="color: navy">;</span>
  src.rate<b> where </b>$this is Ratio<span style="color: navy"><b> -&gt; </b></span>tgt.rate <i>&quot;dosage-rate-Ratio&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span></pre></div>
  </text>
  <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.xver"/>
      </extension>
    </valueInteger>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
    <valueCode value="draft">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom">
        <valueCanonical
                        value="http://hl7.org/fhir/extensions/ImplementationGuide/hl7.fhir.uv.xver"/>
      </extension>
    </valueCode>
  </extension>
  <url value="http://hl7.org/fhir/StructureMap/MedicationAdministration3to2"/>
  <version value="0.1.0"/>
  <name value="MedicationAdministration3to2"/>
  <title value="MedicationAdministration Transforms: R3 to R2"/>
  <status value="active"/>
  <date value="2024-02-22T03:16:50+00: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="MedicationAdministrationTransformsR3toR2"/>
  <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/3.0/MedicationAdministration"/>
    <mode value="source"/>
    <alias value="MedicationAdministration"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/1.0/MedicationAdministration"/>
    <mode value="target"/>
    <alias value="MedicationAdministrationR2"/>
  </structure>
  <import value="http://hl7.org/fhir/StructureMap/*3to2"/>
  <group>
    <name value="MedicationAdministration"/>
    <extends value="DomainResource"/>
    <typeMode value="type-and-types"/>
    <input>
      <name value="src"/>
      <type value="MedicationAdministration"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="MedicationAdministrationR2"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="MedicationAdministration-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="MedicationAdministration-status"/>
      <source>
        <context value="src"/>
        <element value="status"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="status"/>
        <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="MedicationAdministration-patient"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <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="MedicationAdministration-performer"/>
      <source>
        <context value="src"/>
        <element value="performer"/>
        <variable value="vs0"/>
      </source>
      <dependent>
        <name value="mAdPerformer"/>
        <parameter>
          <valueId value="vs0"/>
        </parameter>
        <parameter>
          <valueId value="tgt"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="MedicationAdministration-encounter"/>
      <source>
        <context value="src"/>
        <element value="context"/>
        <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="MedicationAdministration-prescription"/>
      <source>
        <context value="src"/>
        <element value="prescription"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="prescription"/>
        <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="MedicationAdministration-notGiven"/>
      <source>
        <context value="src"/>
        <element value="notGiven"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="wasNotGiven"/>
        <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="MedicationAdministration-reasonNotGiven"/>
      <source>
        <context value="src"/>
        <element value="reasonNotGiven"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="reasonNotGiven"/>
        <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="MedicationAdministration-effectiveTime"/>
      <source>
        <context value="src"/>
        <element value="effective"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="effectiveTime"/>
        <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="MedicationAdministration-medication"/>
      <source>
        <context value="src"/>
        <element value="medication"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="medication"/>
        <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="MedicationAdministration-device"/>
      <source>
        <context value="src"/>
        <element value="device"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="device"/>
        <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="MedicationAdministration-note"/>
      <source>
        <context value="src"/>
        <element value="note"/>
        <listMode value="only_one"/>
        <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="MedicationAdministration-dosage"/>
      <source>
        <context value="src"/>
        <element value="dosage"/>
        <variable value="vs0"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="dosage"/>
        <variable value="vt0"/>
      </target>
      <dependent>
        <name value="mAdDosage"/>
        <parameter>
          <valueId value="vs0"/>
        </parameter>
        <parameter>
          <valueId value="vt0"/>
        </parameter>
      </dependent>
    </rule>
  </group>
  <group>
    <name value="mAdPerformer"/>
    <extends value="BackboneElement"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="MedicationAdministration-performer-actor"/>
      <source>
        <context value="src"/>
        <element value="actor"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="practitioner"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <dependent>
        <name value="DefaultMappingGroupAnonymousAlias"/>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
        <parameter>
          <valueId value="vvv"/>
        </parameter>
      </dependent>
    </rule>
  </group>
  <group>
    <name value="mAdDosage"/>
    <extends value="BackboneElement"/>
    <input>
      <name value="src"/>
      <type value="MedicationAdministrationR2"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="MedicationAdministration"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="dosage-text"/>
      <source>
        <context value="src"/>
        <element value="text"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="text"/>
        <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="dosage-site"/>
      <source>
        <context value="src"/>
        <element value="site"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="site"/>
        <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="dosage-route"/>
      <source>
        <context value="src"/>
        <element value="route"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="route"/>
        <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="dosage-method"/>
      <source>
        <context value="src"/>
        <element value="method"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="method"/>
        <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="dosage-dose"/>
      <source>
        <context value="src"/>
        <element value="dose"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="quantity"/>
        <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="dosage-rate-Ratio"/>
      <source>
        <context value="src"/>
        <element value="rate"/>
        <variable value="vvv"/>
        <condition value="$this is Ratio"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="rate"/>
        <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>