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