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

## : Glasgow Coma Scale Extraction - XML Representation

Active as of 2026-05-21

Raw xml | Download

    <StructureMap xmlns="http://hl7.org/fhir">
      <id value="GlasgowCommaScaleExtract"/>
      <text>
        <status value="generated"/>
        <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap GlasgowCommaScaleExtract</b></p><a name="GlasgowCommaScaleExtract"> </a><a name="hcGlasgowCommaScaleExtract"> </a><pre class="fml">
    <span style="color: #cc00cc">/// <b>url</b> = </span><span style="color: blue">'https://fhir.slade360.co.ke/fhir/StructureMap/GlasgowCommaScaleExtract'</span>
    <span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'GlasgowCommaScaleExtract'</span>
    <span style="color: #cc00cc">/// <b>title</b> = </span><span style="color: blue">'Glasgow Coma Scale Extraction'</span>
    <span style="color: #cc00cc">/// <b>status</b> = </span><span style="color: blue">'active'</span>

    <b>uses</b><span style="color: navy"> &quot;</span><a href="http://hl7.org/fhir/R5/questionnaireresponse.html" title="QuestionnaireResponse">http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse</a><span style="color: navy">&quot; </span><b>alias </b>QR <b>as </b><b>source</b>
    <b>uses</b><span style="color: navy"> &quot;</span><a href="http://hl7.org/fhir/R5/bundle.html" title="Bundle">http://hl7.org/fhir/StructureDefinition/Bundle</a><span style="color: navy">&quot; </span><b>alias </b>Bundle <b>as </b><b>target</b>
    <b>uses</b><span style="color: navy"> &quot;</span><a href="http://hl7.org/fhir/R5/observation.html" title="Observation">http://hl7.org/fhir/StructureDefinition/Observation</a><span style="color: navy">&quot; </span><b>alias </b>Observation <b>as </b><b>target</b>

    <b>group </b>GlasgowCommaScaleExtract<span style="color: navy">(</span><b>source</b> <span style="color: maroon">qr</span><span style="color: navy"> : </span>QR, <b>target</b> <span style="color: maroon">bundle</span><span style="color: navy"> : </span>Bundle<span style="color: navy">)</span><span style="color: navy"> {
    </span>  qr<span style="color: navy"><b> -&gt; </b></span>bundle.type = <span style="color: blue">'transaction'</span> <i>&quot;setBundleType&quot;</i><span style="color: navy">;</span>
      qr.item<b> as </b><span style="color: maroon">itV</span><b> where </b>linkId = 'verbal-response'<span style="color: navy"><b> -&gt; </b></span> bundle.entry<b> as </b><span style="color: maroon">eV</span><span style="color: navy">, </span> eV.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Observation'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">oV</span><b> then</b><span style="color: navy"> {
    </span>    qr<span style="color: navy"><b> -&gt; </b></span>oV.id<b> then </b>BuildBaseObs<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">oV</span><span style="color: navy">, </span><span style="color: maroon">eV</span><span style="color: navy">)</span> <i>&quot;baseV&quot;</i><span style="color: navy">;</span>
        qr<span style="color: navy"><b> -&gt; </b></span>oV.category = <b>cc</b><span style="color: navy">(</span><span style="color: blue">'http://terminology.hl7.org/CodeSystem/observation-category'</span><span style="color: navy">, </span><span style="color: blue">'survey'</span><span style="color: navy">, </span><span style="color: blue">'Survey'</span><span style="color: navy">)</span> <i>&quot;catVSystem&quot;</i><span style="color: navy">;</span>
        qr<span style="color: navy"><b> -&gt; </b></span>oV.code = <b>cc</b><span style="color: navy">(</span><span style="color: blue">'http://loinc.org'</span><span style="color: navy">, </span><span style="color: blue">'9270-0'</span><span style="color: navy">, </span><span style="color: blue">'Glasgow coma score verbal'</span><span style="color: navy">)</span> <i>&quot;codeVCode&quot;</i><span style="color: navy">;</span>
        qr<span style="color: navy"><b> -&gt; </b></span>oV.id<b> then </b>SetValueFromItem<span style="color: navy">(</span><span style="color: maroon">itV</span><span style="color: navy">, </span><span style="color: maroon">oV</span><span style="color: navy">)</span> <i>&quot;valV&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;verbalResponseObs&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">Verbal</span>
      qr.item<b> as </b><span style="color: maroon">itM</span><b> where </b>linkId = 'motor-response'<span style="color: navy"><b> -&gt; </b></span> bundle.entry<b> as </b><span style="color: maroon">eM</span><span style="color: navy">, </span> eM.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Observation'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">oM</span><b> then</b><span style="color: navy"> {
    </span>    qr<span style="color: navy"><b> -&gt; </b></span>oM.id<b> then </b>BuildBaseObs<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">oM</span><span style="color: navy">, </span><span style="color: maroon">eM</span><span style="color: navy">)</span> <i>&quot;baseM&quot;</i><span style="color: navy">;</span>
        qr<span style="color: navy"><b> -&gt; </b></span>oM.category = <b>cc</b><span style="color: navy">(</span><span style="color: blue">'http://terminology.hl7.org/CodeSystem/observation-category'</span><span style="color: navy">, </span><span style="color: blue">'survey'</span><span style="color: navy">, </span><span style="color: blue">'Survey'</span><span style="color: navy">)</span> <i>&quot;catMSystem&quot;</i><span style="color: navy">;</span>
        qr<span style="color: navy"><b> -&gt; </b></span>oM.code = <b>cc</b><span style="color: navy">(</span><span style="color: blue">'http://loinc.org'</span><span style="color: navy">, </span><span style="color: blue">'9268-4'</span><span style="color: navy">, </span><span style="color: blue">'Glasgow coma score motor'</span><span style="color: navy">)</span> <i>&quot;catMCode&quot;</i><span style="color: navy">;</span>
        qr<span style="color: navy"><b> -&gt; </b></span>oM.id<b> then </b>SetValueFromItem<span style="color: navy">(</span><span style="color: maroon">itM</span><span style="color: navy">, </span><span style="color: maroon">oM</span><span style="color: navy">)</span> <i>&quot;valM&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;motorResponseObs&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">Motor</span>
      qr.item<b> as </b><span style="color: maroon">itE</span><b> where </b>linkId = 'eye-opening'<span style="color: navy"><b> -&gt; </b></span> bundle.entry<b> as </b><span style="color: maroon">eE</span><span style="color: navy">, </span> eE.resource = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Observation'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">oE</span><b> then</b><span style="color: navy"> {
    </span>    qr<span style="color: navy"><b> -&gt; </b></span>oE.id<b> then </b>BuildBaseObs<span style="color: navy">(</span><span style="color: maroon">qr</span><span style="color: navy">, </span><span style="color: maroon">oE</span><span style="color: navy">, </span><span style="color: maroon">eE</span><span style="color: navy">)</span> <i>&quot;baseE&quot;</i><span style="color: navy">;</span>
        qr<span style="color: navy"><b> -&gt; </b></span>oE.category = <b>cc</b><span style="color: navy">(</span><span style="color: blue">'http://terminology.hl7.org/CodeSystem/observation-category'</span><span style="color: navy">, </span><span style="color: blue">'survey'</span><span style="color: navy">, </span><span style="color: blue">'Survey'</span><span style="color: navy">)</span> <i>&quot;catESystem&quot;</i><span style="color: navy">;</span>
        qr<span style="color: navy"><b> -&gt; </b></span>oE.code = <b>cc</b><span style="color: navy">(</span><span style="color: blue">'http://loinc.org'</span><span style="color: navy">, </span><span style="color: blue">'9267-6'</span><span style="color: navy">, </span><span style="color: blue">'Glasgow coma score eye opening'</span><span style="color: navy">)</span> <i>&quot;catECode&quot;</i><span style="color: navy">;</span>
        qr<span style="color: navy"><b> -&gt; </b></span>oE.id<b> then </b>SetValueFromItem<span style="color: navy">(</span><span style="color: maroon">itE</span><span style="color: navy">, </span><span style="color: maroon">oE</span><span style="color: navy">)</span> <i>&quot;valE&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;eyeResponseObs&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">Eye</span>
    <span style="color: navy">}

    </span><b>group </b>BuildBaseObs<span style="color: navy">(</span><b>source</b> <span style="color: maroon">qr</span><span style="color: navy"> : </span>QR, <b>target</b> <span style="color: maroon">obs</span><span style="color: navy"> : </span>Observation, <b>target</b> <span style="color: maroon">entry</span><span style="color: navy">)</span><span style="color: navy"> {
    </span>  qr<span style="color: navy"><b> -&gt; </b></span>entry.request<b> as </b><span style="color: maroon">req</span><b> then</b><span style="color: navy"> {
    </span>    qr<span style="color: navy"><b> -&gt; </b></span>req.method = <span style="color: blue">'POST'</span> <i>&quot;reqMethod&quot;</i><span style="color: navy">;</span>
        qr<span style="color: navy"><b> -&gt; </b></span>req.url = <span style="color: blue">'Observation'</span> <i>&quot;reqUrl&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;entryRequest&quot;</i><span style="color: navy">;</span>
      qr<span style="color: navy"><b> -&gt; </b></span>obs.id = <b>uuid</b><span style="color: navy">(</span><span style="color: navy">)</span><b> then </b>SetFullUrl<span style="color: navy">(</span><span style="color: maroon">obs</span><span style="color: navy">, </span><span style="color: maroon">entry</span><span style="color: navy">)</span> <i>&quot;setIdAndFullUrl&quot;</i><span style="color: navy">;</span>
      qr<span style="color: navy"><b> -&gt; </b></span>obs.status = <span style="color: blue">'final'</span> <i>&quot;setStatus&quot;</i><span style="color: navy">;</span>
      qr.subject<b> as </b><span style="color: maroon">s</span><span style="color: navy"><b> -&gt; </b></span>obs.subject = <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">r</span><b> then</b><span style="color: navy"> {
    </span>    s.reference<b> as </b><span style="color: maroon">ref</span><span style="color: navy"><b> -&gt; </b></span>r.reference = <span style="color: maroon">ref</span> <i>&quot;subRef&quot;</i><span style="color: navy">;</span>
        s.display<b> as </b><span style="color: maroon">disp</span><span style="color: navy"><b> -&gt; </b></span>r.display = <span style="color: maroon">disp</span> <i>&quot;subDisp&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;setSubject&quot;</i><span style="color: navy">;</span>
      qr.authored<b> as </b><span style="color: maroon">t</span><span style="color: navy"><b> -&gt; </b></span>obs.effective = <span style="color: maroon">t</span> <i>&quot;setEffective&quot;</i><span style="color: navy">;</span>
      qr.authored<b> as </b><span style="color: maroon">t</span><span style="color: navy"><b> -&gt; </b></span>obs.issued = <span style="color: maroon">t</span> <i>&quot;setIssued&quot;</i><span style="color: navy">;</span>
      qr<span style="color: navy"><b> -&gt; </b></span>obs.derivedFrom = <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">dr</span><b> then</b><span style="color: navy"> {
    </span>    qr.id<b> as </b><span style="color: maroon">id</span><span style="color: navy"><b> -&gt; </b></span>dr.reference = <b>append</b><span style="color: navy">(</span><span style="color: blue">'QuestionnaireResponse/'</span><span style="color: navy">, </span><span style="color: maroon">id</span><span style="color: navy">)</span> <i>&quot;derRef&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;setDerivedFrom&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}

    </span><b>group </b>SetValueFromItem<span style="color: navy">(</span><b>source</b> <span style="color: maroon">it</span><span style="color: navy"> : </span>Element, <b>target</b> <span style="color: maroon">obs</span><span style="color: navy"> : </span>Observation<span style="color: navy">)</span><span style="color: navy"> {
    </span>  it.answer<b> as </b><span style="color: maroon">a</span><span style="color: navy"><b> -&gt; </b></span>obs.value = <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">c</span><b> then</b><span style="color: navy"> {
    </span>    a.value<b> as </b><span style="color: maroon">coding</span><span style="color: navy"><b> -&gt; </b></span>c.coding = <span style="color: maroon">coding</span><b> as </b><span style="color: maroon">nc</span> <i>&quot;copyCoding&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;setValueCC&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}

    </span><b>group </b>SetFullUrl<span style="color: navy">(</span><b>source</b> <span style="color: maroon">obs</span><span style="color: navy"> : </span>Observation, <b>target</b> <span style="color: maroon">entry</span><span style="color: navy">)</span><span style="color: navy"> {
    </span>  obs.id<b> as </b><span style="color: maroon">id</span><span style="color: navy"><b> -&gt; </b></span>entry.fullUrl = <b>append</b><span style="color: navy">(</span><span style="color: blue">'https://fhir.slade360.co.ke/fhir/Observation/'</span><span style="color: navy">, </span><span style="color: maroon">id</span><span style="color: navy">)</span> <i>&quot;assignFullUrl&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}

    </span></pre></div>
      </text>
      <url
           value="https://fhir.slade360.co.ke/fhir/StructureMap/GlasgowCommaScaleExtract"/>
      <version value="0.1.0"/>
      <name value="GlasgowCommaScaleExtract"/>
      <title value="Glasgow Coma Scale Extraction"/>
      <status value="active"/>
      <experimental value="true"/>
      <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="Extracts three Observation resources, one per GCS subscore, from a QuestionnaireResponse to the GCS questionnaire."/>
      <structure>
        <url
             value="http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse"/>
        <mode value="source"/>
        <alias value="QR"/>
      </structure>
      <structure>
        <url value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
        <mode value="target"/>
        <alias value="Bundle"/>
      </structure>
      <structure>
        <url value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mode value="target"/>
        <alias value="Observation"/>
      </structure>
      <group>
        <name value="GlasgowCommaScaleExtract"/>
        <input>
          <name value="qr"/>
          <type value="QR"/>
          <mode value="source"/>
        </input>
        <input>
          <name value="bundle"/>
          <type value="Bundle"/>
          <mode value="target"/>
        </input>
        <rule>
          <name value="setBundleType"/>
          <source>
            <context value="qr"/>
          </source>
          <target>
            <context value="bundle"/>
            <element value="type"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="transaction"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="verbalResponseObs"/>
          <source>
            <context value="qr"/>
            <element value="item"/>
            <variable value="itV"/>
            <condition value="linkId = 'verbal-response'"/>
          </source>
          <target>
            <context value="bundle"/>
            <element value="entry"/>
            <variable value="eV"/>
          </target>
          <target>
            <context value="eV"/>
            <element value="resource"/>
            <variable value="oV"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Observation"/>
            </parameter>
          </target>
          <rule>
            <name value="baseV"/>
            <source>
              <context value="qr"/>
            </source>
            <target>
              <context value="oV"/>
              <element value="id"/>
            </target>
            <dependent>
              <name value="BuildBaseObs"/>
              <parameter>
                <valueId value="qr"/>
              </parameter>
              <parameter>
                <valueId value="oV"/>
              </parameter>
              <parameter>
                <valueId value="eV"/>
              </parameter>
            </dependent>
          </rule>
          <rule>
            <name value="catVSystem"/>
            <source>
              <context value="qr"/>
            </source>
            <target>
              <context value="oV"/>
              <element value="category"/>
              <transform value="cc"/>
              <parameter>
                <valueString
                             value="http://terminology.hl7.org/CodeSystem/observation-category"/>
              </parameter>
              <parameter>
                <valueString value="survey"/>
              </parameter>
              <parameter>
                <valueString value="Survey"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="codeVCode"/>
            <source>
              <context value="qr"/>
            </source>
            <target>
              <context value="oV"/>
              <element value="code"/>
              <transform value="cc"/>
              <parameter>
                <valueString value="http://loinc.org"/>
              </parameter>
              <parameter>
                <valueString value="9270-0"/>
              </parameter>
              <parameter>
                <valueString value="Glasgow coma score verbal"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="valV"/>
            <source>
              <context value="qr"/>
            </source>
            <target>
              <context value="oV"/>
              <element value="id"/>
            </target>
            <dependent>
              <name value="SetValueFromItem"/>
              <parameter>
                <valueId value="itV"/>
              </parameter>
              <parameter>
                <valueId value="oV"/>
              </parameter>
            </dependent>
          </rule>
          <documentation value="Verbal"/>
        </rule>
        <rule>
          <name value="motorResponseObs"/>
          <source>
            <context value="qr"/>
            <element value="item"/>
            <variable value="itM"/>
            <condition value="linkId = 'motor-response'"/>
          </source>
          <target>
            <context value="bundle"/>
            <element value="entry"/>
            <variable value="eM"/>
          </target>
          <target>
            <context value="eM"/>
            <element value="resource"/>
            <variable value="oM"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Observation"/>
            </parameter>
          </target>
          <rule>
            <name value="baseM"/>
            <source>
              <context value="qr"/>
            </source>
            <target>
              <context value="oM"/>
              <element value="id"/>
            </target>
            <dependent>
              <name value="BuildBaseObs"/>
              <parameter>
                <valueId value="qr"/>
              </parameter>
              <parameter>
                <valueId value="oM"/>
              </parameter>
              <parameter>
                <valueId value="eM"/>
              </parameter>
            </dependent>
          </rule>
          <rule>
            <name value="catMSystem"/>
            <source>
              <context value="qr"/>
            </source>
            <target>
              <context value="oM"/>
              <element value="category"/>
              <transform value="cc"/>
              <parameter>
                <valueString
                             value="http://terminology.hl7.org/CodeSystem/observation-category"/>
              </parameter>
              <parameter>
                <valueString value="survey"/>
              </parameter>
              <parameter>
                <valueString value="Survey"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="catMCode"/>
            <source>
              <context value="qr"/>
            </source>
            <target>
              <context value="oM"/>
              <element value="code"/>
              <transform value="cc"/>
              <parameter>
                <valueString value="http://loinc.org"/>
              </parameter>
              <parameter>
                <valueString value="9268-4"/>
              </parameter>
              <parameter>
                <valueString value="Glasgow coma score motor"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="valM"/>
            <source>
              <context value="qr"/>
            </source>
            <target>
              <context value="oM"/>
              <element value="id"/>
            </target>
            <dependent>
              <name value="SetValueFromItem"/>
              <parameter>
                <valueId value="itM"/>
              </parameter>
              <parameter>
                <valueId value="oM"/>
              </parameter>
            </dependent>
          </rule>
          <documentation value="Motor"/>
        </rule>
        <rule>
          <name value="eyeResponseObs"/>
          <source>
            <context value="qr"/>
            <element value="item"/>
            <variable value="itE"/>
            <condition value="linkId = 'eye-opening'"/>
          </source>
          <target>
            <context value="bundle"/>
            <element value="entry"/>
            <variable value="eE"/>
          </target>
          <target>
            <context value="eE"/>
            <element value="resource"/>
            <variable value="oE"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Observation"/>
            </parameter>
          </target>
          <rule>
            <name value="baseE"/>
            <source>
              <context value="qr"/>
            </source>
            <target>
              <context value="oE"/>
              <element value="id"/>
            </target>
            <dependent>
              <name value="BuildBaseObs"/>
              <parameter>
                <valueId value="qr"/>
              </parameter>
              <parameter>
                <valueId value="oE"/>
              </parameter>
              <parameter>
                <valueId value="eE"/>
              </parameter>
            </dependent>
          </rule>
          <rule>
            <name value="catESystem"/>
            <source>
              <context value="qr"/>
            </source>
            <target>
              <context value="oE"/>
              <element value="category"/>
              <transform value="cc"/>
              <parameter>
                <valueString
                             value="http://terminology.hl7.org/CodeSystem/observation-category"/>
              </parameter>
              <parameter>
                <valueString value="survey"/>
              </parameter>
              <parameter>
                <valueString value="Survey"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="catECode"/>
            <source>
              <context value="qr"/>
            </source>
            <target>
              <context value="oE"/>
              <element value="code"/>
              <transform value="cc"/>
              <parameter>
                <valueString value="http://loinc.org"/>
              </parameter>
              <parameter>
                <valueString value="9267-6"/>
              </parameter>
              <parameter>
                <valueString value="Glasgow coma score eye opening"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="valE"/>
            <source>
              <context value="qr"/>
            </source>
            <target>
              <context value="oE"/>
              <element value="id"/>
            </target>
            <dependent>
              <name value="SetValueFromItem"/>
              <parameter>
                <valueId value="itE"/>
              </parameter>
              <parameter>
                <valueId value="oE"/>
              </parameter>
            </dependent>
          </rule>
          <documentation value="Eye"/>
        </rule>
      </group>
      <group>
        <name value="BuildBaseObs"/>
        <input>
          <name value="qr"/>
          <type value="QR"/>
          <mode value="source"/>
        </input>
        <input>
          <name value="obs"/>
          <type value="Observation"/>
          <mode value="target"/>
        </input>
        <input>
          <name value="entry"/>
          <mode value="target"/>
        </input>
        <rule>
          <name value="entryRequest"/>
          <source>
            <context value="qr"/>
          </source>
          <target>
            <context value="entry"/>
            <element value="request"/>
            <variable value="req"/>
          </target>
          <rule>
            <name value="reqMethod"/>
            <source>
              <context value="qr"/>
            </source>
            <target>
              <context value="req"/>
              <element value="method"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="POST"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="reqUrl"/>
            <source>
              <context value="qr"/>
            </source>
            <target>
              <context value="req"/>
              <element value="url"/>
              <transform value="copy"/>
              <parameter>
                <valueString value="Observation"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="setIdAndFullUrl"/>
          <source>
            <context value="qr"/>
          </source>
          <target>
            <context value="obs"/>
            <element value="id"/>
            <transform value="uuid"/>
          </target>
          <dependent>
            <name value="SetFullUrl"/>
            <parameter>
              <valueId value="obs"/>
            </parameter>
            <parameter>
              <valueId value="entry"/>
            </parameter>
          </dependent>
        </rule>
        <rule>
          <name value="setStatus"/>
          <source>
            <context value="qr"/>
          </source>
          <target>
            <context value="obs"/>
            <element value="status"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="final"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="setSubject"/>
          <source>
            <context value="qr"/>
            <element value="subject"/>
            <variable value="s"/>
          </source>
          <target>
            <context value="obs"/>
            <element value="subject"/>
            <variable value="r"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Reference"/>
            </parameter>
          </target>
          <rule>
            <name value="subRef"/>
            <source>
              <context value="s"/>
              <element value="reference"/>
              <variable value="ref"/>
            </source>
            <target>
              <context value="r"/>
              <element value="reference"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="ref"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="subDisp"/>
            <source>
              <context value="s"/>
              <element value="display"/>
              <variable value="disp"/>
            </source>
            <target>
              <context value="r"/>
              <element value="display"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="disp"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="setEffective"/>
          <source>
            <context value="qr"/>
            <element value="authored"/>
            <variable value="t"/>
          </source>
          <target>
            <context value="obs"/>
            <element value="effective"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="t"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="setIssued"/>
          <source>
            <context value="qr"/>
            <element value="authored"/>
            <variable value="t"/>
          </source>
          <target>
            <context value="obs"/>
            <element value="issued"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="t"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="setDerivedFrom"/>
          <source>
            <context value="qr"/>
          </source>
          <target>
            <context value="obs"/>
            <element value="derivedFrom"/>
            <variable value="dr"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Reference"/>
            </parameter>
          </target>
          <rule>
            <name value="derRef"/>
            <source>
              <context value="qr"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="dr"/>
              <element value="reference"/>
              <transform value="append"/>
              <parameter>
                <valueString value="QuestionnaireResponse/"/>
              </parameter>
              <parameter>
                <valueId value="id"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </group>
      <group>
        <name value="SetValueFromItem"/>
        <input>
          <name value="it"/>
          <type value="Element"/>
          <mode value="source"/>
        </input>
        <input>
          <name value="obs"/>
          <type value="Observation"/>
          <mode value="target"/>
        </input>
        <rule>
          <name value="setValueCC"/>
          <source>
            <context value="it"/>
            <element value="answer"/>
            <variable value="a"/>
          </source>
          <target>
            <context value="obs"/>
            <element value="value"/>
            <variable value="c"/>
            <transform value="create"/>
            <parameter>
              <valueString value="CodeableConcept"/>
            </parameter>
          </target>
          <rule>
            <name value="copyCoding"/>
            <source>
              <context value="a"/>
              <element value="value"/>
              <variable value="coding"/>
            </source>
            <target>
              <context value="c"/>
              <element value="coding"/>
              <variable value="nc"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="coding"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </group>
      <group>
        <name value="SetFullUrl"/>
        <input>
          <name value="obs"/>
          <type value="Observation"/>
          <mode value="source"/>
        </input>
        <input>
          <name value="entry"/>
          <mode value="target"/>
        </input>
        <rule>
          <name value="assignFullUrl"/>
          <source>
            <context value="obs"/>
            <element value="id"/>
            <variable value="id"/>
          </source>
          <target>
            <context value="entry"/>
            <element value="fullUrl"/>
            <transform value="append"/>
            <parameter>
              <valueString value="https://fhir.slade360.co.ke/fhir/Observation/"/>
            </parameter>
            <parameter>
              <valueId value="id"/>
            </parameter>
          </target>
        </rule>
      </group>
    </StructureMap>