FHIR Cross-Version Mapping Pack
0.1.0 - Ballot for Release 5.1.0 International flag

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

: DocumentReference Transforms: R3 to R4 - XML Representation

Page standards status: Draft Maturity Level: 1

Raw xml | Download



<StructureMap xmlns="http://hl7.org/fhir">
  <id value="DocumentReference3to4"/>
  <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/DocumentReference3to4'</span>
<span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'DocumentReference3to4'</span>
<span style="color: #cc00cc">/// <b>title</b> = </span><span style="color: blue">'DocumentReference Transforms: R3 to R4'</span>
<span style="color: #cc00cc">/// <b>status</b> = </span><span style="color: blue">'active'</span>

<b>uses</b><span style="color: navy"> &quot;</span>http://hl7.org/fhir/3.0/DocumentReference<span style="color: navy">&quot; </span><b>alias </b>DocumentReferenceR3 <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> &quot;</span>http://hl7.org/fhir/4.0/DocumentReference<span style="color: navy">&quot; </span><b>alias </b>DocumentReference <b>as </b><b>target</b>

<b>imports</b><span style="color: navy"> &quot;</span>http://hl7.org/fhir/StructureMap/*3to4<span style="color: navy">&quot;
</span>
<b>group </b>DocumentReference<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>DocumentReferenceR3, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>DocumentReference<span style="color: navy">)</span><b> extends </b>DomainResource<b> &lt;&lt;type+&gt;&gt;</b><span style="color: navy"> {
</span>  src.masterIdentifier<span style="color: navy"><b> -&gt; </b></span>tgt.masterIdentifier<span style="color: navy">;</span>
  src.identifier<span style="color: navy"><b> -&gt; </b></span>tgt.identifier<span style="color: navy">;</span>
  src.status<span style="color: navy"><b> -&gt; </b></span>tgt.status<span style="color: navy">;</span>
  src.docStatus<span style="color: navy"><b> -&gt; </b></span>tgt.docStatus<span style="color: navy">;</span>
  src.type<span style="color: navy"><b> -&gt; </b></span>tgt.type<span style="color: navy">;</span>
  src.class<span style="color: navy"><b> -&gt; </b></span>tgt.category<span style="color: navy">;</span>
  src.subject<span style="color: navy"><b> -&gt; </b></span>tgt.subject<span style="color: navy">;</span>
  src.indexed<span style="color: navy"><b> -&gt; </b></span>tgt.date<span style="color: navy">;</span>
  src.created<b> as </b><span style="color: maroon">vs</span><span style="color: navy"><b> -&gt; </b></span> tgt.extension<b> as </b><span style="color: maroon">ext</span><span style="color: navy">, </span> ext.url = <span style="color: blue">'http://hl7.org/fhir/3.0/StructureDefinition/extension-DocumentReference.created'</span><span style="color: navy">, </span> ext.value = <span style="color: maroon">vs</span><span style="color: navy">;</span>
  src.author<b> as </b><span style="color: maroon">s</span><span style="color: navy"><b> -&gt; </b></span>tgt.agent<b> as </b><span style="color: maroon">t</span><b> then </b>agent<span style="color: navy">(</span><span style="color: maroon">s</span><span style="color: navy">, </span><span style="color: maroon">t</span><span style="color: navy">)</span><span style="color: navy">;</span>
  src.authenticator<span style="color: navy"><b> -&gt; </b></span>tgt.authenticator<span style="color: navy">;</span>
  src.custodian<span style="color: navy"><b> -&gt; </b></span>tgt.custodian<span style="color: navy">;</span>
  src.relatesTo<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -&gt; </b></span>tgt.relatesTo<b> as </b><span style="color: maroon">vt0</span><b> then </b>relatesTo<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: navy">;</span>
  src.description<span style="color: navy"><b> -&gt; </b></span>tgt.description<span style="color: navy">;</span>
  src.securityLabel<span style="color: navy"><b> -&gt; </b></span>tgt.securityLabel<span style="color: navy">;</span>
  src.content<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -&gt; </b></span>tgt.content<b> as </b><span style="color: maroon">vt0</span><b> then </b>content<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: navy">;</span>
  src.context<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -&gt; </b></span>tgt.context<b> as </b><span style="color: maroon">vt0</span><b> then </b>context<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: navy">;</span>
<span style="color: navy">}

</span><b>group </b>agent<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<span style="color: navy"><b> -&gt; </b></span> tgt.type<b> as </b><span style="color: maroon">cc</span><span style="color: navy">, </span> cc.coding<b> as </b><span style="color: maroon">c</span><span style="color: navy">, </span> c.system = <span style="color: blue">'http://terminology.hl7.org/CodeSystem/v3-ParticipationType'</span><span style="color: navy">, </span> c.code = <span style="color: blue">'AUT'</span> <i>&quot;author&quot;</i><span style="color: navy">;</span>
  src<span style="color: navy"><b> -&gt; </b></span>tgt.who<b> as </b><span style="color: maroon">vt0</span><b> then </b>Reference<span style="color: navy">(</span><span style="color: maroon">src</span><span style="color: navy">, </span><span style="color: maroon">vt0</span><span style="color: navy">)</span> <i>&quot;who&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>relatesTo<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.code<span style="color: navy"><b> -&gt; </b></span>tgt.code<span style="color: navy">;</span>
  src.target<span style="color: navy"><b> -&gt; </b></span>tgt.target<span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>content<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.attachment<span style="color: navy"><b> -&gt; </b></span>tgt.attachment<span style="color: navy">;</span>
  src.format<span style="color: navy"><b> -&gt; </b></span>tgt.format<span style="color: navy">;</span>
<span style="color: navy">}

</span><b>group </b>context<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.encounter<span style="color: navy"><b> -&gt; </b></span>tgt.encounter<span style="color: navy">;</span>
  src.event<span style="color: navy"><b> -&gt; </b></span>tgt.event<span style="color: navy">;</span>
  src.period<span style="color: navy"><b> -&gt; </b></span>tgt.period<span style="color: navy">;</span>
  src.facilityType<span style="color: navy"><b> -&gt; </b></span>tgt.facilityType<span style="color: navy">;</span>
  src.practiceSetting<span style="color: navy"><b> -&gt; </b></span>tgt.practiceSetting<span style="color: navy">;</span>
  src.sourcePatientInfo<span style="color: navy"><b> -&gt; </b></span>tgt.sourcePatientInfo<span style="color: navy">;</span>
  src.related<b> as </b><span style="color: maroon">vs0</span><span style="color: navy"><b> -&gt; </b></span>tgt.related<b> as </b><span style="color: maroon">vt0</span><b> then </b>related<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: navy">;</span>
<span style="color: navy">}

</span><b>group </b>related<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><span style="color: navy"> {
</span>  src.identifier<b> as </b><span style="color: maroon">vs0</span><b> then </b>Identifier2Reference<span style="color: navy">(</span><span style="color: maroon">vs0</span><span style="color: navy">, </span><span style="color: maroon">tgt</span><span style="color: navy">)</span><span style="color: navy">;</span>
  src.ref<b> as </b><span style="color: maroon">vs0</span><b> then </b>Reference<span style="color: navy">(</span><span style="color: maroon">vs0</span><span style="color: navy">, </span><span style="color: maroon">tgt</span><span style="color: navy">)</span><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/DocumentReference3to4"/>
  <version value="0.1.0"/>
  <name value="DocumentReference3to4"/>
  <title value="DocumentReference Transforms: R3 to R4"/>
  <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="DocumentReferenceTransformsR3toR4"/>
  <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/DocumentReference"/>
    <mode value="source"/>
    <alias value="DocumentReferenceR3"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/4.0/DocumentReference"/>
    <mode value="target"/>
    <alias value="DocumentReference"/>
  </structure>
  <import value="http://hl7.org/fhir/StructureMap/*3to4"/>
  <group>
    <name value="DocumentReference"/>
    <extends value="DomainResource"/>
    <typeMode value="type-and-types"/>
    <input>
      <name value="src"/>
      <type value="DocumentReferenceR3"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="DocumentReference"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="masterIdentifier"/>
      <source>
        <context value="src"/>
        <element value="masterIdentifier"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="masterIdentifier"/>
        <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="identifier"/>
      <source>
        <context value="src"/>
        <element value="identifier"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="identifier"/>
        <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="status"/>
      <source>
        <context value="src"/>
        <element value="status"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="status"/>
        <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="docStatus"/>
      <source>
        <context value="src"/>
        <element value="docStatus"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="docStatus"/>
        <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="type"/>
      <source>
        <context value="src"/>
        <element value="type"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="type"/>
        <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="class"/>
      <source>
        <context value="src"/>
        <element value="class"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="category"/>
        <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="subject"/>
      <source>
        <context value="src"/>
        <element value="subject"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="subject"/>
        <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="indexed"/>
      <source>
        <context value="src"/>
        <element value="indexed"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="date"/>
        <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="created"/>
      <source>
        <context value="src"/>
        <element value="created"/>
        <variable value="vs"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="extension"/>
        <variable value="ext"/>
      </target>
      <target>
        <context value="ext"/>
        <element value="url"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="http://hl7.org/fhir/3.0/StructureDefinition/extension-DocumentReference.created"/>
        </parameter>
      </target>
      <target>
        <context value="ext"/>
        <element value="value"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="vs"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="author"/>
      <source>
        <context value="src"/>
        <element value="author"/>
        <variable value="s"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="agent"/>
        <variable value="t"/>
      </target>
      <dependent>
        <name value="agent"/>
        <parameter>
          <valueId value="s"/>
        </parameter>
        <parameter>
          <valueId value="t"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="authenticator"/>
      <source>
        <context value="src"/>
        <element value="authenticator"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="authenticator"/>
        <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="custodian"/>
      <source>
        <context value="src"/>
        <element value="custodian"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="custodian"/>
        <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="relatesTo"/>
      <source>
        <context value="src"/>
        <element value="relatesTo"/>
        <variable value="vs0"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="relatesTo"/>
        <variable value="vt0"/>
      </target>
      <dependent>
        <name value="relatesTo"/>
        <parameter>
          <valueId value="vs0"/>
        </parameter>
        <parameter>
          <valueId value="vt0"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="description"/>
      <source>
        <context value="src"/>
        <element value="description"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="description"/>
        <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="securityLabel"/>
      <source>
        <context value="src"/>
        <element value="securityLabel"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="securityLabel"/>
        <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"/>
      <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="content"/>
        <parameter>
          <valueId value="vs0"/>
        </parameter>
        <parameter>
          <valueId value="vt0"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="context"/>
      <source>
        <context value="src"/>
        <element value="context"/>
        <variable value="vs0"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="context"/>
        <variable value="vt0"/>
      </target>
      <dependent>
        <name value="context"/>
        <parameter>
          <valueId value="vs0"/>
        </parameter>
        <parameter>
          <valueId value="vt0"/>
        </parameter>
      </dependent>
    </rule>
  </group>
  <group>
    <name value="agent"/>
    <extends value="BackboneElement"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="author"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="type"/>
        <variable value="cc"/>
      </target>
      <target>
        <context value="cc"/>
        <element value="coding"/>
        <variable value="c"/>
      </target>
      <target>
        <context value="c"/>
        <element value="system"/>
        <transform value="copy"/>
        <parameter>
          <valueString
                       value="http://terminology.hl7.org/CodeSystem/v3-ParticipationType"/>
        </parameter>
      </target>
      <target>
        <context value="c"/>
        <element value="code"/>
        <transform value="copy"/>
        <parameter>
          <valueString value="AUT"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="who"/>
      <source>
        <context value="src"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="who"/>
        <variable value="vt0"/>
      </target>
      <dependent>
        <name value="Reference"/>
        <parameter>
          <valueId value="src"/>
        </parameter>
        <parameter>
          <valueId value="vt0"/>
        </parameter>
      </dependent>
    </rule>
  </group>
  <group>
    <name value="relatesTo"/>
    <extends value="BackboneElement"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="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="target"/>
      <source>
        <context value="src"/>
        <element value="target"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="target"/>
        <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="content"/>
    <extends value="BackboneElement"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="attachment"/>
      <source>
        <context value="src"/>
        <element value="attachment"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="attachment"/>
        <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="format"/>
      <source>
        <context value="src"/>
        <element value="format"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="format"/>
        <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="context"/>
    <extends value="BackboneElement"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="encounter"/>
      <source>
        <context value="src"/>
        <element value="encounter"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="encounter"/>
        <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="event"/>
      <source>
        <context value="src"/>
        <element value="event"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="event"/>
        <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="period"/>
      <source>
        <context value="src"/>
        <element value="period"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="period"/>
        <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="facilityType"/>
      <source>
        <context value="src"/>
        <element value="facilityType"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="facilityType"/>
        <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="practiceSetting"/>
      <source>
        <context value="src"/>
        <element value="practiceSetting"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="practiceSetting"/>
        <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="sourcePatientInfo"/>
      <source>
        <context value="src"/>
        <element value="sourcePatientInfo"/>
        <variable value="vvv"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="sourcePatientInfo"/>
        <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="related"/>
      <source>
        <context value="src"/>
        <element value="related"/>
        <variable value="vs0"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="related"/>
        <variable value="vt0"/>
      </target>
      <dependent>
        <name value="related"/>
        <parameter>
          <valueId value="vs0"/>
        </parameter>
        <parameter>
          <valueId value="vt0"/>
        </parameter>
      </dependent>
    </rule>
  </group>
  <group>
    <name value="related"/>
    <input>
      <name value="src"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="identifier"/>
      <source>
        <context value="src"/>
        <element value="identifier"/>
        <variable value="vs0"/>
      </source>
      <dependent>
        <name value="Identifier2Reference"/>
        <parameter>
          <valueId value="vs0"/>
        </parameter>
        <parameter>
          <valueId value="tgt"/>
        </parameter>
      </dependent>
    </rule>
    <rule>
      <name value="ref"/>
      <source>
        <context value="src"/>
        <element value="ref"/>
        <variable value="vs0"/>
      </source>
      <dependent>
        <name value="Reference"/>
        <parameter>
          <valueId value="vs0"/>
        </parameter>
        <parameter>
          <valueId value="tgt"/>
        </parameter>
      </dependent>
    </rule>
  </group>
</StructureMap>