SGHI FHIR Profile Implementation Guide
0.1.0 - ci-build

SGHI FHIR Profile Implementation Guide, published by Kathurima Kimathi. 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/savannahghi/sil_fhir_profile_ig/ and changes regularly. See the Directory of published versions

## : EpisodeOfCare Transforms: R4 → SGHI R5 - XML Representation

Active as of 2026-04-27

Raw xml | Download

    <StructureMap xmlns="http://hl7.org/fhir">
      <id value="EpisodeOfCare4toSGHI5"/>
      <text>
        <status value="generated"/>
        <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap EpisodeOfCare4toSGHI5</b></p><a name="EpisodeOfCare4toSGHI5"> </a><a name="hcEpisodeOfCare4toSGHI5"> </a><pre class="fml">
    <span style="color: #cc00cc">/// <b>url</b> = </span><span style="color: blue">'https://fhir.slade360.co.ke/fhir/StructureMap/EpisodeOfCare4toSGHI5'</span>
    <span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'EpisodeOfCare4toSGHI5'</span>
    <span style="color: #cc00cc">/// <b>title</b> = </span><span style="color: blue">'EpisodeOfCare Transforms: R4 → SGHI R5'</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/4.0/StructureDefinition/EpisodeOfCare<span style="color: navy">&quot; </span><b>alias </b>EpisodeOfCareR4 <b>as </b><b>source</b>
    <b>uses</b><span style="color: navy"> &quot;</span><a href="StructureDefinition-episodeofcare.html" title="SGHI EpisodeOfCare">https://fhir.slade360.co.ke/fhir/StructureDefinition/episodeofcare</a><span style="color: navy">&quot; </span><b>alias </b>SGHIEpisodeOfCare <b>as </b><b>target</b>

    <b>imports</b><span style="color: navy"> &quot;</span>http://hl7.org/fhir/StructureMap/*4to5<span style="color: navy">&quot;
    </span>
    <b>group </b>SGHIEpisodeOfCare<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>EpisodeOfCareR4, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>SGHIEpisodeOfCare<span style="color: navy">)</span><b> extends </b>DomainResource<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.active<span style="color: navy"><b> -&gt; </b></span>tgt.active = <span style="color: blue">'true'</span><span style="color: navy">;</span>
      src.language<span style="color: navy"><b> -&gt; </b></span>tgt.language<span style="color: navy">;</span>
      src<span style="color: navy"><b> -&gt; </b></span>tgt.text = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Narrative'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">tgt_n</span><b> then</b><span style="color: navy"> {
    </span>    src<span style="color: navy"><b> -&gt; </b></span>tgt_n.status = <span style="color: blue">'generated'</span> <i>&quot;settextstatus&quot;</i><span style="color: navy">;</span>
        src<span style="color: navy"><b> -&gt; </b></span>tgt_n.div = <span style="color: blue">'&lt;div xmlns=\&quot;http://www.w3.org/1999/xhtml\&quot;&gt;&lt;h1&gt;Generated text&lt;/h1&gt;&lt;/div&gt;'</span> <i>&quot;settextdiv&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;createhardcodedtext&quot;</i><span style="color: navy">;</span>
      src<b> as </b><span style="color: maroon">sc</span><b> where </b>identifier.exists().not()<span style="color: navy"><b> -&gt; </b></span>tgt.identifier = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Identifier'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">tt_id</span><b> then</b><span style="color: navy"> {
    </span>    src.id<b> as </b><span style="color: maroon">uuid</span><span style="color: navy"><b> -&gt; </b></span>tt_id.value = <span style="color: maroon">uuid</span> <i>&quot;creating id&quot;</i><span style="color: navy">;</span>
        src<span style="color: navy"><b> -&gt; </b></span>tt_id.use = <span style="color: blue">'official'</span> <i>&quot;creating use&quot;</i><span style="color: navy">;</span>
        src<span style="color: navy"><b> -&gt; </b></span>tt_id.type<b> as </b><span style="color: maroon">ty</span><b> then</b><span style="color: navy"> {
    </span>      src<span style="color: navy"><b> -&gt; </b></span>ty.coding = <b>create</b><span style="color: navy">(</span><span style="color: blue">'CodeableConcept'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">ty_c</span><b> then</b><span style="color: navy"> {
    </span>        src<span style="color: navy"><b> -&gt; </b></span>ty_c.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem'</span> <i>&quot;creating coding&quot;</i><span style="color: navy">;</span>
            src<span style="color: navy"><b> -&gt; </b></span>ty_c.code = <span style="color: blue">'fhir-id'</span> <i>&quot;creating code&quot;</i><span style="color: navy">;</span>
            src<span style="color: navy"><b> -&gt; </b></span>ty_c.display = <span style="color: blue">'FHIR Id'</span> <i>&quot;creating display&quot;</i><span style="color: navy">;</span>
          <span style="color: navy">}</span> <i>&quot;creating identifier type&quot;</i><span style="color: navy">;</span>
          src<span style="color: navy"><b> -&gt; </b></span>tt_id.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem'</span> <i>&quot;creating system&quot;</i><span style="color: navy">;</span>
          src.managingOrganization<b> as </b><span style="color: maroon">sp</span><span style="color: navy"><b> -&gt; </b></span>tt_id.assigner = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Reference'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">t_assigner</span><b> then</b><span style="color: navy"> {
    </span>        sp.reference<span style="color: navy"><b> -&gt; </b></span>t_assigner.reference<span style="color: navy">;</span>
            sp.display<span style="color: navy"><b> -&gt; </b></span>t_assigner.display<span style="color: navy">;</span>
          <span style="color: navy">}</span><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;creating identifier type&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;creating identifier&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">Create identifier</span>
      src.managingOrganization<b> as </b><span style="color: maroon">smo</span><span style="color: navy"><b> -&gt; </b></span>tgt.managingOrganization = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Reference'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">tmo</span><b> then</b><span style="color: navy"> {
    </span>    smo.reference<span style="color: navy"><b> -&gt; </b></span>tmo.reference<span style="color: navy">;</span>
        smo.display<b> where </b>display.exists()<span style="color: navy"><b> -&gt; </b></span>tmo.display<span style="color: navy">;</span>
        src.managingOrganization<b> where </b>display.exists().not()<span style="color: navy"><b> -&gt; </b></span>tmo.display = <span style="color: blue">'Organization'</span><span style="color: navy">;</span>
        smo.display<span style="color: navy"><b> -&gt; </b></span>tmo.display<span style="color: navy">;</span>
      <span style="color: navy">}</span><span style="color: navy">;</span>
      src.status<span style="color: navy"><b> -&gt; </b></span>tgt.status<span style="color: navy">;</span>
      src.meta<b> as </b><span style="color: maroon">s_meta</span><span style="color: navy"><b> -&gt; </b></span>tgt.meta<b> as </b><span style="color: maroon">t_meta</span><b> then</b><span style="color: navy"> {
    </span>    s_meta.lastUpdated<span style="color: navy"><b> -&gt; </b></span>t_meta.lastUpdated<span style="color: navy">;</span>
        s_meta.language<span style="color: navy"><b> -&gt; </b></span>t_meta.language<span style="color: navy">;</span>
        s_meta.tags<span style="color: navy"><b> -&gt; </b></span>t_meta.tags<span style="color: navy">;</span>
        src.meta<b> where </b>profile.exists().not()<span style="color: navy"><b> -&gt; </b></span>t_meta.profile = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/StructureDefinition/episodeofcare'</span> <i>&quot;setprofileinmeta&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;set profile in meta&quot;</i><span style="color: navy">;</span>
      src.period<span style="color: navy"><b> -&gt; </b></span>tgt.period<span style="color: navy">;</span>
      src.patient<span style="color: navy"><b> -&gt; </b></span>tgt.patient<span style="color: navy">;</span>
      src<b> where </b>statusHistory.exists().not()<span style="color: navy"><b> -&gt; </b></span>tgt.statusHistory = <b>create</b><span style="color: navy">(</span><span style="color: blue">'BackboneElement'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">th</span><b> then</b><span style="color: navy"> {
    </span>    src<span style="color: navy"><b> -&gt; </b></span>th.status = <span style="color: blue">'planned'</span> <i>&quot;set default status&quot;</i><span style="color: navy">;</span>
        src<span style="color: navy"><b> -&gt; </b></span>th.period = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Period'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">tp</span><b> then</b><span style="color: navy"> {
    </span>      src.period<b> as </b><span style="color: maroon">sp</span><span style="color: navy"><b> -&gt; </b></span>th.period<b> as </b><span style="color: maroon">tp</span><b> then </b>TransformPeriod<span style="color: navy">(</span><span style="color: maroon">sp</span><span style="color: navy">, </span><span style="color: maroon">tp</span><span style="color: navy">)</span><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;copying status history period&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;creating status history&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}

    </span><b>group </b>TransformAssigner<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> &lt;&lt;types&gt;&gt;</b><span style="color: navy"> {
    </span>  src.reference<span style="color: navy"><b> -&gt; </b></span>tgt.reference<span style="color: navy">;</span>
      src.display<span style="color: navy"><b> -&gt; </b></span>tgt.display<span style="color: navy">;</span>
    <span style="color: navy">}

    </span><b>group </b>TransformPeriod<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> &lt;&lt;types&gt;&gt;</b><span style="color: navy"> {
    </span>  src.start<span style="color: navy"><b> -&gt; </b></span>tgt.start<span style="color: navy">;</span>
      src.end<span style="color: navy"><b> -&gt; </b></span>tgt.end<span style="color: navy">;</span>
    <span style="color: navy">}

    </span></pre></div>
      </text>
      <url
           value="https://fhir.slade360.co.ke/fhir/StructureMap/EpisodeOfCare4toSGHI5"/>
      <version value="0.1.0"/>
      <name value="EpisodeOfCare4toSGHI5"/>
      <title value="EpisodeOfCare Transforms: R4 → SGHI R5"/>
      <status value="active"/>
      <date value="2026-04-27T09:21:43+00:00"/>
      <publisher value="Kathurima Kimathi"/>
      <contact>
        <name value="Kathurima Kimathi"/>
        <telecom>
          <system value="url"/>
          <value value="https://www.linkedin.com/in/kathurima-kimathi/"/>
        </telecom>
        <telecom>
          <system value="email"/>
          <value value="kathurimakimathi415@gmail.com"/>
        </telecom>
      </contact>
      <contact>
        <name value="Oscar John"/>
        <telecom>
          <system value="email"/>
          <value value="oscarjohnotieno@gmail.com"/>
          <use value="work"/>
        </telecom>
      </contact>
      <contact>
        <name value="Kennedy Omondi"/>
        <telecom>
          <system value="email"/>
          <value value="kennankole@gmail.com"/>
          <use value="work"/>
        </telecom>
      </contact>
      <description value="EpisodeOfCareTransformsR4SGHIR5"/>
      <structure>
        <url value="http://hl7.org/fhir/4.0/StructureDefinition/EpisodeOfCare"/>
        <mode value="source"/>
        <alias value="EpisodeOfCareR4"/>
      </structure>
      <structure>
        <url
             value="https://fhir.slade360.co.ke/fhir/StructureDefinition/episodeofcare"/>
        <mode value="target"/>
        <alias value="SGHIEpisodeOfCare"/>
      </structure>
      <import value="http://hl7.org/fhir/StructureMap/*4to5"/>
      <group>
        <name value="SGHIEpisodeOfCare"/>
        <extends value="DomainResource"/>
        <typeMode value="type-and-types"/>
        <input>
          <name value="src"/>
          <type value="EpisodeOfCareR4"/>
          <mode value="source"/>
        </input>
        <input>
          <name value="tgt"/>
          <type value="SGHIEpisodeOfCare"/>
          <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>
          <dependent>
            <name value="DefaultMappingGroupAnonymousAlias"/>
            <parameter>
              <valueId value="vvv"/>
            </parameter>
            <parameter>
              <valueId value="vvv"/>
            </parameter>
          </dependent>
        </rule>
        <rule>
          <name value="active"/>
          <source>
            <context value="src"/>
            <element value="active"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="active"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="true"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="language"/>
          <source>
            <context value="src"/>
            <element value="language"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="language"/>
            <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="createhardcodedtext"/>
          <source>
            <context value="src"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="text"/>
            <variable value="tgt_n"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Narrative"/>
            </parameter>
          </target>
          <rule>
            <name value="settextstatus"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="tgt_n"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="generated"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="settextdiv"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="tgt_n"/>
              <element value="div"/>
              <transform value="copy"/>
              <parameter>
                <valueString
                             value="&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;h1&gt;Generated text&lt;/h1&gt;&lt;/div&gt;"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="creating identifier"/>
          <source>
            <context value="src"/>
            <variable value="sc"/>
            <condition value="identifier.exists().not()"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="identifier"/>
            <variable value="tt_id"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Identifier"/>
            </parameter>
          </target>
          <rule>
            <name value="creating id"/>
            <source>
              <context value="src"/>
              <element value="id"/>
              <variable value="uuid"/>
            </source>
            <target>
              <context value="tt_id"/>
              <element value="value"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="uuid"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="creating use"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="tt_id"/>
              <element value="use"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="official"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="creating identifier type"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="tt_id"/>
              <element value="type"/>
              <variable value="ty"/>
            </target>
            <rule>
              <name value="creating identifier type"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="ty"/>
                <element value="coding"/>
                <variable value="ty_c"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="CodeableConcept"/>
                </parameter>
              </target>
              <rule>
                <name value="creating coding"/>
                <source>
                  <context value="src"/>
                </source>
                <target>
                  <context value="ty_c"/>
                  <element value="system"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString
                                 value="https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="creating code"/>
                <source>
                  <context value="src"/>
                </source>
                <target>
                  <context value="ty_c"/>
                  <element value="code"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="fhir-id"/>
                  </parameter>
                </target>
              </rule>
              <rule>
                <name value="creating display"/>
                <source>
                  <context value="src"/>
                </source>
                <target>
                  <context value="ty_c"/>
                  <element value="display"/>
                  <transform value="copy"/>
                  <parameter>
                    <valueString value="FHIR Id"/>
                  </parameter>
                </target>
              </rule>
            </rule>
            <rule>
              <name value="creating system"/>
              <source>
                <context value="src"/>
              </source>
              <target>
                <context value="tt_id"/>
                <element value="system"/>
                <transform value="copy"/>
                <parameter>
                  <valueString
                               value="https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="managingOrganization"/>
              <source>
                <context value="src"/>
                <element value="managingOrganization"/>
                <variable value="sp"/>
              </source>
              <target>
                <context value="tt_id"/>
                <element value="assigner"/>
                <variable value="t_assigner"/>
                <transform value="create"/>
                <parameter>
                  <valueString value="Reference"/>
                </parameter>
              </target>
              <rule>
                <name value="reference"/>
                <source>
                  <context value="sp"/>
                  <element value="reference"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="t_assigner"/>
                  <element value="reference"/>
                  <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="display"/>
                <source>
                  <context value="sp"/>
                  <element value="display"/>
                  <variable value="vvv"/>
                </source>
                <target>
                  <context value="t_assigner"/>
                  <element value="display"/>
                  <variable value="vvv"/>
                  <transform value="create"/>
                </target>
                <dependent>
                  <name value="DefaultMappingGroupAnonymousAlias"/>
                  <parameter>
                    <valueId value="vvv"/>
                  </parameter>
                  <parameter>
                    <valueId value="vvv"/>
                  </parameter>
                </dependent>
              </rule>
            </rule>
          </rule>
          <documentation value="Create identifier"/>
        </rule>
        <rule>
          <name value="managingOrganization"/>
          <source>
            <context value="src"/>
            <element value="managingOrganization"/>
            <variable value="smo"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="managingOrganization"/>
            <variable value="tmo"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Reference"/>
            </parameter>
          </target>
          <rule>
            <name value="reference"/>
            <source>
              <context value="smo"/>
              <element value="reference"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="tmo"/>
              <element value="reference"/>
              <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="display"/>
            <source>
              <context value="smo"/>
              <element value="display"/>
              <variable value="vvv"/>
              <condition value="display.exists()"/>
            </source>
            <target>
              <context value="tmo"/>
              <element value="display"/>
              <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="managingOrganization"/>
            <source>
              <context value="src"/>
              <element value="managingOrganization"/>
              <condition value="display.exists().not()"/>
            </source>
            <target>
              <context value="tmo"/>
              <element value="display"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="Organization"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="display"/>
            <source>
              <context value="smo"/>
              <element value="display"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="tmo"/>
              <element value="display"/>
              <variable value="vvv"/>
              <transform value="create"/>
            </target>
            <dependent>
              <name value="DefaultMappingGroupAnonymousAlias"/>
              <parameter>
                <valueId value="vvv"/>
              </parameter>
              <parameter>
                <valueId value="vvv"/>
              </parameter>
            </dependent>
          </rule>
        </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="set profile in meta"/>
          <source>
            <context value="src"/>
            <element value="meta"/>
            <variable value="s_meta"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="meta"/>
            <variable value="t_meta"/>
          </target>
          <rule>
            <name value="lastUpdated"/>
            <source>
              <context value="s_meta"/>
              <element value="lastUpdated"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="t_meta"/>
              <element value="lastUpdated"/>
              <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="language"/>
            <source>
              <context value="s_meta"/>
              <element value="language"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="t_meta"/>
              <element value="language"/>
              <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="tags"/>
            <source>
              <context value="s_meta"/>
              <element value="tags"/>
              <variable value="vvv"/>
            </source>
            <target>
              <context value="t_meta"/>
              <element value="tags"/>
              <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="setprofileinmeta"/>
            <source>
              <context value="src"/>
              <element value="meta"/>
              <condition value="profile.exists().not()"/>
            </source>
            <target>
              <context value="t_meta"/>
              <element value="profile"/>
              <transform value="copy"/>
              <parameter>
                <valueString
                             value="https://fhir.slade360.co.ke/fhir/StructureDefinition/episodeofcare"/>
              </parameter>
            </target>
          </rule>
        </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="patient"/>
          <source>
            <context value="src"/>
            <element value="patient"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="patient"/>
            <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="creating status history"/>
          <source>
            <context value="src"/>
            <condition value="statusHistory.exists().not()"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="statusHistory"/>
            <variable value="th"/>
            <transform value="create"/>
            <parameter>
              <valueString value="BackboneElement"/>
            </parameter>
          </target>
          <rule>
            <name value="set default status"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="th"/>
              <element value="status"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="planned"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="copying status history period"/>
            <source>
              <context value="src"/>
            </source>
            <target>
              <context value="th"/>
              <element value="period"/>
              <variable value="tp"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Period"/>
              </parameter>
            </target>
            <rule>
              <name value="period"/>
              <source>
                <context value="src"/>
                <element value="period"/>
                <variable value="sp"/>
              </source>
              <target>
                <context value="th"/>
                <element value="period"/>
                <variable value="tp"/>
              </target>
              <dependent>
                <name value="TransformPeriod"/>
                <parameter>
                  <valueId value="sp"/>
                </parameter>
                <parameter>
                  <valueId value="tp"/>
                </parameter>
              </dependent>
            </rule>
          </rule>
        </rule>
      </group>
      <group>
        <name value="TransformAssigner"/>
        <typeMode value="types"/>
        <input>
          <name value="src"/>
          <mode value="source"/>
        </input>
        <input>
          <name value="tgt"/>
          <mode value="target"/>
        </input>
        <rule>
          <name value="reference"/>
          <source>
            <context value="src"/>
            <element value="reference"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="reference"/>
            <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="display"/>
          <source>
            <context value="src"/>
            <element value="display"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="display"/>
            <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="TransformPeriod"/>
        <typeMode value="types"/>
        <input>
          <name value="src"/>
          <mode value="source"/>
        </input>
        <input>
          <name value="tgt"/>
          <mode value="target"/>
        </input>
        <rule>
          <name value="start"/>
          <source>
            <context value="src"/>
            <element value="start"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="start"/>
            <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="end"/>
          <source>
            <context value="src"/>
            <element value="end"/>
            <variable value="vvv"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="end"/>
            <variable value="vvv"/>
            <transform value="create"/>
          </target>
          <dependent>
            <name value="DefaultMappingGroupAnonymousAlias"/>
            <parameter>
              <valueId value="vvv"/>
            </parameter>
            <parameter>
              <valueId value="vvv"/>
            </parameter>
          </dependent>
        </rule>
      </group>
    </StructureMap>