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: R2 to R3 - XML Representation

Page standards status: Draft Maturity Level: 1

Raw xml | Download



<StructureMap xmlns="http://hl7.org/fhir">
  <id value="MedicationAdministration2to3"/>
  <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/MedicationAdministration2to3'</span>
<span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'MedicationAdministration2to3'</span>
<span style="color: #cc00cc">/// <b>title</b> = </span><span style="color: blue">'MedicationAdministration Transforms: R2 to R3'</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/1.0/MedicationAdministration<span style="color: navy">&quot; </span><b>alias </b>MedicationAdministrationR2 <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>RatioR2 <b>as </b><b>source</b>
<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>target</b>

<b>imports</b><span style="color: navy"> &quot;</span>http://hl7.org/fhir/StructureMap/*2to3<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>MedicationAdministrationR2, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>MedicationAdministration<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.patient<span style="color: navy"><b> -&gt; </b></span>tgt.subject <i>&quot;MedicationAdministration-patient&quot;</i><span style="color: navy">;</span>
  src.practitioner<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span> tgt.performer<b> as </b><span style="color: maroon">vd</span><span style="color: navy">, </span> vd.actor = <span style="color: maroon">v</span> <i>&quot;MedicationAdministration-practitioner&quot;</i><span style="color: navy">;</span>
  src.encounter<span style="color: navy"><b> -&gt; </b></span>tgt.context <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.wasNotGiven<span style="color: navy"><b> -&gt; </b></span>tgt.notGiven <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.effectiveTime<span style="color: navy"><b> -&gt; </b></span>tgt.effective <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<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>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.quantity<span style="color: navy"><b> -&gt; </b></span>tgt.dose <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/MedicationAdministration2to3"/>
  <version value="0.1.0"/>
  <name value="MedicationAdministration2to3"/>
  <title value="MedicationAdministration Transforms: R2 to R3"/>
  <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="MedicationAdministrationTransformsR2toR3"/>
  <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/1.0/MedicationAdministration"/>
    <mode value="source"/>
    <alias value="MedicationAdministrationR2"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/1.0/MedicationAdministration"/>
    <mode value="source"/>
    <alias value="RatioR2"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/3.0/MedicationAdministration"/>
    <mode value="target"/>
    <alias value="MedicationAdministration"/>
  </structure>
  <import value="http://hl7.org/fhir/StructureMap/*2to3"/>
  <group>
    <name value="MedicationAdministration"/>
    <extends value="DomainResource"/>
    <typeMode value="type-and-types"/>
    <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="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="patient"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="subject"/>
        <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-practitioner"/>
      <source>
        <context value="src"/>
        <element value="practitioner"/>
        <variable value="v"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="performer"/>
        <variable value="vd"/>
      </target>
      <target>
        <context value="vd"/>
        <element value="actor"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="v"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="MedicationAdministration-encounter"/>
      <source>
        <context value="src"/>
        <element value="encounter"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="context"/>
        <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="wasNotGiven"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="notGiven"/>
        <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="effectiveTime"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="effective"/>
        <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"/>
        <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="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="quantity"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="dose"/>
        <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>