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

Active as of 2026-04-27

Raw ttl | Download

    @prefix fhir: <http://hl7.org/fhir/> .
    @prefix owl: <http://www.w3.org/2002/07/owl#> .
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
    @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

    # - resource -------------------------------------------------------------------

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