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

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

Active as of 2026-05-21

Raw xml | Download

    <StructureMap xmlns="http://hl7.org/fhir">
      <id value="RiskAssessmentR4toSGHIR5"/>
      <text>
        <status value="generated"/>
        <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap RiskAssessmentR4toSGHIR5</b></p><a name="RiskAssessmentR4toSGHIR5"> </a><a name="hcRiskAssessmentR4toSGHIR5"> </a><pre class="fml">
    <span style="color: #cc00cc">/// <b>url</b> = </span><span style="color: blue">'https://fhir.slade360.co.ke/fhir/StructureMap/RiskAssessmentR4toSGHIR5'</span>
    <span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'RiskAssessmentR4toSGHIR5'</span>
    <span style="color: #cc00cc">/// <b>title</b> = </span><span style="color: blue">'RiskAssessment 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/RiskAssessment<span style="color: navy">&quot; </span><b>alias </b>RiskAssessmentR4 <b>as </b><b>source</b>
    <b>uses</b><span style="color: navy"> &quot;</span><a href="StructureDefinition-riskassessment.html" title="SGHI RiskAssessment">https://fhir.slade360.co.ke/fhir/StructureDefinition/riskassessment</a><span style="color: navy">&quot; </span><b>alias </b>RiskAssessmentR5 <b>as </b><b>target</b>

    <b>group </b>RiskAssessment<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>RiskAssessmentR4, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>RiskAssessmentR5<span style="color: navy">)</span><b> &lt;&lt;type+&gt;&gt;</b><span style="color: navy"> {
    </span>  src.id<b> as </b><span style="color: maroon">v</span><span style="color: navy"><b> -&gt; </b></span>tgt.id = <span style="color: maroon">v</span><span style="color: navy">;</span>
      src.meta<b> as </b><span style="color: maroon">m</span><span style="color: navy"><b> -&gt; </b></span>tgt.meta = <span style="color: maroon">m</span><span style="color: navy">;</span>
      src.language<b> as </b><span style="color: maroon">l</span><span style="color: navy"><b> -&gt; </b></span>tgt.language = <span style="color: navy">(</span>l.lower()<span style="color: navy">)</span><span style="color: navy">;</span>
      src.text<b> as </b><span style="color: maroon">n</span><span style="color: navy"><b> -&gt; </b></span>tgt.text = <span style="color: maroon">n</span><span style="color: navy">;</span>
      src.status<b> as </b><span style="color: maroon">s</span><span style="color: navy"><b> -&gt; </b></span>tgt.status = <span style="color: maroon">s</span><span style="color: navy">;</span>
      src.code<b> as </b><span style="color: maroon">c</span><span style="color: navy"><b> -&gt; </b></span>tgt.code = <span style="color: maroon">c</span><span style="color: navy">;</span>
      src.subject<b> as </b><span style="color: maroon">sbj</span><span style="color: navy"><b> -&gt; </b></span>tgt.subject = <span style="color: maroon">sbj</span><span style="color: navy">;</span>
      src.encounter<b> as </b><span style="color: maroon">enc</span><span style="color: navy"><b> -&gt; </b></span>tgt.encounter = <span style="color: maroon">enc</span><span style="color: navy">;</span>
      src.occurrence<b> as </b><span style="color: maroon">occ</span><span style="color: navy"><b> -&gt; </b></span>tgt.occurrence = <span style="color: maroon">occ</span><span style="color: navy">;</span>
      src.condition<b> as </b><span style="color: maroon">cond</span><span style="color: navy"><b> -&gt; </b></span>tgt.condition = <span style="color: maroon">cond</span><span style="color: navy">;</span>
      src.performer<b> as </b><span style="color: maroon">perf</span><span style="color: navy"><b> -&gt; </b></span>tgt.performer = <span style="color: maroon">perf</span><span style="color: navy">;</span>
      src.reasonCode<b> as </b><span style="color: maroon">rc</span><span style="color: navy"><b> -&gt; </b></span> tgt.reason<b> as </b><span style="color: maroon">r</span><span style="color: navy">, </span> r.concept = <span style="color: maroon">rc</span> <i>&quot;reasonCodeToReason&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">R4 reasonCode + reasonReference → R5 reason (CodeableReference)</span>
      src.reasonReference<b> as </b><span style="color: maroon">rr</span><span style="color: navy"><b> -&gt; </b></span> tgt.reason<b> as </b><span style="color: maroon">r2</span><span style="color: navy">, </span> r2.reference = <span style="color: maroon">rr</span> <i>&quot;reasonRefToReason&quot;</i><span style="color: navy">;</span>
      src.basis<b> as </b><span style="color: maroon">b</span><span style="color: navy"><b> -&gt; </b></span>tgt.basis = <span style="color: maroon">b</span><span style="color: navy">;</span>
      src.prediction<b> as </b><span style="color: maroon">p</span><span style="color: navy"><b> -&gt; </b></span>tgt.prediction<b> as </b><span style="color: maroon">tp</span><b> then</b><span style="color: navy"> {
    </span>    p.outcome<b> as </b><span style="color: maroon">o</span><span style="color: navy"><b> -&gt; </b></span>tp.outcome = <span style="color: maroon">o</span><span style="color: navy">;</span>
        p.probabilityDecimal<b> as </b><span style="color: maroon">d</span><span style="color: navy"><b> -&gt; </b></span>tp.probability = <span style="color: maroon">d</span><span style="color: navy">;</span>
        p.probabilityRange<b> as </b><span style="color: maroon">pr</span><span style="color: navy"><b> -&gt; </b></span>tp.probability = <span style="color: maroon">pr</span><span style="color: navy">;</span>
        p.qualitativeRisk<b> as </b><span style="color: maroon">qr</span><span style="color: navy"><b> -&gt; </b></span>tp.qualitativeRisk = <span style="color: maroon">qr</span><span style="color: navy">;</span>
        p.relativeRisk<b> as </b><span style="color: maroon">rr</span><span style="color: navy"><b> -&gt; </b></span>tp.relativeRisk = <span style="color: maroon">rr</span><span style="color: navy">;</span>
        p.whenPeriod<b> as </b><span style="color: maroon">wp</span><span style="color: navy"><b> -&gt; </b></span>tp.when = <span style="color: maroon">wp</span><span style="color: navy">;</span>
        p.whenRange<b> as </b><span style="color: maroon">wr</span><span style="color: navy"><b> -&gt; </b></span>tp.when = <span style="color: maroon">wr</span><span style="color: navy">;</span>
        p.rationale<b> as </b><span style="color: maroon">ra</span><span style="color: navy"><b> -&gt; </b></span>tp.rationale = <span style="color: maroon">ra</span><span style="color: navy">;</span>
      <span style="color: navy">}</span><span style="color: navy">;</span>
      src.mitigation<b> as </b><span style="color: maroon">mit</span><span style="color: navy"><b> -&gt; </b></span>tgt.mitigation = <span style="color: maroon">mit</span><span style="color: navy">;</span>
      src.note<b> as </b><span style="color: maroon">notes</span><span style="color: navy"><b> -&gt; </b></span>tgt.note = <span style="color: maroon">notes</span><span style="color: navy">;</span>
    <span style="color: navy">}

    </span></pre></div>
      </text>
      <url
           value="https://fhir.slade360.co.ke/fhir/StructureMap/RiskAssessmentR4toSGHIR5"/>
      <version value="0.1.0"/>
      <name value="RiskAssessmentR4toSGHIR5"/>
      <title value="RiskAssessment Transforms: R4 → SGHI R5"/>
      <status value="active"/>
      <date value="2026-05-21T09:38:13+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="RiskAssessmentTransformsR4SGHIR5"/>
      <structure>
        <url value="http://hl7.org/fhir/4.0/StructureDefinition/RiskAssessment"/>
        <mode value="source"/>
        <alias value="RiskAssessmentR4"/>
      </structure>
      <structure>
        <url
             value="https://fhir.slade360.co.ke/fhir/StructureDefinition/riskassessment"/>
        <mode value="target"/>
        <alias value="RiskAssessmentR5"/>
      </structure>
      <group>
        <name value="RiskAssessment"/>
        <typeMode value="type-and-types"/>
        <input>
          <name value="src"/>
          <type value="RiskAssessmentR4"/>
          <mode value="source"/>
        </input>
        <input>
          <name value="tgt"/>
          <type value="RiskAssessmentR5"/>
          <mode value="target"/>
        </input>
        <rule>
          <name value="id"/>
          <source>
            <context value="src"/>
            <element value="id"/>
            <variable value="v"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="id"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="v"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="meta"/>
          <source>
            <context value="src"/>
            <element value="meta"/>
            <variable value="m"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="meta"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="m"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="language"/>
          <source>
            <context value="src"/>
            <element value="language"/>
            <variable value="l"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="language"/>
            <transform value="evaluate"/>
            <parameter>
              <valueString value="l.lower()"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="text"/>
          <source>
            <context value="src"/>
            <element value="text"/>
            <variable value="n"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="text"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="n"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="status"/>
          <source>
            <context value="src"/>
            <element value="status"/>
            <variable value="s"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="status"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="s"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="code"/>
          <source>
            <context value="src"/>
            <element value="code"/>
            <variable value="c"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="code"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="c"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="subject"/>
          <source>
            <context value="src"/>
            <element value="subject"/>
            <variable value="sbj"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="subject"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="sbj"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="encounter"/>
          <source>
            <context value="src"/>
            <element value="encounter"/>
            <variable value="enc"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="encounter"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="enc"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="occurrence"/>
          <source>
            <context value="src"/>
            <element value="occurrence"/>
            <variable value="occ"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="occurrence"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="occ"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="condition"/>
          <source>
            <context value="src"/>
            <element value="condition"/>
            <variable value="cond"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="condition"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="cond"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="performer"/>
          <source>
            <context value="src"/>
            <element value="performer"/>
            <variable value="perf"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="performer"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="perf"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="reasonCodeToReason"/>
          <source>
            <context value="src"/>
            <element value="reasonCode"/>
            <variable value="rc"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="reason"/>
            <variable value="r"/>
          </target>
          <target>
            <context value="r"/>
            <element value="concept"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="rc"/>
            </parameter>
          </target>
          <documentation
                         value="R4 reasonCode + reasonReference → R5 reason (CodeableReference)"/>
        </rule>
        <rule>
          <name value="reasonRefToReason"/>
          <source>
            <context value="src"/>
            <element value="reasonReference"/>
            <variable value="rr"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="reason"/>
            <variable value="r2"/>
          </target>
          <target>
            <context value="r2"/>
            <element value="reference"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="rr"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="basis"/>
          <source>
            <context value="src"/>
            <element value="basis"/>
            <variable value="b"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="basis"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="b"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="prediction"/>
          <source>
            <context value="src"/>
            <element value="prediction"/>
            <variable value="p"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="prediction"/>
            <variable value="tp"/>
          </target>
          <rule>
            <name value="outcome"/>
            <source>
              <context value="p"/>
              <element value="outcome"/>
              <variable value="o"/>
            </source>
            <target>
              <context value="tp"/>
              <element value="outcome"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="o"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="probabilityDecimal"/>
            <source>
              <context value="p"/>
              <element value="probabilityDecimal"/>
              <variable value="d"/>
            </source>
            <target>
              <context value="tp"/>
              <element value="probability"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="d"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="probabilityRange"/>
            <source>
              <context value="p"/>
              <element value="probabilityRange"/>
              <variable value="pr"/>
            </source>
            <target>
              <context value="tp"/>
              <element value="probability"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="pr"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="qualitativeRisk"/>
            <source>
              <context value="p"/>
              <element value="qualitativeRisk"/>
              <variable value="qr"/>
            </source>
            <target>
              <context value="tp"/>
              <element value="qualitativeRisk"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="qr"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="relativeRisk"/>
            <source>
              <context value="p"/>
              <element value="relativeRisk"/>
              <variable value="rr"/>
            </source>
            <target>
              <context value="tp"/>
              <element value="relativeRisk"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="rr"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="whenPeriod"/>
            <source>
              <context value="p"/>
              <element value="whenPeriod"/>
              <variable value="wp"/>
            </source>
            <target>
              <context value="tp"/>
              <element value="when"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="wp"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="whenRange"/>
            <source>
              <context value="p"/>
              <element value="whenRange"/>
              <variable value="wr"/>
            </source>
            <target>
              <context value="tp"/>
              <element value="when"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="wr"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="rationale"/>
            <source>
              <context value="p"/>
              <element value="rationale"/>
              <variable value="ra"/>
            </source>
            <target>
              <context value="tp"/>
              <element value="rationale"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="ra"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="mitigation"/>
          <source>
            <context value="src"/>
            <element value="mitigation"/>
            <variable value="mit"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="mitigation"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="mit"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="note"/>
          <source>
            <context value="src"/>
            <element value="note"/>
            <variable value="notes"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="note"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="notes"/>
            </parameter>
          </target>
        </rule>
      </group>
    </StructureMap>