SGHI FHIR Profile Implementation Guide
0.1.0 - ci-build

SGHI FHIR Profile Implementation Guide, published by Kathurima Kimathi. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/savannahghi/sil_fhir_profile_ig/ and changes regularly. See the Directory of published versions

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

Active as of 2026-04-27

Raw json | Download

    {
      "resourceType" : "StructureMap",
      "id" : "RiskAssessmentR4toSGHIR5",
      "text" : {
        "status" : "generated",
        "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap RiskAssessmentR4toSGHIR5</b></p><a name=\"RiskAssessmentR4toSGHIR5\"> </a><a name=\"hcRiskAssessmentR4toSGHIR5\"> </a><pre class=\"fml\">\r\n<span style=\"color: #cc00cc\">/// <b>url</b> = </span><span style=\"color: blue\">'https://fhir.slade360.co.ke/fhir/StructureMap/RiskAssessmentR4toSGHIR5'</span>\r\n<span style=\"color: #cc00cc\">/// <b>name</b> = </span><span style=\"color: blue\">'RiskAssessmentR4toSGHIR5'</span>\r\n<span style=\"color: #cc00cc\">/// <b>title</b> = </span><span style=\"color: blue\">'RiskAssessment Transforms: R4 → SGHI R5'</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>http://hl7.org/fhir/4.0/StructureDefinition/RiskAssessment<span style=\"color: navy\">&quot; </span><b>alias </b>RiskAssessmentR4 <b>as </b><b>source</b>\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"StructureDefinition-riskassessment.html\" title=\"SGHI RiskAssessment\">https://fhir.slade360.co.ke/fhir/StructureDefinition/riskassessment</a><span style=\"color: navy\">&quot; </span><b>alias </b>RiskAssessmentR5 <b>as </b><b>target</b>\r\n\r\n<b>group </b>RiskAssessment<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>RiskAssessmentR4, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>RiskAssessmentR5<span style=\"color: navy\">)</span><b> &lt;&lt;type+&gt;&gt;</b><span style=\"color: navy\"> {\r\n</span>  src.id<b> as </b><span style=\"color: maroon\">v</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.id = <span style=\"color: maroon\">v</span><span style=\"color: navy\">;</span>\r\n  src.meta<b> as </b><span style=\"color: maroon\">m</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.meta = <span style=\"color: maroon\">m</span><span style=\"color: navy\">;</span>\r\n  src.language<b> as </b><span style=\"color: maroon\">l</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.language = <span style=\"color: navy\">(</span>l.lower()<span style=\"color: navy\">)</span><span style=\"color: navy\">;</span>\r\n  src.text<b> as </b><span style=\"color: maroon\">n</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.text = <span style=\"color: maroon\">n</span><span style=\"color: navy\">;</span>\r\n  src.status<b> as </b><span style=\"color: maroon\">s</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.status = <span style=\"color: maroon\">s</span><span style=\"color: navy\">;</span>\r\n  src.code<b> as </b><span style=\"color: maroon\">c</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.code = <span style=\"color: maroon\">c</span><span style=\"color: navy\">;</span>\r\n  src.subject<b> as </b><span style=\"color: maroon\">sbj</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.subject = <span style=\"color: maroon\">sbj</span><span style=\"color: navy\">;</span>\r\n  src.encounter<b> as </b><span style=\"color: maroon\">enc</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.encounter = <span style=\"color: maroon\">enc</span><span style=\"color: navy\">;</span>\r\n  src.occurrence<b> as </b><span style=\"color: maroon\">occ</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.occurrence = <span style=\"color: maroon\">occ</span><span style=\"color: navy\">;</span>\r\n  src.condition<b> as </b><span style=\"color: maroon\">cond</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.condition = <span style=\"color: maroon\">cond</span><span style=\"color: navy\">;</span>\r\n  src.performer<b> as </b><span style=\"color: maroon\">perf</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.performer = <span style=\"color: maroon\">perf</span><span style=\"color: navy\">;</span>\r\n  src.reasonCode<b> as </b><span style=\"color: maroon\">rc</span><span style=\"color: navy\"><b> -&gt; </b></span> tgt.reason<b> as </b><span style=\"color: maroon\">r</span><span style=\"color: navy\">, </span> r.concept = <span style=\"color: maroon\">rc</span> <i>&quot;reasonCodeToReason&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">R4 reasonCode + reasonReference → R5 reason (CodeableReference)</span>\r\n  src.reasonReference<b> as </b><span style=\"color: maroon\">rr</span><span style=\"color: navy\"><b> -&gt; </b></span> tgt.reason<b> as </b><span style=\"color: maroon\">r2</span><span style=\"color: navy\">, </span> r2.reference = <span style=\"color: maroon\">rr</span> <i>&quot;reasonRefToReason&quot;</i><span style=\"color: navy\">;</span>\r\n  src.basis<b> as </b><span style=\"color: maroon\">b</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.basis = <span style=\"color: maroon\">b</span><span style=\"color: navy\">;</span>\r\n  src.prediction<b> as </b><span style=\"color: maroon\">p</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.prediction<b> as </b><span style=\"color: maroon\">tp</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    p.outcome<b> as </b><span style=\"color: maroon\">o</span><span style=\"color: navy\"><b> -&gt; </b></span>tp.outcome = <span style=\"color: maroon\">o</span><span style=\"color: navy\">;</span>\r\n    p.probabilityDecimal<b> as </b><span style=\"color: maroon\">d</span><span style=\"color: navy\"><b> -&gt; </b></span>tp.probability = <span style=\"color: maroon\">d</span><span style=\"color: navy\">;</span>\r\n    p.probabilityRange<b> as </b><span style=\"color: maroon\">pr</span><span style=\"color: navy\"><b> -&gt; </b></span>tp.probability = <span style=\"color: maroon\">pr</span><span style=\"color: navy\">;</span>\r\n    p.qualitativeRisk<b> as </b><span style=\"color: maroon\">qr</span><span style=\"color: navy\"><b> -&gt; </b></span>tp.qualitativeRisk = <span style=\"color: maroon\">qr</span><span style=\"color: navy\">;</span>\r\n    p.relativeRisk<b> as </b><span style=\"color: maroon\">rr</span><span style=\"color: navy\"><b> -&gt; </b></span>tp.relativeRisk = <span style=\"color: maroon\">rr</span><span style=\"color: navy\">;</span>\r\n    p.whenPeriod<b> as </b><span style=\"color: maroon\">wp</span><span style=\"color: navy\"><b> -&gt; </b></span>tp.when = <span style=\"color: maroon\">wp</span><span style=\"color: navy\">;</span>\r\n    p.whenRange<b> as </b><span style=\"color: maroon\">wr</span><span style=\"color: navy\"><b> -&gt; </b></span>tp.when = <span style=\"color: maroon\">wr</span><span style=\"color: navy\">;</span>\r\n    p.rationale<b> as </b><span style=\"color: maroon\">ra</span><span style=\"color: navy\"><b> -&gt; </b></span>tp.rationale = <span style=\"color: maroon\">ra</span><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span><span style=\"color: navy\">;</span>\r\n  src.mitigation<b> as </b><span style=\"color: maroon\">mit</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.mitigation = <span style=\"color: maroon\">mit</span><span style=\"color: navy\">;</span>\r\n  src.note<b> as </b><span style=\"color: maroon\">notes</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.note = <span style=\"color: maroon\">notes</span><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span></pre></div>"
      },
      "url" : "https://fhir.slade360.co.ke/fhir/StructureMap/RiskAssessmentR4toSGHIR5",
      "version" : "0.1.0",
      "name" : "RiskAssessmentR4toSGHIR5",
      "title" : "RiskAssessment Transforms: R4 → SGHI R5",
      "status" : "active",
      "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" : "RiskAssessmentTransformsR4SGHIR5",
      "structure" : [
        {
          "url" : "http://hl7.org/fhir/4.0/StructureDefinition/RiskAssessment",
          "mode" : "source",
          "alias" : "RiskAssessmentR4"
        },
        {
          "url" : "https://fhir.slade360.co.ke/fhir/StructureDefinition/riskassessment",
          "mode" : "target",
          "alias" : "RiskAssessmentR5"
        }
      ],
      "group" : [
        {
          "name" : "RiskAssessment",
          "typeMode" : "type-and-types",
          "input" : [
            {
              "name" : "src",
              "type" : "RiskAssessmentR4",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "type" : "RiskAssessmentR5",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "id",
              "source" : [
                {
                  "context" : "src",
                  "element" : "id",
                  "variable" : "v"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "id",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "v"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "meta",
              "source" : [
                {
                  "context" : "src",
                  "element" : "meta",
                  "variable" : "m"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "meta",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "m"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "language",
              "source" : [
                {
                  "context" : "src",
                  "element" : "language",
                  "variable" : "l"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "language",
                  "transform" : "evaluate",
                  "parameter" : [
                    {
                      "valueString" : "l.lower()"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "text",
              "source" : [
                {
                  "context" : "src",
                  "element" : "text",
                  "variable" : "n"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "text",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "n"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "status",
              "source" : [
                {
                  "context" : "src",
                  "element" : "status",
                  "variable" : "s"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "status",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "s"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "code",
              "source" : [
                {
                  "context" : "src",
                  "element" : "code",
                  "variable" : "c"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "code",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "c"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "subject",
              "source" : [
                {
                  "context" : "src",
                  "element" : "subject",
                  "variable" : "sbj"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "subject",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "sbj"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "encounter",
              "source" : [
                {
                  "context" : "src",
                  "element" : "encounter",
                  "variable" : "enc"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "encounter",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "enc"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "occurrence",
              "source" : [
                {
                  "context" : "src",
                  "element" : "occurrence",
                  "variable" : "occ"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "occurrence",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "occ"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "condition",
              "source" : [
                {
                  "context" : "src",
                  "element" : "condition",
                  "variable" : "cond"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "condition",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "cond"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "performer",
              "source" : [
                {
                  "context" : "src",
                  "element" : "performer",
                  "variable" : "perf"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "performer",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "perf"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "reasonCodeToReason",
              "source" : [
                {
                  "context" : "src",
                  "element" : "reasonCode",
                  "variable" : "rc"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "reason",
                  "variable" : "r"
                },
                {
                  "context" : "r",
                  "element" : "concept",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "rc"
                    }
                  ]
                }
              ],
              "documentation" : "R4 reasonCode + reasonReference → R5 reason (CodeableReference)"
            },
            {
              "name" : "reasonRefToReason",
              "source" : [
                {
                  "context" : "src",
                  "element" : "reasonReference",
                  "variable" : "rr"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "reason",
                  "variable" : "r2"
                },
                {
                  "context" : "r2",
                  "element" : "reference",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "rr"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "basis",
              "source" : [
                {
                  "context" : "src",
                  "element" : "basis",
                  "variable" : "b"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "basis",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "b"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "prediction",
              "source" : [
                {
                  "context" : "src",
                  "element" : "prediction",
                  "variable" : "p"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "prediction",
                  "variable" : "tp"
                }
              ],
              "rule" : [
                {
                  "name" : "outcome",
                  "source" : [
                    {
                      "context" : "p",
                      "element" : "outcome",
                      "variable" : "o"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tp",
                      "element" : "outcome",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "o"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "probabilityDecimal",
                  "source" : [
                    {
                      "context" : "p",
                      "element" : "probabilityDecimal",
                      "variable" : "d"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tp",
                      "element" : "probability",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "d"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "probabilityRange",
                  "source" : [
                    {
                      "context" : "p",
                      "element" : "probabilityRange",
                      "variable" : "pr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tp",
                      "element" : "probability",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "pr"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "qualitativeRisk",
                  "source" : [
                    {
                      "context" : "p",
                      "element" : "qualitativeRisk",
                      "variable" : "qr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tp",
                      "element" : "qualitativeRisk",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "qr"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "relativeRisk",
                  "source" : [
                    {
                      "context" : "p",
                      "element" : "relativeRisk",
                      "variable" : "rr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tp",
                      "element" : "relativeRisk",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "rr"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "whenPeriod",
                  "source" : [
                    {
                      "context" : "p",
                      "element" : "whenPeriod",
                      "variable" : "wp"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tp",
                      "element" : "when",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "wp"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "whenRange",
                  "source" : [
                    {
                      "context" : "p",
                      "element" : "whenRange",
                      "variable" : "wr"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tp",
                      "element" : "when",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "wr"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "rationale",
                  "source" : [
                    {
                      "context" : "p",
                      "element" : "rationale",
                      "variable" : "ra"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tp",
                      "element" : "rationale",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "ra"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "mitigation",
              "source" : [
                {
                  "context" : "src",
                  "element" : "mitigation",
                  "variable" : "mit"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "mitigation",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "mit"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "note",
              "source" : [
                {
                  "context" : "src",
                  "element" : "note",
                  "variable" : "notes"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "note",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueId" : "notes"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }