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">
<id value="Comments"/>
<language value="en"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap Comments</b></p><a name="Comments"> </a><a name="hcComments"> </a><pre class="fml">
<span style="color: #cc00cc">/// <b>url</b> = </span><span style="color: blue">'http://hl7.org/fhir/uv/mapping-language/StructureMap/Comments'</span>
<span style="color: #cc00cc">/// <b>version</b> = </span><span style="color: blue">'0.1.0'</span>
<span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'Comments'</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 use of comments in FML'</span>
<span style="color: navy">// </span><span style="color: green">comment on source structure import</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> <span style="color: navy">// </span><span style="color: green">trailing comment 1</span>
<span style="color: navy">// </span><span style="color: green">comment on target structure import</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>target</b> <span style="color: navy">// </span><span style="color: green">trailing comment 2</span>
<span style="color: navy">// </span><span style="color: green">This is a comment on the group</span>
<b>group </b>CommentsDemo<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> <span style="color: navy">// </span><span style="color: green">A comment preceding a rule R1</span>
<span style="color: navy">// </span><span style="color: green">with more than one line</span>
src.birthDate<span style="color: navy"><b> -> </b></span>tgt.birthDate <i>"R1"</i><span style="color: navy">;</span>
src.active<span style="color: navy"><b> -> </b></span>tgt.active <i>"R2"</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">A comment after R2</span>
src.name<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -> </b></span>tgt.name<b> as </b><span style="color: maroon">tn</span><b> then</b><span style="color: navy"> {
</span> <span style="color: navy">// </span><span style="color: green">before R3 comment</span>
v.family<span style="color: navy"><b> -> </b></span>tn.family <i>"R3"</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">after R3 comment</span>
<span style="color: navy">}</span> <i>"R4"</i><span style="color: navy">;</span>
<span style="color: navy">// </span><span style="color: green">and a trailing comment after all rules (before close of group)</span>
<span style="color: navy">}
</span></pre></div>
</text>
<url value="http://hl7.org/fhir/uv/mapping-language/StructureMap/Comments"/>
<identifier>
<system value="urn:ietf:rfc:3986"/>
<value value="urn:oid:2.16.840.1.113883.4.642.40.89.43.1"/>
</identifier>
<version value="0.1.0"/>
<name value="Comments"/>
<status value="active"/>
<date value="2026-10-15T22:52:06+00:00"/>
<publisher value="HL7 International / FHIR Infrastructure"/>
<contact>
<name value="HL7 International / FHIR Infrastructure"/>
<telecom>
<system value="url"/>
<value value="http://www.hl7.org/Special/committees/fiwg"/>
</telecom>
</contact>
<contact>
<telecom>
<system value="url"/>
<value value="http://www.hl7.org/Special/committees/fiwg"/>
</telecom>
</contact>
<description value="Example demonstrating the use of comments in FML"/>
<jurisdiction>
<coding>
<system value="http://unstats.un.org/unsd/methods/m49/m49.htm"/>
<code value="001"/>
<display value="World"/>
</coding>
</jurisdiction>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Patient"/>
<mode value="source"/>
<documentation value="comment on source structure import"/>
</structure>
<structure>
<url value="http://hl7.org/fhir/StructureDefinition/Patient"/>
<mode value="target"/>
<documentation value="comment on target structure import"/>
</structure>
<group>
<name value="CommentsDemo"/>
<documentation value="This is a comment on the group"/>
<input>
<name value="src"/>
<type value="Patient"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="Patient"/>
<mode value="target"/>
</input>
<rule>
<name value="R1"/>
<source>
<context value="src"/>
<element value="birthDate"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="birthDate"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<documentation
value="A comment preceding a rule R1
with more than one line"/>
</rule>
<rule>
<name value="R2"/>
<source>
<context value="src"/>
<element value="active"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="active"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
</rule>
<rule>
<name value="R4"/>
<source>
<context value="src"/>
<element value="name"/>
<variable value="v"/>
</source>
<target>
<context value="tgt"/>
<element value="name"/>
<variable value="tn"/>
</target>
<rule>
<name value="R3"/>
<source>
<context value="v"/>
<element value="family"/>
<variable value="vvv"/>
</source>
<target>
<context value="tn"/>
<element value="family"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<documentation value="before R3 comment"/>
</rule>
</rule>
</group>
</StructureMap>