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="MedicationStatement2to3"/>
<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/MedicationStatement2to3'</span>
<span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'MedicationStatement2to3'</span>
<span style="color: #cc00cc">/// <b>title</b> = </span><span style="color: blue">'MedicationStatement 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"> "</span>http://hl7.org/fhir/1.0/MedicationStatement<span style="color: navy">" </span><b>alias </b>MedicationStatementR2 <b>as </b><b>source</b>
<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>target</b>
<b>imports</b><span style="color: navy"> "</span>http://hl7.org/fhir/StructureMap/*2to3<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>MedicationStatementR2, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>MedicationStatement<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.patient<span style="color: navy"><b> -> </b></span>tgt.subject <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<span style="color: navy"><b> -> </b></span>tgt.status <i>"MedicationStatement-status"</i><span style="color: navy">;</span>
src.wasNotTaken<b> as </b><span style="color: maroon">vt</span><b> where </b>$this = true<span style="color: navy"><b> -> </b></span>tgt.taken = <span style="color: blue">'n'</span> <i>"MedicationStatement-wasNotTaken"</i><span style="color: navy">;</span>
src.wasNotTaken<b> as </b><span style="color: maroon">vt</span><b> where </b>$this = false<span style="color: navy"><b> -> </b></span>tgt.taken = <span style="color: blue">'y'</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.reasonForUse<b> where </b>$this is CodeableConcept<span style="color: navy"><b> -> </b></span>tgt.reasonCode <i>"MedicationStatement-reasonForUse"</i><span style="color: navy">;</span>
src.reasonForUse<b> where </b>$this is Reference<span style="color: navy"><b> -> </b></span>tgt.reasonReference <i>"MedicationStatement-reasonForUse"</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.supportingInformation<span style="color: navy"><b> -> </b></span>tgt.derivedFrom <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<b> where </b>$this is CodeableConcept<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.quantity<span style="color: navy"><b> -> </b></span>tgt.dose <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/MedicationStatement2to3"/>
<version value="0.1.0"/>
<name value="MedicationStatement2to3"/>
<title value="MedicationStatement 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="MedicationStatementTransformsR2toR3"/>
<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/MedicationStatement"/>
<mode value="source"/>
<alias value="MedicationStatementR2"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/3.0/MedicationStatement"/>
<mode value="target"/>
<alias value="MedicationStatement"/>
</structure>
<import value="http://hl7.org/fhir/StructureMap/*2to3"/>
<group>
<name value="MedicationStatement"/>
<extends value="DomainResource"/>
<typeMode value="type-and-types"/>
<input>
<name value="src"/>
<type value="MedicationStatementR2"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="MedicationStatement"/>
<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="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="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"/>
</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="wasNotTaken"/>
<variable value="vt"/>
<condition value="$this = true"/>
</source>
<target>
<context value="tgt"/>
<element value="taken"/>
<transform value="copy"/>
<parameter>
<valueString value="n"/>
</parameter>
</target>
</rule>
<rule>
<name value="MedicationStatement-wasNotTaken"/>
<source>
<context value="src"/>
<element value="wasNotTaken"/>
<variable value="vt"/>
<condition value="$this = false"/>
</source>
<target>
<context value="tgt"/>
<element value="taken"/>
<transform value="copy"/>
<parameter>
<valueString value="y"/>
</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-reasonForUse"/>
<source>
<context value="src"/>
<element value="reasonForUse"/>
<variable value="vvv"/>
<condition value="$this is CodeableConcept"/>
</source>
<target>
<context value="tgt"/>
<element value="reasonCode"/>
<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-reasonForUse"/>
<source>
<context value="src"/>
<element value="reasonForUse"/>
<variable value="vvv"/>
<condition value="$this is Reference"/>
</source>
<target>
<context value="tgt"/>
<element value="reasonReference"/>
<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="supportingInformation"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="derivedFrom"/>
<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"/>
<condition value="$this is CodeableConcept"/>
</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="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="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>