FHIR Mapping Language (FML), 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/mapping-language-ig/ and changes regularly. See the Directory of published versions
| Page standards status: Informative |
<StructureMap xmlns="http://hl7.org/fhir"
resourceDefinition="http://hl7.org/fhir/StructureDefinition/StructureMap|0.1.0">
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap UsesQueriedProduced</b></p><a name="UsesQueriedProduced"> </a><a name="hcUsesQueriedProduced"> </a><pre class="fml">
<span style="color: #cc00cc">/// <b>url</b> = </span><span style="color: blue">'http://hl7.org/fhir/uv/mapping-language/StructureMap/UsesQueriedProduced'</span>
<span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'UsesQueriedProduced'</span>
<span style="color: #cc00cc">/// <b>status</b> = </span><span style="color: blue">'active'</span>
<span style="color: #cc00cc">/// <b>description</b> = </span><span style="color: blue">'Example demonstrating queried and produced modes in uses declarations - Only demonstrates produced, doesn\'t demonstrate queried.'</span>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/6.0.0-ballot5/patient.html" title="Patient">http://hl7.org/fhir/StructureDefinition/Patient</a><span style="color: navy">" </span><b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/6.0.0-ballot5/patient.html" title="Patient">http://hl7.org/fhir/StructureDefinition/Patient</a><span style="color: navy">" </span><b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> "</span><a href="http://hl7.org/fhir/6.0.0-ballot5/datatypes.html#HumanName" title="HumanName">http://hl7.org/fhir/StructureDefinition/HumanName</a><span style="color: navy">" </span><b>as </b><b>produced</b>
<b>group </b>UsesQueriedProduced<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>Patient, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>Patient<span style="color: navy">)</span><span style="color: navy"> {
</span> src.id<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span>tgt.id = <span style="color: maroon">v</span> <i>"r1"</i><span style="color: navy">;</span>
src.name<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span>tgt.name = <b>create</b><span style="color: navy">(</span><span style="color: blue">'HumanName'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">tn</span><b> then</b><span style="color: navy"> {
</span> v.family<b> as </b><span style="color: maroon">f</span><span style="color: navy"><b> -> </b></span>tn.family = <span style="color: maroon">f</span> <i>"setFamily"</i><span style="color: navy">;</span>
v.given<b> as </b><span style="color: maroon">f</span><span style="color: navy"><b> -> </b></span>tn.given = <span style="color: maroon">f</span> <i>"setGiven"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"r2"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span></pre></div>
</text>
<url
value="http://hl7.org/fhir/uv/mapping-language/StructureMap/UsesQueriedProduced"/>
<name value="UsesQueriedProduced"/>
<status value="active"/>
<description
value="Example demonstrating queried and produced modes in uses declarations - Only demonstrates produced, doesn't demonstrate queried."/>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Patient"/>
<mode value="source"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Patient"/>
<mode value="target"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/HumanName"/>
<mode value="produced"/>
</structure>
<group>
<name value="UsesQueriedProduced"/>
<input>
<mode value="source"/>
<name value="src"/>
<type value="Patient"/>
</input>
<input>
<mode value="target"/>
<name value="tgt"/>
<type value="Patient"/>
</input>
<rule>
<source>
<context value="src"/>
<element value="id"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<element value="id"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
<name value="r1"/>
</rule>
<rule>
<source>
<context value="src"/>
<element value="name"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<element value="name"/>
<transform value="create"/>
<parameter>
<valueString value="HumanName"/>
</parameter>
<variable value="tn"/>
</target>
<rule>
<source>
<context value="v"/>
<element value="family"/>
<variable value="f"/>
</source>
<target>
<context value="tn"/>
<element value="family"/>
<transform value="copy"/>
<parameter>
<valueId value="f"/>
</parameter>
</target>
<name value="setFamily"/>
</rule>
<rule>
<source>
<context value="v"/>
<element value="given"/>
<variable value="f"/>
</source>
<target>
<context value="tn"/>
<element value="given"/>
<transform value="copy"/>
<parameter>
<valueId value="f"/>
</parameter>
</target>
<name value="setGiven"/>
</rule>
<name value="r2"/>
</rule>
</group>
<id value="UsesQueriedProduced"/>
<language value="en"/>
</StructureMap>