FHIR Mapping Language (FML)
0.1.0 - STU 1 World

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

: GroupTypePlus

Page standards status: Informative

Raw xml | Download


<StructureMap xmlns="http://hl7.org/fhir"
              resourceDefinition="http://hl7.org/fhir/StructureDefinition/StructureMap|0.1.0">
  <id value="GroupTypePlus"/>
  <language value="en"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap GroupTypePlus</b></p><a name="GroupTypePlus"> </a><a name="hcGroupTypePlus"> </a><pre class="fml">
<span style="color: #cc00cc">/// <b>url</b> = </span><span style="color: blue">'http://hl7.org/fhir/uv/mapping-language/StructureMap/GroupTypePlus'</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">'GroupTypePlus'</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 type+ stereotype that also creates the target type when not fixed'</span>

<b>uses</b><span style="color: navy"> &quot;</span><a href="http://hl7.org/fhir/6.0.0-ballot5/observation.html" title="Observation">http://hl7.org/fhir/StructureDefinition/Observation</a><span style="color: navy">&quot; </span><b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> &quot;</span><a href="http://hl7.org/fhir/6.0.0-ballot5/observation.html" title="Observation">http://hl7.org/fhir/StructureDefinition/Observation</a><span style="color: navy">&quot; </span><b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> &quot;</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">&quot; </span><b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> &quot;</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">&quot; </span><b>as </b><b>target</b>
<b>uses</b><span style="color: navy"> &quot;</span><a href="http://hl7.org/fhir/6.0.0-ballot5/practitioner.html" title="Practitioner">http://hl7.org/fhir/StructureDefinition/Practitioner</a><span style="color: navy">&quot; </span><b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> &quot;</span><a href="http://hl7.org/fhir/6.0.0-ballot5/practitioner.html" title="Practitioner">http://hl7.org/fhir/StructureDefinition/Practitioner</a><span style="color: navy">&quot; </span><b>as </b><b>target</b>

<b>group </b>UseDefaultTypePlus<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>Observation, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>Observation<span style="color: navy">)</span><span style="color: navy"> {
</span>  src.id<span style="color: navy"><b> -&gt; </b></span>tgt.id<span style="color: navy">;</span>
  <span style="color: navy">// </span><span style="color: green">the datatype of contained is Resource (which is the base for all resources)</span>
  <span style="color: navy">// </span><span style="color: green">thus the source/target mapping isn't enough to work out what to do here.</span>
  <span style="color: navy">// </span><span style="color: green">So FML falls back to the &quot;default&quot; map to use given this source type</span>
  src.contained<span style="color: navy"><b> -&gt; </b></span>tgt.contained<span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>GroupTypePlusPatient<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><b> &lt;&lt;type+&gt;&gt;</b><span style="color: navy"> {
</span>  src.id<span style="color: navy"><b> -&gt; </b></span>tgt.id<span style="color: navy">;</span>
  src.name<span style="color: navy"><b> -&gt; </b></span>tgt.name<span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>GroupTypePlusPractitioner<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>Practitioner, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>Practitioner<span style="color: navy">)</span><b> &lt;&lt;type+&gt;&gt;</b><span style="color: navy"> {
</span>  src.id<span style="color: navy"><b> -&gt; </b></span>tgt.id<span style="color: navy">;</span>
  src.name<span style="color: navy"><b> -&gt; </b></span>tgt.name<span style="color: navy">;</span>
<span style="color: navy">}

</span></pre></div>
  </text>
  <url
       value="http://hl7.org/fhir/uv/mapping-language/StructureMap/GroupTypePlus"/>
  <identifier>
    <system value="urn:ietf:rfc:3986"/>
    <value value="urn:oid:2.16.840.1.113883.4.642.40.89.43.10"/>
  </identifier>
  <version value="0.1.0"/>
  <name value="GroupTypePlus"/>
  <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 type+ stereotype that also creates the target type when not fixed"/>
  <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/Observation"/>
    <mode value="source"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Observation"/>
    <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>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Practitioner"/>
    <mode value="source"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Practitioner"/>
    <mode value="target"/>
  </structure>
  <group>
    <name value="UseDefaultTypePlus"/>
    <input>
      <name value="src"/>
      <type value="Observation"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="Observation"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="id"/>
      <source>
        <context value="src"/>
        <element value="id"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="id"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="contained"/>
      <source>
        <context value="src"/>
        <element value="contained"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="contained"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
      <documentation
                     value="the datatype of contained is Resource (which is the base for all resources)
thus the source/target mapping isn't enough to work out what to do here.
So FML falls back to the &quot;default&quot; map to use given this source type"/>
    </rule>
  </group>
  <group>
    <name value="GroupTypePlusPatient"/>
    <typeMode value="type-and-types"/>
    <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="id"/>
      <source>
        <context value="src"/>
        <element value="id"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="id"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="name"/>
      <source>
        <context value="src"/>
        <element value="name"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="name"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
    </rule>
  </group>
  <group>
    <name value="GroupTypePlusPractitioner"/>
    <typeMode value="type-and-types"/>
    <input>
      <name value="src"/>
      <type value="Practitioner"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="Practitioner"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="id"/>
      <source>
        <context value="src"/>
        <element value="id"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="id"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
    </rule>
    <rule>
      <name value="name"/>
      <source>
        <context value="src"/>
        <element value="name"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="name"/>
        <variable value="vvv"/>
        <transform value="create"/>
      </target>
    </rule>
  </group>
</StructureMap>