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 - JSON Representation

Active as of 2026-04-27

Raw json | Download

    {
      "resourceType" : "StructureMap",
      "id" : "GlasgowCommaScaleExtract",
      "text" : {
        "status" : "generated",
        "div" : "<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\">\r\n<span style=\"color: #cc00cc\">/// <b>url</b> = </span><span style=\"color: blue\">'https://fhir.slade360.co.ke/fhir/StructureMap/GlasgowCommaScaleExtract'</span>\r\n<span style=\"color: #cc00cc\">/// <b>name</b> = </span><span style=\"color: blue\">'GlasgowCommaScaleExtract'</span>\r\n<span style=\"color: #cc00cc\">/// <b>title</b> = </span><span style=\"color: blue\">'Glasgow Coma Scale Extraction'</span>\r\n<span style=\"color: #cc00cc\">/// <b>status</b> = </span><span style=\"color: blue\">'active'</span>\r\n\r\n<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>\r\n<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>\r\n<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>\r\n\r\n<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\"> {\r\n</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>\r\n  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\"> {\r\n</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>\r\n    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>\r\n    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>\r\n    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>\r\n  <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>\r\n  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\"> {\r\n</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>\r\n    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>\r\n    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>\r\n    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>\r\n  <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>\r\n  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\"> {\r\n</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>\r\n    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>\r\n    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>\r\n    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>\r\n  <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>\r\n<span style=\"color: navy\">}\r\n\r\n</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\"> {\r\n</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\"> {\r\n</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>\r\n    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>\r\n  <span style=\"color: navy\">}</span> <i>&quot;entryRequest&quot;</i><span style=\"color: navy\">;</span>\r\n  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>\r\n  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>\r\n  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\"> {\r\n</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>\r\n    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>\r\n  <span style=\"color: navy\">}</span> <i>&quot;setSubject&quot;</i><span style=\"color: navy\">;</span>\r\n  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>\r\n  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>\r\n  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\"> {\r\n</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>\r\n  <span style=\"color: navy\">}</span> <i>&quot;setDerivedFrom&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</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\"> {\r\n</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\"> {\r\n</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>\r\n  <span style=\"color: navy\">}</span> <i>&quot;setValueCC&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</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\"> {\r\n</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>\r\n<span style=\"color: navy\">}\r\n\r\n</span></pre></div>"
      },
      "url" : "https://fhir.slade360.co.ke/fhir/StructureMap/GlasgowCommaScaleExtract",
      "version" : "0.1.0",
      "name" : "GlasgowCommaScaleExtract",
      "title" : "Glasgow Coma Scale Extraction",
      "status" : "active",
      "experimental" : true,
      "date" : "2026-04-27T09:21:43+00:00",
      "publisher" : "Kathurima Kimathi",
      "contact" : [
        {
          "name" : "Kathurima Kimathi",
          "telecom" : [
            {
              "system" : "url",
              "value" : "https://www.linkedin.com/in/kathurima-kimathi/"
            },
            {
              "system" : "email",
              "value" : "kathurimakimathi415@gmail.com"
            }
          ]
        },
        {
          "name" : "Oscar John",
          "telecom" : [
            {
              "system" : "email",
              "value" : "oscarjohnotieno@gmail.com",
              "use" : "work"
            }
          ]
        },
        {
          "name" : "Kennedy Omondi",
          "telecom" : [
            {
              "system" : "email",
              "value" : "kennankole@gmail.com",
              "use" : "work"
            }
          ]
        }
      ],
      "description" : "Extracts three Observation resources, one per GCS subscore, from a QuestionnaireResponse to the GCS questionnaire.",
      "structure" : [
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse",
          "mode" : "source",
          "alias" : "QR"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/Bundle",
          "mode" : "target",
          "alias" : "Bundle"
        },
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/Observation",
          "mode" : "target",
          "alias" : "Observation"
        }
      ],
      "group" : [
        {
          "name" : "GlasgowCommaScaleExtract",
          "input" : [
            {
              "name" : "qr",
              "type" : "QR",
              "mode" : "source"
            },
            {
              "name" : "bundle",
              "type" : "Bundle",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "setBundleType",
              "source" : [
                {
                  "context" : "qr"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "element" : "type",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "transaction"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "verbalResponseObs",
              "source" : [
                {
                  "context" : "qr",
                  "element" : "item",
                  "variable" : "itV",
                  "condition" : "linkId = 'verbal-response'"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "element" : "entry",
                  "variable" : "eV"
                },
                {
                  "context" : "eV",
                  "element" : "resource",
                  "variable" : "oV",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Observation"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "baseV",
                  "source" : [
                    {
                      "context" : "qr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "oV",
                      "element" : "id"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "BuildBaseObs",
                      "parameter" : [
                        {
                          "valueId" : "qr"
                        },
                        {
                          "valueId" : "oV"
                        },
                        {
                          "valueId" : "eV"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "catVSystem",
                  "source" : [
                    {
                      "context" : "qr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "oV",
                      "element" : "category",
                      "transform" : "cc",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                        },
                        {
                          "valueString" : "survey"
                        },
                        {
                          "valueString" : "Survey"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "codeVCode",
                  "source" : [
                    {
                      "context" : "qr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "oV",
                      "element" : "code",
                      "transform" : "cc",
                      "parameter" : [
                        {
                          "valueString" : "http://loinc.org"
                        },
                        {
                          "valueString" : "9270-0"
                        },
                        {
                          "valueString" : "Glasgow coma score verbal"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "valV",
                  "source" : [
                    {
                      "context" : "qr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "oV",
                      "element" : "id"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "SetValueFromItem",
                      "parameter" : [
                        {
                          "valueId" : "itV"
                        },
                        {
                          "valueId" : "oV"
                        }
                      ]
                    }
                  ]
                }
              ],
              "documentation" : "Verbal"
            },
            {
              "name" : "motorResponseObs",
              "source" : [
                {
                  "context" : "qr",
                  "element" : "item",
                  "variable" : "itM",
                  "condition" : "linkId = 'motor-response'"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "element" : "entry",
                  "variable" : "eM"
                },
                {
                  "context" : "eM",
                  "element" : "resource",
                  "variable" : "oM",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Observation"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "baseM",
                  "source" : [
                    {
                      "context" : "qr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "oM",
                      "element" : "id"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "BuildBaseObs",
                      "parameter" : [
                        {
                          "valueId" : "qr"
                        },
                        {
                          "valueId" : "oM"
                        },
                        {
                          "valueId" : "eM"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "catMSystem",
                  "source" : [
                    {
                      "context" : "qr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "oM",
                      "element" : "category",
                      "transform" : "cc",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                        },
                        {
                          "valueString" : "survey"
                        },
                        {
                          "valueString" : "Survey"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "catMCode",
                  "source" : [
                    {
                      "context" : "qr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "oM",
                      "element" : "code",
                      "transform" : "cc",
                      "parameter" : [
                        {
                          "valueString" : "http://loinc.org"
                        },
                        {
                          "valueString" : "9268-4"
                        },
                        {
                          "valueString" : "Glasgow coma score motor"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "valM",
                  "source" : [
                    {
                      "context" : "qr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "oM",
                      "element" : "id"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "SetValueFromItem",
                      "parameter" : [
                        {
                          "valueId" : "itM"
                        },
                        {
                          "valueId" : "oM"
                        }
                      ]
                    }
                  ]
                }
              ],
              "documentation" : "Motor"
            },
            {
              "name" : "eyeResponseObs",
              "source" : [
                {
                  "context" : "qr",
                  "element" : "item",
                  "variable" : "itE",
                  "condition" : "linkId = 'eye-opening'"
                }
              ],
              "target" : [
                {
                  "context" : "bundle",
                  "element" : "entry",
                  "variable" : "eE"
                },
                {
                  "context" : "eE",
                  "element" : "resource",
                  "variable" : "oE",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Observation"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "baseE",
                  "source" : [
                    {
                      "context" : "qr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "oE",
                      "element" : "id"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "BuildBaseObs",
                      "parameter" : [
                        {
                          "valueId" : "qr"
                        },
                        {
                          "valueId" : "oE"
                        },
                        {
                          "valueId" : "eE"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "catESystem",
                  "source" : [
                    {
                      "context" : "qr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "oE",
                      "element" : "category",
                      "transform" : "cc",
                      "parameter" : [
                        {
                          "valueString" : "http://terminology.hl7.org/CodeSystem/observation-category"
                        },
                        {
                          "valueString" : "survey"
                        },
                        {
                          "valueString" : "Survey"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "catECode",
                  "source" : [
                    {
                      "context" : "qr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "oE",
                      "element" : "code",
                      "transform" : "cc",
                      "parameter" : [
                        {
                          "valueString" : "http://loinc.org"
                        },
                        {
                          "valueString" : "9267-6"
                        },
                        {
                          "valueString" : "Glasgow coma score eye opening"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "valE",
                  "source" : [
                    {
                      "context" : "qr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "oE",
                      "element" : "id"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "SetValueFromItem",
                      "parameter" : [
                        {
                          "valueId" : "itE"
                        },
                        {
                          "valueId" : "oE"
                        }
                      ]
                    }
                  ]
                }
              ],
              "documentation" : "Eye"
            }
          ]
        },
        {
          "name" : "BuildBaseObs",
          "input" : [
            {
              "name" : "qr",
              "type" : "QR",
              "mode" : "source"
            },
            {
              "name" : "obs",
              "type" : "Observation",
              "mode" : "target"
            },
            {
              "name" : "entry",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "entryRequest",
              "source" : [
                {
                  "context" : "qr"
                }
              ],
              "target" : [
                {
                  "context" : "entry",
                  "element" : "request",
                  "variable" : "req"
                }
              ],
              "rule" : [
                {
                  "name" : "reqMethod",
                  "source" : [
                    {
                      "context" : "qr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "req",
                      "element" : "method",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "POST"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "reqUrl",
                  "source" : [
                    {
                      "context" : "qr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "req",
                      "element" : "url",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Observation"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "setIdAndFullUrl",
              "source" : [
                {
                  "context" : "qr"
                }
              ],
              "target" : [
                {
                  "context" : "obs",
                  "element" : "id",
                  "transform" : "uuid"
                }
              ],
              "dependent" : [
                {
                  "name" : "SetFullUrl",
                  "parameter" : [
                    {
                      "valueId" : "obs"
                    },
                    {
                      "valueId" : "entry"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "setStatus",
              "source" : [
                {
                  "context" : "qr"
                }
              ],
              "target" : [
                {
                  "context" : "obs",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "final"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "setSubject",
              "source" : [
                {
                  "context" : "qr",
                  "element" : "subject",
                  "variable" : "s"
                }
              ],
              "target" : [
                {
                  "context" : "obs",
                  "element" : "subject",
                  "variable" : "r",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "subRef",
                  "source" : [
                    {
                      "context" : "s",
                      "element" : "reference",
                      "variable" : "ref"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "r",
                      "element" : "reference",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "ref"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "subDisp",
                  "source" : [
                    {
                      "context" : "s",
                      "element" : "display",
                      "variable" : "disp"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "r",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "disp"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "setEffective",
              "source" : [
                {
                  "context" : "qr",
                  "element" : "authored",
                  "variable" : "t"
                }
              ],
              "target" : [
                {
                  "context" : "obs",
                  "element" : "effective",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "t"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "setIssued",
              "source" : [
                {
                  "context" : "qr",
                  "element" : "authored",
                  "variable" : "t"
                }
              ],
              "target" : [
                {
                  "context" : "obs",
                  "element" : "issued",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "t"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "setDerivedFrom",
              "source" : [
                {
                  "context" : "qr"
                }
              ],
              "target" : [
                {
                  "context" : "obs",
                  "element" : "derivedFrom",
                  "variable" : "dr",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "derRef",
                  "source" : [
                    {
                      "context" : "qr",
                      "element" : "id",
                      "variable" : "id"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "dr",
                      "element" : "reference",
                      "transform" : "append",
                      "parameter" : [
                        {
                          "valueString" : "QuestionnaireResponse/"
                        },
                        {
                          "valueId" : "id"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "SetValueFromItem",
          "input" : [
            {
              "name" : "it",
              "type" : "Element",
              "mode" : "source"
            },
            {
              "name" : "obs",
              "type" : "Observation",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "setValueCC",
              "source" : [
                {
                  "context" : "it",
                  "element" : "answer",
                  "variable" : "a"
                }
              ],
              "target" : [
                {
                  "context" : "obs",
                  "element" : "value",
                  "variable" : "c",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "CodeableConcept"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "copyCoding",
                  "source" : [
                    {
                      "context" : "a",
                      "element" : "value",
                      "variable" : "coding"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "c",
                      "element" : "coding",
                      "variable" : "nc",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "coding"
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "SetFullUrl",
          "input" : [
            {
              "name" : "obs",
              "type" : "Observation",
              "mode" : "source"
            },
            {
              "name" : "entry",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "assignFullUrl",
              "source" : [
                {
                  "context" : "obs",
                  "element" : "id",
                  "variable" : "id"
                }
              ],
              "target" : [
                {
                  "context" : "entry",
                  "element" : "fullUrl",
                  "transform" : "append",
                  "parameter" : [
                    {
                      "valueString" : "https://fhir.slade360.co.ke/fhir/Observation/"
                    },
                    {
                      "valueId" : "id"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }