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="Medication3to2"/>
<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/Medication3to2'</span>
<span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'Medication3to2'</span>
<span style="color: #cc00cc">/// <b>title</b> = </span><span style="color: blue">'Medication 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/Medication<span style="color: navy">" </span><b>alias </b>Medication <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> "</span>http://hl7.org/fhir/1.0/Medication<span style="color: navy">" </span><b>alias </b>MedicationR2 <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>Medication<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>Medication, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>MedicationR2<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 <i>"Medication-code"</i><span style="color: navy">;</span>
src.isBrand<span style="color: navy"><b> -> </b></span>tgt.isBrand <i>"Medication-isBrand"</i><span style="color: navy">;</span>
src.manufacturer<span style="color: navy"><b> -> </b></span>tgt.manufacturer <i>"Medication-manufacturer"</i><span style="color: navy">;</span>
src.form<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span> tgt.product<b> as </b><span style="color: maroon">vt0</span><span style="color: navy">, </span> vt0.form<b> as </b><span style="color: maroon">v</span> <i>"product-form"</i><span style="color: navy">;</span>
src.ingredient<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -> </b></span> tgt.product<b> as </b><span style="color: maroon">vt0</span><span style="color: navy">, </span> vt0.ingredient<b> as </b><span style="color: maroon">vt1</span><b> then </b>medIngredient<span style="color: navy">(</span><span style="color: maroon">vs0</span><span style="color: navy">, </span><span style="color: maroon">vt1</span><span style="color: navy">)</span> <i>"product-ingredient"</i><span style="color: navy">;</span>
src.package<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -> </b></span>tgt.package<b> as </b><span style="color: maroon">vt0</span><b> then </b>medPackage<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: maroon">tgt</span><span style="color: navy">)</span> <i>"Medication-package"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>medProduct<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.form<span style="color: navy"><b> -> </b></span>tgt.form <i>"product-form"</i><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>medIngredient<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>"product-ingredient"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>medIngredient<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<b> where </b>$this is Reference<span style="color: navy"><b> -> </b></span>tgt.item <i>"batch-item"</i><span style="color: navy">;</span>
src.amount<span style="color: navy"><b> -> </b></span>tgt.amount <i>"batch-amount"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>medBatch<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 <i>"batch-lotNumber"</i><span style="color: navy">;</span>
src.expirationDate<span style="color: navy"><b> -> </b></span>tgt.expirationDate <i>"batch-expirationDate"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>medPackage<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span>, <b>target</b> <span style="color: maroon">tgt</span>, <b>target</b> <span style="color: maroon">res</span><span style="color: navy">)</span><b> extends </b>BackboneElement<span style="color: navy"> {
</span> src.container<span style="color: navy"><b> -> </b></span>tgt.container <i>"package-container"</i><span style="color: navy">;</span>
src.content<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -> </b></span>tgt.content<b> as </b><span style="color: maroon">vt0</span><b> then </b>medContent<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>"package-content"</i><span style="color: navy">;</span>
src.batch<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -> </b></span> res.product<b> as </b><span style="color: maroon">vt1</span><span style="color: navy">, </span> vt1.batch<b> as </b><span style="color: maroon">vt0</span><b> then </b>medBatch<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>"product-batch"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>medContent<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<b> where </b>$this is Reference<span style="color: navy"><b> -> </b></span>tgt.item <i>"content-item"</i><span style="color: navy">;</span>
src.amount<span style="color: navy"><b> -> </b></span>tgt.amount <i>"content-amount"</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/Medication3to2"/>
<version value="0.1.0"/>
<name value="Medication3to2"/>
<title value="Medication 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="MedicationTransformsR3toR2"/>
<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="Medication"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/1.0/Medication"/>
<mode value="target"/>
<alias value="MedicationR2"/>
</structure>
<import value="http://hl7.org/fhir/StructureMap/*3to2"/>
<group>
<name value="Medication"/>
<extends value="DomainResource"/>
<typeMode value="type-and-types"/>
<input>
<name value="src"/>
<type value="Medication"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="MedicationR2"/>
<mode value="target"/>
</input>
<rule>
<name value="Medication-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="Medication-isBrand"/>
<source>
<context value="src"/>
<element value="isBrand"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="isBrand"/>
<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="Medication-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="product-form"/>
<source>
<context value="src"/>
<element value="form"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<element value="product"/>
<variable value="vt0"/>
</target>
<target>
<context value="vt0"/>
<element value="form"/>
<variable value="v"/>
</target>
</rule>
<rule>
<name value="product-ingredient"/>
<source>
<context value="src"/>
<element value="ingredient"/>
<variable value="vs0"/>
</source>
<target>
<context value="tgt"/>
<element value="product"/>
<variable value="vt0"/>
</target>
<target>
<context value="vt0"/>
<element value="ingredient"/>
<variable value="vt1"/>
</target>
<dependent>
<name value="medIngredient"/>
<parameter>
<valueId value="vs0"/>
</parameter>
<parameter>
<valueId value="vt1"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="Medication-package"/>
<source>
<context value="src"/>
<element value="package"/>
<variable value="vs0"/>
</source>
<target>
<context value="tgt"/>
<element value="package"/>
<variable value="vt0"/>
</target>
<dependent>
<name value="medPackage"/>
<parameter>
<valueId value="vs0"/>
</parameter>
<parameter>
<valueId value="vt0"/>
</parameter>
<parameter>
<valueId value="tgt"/>
</parameter>
</dependent>
</rule>
</group>
<group>
<name value="medProduct"/>
<extends value="BackboneElement"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<rule>
<name value="product-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="product-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="medIngredient"/>
<parameter>
<valueId value="vs0"/>
</parameter>
<parameter>
<valueId value="vt0"/>
</parameter>
</dependent>
</rule>
</group>
<group>
<name value="medIngredient"/>
<extends value="BackboneElement"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<rule>
<name value="batch-item"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="vvv"/>
<condition value="$this is Reference"/>
</source>
<target>
<context value="tgt"/>
<element value="item"/>
<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="batch-amount"/>
<source>
<context value="src"/>
<element value="amount"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="amount"/>
<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="medBatch"/>
<extends value="BackboneElement"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<rule>
<name value="batch-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="batch-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>
<group>
<name value="medPackage"/>
<extends value="BackboneElement"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<input>
<name value="res"/>
<mode value="target"/>
</input>
<rule>
<name value="package-container"/>
<source>
<context value="src"/>
<element value="container"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="container"/>
<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="package-content"/>
<source>
<context value="src"/>
<element value="content"/>
<variable value="vs0"/>
</source>
<target>
<context value="tgt"/>
<element value="content"/>
<variable value="vt0"/>
</target>
<dependent>
<name value="medContent"/>
<parameter>
<valueId value="vs0"/>
</parameter>
<parameter>
<valueId value="vt0"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="product-batch"/>
<source>
<context value="src"/>
<element value="batch"/>
<variable value="vs0"/>
</source>
<target>
<context value="res"/>
<element value="product"/>
<variable value="vt1"/>
</target>
<target>
<context value="vt1"/>
<element value="batch"/>
<variable value="vt0"/>
</target>
<dependent>
<name value="medBatch"/>
<parameter>
<valueId value="vs0"/>
</parameter>
<parameter>
<valueId value="vt0"/>
</parameter>
</dependent>
</rule>
</group>
<group>
<name value="medContent"/>
<extends value="BackboneElement"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<rule>
<name value="content-item"/>
<source>
<context value="src"/>
<element value="item"/>
<variable value="vvv"/>
<condition value="$this is Reference"/>
</source>
<target>
<context value="tgt"/>
<element value="item"/>
<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="content-amount"/>
<source>
<context value="src"/>
<element value="amount"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="amount"/>
<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>