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

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

Active as of 2026-04-27

Raw json | Download

    {
      "resourceType" : "StructureMap",
      "id" : "EpisodeOfCare4toSGHI5",
      "text" : {
        "status" : "generated",
        "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap EpisodeOfCare4toSGHI5</b></p><a name=\"EpisodeOfCare4toSGHI5\"> </a><a name=\"hcEpisodeOfCare4toSGHI5\"> </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/EpisodeOfCare4toSGHI5'</span>\r\n<span style=\"color: #cc00cc\">/// <b>name</b> = </span><span style=\"color: blue\">'EpisodeOfCare4toSGHI5'</span>\r\n<span style=\"color: #cc00cc\">/// <b>title</b> = </span><span style=\"color: blue\">'EpisodeOfCare 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/EpisodeOfCare<span style=\"color: navy\">&quot; </span><b>alias </b>EpisodeOfCareR4 <b>as </b><b>source</b>\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"StructureDefinition-episodeofcare.html\" title=\"SGHI EpisodeOfCare\">https://fhir.slade360.co.ke/fhir/StructureDefinition/episodeofcare</a><span style=\"color: navy\">&quot; </span><b>alias </b>SGHIEpisodeOfCare <b>as </b><b>target</b>\r\n\r\n<b>imports</b><span style=\"color: navy\"> &quot;</span>http://hl7.org/fhir/StructureMap/*4to5<span style=\"color: navy\">&quot;\r\n</span>\r\n<b>group </b>SGHIEpisodeOfCare<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>EpisodeOfCareR4, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>SGHIEpisodeOfCare<span style=\"color: navy\">)</span><b> extends </b>DomainResource<b> &lt;&lt;type+&gt;&gt;</b><span style=\"color: navy\"> {\r\n</span>  src.id<span style=\"color: navy\"><b> -&gt; </b></span>tgt.id<span style=\"color: navy\">;</span>\r\n  src.active<span style=\"color: navy\"><b> -&gt; </b></span>tgt.active = <span style=\"color: blue\">'true'</span><span style=\"color: navy\">;</span>\r\n  src.language<span style=\"color: navy\"><b> -&gt; </b></span>tgt.language<span style=\"color: navy\">;</span>\r\n  src<span style=\"color: navy\"><b> -&gt; </b></span>tgt.text = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Narrative'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">tgt_n</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    src<span style=\"color: navy\"><b> -&gt; </b></span>tgt_n.status = <span style=\"color: blue\">'generated'</span> <i>&quot;settextstatus&quot;</i><span style=\"color: navy\">;</span>\r\n    src<span style=\"color: navy\"><b> -&gt; </b></span>tgt_n.div = <span style=\"color: blue\">'&lt;div xmlns=\\&quot;http://www.w3.org/1999/xhtml\\&quot;&gt;&lt;h1&gt;Generated text&lt;/h1&gt;&lt;/div&gt;'</span> <i>&quot;settextdiv&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;createhardcodedtext&quot;</i><span style=\"color: navy\">;</span>\r\n  src<b> as </b><span style=\"color: maroon\">sc</span><b> where </b>identifier.exists().not()<span style=\"color: navy\"><b> -&gt; </b></span>tgt.identifier = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Identifier'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">tt_id</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    src.id<b> as </b><span style=\"color: maroon\">uuid</span><span style=\"color: navy\"><b> -&gt; </b></span>tt_id.value = <span style=\"color: maroon\">uuid</span> <i>&quot;creating id&quot;</i><span style=\"color: navy\">;</span>\r\n    src<span style=\"color: navy\"><b> -&gt; </b></span>tt_id.use = <span style=\"color: blue\">'official'</span> <i>&quot;creating use&quot;</i><span style=\"color: navy\">;</span>\r\n    src<span style=\"color: navy\"><b> -&gt; </b></span>tt_id.type<b> as </b><span style=\"color: maroon\">ty</span><b> then</b><span style=\"color: navy\"> {\r\n</span>      src<span style=\"color: navy\"><b> -&gt; </b></span>ty.coding = <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\">ty_c</span><b> then</b><span style=\"color: navy\"> {\r\n</span>        src<span style=\"color: navy\"><b> -&gt; </b></span>ty_c.system = <span style=\"color: blue\">'https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem'</span> <i>&quot;creating coding&quot;</i><span style=\"color: navy\">;</span>\r\n        src<span style=\"color: navy\"><b> -&gt; </b></span>ty_c.code = <span style=\"color: blue\">'fhir-id'</span> <i>&quot;creating code&quot;</i><span style=\"color: navy\">;</span>\r\n        src<span style=\"color: navy\"><b> -&gt; </b></span>ty_c.display = <span style=\"color: blue\">'FHIR Id'</span> <i>&quot;creating display&quot;</i><span style=\"color: navy\">;</span>\r\n      <span style=\"color: navy\">}</span> <i>&quot;creating identifier type&quot;</i><span style=\"color: navy\">;</span>\r\n      src<span style=\"color: navy\"><b> -&gt; </b></span>tt_id.system = <span style=\"color: blue\">'https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem'</span> <i>&quot;creating system&quot;</i><span style=\"color: navy\">;</span>\r\n      src.managingOrganization<b> as </b><span style=\"color: maroon\">sp</span><span style=\"color: navy\"><b> -&gt; </b></span>tt_id.assigner = <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\">t_assigner</span><b> then</b><span style=\"color: navy\"> {\r\n</span>        sp.reference<span style=\"color: navy\"><b> -&gt; </b></span>t_assigner.reference<span style=\"color: navy\">;</span>\r\n        sp.display<span style=\"color: navy\"><b> -&gt; </b></span>t_assigner.display<span style=\"color: navy\">;</span>\r\n      <span style=\"color: navy\">}</span><span style=\"color: navy\">;</span>\r\n    <span style=\"color: navy\">}</span> <i>&quot;creating identifier type&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;creating identifier&quot;</i><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">Create identifier</span>\r\n  src.managingOrganization<b> as </b><span style=\"color: maroon\">smo</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.managingOrganization = <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\">tmo</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    smo.reference<span style=\"color: navy\"><b> -&gt; </b></span>tmo.reference<span style=\"color: navy\">;</span>\r\n    smo.display<b> where </b>display.exists()<span style=\"color: navy\"><b> -&gt; </b></span>tmo.display<span style=\"color: navy\">;</span>\r\n    src.managingOrganization<b> where </b>display.exists().not()<span style=\"color: navy\"><b> -&gt; </b></span>tmo.display = <span style=\"color: blue\">'Organization'</span><span style=\"color: navy\">;</span>\r\n    smo.display<span style=\"color: navy\"><b> -&gt; </b></span>tmo.display<span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span><span style=\"color: navy\">;</span>\r\n  src.status<span style=\"color: navy\"><b> -&gt; </b></span>tgt.status<span style=\"color: navy\">;</span>\r\n  src.meta<b> as </b><span style=\"color: maroon\">s_meta</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.meta<b> as </b><span style=\"color: maroon\">t_meta</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    s_meta.lastUpdated<span style=\"color: navy\"><b> -&gt; </b></span>t_meta.lastUpdated<span style=\"color: navy\">;</span>\r\n    s_meta.language<span style=\"color: navy\"><b> -&gt; </b></span>t_meta.language<span style=\"color: navy\">;</span>\r\n    s_meta.tags<span style=\"color: navy\"><b> -&gt; </b></span>t_meta.tags<span style=\"color: navy\">;</span>\r\n    src.meta<b> where </b>profile.exists().not()<span style=\"color: navy\"><b> -&gt; </b></span>t_meta.profile = <span style=\"color: blue\">'https://fhir.slade360.co.ke/fhir/StructureDefinition/episodeofcare'</span> <i>&quot;setprofileinmeta&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;set profile in meta&quot;</i><span style=\"color: navy\">;</span>\r\n  src.period<span style=\"color: navy\"><b> -&gt; </b></span>tgt.period<span style=\"color: navy\">;</span>\r\n  src.patient<span style=\"color: navy\"><b> -&gt; </b></span>tgt.patient<span style=\"color: navy\">;</span>\r\n  src<b> where </b>statusHistory.exists().not()<span style=\"color: navy\"><b> -&gt; </b></span>tgt.statusHistory = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'BackboneElement'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">th</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    src<span style=\"color: navy\"><b> -&gt; </b></span>th.status = <span style=\"color: blue\">'planned'</span> <i>&quot;set default status&quot;</i><span style=\"color: navy\">;</span>\r\n    src<span style=\"color: navy\"><b> -&gt; </b></span>th.period = <b>create</b><span style=\"color: navy\">(</span><span style=\"color: blue\">'Period'</span><span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">tp</span><b> then</b><span style=\"color: navy\"> {\r\n</span>      src.period<b> as </b><span style=\"color: maroon\">sp</span><span style=\"color: navy\"><b> -&gt; </b></span>th.period<b> as </b><span style=\"color: maroon\">tp</span><b> then </b>TransformPeriod<span style=\"color: navy\">(</span><span style=\"color: maroon\">sp</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">tp</span><span style=\"color: navy\">)</span><span style=\"color: navy\">;</span>\r\n    <span style=\"color: navy\">}</span> <i>&quot;copying status history period&quot;</i><span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span> <i>&quot;creating status history&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>TransformAssigner<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span>, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\">)</span><b> &lt;&lt;types&gt;&gt;</b><span style=\"color: navy\"> {\r\n</span>  src.reference<span style=\"color: navy\"><b> -&gt; </b></span>tgt.reference<span style=\"color: navy\">;</span>\r\n  src.display<span style=\"color: navy\"><b> -&gt; </b></span>tgt.display<span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>TransformPeriod<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span>, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\">)</span><b> &lt;&lt;types&gt;&gt;</b><span style=\"color: navy\"> {\r\n</span>  src.start<span style=\"color: navy\"><b> -&gt; </b></span>tgt.start<span style=\"color: navy\">;</span>\r\n  src.end<span style=\"color: navy\"><b> -&gt; </b></span>tgt.end<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/EpisodeOfCare4toSGHI5",
      "version" : "0.1.0",
      "name" : "EpisodeOfCare4toSGHI5",
      "title" : "EpisodeOfCare 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" : "EpisodeOfCareTransformsR4SGHIR5",
      "structure" : [
        {
          "url" : "http://hl7.org/fhir/4.0/StructureDefinition/EpisodeOfCare",
          "mode" : "source",
          "alias" : "EpisodeOfCareR4"
        },
        {
          "url" : "https://fhir.slade360.co.ke/fhir/StructureDefinition/episodeofcare",
          "mode" : "target",
          "alias" : "SGHIEpisodeOfCare"
        }
      ],
      "import" : [
        "http://hl7.org/fhir/StructureMap/*4to5"
      ],
      "group" : [
        {
          "name" : "SGHIEpisodeOfCare",
          "extends" : "DomainResource",
          "typeMode" : "type-and-types",
          "input" : [
            {
              "name" : "src",
              "type" : "EpisodeOfCareR4",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "type" : "SGHIEpisodeOfCare",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "id",
              "source" : [
                {
                  "context" : "src",
                  "element" : "id",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "id",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ],
              "dependent" : [
                {
                  "name" : "DefaultMappingGroupAnonymousAlias",
                  "parameter" : [
                    {
                      "valueId" : "vvv"
                    },
                    {
                      "valueId" : "vvv"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "active",
              "source" : [
                {
                  "context" : "src",
                  "element" : "active"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "active",
                  "transform" : "copy",
                  "parameter" : [
                    {
                      "valueString" : "true"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "language",
              "source" : [
                {
                  "context" : "src",
                  "element" : "language",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "language",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ],
              "dependent" : [
                {
                  "name" : "DefaultMappingGroupAnonymousAlias",
                  "parameter" : [
                    {
                      "valueId" : "vvv"
                    },
                    {
                      "valueId" : "vvv"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "createhardcodedtext",
              "source" : [
                {
                  "context" : "src"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "text",
                  "variable" : "tgt_n",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Narrative"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "settextstatus",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgt_n",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "generated"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "settextdiv",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tgt_n",
                      "element" : "div",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Generated text</h1></div>"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "creating identifier",
              "source" : [
                {
                  "context" : "src",
                  "variable" : "sc",
                  "condition" : "identifier.exists().not()"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "identifier",
                  "variable" : "tt_id",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Identifier"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "creating id",
                  "source" : [
                    {
                      "context" : "src",
                      "element" : "id",
                      "variable" : "uuid"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tt_id",
                      "element" : "value",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "uuid"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "creating use",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tt_id",
                      "element" : "use",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "official"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "creating identifier type",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tt_id",
                      "element" : "type",
                      "variable" : "ty"
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "creating identifier type",
                      "source" : [
                        {
                          "context" : "src"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "ty",
                          "element" : "coding",
                          "variable" : "ty_c",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "CodeableConcept"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "creating coding",
                          "source" : [
                            {
                              "context" : "src"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ty_c",
                              "element" : "system",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "creating code",
                          "source" : [
                            {
                              "context" : "src"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ty_c",
                              "element" : "code",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "fhir-id"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "creating display",
                          "source" : [
                            {
                              "context" : "src"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "ty_c",
                              "element" : "display",
                              "transform" : "copy",
                              "parameter" : [
                                {
                                  "valueString" : "FHIR Id"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "creating system",
                      "source" : [
                        {
                          "context" : "src"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "tt_id",
                          "element" : "system",
                          "transform" : "copy",
                          "parameter" : [
                            {
                              "valueString" : "https://fhir.slade360.co.ke/fhir/CodeSystem/identifier-codesystem"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name" : "managingOrganization",
                      "source" : [
                        {
                          "context" : "src",
                          "element" : "managingOrganization",
                          "variable" : "sp"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "tt_id",
                          "element" : "assigner",
                          "variable" : "t_assigner",
                          "transform" : "create",
                          "parameter" : [
                            {
                              "valueString" : "Reference"
                            }
                          ]
                        }
                      ],
                      "rule" : [
                        {
                          "name" : "reference",
                          "source" : [
                            {
                              "context" : "sp",
                              "element" : "reference",
                              "variable" : "vvv"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "t_assigner",
                              "element" : "reference",
                              "variable" : "vvv",
                              "transform" : "create"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "DefaultMappingGroupAnonymousAlias",
                              "parameter" : [
                                {
                                  "valueId" : "vvv"
                                },
                                {
                                  "valueId" : "vvv"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name" : "display",
                          "source" : [
                            {
                              "context" : "sp",
                              "element" : "display",
                              "variable" : "vvv"
                            }
                          ],
                          "target" : [
                            {
                              "context" : "t_assigner",
                              "element" : "display",
                              "variable" : "vvv",
                              "transform" : "create"
                            }
                          ],
                          "dependent" : [
                            {
                              "name" : "DefaultMappingGroupAnonymousAlias",
                              "parameter" : [
                                {
                                  "valueId" : "vvv"
                                },
                                {
                                  "valueId" : "vvv"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ],
              "documentation" : "Create identifier"
            },
            {
              "name" : "managingOrganization",
              "source" : [
                {
                  "context" : "src",
                  "element" : "managingOrganization",
                  "variable" : "smo"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "managingOrganization",
                  "variable" : "tmo",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "Reference"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "reference",
                  "source" : [
                    {
                      "context" : "smo",
                      "element" : "reference",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tmo",
                      "element" : "reference",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "DefaultMappingGroupAnonymousAlias",
                      "parameter" : [
                        {
                          "valueId" : "vvv"
                        },
                        {
                          "valueId" : "vvv"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "display",
                  "source" : [
                    {
                      "context" : "smo",
                      "element" : "display",
                      "variable" : "vvv",
                      "condition" : "display.exists()"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tmo",
                      "element" : "display",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "DefaultMappingGroupAnonymousAlias",
                      "parameter" : [
                        {
                          "valueId" : "vvv"
                        },
                        {
                          "valueId" : "vvv"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "managingOrganization",
                  "source" : [
                    {
                      "context" : "src",
                      "element" : "managingOrganization",
                      "condition" : "display.exists().not()"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tmo",
                      "element" : "display",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "Organization"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "display",
                  "source" : [
                    {
                      "context" : "smo",
                      "element" : "display",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tmo",
                      "element" : "display",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "DefaultMappingGroupAnonymousAlias",
                      "parameter" : [
                        {
                          "valueId" : "vvv"
                        },
                        {
                          "valueId" : "vvv"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "status",
              "source" : [
                {
                  "context" : "src",
                  "element" : "status",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "status",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ],
              "dependent" : [
                {
                  "name" : "DefaultMappingGroupAnonymousAlias",
                  "parameter" : [
                    {
                      "valueId" : "vvv"
                    },
                    {
                      "valueId" : "vvv"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "set profile in meta",
              "source" : [
                {
                  "context" : "src",
                  "element" : "meta",
                  "variable" : "s_meta"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "meta",
                  "variable" : "t_meta"
                }
              ],
              "rule" : [
                {
                  "name" : "lastUpdated",
                  "source" : [
                    {
                      "context" : "s_meta",
                      "element" : "lastUpdated",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "t_meta",
                      "element" : "lastUpdated",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "DefaultMappingGroupAnonymousAlias",
                      "parameter" : [
                        {
                          "valueId" : "vvv"
                        },
                        {
                          "valueId" : "vvv"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "language",
                  "source" : [
                    {
                      "context" : "s_meta",
                      "element" : "language",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "t_meta",
                      "element" : "language",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "DefaultMappingGroupAnonymousAlias",
                      "parameter" : [
                        {
                          "valueId" : "vvv"
                        },
                        {
                          "valueId" : "vvv"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "tags",
                  "source" : [
                    {
                      "context" : "s_meta",
                      "element" : "tags",
                      "variable" : "vvv"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "t_meta",
                      "element" : "tags",
                      "variable" : "vvv",
                      "transform" : "create"
                    }
                  ],
                  "dependent" : [
                    {
                      "name" : "DefaultMappingGroupAnonymousAlias",
                      "parameter" : [
                        {
                          "valueId" : "vvv"
                        },
                        {
                          "valueId" : "vvv"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "setprofileinmeta",
                  "source" : [
                    {
                      "context" : "src",
                      "element" : "meta",
                      "condition" : "profile.exists().not()"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "t_meta",
                      "element" : "profile",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "https://fhir.slade360.co.ke/fhir/StructureDefinition/episodeofcare"
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "name" : "period",
              "source" : [
                {
                  "context" : "src",
                  "element" : "period",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "period",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ],
              "dependent" : [
                {
                  "name" : "DefaultMappingGroupAnonymousAlias",
                  "parameter" : [
                    {
                      "valueId" : "vvv"
                    },
                    {
                      "valueId" : "vvv"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "patient",
              "source" : [
                {
                  "context" : "src",
                  "element" : "patient",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "patient",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ],
              "dependent" : [
                {
                  "name" : "DefaultMappingGroupAnonymousAlias",
                  "parameter" : [
                    {
                      "valueId" : "vvv"
                    },
                    {
                      "valueId" : "vvv"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "creating status history",
              "source" : [
                {
                  "context" : "src",
                  "condition" : "statusHistory.exists().not()"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "statusHistory",
                  "variable" : "th",
                  "transform" : "create",
                  "parameter" : [
                    {
                      "valueString" : "BackboneElement"
                    }
                  ]
                }
              ],
              "rule" : [
                {
                  "name" : "set default status",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "th",
                      "element" : "status",
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueString" : "planned"
                        }
                      ]
                    }
                  ]
                },
                {
                  "name" : "copying status history period",
                  "source" : [
                    {
                      "context" : "src"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "th",
                      "element" : "period",
                      "variable" : "tp",
                      "transform" : "create",
                      "parameter" : [
                        {
                          "valueString" : "Period"
                        }
                      ]
                    }
                  ],
                  "rule" : [
                    {
                      "name" : "period",
                      "source" : [
                        {
                          "context" : "src",
                          "element" : "period",
                          "variable" : "sp"
                        }
                      ],
                      "target" : [
                        {
                          "context" : "th",
                          "element" : "period",
                          "variable" : "tp"
                        }
                      ],
                      "dependent" : [
                        {
                          "name" : "TransformPeriod",
                          "parameter" : [
                            {
                              "valueId" : "sp"
                            },
                            {
                              "valueId" : "tp"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "TransformAssigner",
          "typeMode" : "types",
          "input" : [
            {
              "name" : "src",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "reference",
              "source" : [
                {
                  "context" : "src",
                  "element" : "reference",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "reference",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ],
              "dependent" : [
                {
                  "name" : "DefaultMappingGroupAnonymousAlias",
                  "parameter" : [
                    {
                      "valueId" : "vvv"
                    },
                    {
                      "valueId" : "vvv"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "display",
              "source" : [
                {
                  "context" : "src",
                  "element" : "display",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "display",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ],
              "dependent" : [
                {
                  "name" : "DefaultMappingGroupAnonymousAlias",
                  "parameter" : [
                    {
                      "valueId" : "vvv"
                    },
                    {
                      "valueId" : "vvv"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "TransformPeriod",
          "typeMode" : "types",
          "input" : [
            {
              "name" : "src",
              "mode" : "source"
            },
            {
              "name" : "tgt",
              "mode" : "target"
            }
          ],
          "rule" : [
            {
              "name" : "start",
              "source" : [
                {
                  "context" : "src",
                  "element" : "start",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "start",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ],
              "dependent" : [
                {
                  "name" : "DefaultMappingGroupAnonymousAlias",
                  "parameter" : [
                    {
                      "valueId" : "vvv"
                    },
                    {
                      "valueId" : "vvv"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "end",
              "source" : [
                {
                  "context" : "src",
                  "element" : "end",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "end",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ],
              "dependent" : [
                {
                  "name" : "DefaultMappingGroupAnonymousAlias",
                  "parameter" : [
                    {
                      "valueId" : "vvv"
                    },
                    {
                      "valueId" : "vvv"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }