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 GroupTypes</b></p><a name="GroupTypes"> </a><a name="hcGroupTypes"> </a><pre class="fml">
<span style="color: #cc00cc">/// <b>url</b> = </span><span style="color: blue">'http://hl7.org/fhir/uv/mapping-language/StructureMap/GroupTypes'</span>
<span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'GroupTypes'</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 the types stereotype marking a default mapping for a type pair'</span>
<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>source</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>target</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>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>group </b>UseDefaultTypes<span style="color: navy">(</span><b>source</b> <span style="color: maroon">srcP</span><span style="color: navy"> : </span>Patient, <b>target</b> <span style="color: maroon">tgtP</span><span style="color: navy"> : </span>Patient<span style="color: navy">)</span><span style="color: navy"> {
</span> <span style="color: navy">// </span><span style="color: green">this rule will resolve the HumanName source/target types</span>
<span style="color: navy">// </span><span style="color: green">to the GroupTypes group and call it</span>
srcP.name<span style="color: navy"><b> -> </b></span>tgtP.name<span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>GroupTypes<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>HumanName, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>HumanName<span style="color: navy">)</span><b> <<types>></b><span style="color: navy"> {
</span> <span style="color: navy">// </span><span style="color: green">This specific default group for mapping names will only copy the family and text,</span>
<span style="color: navy">// </span><span style="color: green">all other properties will be dropped</span>
src.family<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span>tgt.family = <span style="color: maroon">v</span><span style="color: navy">;</span>
src.text<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span>tgt.text = <span style="color: maroon">v</span><span style="color: navy">;</span>
<span style="color: navy">}
</span></pre></div>
</text>
<url
value="http://hl7.org/fhir/uv/mapping-language/StructureMap/GroupTypes"/>
<name value="GroupTypes"/>
<status value="active"/>
<description
value="Example demonstrating the types stereotype marking a default mapping for a type pair"/>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/HumanName"/>
<mode value="source"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/HumanName"/>
<mode value="target"/>
</structure>
<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>
<group>
<name value="UseDefaultTypes"/>
<input>
<mode value="source"/>
<name value="srcP"/>
<type value="Patient"/>
</input>
<input>
<mode value="target"/>
<name value="tgtP"/>
<type value="Patient"/>
</input>
<rule>
<source>
<context value="srcP"/>
<element value="name"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgtP"/>
<element value="name"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<documentation
value="this rule will resolve the HumanName source/target types
to the GroupTypes group and call it"/>
<name value="name"/>
</rule>
</group>
<group>
<name value="GroupTypes"/>
<input>
<mode value="source"/>
<name value="src"/>
<type value="HumanName"/>
</input>
<input>
<mode value="target"/>
<name value="tgt"/>
<type value="HumanName"/>
</input>
<rule>
<source>
<context value="src"/>
<element value="family"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<element value="family"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
<documentation
value="This specific default group for mapping names will only copy the family and text,
all other properties will be dropped"/>
<name value="family"/>
</rule>
<rule>
<source>
<context value="src"/>
<element value="text"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<element value="text"/>
<transform value="copy"/>
<parameter>
<valueId value="v"/>
</parameter>
</target>
<name value="text"/>
</rule>
<typeMode value="types"/>
</group>
<id value="GroupTypes"/>
<language value="en"/>
</StructureMap>