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
Page standards status: Draft | Maturity Level: 1 |
<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"> "</span>http://hl7.org/fhir/3.0/MedicationStatement<span style="color: navy">" </span><b>alias </b>MedicationStatement <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> "</span>http://hl7.org/fhir/1.0/MedicationStatement<span style="color: navy">" </span><b>alias </b>MedicationStatementR2 <b>as </b><b>target</b>
<b>imports</b><span style="color: navy"> "</span>http://hl7.org/fhir/StructureMap/*3to2<span style="color: navy">"
</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> <<type+>></b><span style="color: navy"> {
</span> src.identifier<span style="color: navy"><b> -> </b></span>tgt.identifier <i>"MedicationStatement-identifier"</i><span style="color: navy">;</span>
src.subject<span style="color: navy"><b> -> </b></span>tgt.patient <i>"MedicationStatement-subject"</i><span style="color: navy">;</span>
src.informationSource<span style="color: navy"><b> -> </b></span>tgt.informationSource <i>"MedicationStatement-informationSource"</i><span style="color: navy">;</span>
src.dateAsserted<span style="color: navy"><b> -> </b></span>tgt.dateAsserted <i>"MedicationStatement-dateAsserted"</i><span style="color: navy">;</span>
src.status<b> check </b>(src.status != 'stopped') and (status != 'on-hold')<span style="color: navy"><b> -> </b></span>tgt.status <i>"MedicationStatement-status"</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> -> </b></span>tgt.wasNotTaken = <span style="color: blue">'true'</span> <i>"MedicationStatement-wasNotTaken"</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> -> </b></span>tgt.wasNotTaken = <span style="color: blue">'false'</span> <i>"MedicationStatement-wasNotTaken"</i><span style="color: navy">;</span>
src.reasonNotTaken<span style="color: navy"><b> -> </b></span>tgt.reasonNotTaken <i>"MedicationStatement-reasonNotTaken"</i><span style="color: navy">;</span>
src.reasonCode<span style="color: navy"><b> -> </b></span>tgt.reasonForUse <i>"MedicationStatement-reasonForUse1"</i><span style="color: navy">;</span>
src.reasonReference<span style="color: navy"><b> -> </b></span>tgt.reasonForUse <i>"MedicationStatement-reasonForUse2"</i><span style="color: navy">;</span>
src.effective<span style="color: navy"><b> -> </b></span>tgt.effective <i>"MedicationStatement-effective"</i><span style="color: navy">;</span>
src.note<span style="color: navy"><b> -> </b></span>tgt.note <i>"MedicationStatement-note"</i><span style="color: navy">;</span>
src.derivedFrom<span style="color: navy"><b> -> </b></span>tgt.supportingInformation <i>"MedicationStatement-supportingInformation"</i><span style="color: navy">;</span>
src.medication<span style="color: navy"><b> -> </b></span>tgt.medication <i>"MedicationStatement-medication"</i><span style="color: navy">;</span>
src.dosage<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -> </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>"MedicationStatement-dosage"</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> -> </b></span>tgt.text <i>"DosageInstruction-text"</i><span style="color: navy">;</span>
src.timing<span style="color: navy"><b> -> </b></span>tgt.timing <i>"DosageInstruction-timing"</i><span style="color: navy">;</span>
src.asNeeded<span style="color: navy"><b> -> </b></span>tgt.asNeeded <i>"DosageInstruction-asNeeded"</i><span style="color: navy">;</span>
src.site<span style="color: navy"><b> -> </b></span>tgt.site <i>"DosageInstruction-site"</i><span style="color: navy">;</span>
src.route<span style="color: navy"><b> -> </b></span>tgt.route <i>"DosageInstruction-route"</i><span style="color: navy">;</span>
src.method<span style="color: navy"><b> -> </b></span>tgt.method <i>"DosageInstruction-method"</i><span style="color: navy">;</span>
src.dose<span style="color: navy"><b> -> </b></span>tgt.quantity <i>"DosageInstruction-quantity"</i><span style="color: navy">;</span>
src.rate<span style="color: navy"><b> -> </b></span>tgt.rate <i>"DosageInstruction-rate"</i><span style="color: navy">;</span>
src.maxDosePerPeriod<span style="color: navy"><b> -> </b></span>tgt.maxDosePerPeriod <i>"DosageInstruction-maxDosePerPeriod"</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>