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="Medication3to4"/>
<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/Medication3to4'</span>
<span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'Medication3to4'</span>
<span style="color: #cc00cc">/// <b>title</b> = </span><span style="color: blue">'Medication Transforms: R3 to R4 '</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/Medication<span style="color: navy">" </span><b>alias </b>MedicationR3 <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> "</span>http://hl7.org/fhir/4.0/Medication<span style="color: navy">" </span><b>alias </b>Medication <b>as </b><b>target</b>
<b>imports</b><span style="color: navy"> "</span>http://hl7.org/fhir/StructureMap/*3to4<span style="color: navy">"
</span>
<b>group </b>Medication<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>MedicationR3, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>Medication<span style="color: navy">)</span><b> extends </b>DomainResource<b> <<type+>></b><span style="color: navy"> {
</span> src.code<span style="color: navy"><b> -> </b></span>tgt.code<span style="color: navy">;</span>
src.status<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span> tgt.extension<b> as </b><span style="color: maroon">vt</span><span style="color: navy">, </span> vt.url = <span style="color: blue">'http://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.status'</span><span style="color: navy">, </span> vt.value = <span style="color: maroon">v</span><span style="color: navy">;</span>
src.isBrand<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span> tgt.extension<b> as </b><span style="color: maroon">vt</span><span style="color: navy">, </span> vt.url = <span style="color: blue">'hhttp://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.isBrand'</span><span style="color: navy">, </span> vt.value = <span style="color: maroon">v</span><span style="color: navy">;</span>
src.isOverTheCounter<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span> tgt.extension<b> as </b><span style="color: maroon">vt</span><span style="color: navy">, </span> vt.url = <span style="color: blue">'http://hl7.org/fhir/3.0/StructureDefinition/extension-MedicationOTC'</span><span style="color: navy">, </span> vt.value = <span style="color: maroon">v</span><span style="color: navy">;</span>
src.manufacturer<span style="color: navy"><b> -> </b></span>tgt.manufacturer<span style="color: navy">;</span>
src.form<span style="color: navy"><b> -> </b></span>tgt.form<span style="color: navy">;</span>
src.ingredient<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -> </b></span>tgt.ingredient<b> as </b><span style="color: maroon">vt0</span><b> then </b>ingredient<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><span style="color: navy">;</span>
src.package<b> as </b><span style="color: maroon">vs0</span><b> then </b>package<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><span style="color: navy">;</span>
src.image<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span> tgt.extension<b> as </b><span style="color: maroon">vt</span><span style="color: navy">, </span> vt.url = <span style="color: blue">'http://hl7.org/fhir/3.0/StructureDefinition/extension-MedicationImage'</span><span style="color: navy">, </span> vt.value = <span style="color: maroon">v</span><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>ingredient<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.item<span style="color: navy"> : </span>CodeableConcept<b> as </b><span style="color: maroon">vs</span><span style="color: navy"><b> -> </b></span>tgt.item = <b>create</b><span style="color: navy">(</span><span style="color: blue">'CodeableConcept'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">vt</span><b> then </b>CodeableConcept<span style="color: navy">(</span><span style="color: maroon">vs</span><span style="color: navy">, </span><span style="color: maroon">vt</span><span style="color: navy">)</span><span style="color: navy">;</span>
src.item<span style="color: navy"> : </span>Reference<b> as </b><span style="color: maroon">vs</span><span style="color: navy"><b> -> </b></span>tgt.item = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Reference'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">vt</span><b> then </b>Reference<span style="color: navy">(</span><span style="color: maroon">vs</span><span style="color: navy">, </span><span style="color: maroon">vt</span><span style="color: navy">)</span><span style="color: navy">;</span>
src.isActive<span style="color: navy"><b> -> </b></span>tgt.isActive<span style="color: navy">;</span>
src.amount<span style="color: navy"><b> -> </b></span>tgt.strength<span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>package<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><span style="color: navy"> {
</span> src.container<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span> tgt.extension<b> as </b><span style="color: maroon">vt</span><span style="color: navy">, </span> vt.url = <span style="color: blue">'http://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.package.container'</span><span style="color: navy">, </span> vt.value = <span style="color: maroon">v</span><span style="color: navy">;</span>
src.content<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -> </b></span> tgt.extension<b> as </b><span style="color: maroon">vt</span><span style="color: navy">, </span> vt.url = <span style="color: blue">'http://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.package.content'</span><b> then </b>content<span style="color: navy">(</span><span style="color: maroon">vs0</span><span style="color: navy">, </span><span style="color: maroon">vt</span><span style="color: navy">)</span><span style="color: navy">;</span>
src.batch<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -> </b></span>tgt.batch<b> as </b><span style="color: maroon">vt0</span><b> then </b>batch<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><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>content<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.item<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span> tgt.extension<b> as </b><span style="color: maroon">vt</span><span style="color: navy">, </span> vt.url = <span style="color: blue">'http://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.package.content'</span><span style="color: navy">, </span> vt.value = <span style="color: maroon">v</span><span style="color: navy">;</span>
src.amount<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span> tgt.extension<b> as </b><span style="color: maroon">vt</span><span style="color: navy">, </span> vt.url = <span style="color: blue">'http://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.package.content.amount'</span><span style="color: navy">, </span> vt.value = <span style="color: maroon">v</span><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>batch<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.lotNumber<span style="color: navy"><b> -> </b></span>tgt.lotNumber<span style="color: navy">;</span>
src.expirationDate<span style="color: navy"><b> -> </b></span>tgt.expirationDate<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/Medication3to4"/>
<version value="0.1.0"/>
<name value="Medication3to4"/>
<title value="Medication Transforms: R3 to R4 "/>
<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="MedicationTransformsR3toR4"/>
<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/Medication"/>
<mode value="source"/>
<alias value="MedicationR3"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/4.0/Medication"/>
<mode value="target"/>
<alias value="Medication"/>
</structure>
<import value="http://hl7.org/fhir/StructureMap/*3to4"/>
<group>
<name value="Medication"/>
<extends value="DomainResource"/>
<typeMode value="type-and-types"/>
<input>
<name value="src"/>
<type value="MedicationR3"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="Medication"/>
<mode value="target"/>
</input>
<rule>
<name value="code"/>
<source>
<context value="src"/>
<element value="code"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="code"/>
<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="status"/>
<source>
<context value="src"/>
<element value="status"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<element value="extension"/>
<variable value="vt"/>
</target>
<target>
<context value="vt"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.status"/>
</parameter>
</target>
<target>
<context value="vt"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
</rule>
<rule>
<name value="isBrand"/>
<source>
<context value="src"/>
<element value="isBrand"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<element value="extension"/>
<variable value="vt"/>
</target>
<target>
<context value="vt"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="hhttp://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.isBrand"/>
</parameter>
</target>
<target>
<context value="vt"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
</rule>
<rule>
<name value="isOverTheCounter"/>
<source>
<context value="src"/>
<element value="isOverTheCounter"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<element value="extension"/>
<variable value="vt"/>
</target>
<target>
<context value="vt"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://hl7.org/fhir/3.0/StructureDefinition/extension-MedicationOTC"/>
</parameter>
</target>
<target>
<context value="vt"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
</rule>
<rule>
<name value="manufacturer"/>
<source>
<context value="src"/>
<element value="manufacturer"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="manufacturer"/>
<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="form"/>
<source>
<context value="src"/>
<element value="form"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="form"/>
<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="ingredient"/>
<source>
<context value="src"/>
<element value="ingredient"/>
<variable value="vs0"/>
</source>
<target>
<context value="tgt"/>
<element value="ingredient"/>
<variable value="vt0"/>
</target>
<dependent>
<name value="ingredient"/>
<parameter>
<valueId value="vs0"/>
</parameter>
<parameter>
<valueId value="vt0"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="package"/>
<source>
<context value="src"/>
<element value="package"/>
<variable value="vs0"/>
</source>
<dependent>
<name value="package"/>
<parameter>
<valueId value="vs0"/>
</parameter>
<parameter>
<valueId value="tgt"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="image"/>
<source>
<context value="src"/>
<element value="image"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<element value="extension"/>
<variable value="vt"/>
</target>
<target>
<context value="vt"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://hl7.org/fhir/3.0/StructureDefinition/extension-MedicationImage"/>
</parameter>
</target>
<target>
<context value="vt"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
</rule>
</group>
<group>
<name value="ingredient"/>
<extends value="BackboneElement"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<rule>
<name value="itemCodeableConcept"/>
<source>
<context value="src"/>
<type value="CodeableConcept"/>
<element value="item"/>
<variable value="vs"/>
</source>
<target>
<context value="tgt"/>
<element value="item"/>
<variable value="vt"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<dependent>
<name value="CodeableConcept"/>
<parameter>
<valueId value="vs"/>
</parameter>
<parameter>
<valueId value="vt"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="itemReference"/>
<source>
<context value="src"/>
<type value="Reference"/>
<element value="item"/>
<variable value="vs"/>
</source>
<target>
<context value="tgt"/>
<element value="item"/>
<variable value="vt"/>
<transform value="create"/>
<parameter>
<valueString value="Reference"/>
</parameter>
</target>
<dependent>
<name value="Reference"/>
<parameter>
<valueId value="vs"/>
</parameter>
<parameter>
<valueId value="vt"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="isActive"/>
<source>
<context value="src"/>
<element value="isActive"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="isActive"/>
<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="amount"/>
<source>
<context value="src"/>
<element value="amount"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="strength"/>
<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="package"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<rule>
<name value="container"/>
<source>
<context value="src"/>
<element value="container"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<element value="extension"/>
<variable value="vt"/>
</target>
<target>
<context value="vt"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.package.container"/>
</parameter>
</target>
<target>
<context value="vt"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
</rule>
<rule>
<name value="content"/>
<source>
<context value="src"/>
<element value="content"/>
<variable value="vs0"/>
</source>
<target>
<context value="tgt"/>
<element value="extension"/>
<variable value="vt"/>
</target>
<target>
<context value="vt"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.package.content"/>
</parameter>
</target>
<dependent>
<name value="content"/>
<parameter>
<valueId value="vs0"/>
</parameter>
<parameter>
<valueId value="vt"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="batch"/>
<source>
<context value="src"/>
<element value="batch"/>
<variable value="vs0"/>
</source>
<target>
<context value="tgt"/>
<element value="batch"/>
<variable value="vt0"/>
</target>
<dependent>
<name value="batch"/>
<parameter>
<valueId value="vs0"/>
</parameter>
<parameter>
<valueId value="vt0"/>
</parameter>
</dependent>
</rule>
</group>
<group>
<name value="content"/>
<extends value="Element"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<rule>
<name value="item"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<element value="extension"/>
<variable value="vt"/>
</target>
<target>
<context value="vt"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.package.content"/>
</parameter>
</target>
<target>
<context value="vt"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
</rule>
<rule>
<name value="amount"/>
<source>
<context value="src"/>
<element value="amount"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<element value="extension"/>
<variable value="vt"/>
</target>
<target>
<context value="vt"/>
<element value="url"/>
<transform value="copy"/>
<parameter>
<valueString
value="http://hl7.org/fhir/3.0/StructureDefinition/extension-Medication.package.content.amount"/>
</parameter>
</target>
<target>
<context value="vt"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
</rule>
</group>
<group>
<name value="batch"/>
<extends value="BackboneElement"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<rule>
<name value="lotNumber"/>
<source>
<context value="src"/>
<element value="lotNumber"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="lotNumber"/>
<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="expirationDate"/>
<source>
<context value="src"/>
<element value="expirationDate"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="expirationDate"/>
<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>