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

: MedicationStatement Transforms: R3 to R2 - XML Representation

Page standards status: Draft Maturity Level: 1

Raw xml | Download



<StructureMap xmlns="http://hl7.org/fhir">
  <id value="MedicationStatement3to2"/>
  <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/MedicationStatement3to2'</span>
<span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'MedicationStatement3to2'</span>
<span style="color: #cc00cc">/// <b>title</b> = </span><span style="color: blue">'MedicationStatement 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/MedicationStatement<span style="color: navy">&quot; </span><b>alias </b>MedicationStatement <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> &quot;</span>http://hl7.org/fhir/1.0/MedicationStatement<span style="color: navy">&quot; </span><b>alias </b>MedicationStatementR2 <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>MedicationStatement<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>MedicationStatement, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>MedicationStatementR2<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;MedicationStatement-identifier&quot;</i><span style="color: navy">;</span>
  src.subject<span style="color: navy"><b> -&gt; </b></span>tgt.patient <i>&quot;MedicationStatement-subject&quot;</i><span style="color: navy">;</span>
  src.informationSource<span style="color: navy"><b> -&gt; </b></span>tgt.informationSource <i>&quot;MedicationStatement-informationSource&quot;</i><span style="color: navy">;</span>
  src.dateAsserted<span style="color: navy"><b> -&gt; </b></span>tgt.dateAsserted <i>&quot;MedicationStatement-dateAsserted&quot;</i><span style="color: navy">;</span>
  src.status<b> check </b>(src.status != 'stopped') and (status != 'on-hold')<span style="color: navy"><b> -&gt; </b></span>tgt.status <i>&quot;MedicationStatement-status&quot;</i><span style="color: navy">;</span>
  src.taken<b> as </b><span style="color: maroon">vt</span><b> where </b>$this = 'n'<span style="color: navy"><b> -&gt; </b></span>tgt.wasNotTaken = <span style="color: blue">'true'</span> <i>&quot;MedicationStatement-wasNotTaken&quot;</i><span style="color: navy">;</span>
  src.taken<b> as </b><span style="color: maroon">vt</span><b> where </b>$this = 'y'<span style="color: navy"><b> -&gt; </b></span>tgt.wasNotTaken = <span style="color: blue">'false'</span> <i>&quot;MedicationStatement-wasNotTaken&quot;</i><span style="color: navy">;</span>
  src.reasonNotTaken<span style="color: navy"><b> -&gt; </b></span>tgt.reasonNotTaken <i>&quot;MedicationStatement-reasonNotTaken&quot;</i><span style="color: navy">;</span>
  src.reasonCode<span style="color: navy"><b> -&gt; </b></span>tgt.reasonForUse <i>&quot;MedicationStatement-reasonForUse1&quot;</i><span style="color: navy">;</span>
  src.reasonReference<span style="color: navy"><b> -&gt; </b></span>tgt.reasonForUse <i>&quot;MedicationStatement-reasonForUse2&quot;</i><span style="color: navy">;</span>
  src.effective<span style="color: navy"><b> -&gt; </b></span>tgt.effective <i>&quot;MedicationStatement-effective&quot;</i><span style="color: navy">;</span>
  src.note<span style="color: navy"><b> -&gt; </b></span>tgt.note <i>&quot;MedicationStatement-note&quot;</i><span style="color: navy">;</span>
  src.derivedFrom<span style="color: navy"><b> -&gt; </b></span>tgt.supportingInformation <i>&quot;MedicationStatement-supportingInformation&quot;</i><span style="color: navy">;</span>
  src.medication<span style="color: navy"><b> -&gt; </b></span>tgt.medication <i>&quot;MedicationStatement-medication&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>mstDosage<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;MedicationStatement-dosage&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>mstDosage<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>Element<span style="color: navy"> {
</span>  src.text<span style="color: navy"><b> -&gt; </b></span>tgt.text <i>&quot;DosageInstruction-text&quot;</i><span style="color: navy">;</span>
  src.timing<span style="color: navy"><b> -&gt; </b></span>tgt.timing <i>&quot;DosageInstruction-timing&quot;</i><span style="color: navy">;</span>
  src.asNeeded<span style="color: navy"><b> -&gt; </b></span>tgt.asNeeded <i>&quot;DosageInstruction-asNeeded&quot;</i><span style="color: navy">;</span>
  src.site<span style="color: navy"><b> -&gt; </b></span>tgt.site <i>&quot;DosageInstruction-site&quot;</i><span style="color: navy">;</span>
  src.route<span style="color: navy"><b> -&gt; </b></span>tgt.route <i>&quot;DosageInstruction-route&quot;</i><span style="color: navy">;</span>
  src.method<span style="color: navy"><b> -&gt; </b></span>tgt.method <i>&quot;DosageInstruction-method&quot;</i><span style="color: navy">;</span>
  src.dose<span style="color: navy"><b> -&gt; </b></span>tgt.quantity <i>&quot;DosageInstruction-quantity&quot;</i><span style="color: navy">;</span>
  src.rate<span style="color: navy"><b> -&gt; </b></span>tgt.rate <i>&quot;DosageInstruction-rate&quot;</i><span style="color: navy">;</span>
  src.maxDosePerPeriod<span style="color: navy"><b> -&gt; </b></span>tgt.maxDosePerPeriod <i>&quot;DosageInstruction-maxDosePerPeriod&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/MedicationStatement3to2"/>
  <version value="0.1.0"/>
  <name value="MedicationStatement3to2"/>
  <title value="MedicationStatement 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="MedicationStatementTransformsR3toR2"/>
  <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/MedicationStatement"/>
    <mode value="source"/>
    <alias value="MedicationStatement"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/1.0/MedicationStatement"/>
    <mode value="target"/>
    <alias value="MedicationStatementR2"/>
  </structure>
  <import value="http://hl7.org/fhir/StructureMap/*3to2"/>
  <group>
    <name value="MedicationStatement"/>
    <extends value="DomainResource"/>
    <typeMode value="type-and-types"/>
    <input>
      <name value="src"/>
      <type value="MedicationStatement"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="MedicationStatementR2"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="MedicationStatement-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="MedicationStatement-subject"/>
      <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="MedicationStatement-informationSource"/>
      <source>
        <context value="src"/>
        <element value="informationSource"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="informationSource"/>
        <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="MedicationStatement-dateAsserted"/>
      <source>
        <context value="src"/>
        <element value="dateAsserted"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="dateAsserted"/>
        <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="MedicationStatement-status"/>
      <source>
        <context value="src"/>
        <element value="status"/>
        <variable value="vvv"/>
        <check value="(src.status != 'stopped') and (status != 'on-hold')"/>
      </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="MedicationStatement-wasNotTaken"/>
      <source>
        <context value="src"/>
        <element value="taken"/>
        <variable value="vt"/>
        <condition value="$this = 'n'"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="wasNotTaken"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="true"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="MedicationStatement-wasNotTaken"/>
      <source>
        <context value="src"/>
        <element value="taken"/>
        <variable value="vt"/>
        <condition value="$this = 'y'"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="wasNotTaken"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="false"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="MedicationStatement-reasonNotTaken"/>
      <source>
        <context value="src"/>
        <element value="reasonNotTaken"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="reasonNotTaken"/>
        <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="MedicationStatement-reasonForUse1"/>
      <source>
        <context value="src"/>
        <element value="reasonCode"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="reasonForUse"/>
        <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="MedicationStatement-reasonForUse2"/>
      <source>
        <context value="src"/>
        <element value="reasonReference"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="reasonForUse"/>
        <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="MedicationStatement-effective"/>
      <source>
        <context value="src"/>
        <element value="effective"/>
        <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="MedicationStatement-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="MedicationStatement-supportingInformation"/>
      <source>
        <context value="src"/>
        <element value="derivedFrom"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="supportingInformation"/>
        <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="MedicationStatement-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="MedicationStatement-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="mstDosage"/>
        <parameter>
          <valueId value="vs0"/>
        </parameter>
        <parameter>
          <valueId value="vt0"/>
        </parameter>
      </dependent>
    </rule>
  </group>
  <group>
    <name value="mstDosage"/>
    <extends value="Element"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="DosageInstruction-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="DosageInstruction-timing"/>
      <source>
        <context value="src"/>
        <element value="timing"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="timing"/>
        <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="DosageInstruction-asNeeded"/>
      <source>
        <context value="src"/>
        <element value="asNeeded"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="asNeeded"/>
        <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="DosageInstruction-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="DosageInstruction-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="DosageInstruction-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="DosageInstruction-quantity"/>
      <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="DosageInstruction-rate"/>
      <source>
        <context value="src"/>
        <element value="rate"/>
        <variable value="vvv"/>
      </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>
    <rule>
      <name value="DosageInstruction-maxDosePerPeriod"/>
      <source>
        <context value="src"/>
        <element value="maxDosePerPeriod"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="maxDosePerPeriod"/>
        <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>