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
| Active as of 2025-09-17 |
<StructureMap xmlns="http://hl7.org/fhir">
<id value="Organization4toSGHI5"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap Organization4toSGHI5</b></p><a name="Organization4toSGHI5"> </a><a name="hcOrganization4toSGHI5"> </a><pre class="fml">
<span style="color: #cc00cc">/// <b>url</b> = </span><span style="color: blue">'https://fhir.slade360.co.ke/fhir/StructureMap/Organization4toSGHI5'</span>
<span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'Organization4toSGHI5'</span>
<span style="color: #cc00cc">/// <b>title</b> = </span><span style="color: blue">'Organization Transforms: R4 → SGHI R5'</span>
<span style="color: #cc00cc">/// <b>status</b> = </span><span style="color: blue">'active'</span>
<b>uses</b><span style="color: navy"> "</span>http://hl7.org/fhir/4.0/StructureDefinition/Organization<span style="color: navy">" </span><b>alias </b>OrganizationR4 <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> "</span><a href="StructureDefinition-sghi-organization.html" title="SGHI Organization">https://fhir.slade360.co.ke/fhir/StructureDefinition/sghi-organization</a><span style="color: navy">" </span><b>alias </b>SGHIOrganization <b>as </b><b>target</b>
<b>imports</b><span style="color: navy"> "</span>http://hl7.org/fhir/StructureMap/*4to5<span style="color: navy">"
</span>
<b>group </b>SGHIOrganization<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>OrganizationR4, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>SGHIOrganization<span style="color: navy">)</span><b> extends </b>DomainResource<b> <<type+>></b><span style="color: navy"> {
</span> src.text<span style="color: navy"><b> -> </b></span>tgt.text<span style="color: navy">;</span>
src.identifier<b> as </b><span style="color: maroon">s</span><b> where </b>(s.system = 'SladeCode') and s.value.exists()<span style="color: navy"><b> -> </b></span>tgt.identifier<b> as </b><span style="color: maroon">t</span><b> then</b><span style="color: navy"> {
</span> s.use<span style="color: navy"><b> -> </b></span>t.use <i>"copyuse"</i><span style="color: navy">;</span>
s.value<span style="color: navy"><b> -> </b></span>t.value <i>"copyvalue"</i><span style="color: navy">;</span>
s.period<span style="color: navy"><b> -> </b></span>t.period <i>"copyperiod"</i><span style="color: navy">;</span>
s.type<b> as </b><span style="color: maroon">st</span><span style="color: navy"><b> -> </b></span>t.type<b> as </b><span style="color: maroon">tt</span><b> then</b><span style="color: navy"> {
</span> st.coding<b> as </b><span style="color: maroon">sc</span><b> where </b>(sc.system = 'SladeCode')<span style="color: navy"><b> -> </b></span> tt.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">tc</span><span style="color: navy">, </span> tc.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/sghi-identifier-codesystem'</span><span style="color: navy">, </span> tc.code = <span style="color: blue">'slade-code'</span><span style="color: navy">, </span> tc.display = <span style="color: blue">'Slade360 Code'</span><span style="color: navy">;</span>
<span style="color: navy">}</span><span style="color: navy">;</span>
s<span style="color: navy"><b> -> </b></span>t.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/sghi-identifier-codesystem'</span> <i>"SetFixedIdentifierSystem"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"processoneidentifier"</i><span style="color: navy">;</span>
src.identifier<b> as </b><span style="color: maroon">s_id</span><span style="color: navy"><b> -> </b></span>tgt.identifier<b> as </b><span style="color: maroon">t_id</span><b> then</b><span style="color: navy"> {
</span> s_id.use<span style="color: navy"><b> -> </b></span>t_id.use <i>"copyuse"</i><span style="color: navy">;</span>
src.id<b> as </b><span style="color: maroon">uuid</span><span style="color: navy"><b> -> </b></span>t_id.value = <span style="color: maroon">uuid</span><span style="color: navy">;</span>
s_id.period<span style="color: navy"><b> -> </b></span>t_id.period<span style="color: navy">;</span>
s_id.type<b> as </b><span style="color: maroon">st</span><span style="color: navy"><b> -> </b></span>t_id.type<b> as </b><span style="color: maroon">tt</span><b> then</b><span style="color: navy"> {
</span> st.coding<span style="color: navy"><b> -> </b></span> tt.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">tt</span><span style="color: navy">, </span> tt.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/sghi-identifier-codesystem'</span><span style="color: navy">, </span> tt.code = <span style="color: blue">'fhir-id'</span><span style="color: navy">, </span> tt.display = <span style="color: blue">'FHIR Id'</span><span style="color: navy">;</span>
<span style="color: navy">}</span><span style="color: navy">;</span>
s_id<span style="color: navy"><b> -> </b></span>t_id.system = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/CodeSystem/sghi-identifier-codesystem'</span> <i>"SetFixedIdentifierSystem"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"create the default FHIR ID identifier type"</i><span style="color: navy">;</span>
src.active<span style="color: navy"><b> -> </b></span>tgt.active<span style="color: navy">;</span>
src.name<span style="color: navy"><b> -> </b></span>tgt.name<span style="color: navy">;</span>
src<span style="color: navy"><b> -> </b></span>tgt.contact = <b>create</b><span style="color: navy">(</span><span style="color: blue">'ExtendedContactDetail'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">t_contact</span><b> then</b><span style="color: navy"> {
</span> src.telecom<b> as </b><span style="color: maroon">s_contact</span><span style="color: navy"><b> -> </b></span>t_contact.telecom<b> as </b><span style="color: maroon">t_contact</span><b> then </b>SGHIContactPointMap<span style="color: navy">(</span><span style="color: maroon">s_contact</span><span style="color: navy">, </span><span style="color: maroon">t_contact</span><span style="color: navy">)</span> <i>"setcontact"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"createcontact"</i><span style="color: navy">;</span>
src<span style="color: navy"><b> -> </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"> {
</span> src<span style="color: navy"><b> -> </b></span>tgt_n.status = <span style="color: blue">'generated'</span> <i>"settextstatus"</i><span style="color: navy">;</span>
src<span style="color: navy"><b> -> </b></span>tgt_n.div = <span style="color: blue">'<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Generated text</h1></div>'</span> <i>"settextdiv"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"createhardcodedtext"</i><span style="color: navy">;</span>
src<span style="color: navy"><b> -> </b></span>tgt.meta = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Meta'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">tm</span><b> then</b><span style="color: navy"> {
</span> src<span style="color: navy"><b> -> </b></span>tm.profile = <span style="color: blue">'https://fhir.slade360.co.ke/fhir/StructureDefinition/sghi-organization'</span> <i>"setprofileinmeta"</i><span style="color: navy">;</span>
<span style="color: navy">}</span> <i>"createhardcodedprofile"</i><span style="color: navy">;</span>
<span style="color: navy">}
</span><b>group </b>SGHIContactPointMap<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> extends </b>ContactPoint<span style="color: navy"> {
</span> src.system<span style="color: navy"><b> -> </b></span>tgt.system<span style="color: navy">;</span>
src.value<span style="color: navy"><b> -> </b></span>tgt.value<span style="color: navy">;</span>
src.use<span style="color: navy"><b> -> </b></span>tgt.use<span style="color: navy">;</span>
src.rank<span style="color: navy"><b> -> </b></span>tgt.rank<span style="color: navy">;</span>
src.period<span style="color: navy"><b> -> </b></span>tgt.period<span style="color: navy">;</span>
<span style="color: navy">}
</span></pre></div>
</text>
<url
value="https://fhir.slade360.co.ke/fhir/StructureMap/Organization4toSGHI5"/>
<version value="0.1.0"/>
<name value="Organization4toSGHI5"/>
<title value="Organization Transforms: R4 → SGHI R5"/>
<status value="active"/>
<date value="2025-09-17T11:42:20+00:00"/>
<publisher value="Kathurima Kimathi"/>
<contact>
<name value="Kathurima Kimathi"/>
<telecom>
<system value="url"/>
<value value="https://www.linkedin.com/in/kathurima-kimathi/"/>
</telecom>
<telecom>
<system value="email"/>
<value value="kathurimakimathi415@gmail.com"/>
</telecom>
</contact>
<contact>
<name value="Oscar John"/>
<telecom>
<system value="email"/>
<value value="oscarjohnotieno@gmail.com"/>
<use value="work"/>
</telecom>
</contact>
<contact>
<name value="Kennedy Omondi"/>
<telecom>
<system value="email"/>
<value value="kennankole@gmail.com"/>
<use value="work"/>
</telecom>
</contact>
<description value="OrganizationTransformsR4SGHIR5"/>
<structure>
<url value="http://hl7.org/fhir/4.0/StructureDefinition/Organization"/>
<mode value="source"/>
<alias value="OrganizationR4"/>
</structure>
<structure>
<url
value="https://fhir.slade360.co.ke/fhir/StructureDefinition/sghi-organization"/>
<mode value="target"/>
<alias value="SGHIOrganization"/>
</structure>
<import value="http://hl7.org/fhir/StructureMap/*4to5"/>
<group>
<name value="SGHIOrganization"/>
<extends value="DomainResource"/>
<typeMode value="type-and-types"/>
<input>
<name value="src"/>
<type value="OrganizationR4"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<type value="SGHIOrganization"/>
<mode value="target"/>
</input>
<rule>
<name value="text"/>
<source>
<context value="src"/>
<element value="text"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="text"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="processoneidentifier"/>
<source>
<context value="src"/>
<element value="identifier"/>
<variable value="s"/>
<condition value="(s.system = 'SladeCode') and s.value.exists()"/>
</source>
<target>
<context value="tgt"/>
<element value="identifier"/>
<variable value="t"/>
</target>
<rule>
<name value="copyuse"/>
<source>
<context value="s"/>
<element value="use"/>
<variable value="vvv"/>
</source>
<target>
<context value="t"/>
<element value="use"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="copyvalue"/>
<source>
<context value="s"/>
<element value="value"/>
<variable value="vvv"/>
</source>
<target>
<context value="t"/>
<element value="value"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="copyperiod"/>
<source>
<context value="s"/>
<element value="period"/>
<variable value="vvv"/>
</source>
<target>
<context value="t"/>
<element value="period"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="type"/>
<source>
<context value="s"/>
<element value="type"/>
<variable value="st"/>
</source>
<target>
<context value="t"/>
<element value="type"/>
<variable value="tt"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="st"/>
<element value="coding"/>
<variable value="sc"/>
<condition value="(sc.system = 'SladeCode')"/>
</source>
<target>
<context value="tt"/>
<element value="coding"/>
<variable value="tc"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<target>
<context value="tc"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/sghi-identifier-codesystem"/>
</parameter>
</target>
<target>
<context value="tc"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="slade-code"/>
</parameter>
</target>
<target>
<context value="tc"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="Slade360 Code"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="SetFixedIdentifierSystem"/>
<source>
<context value="s"/>
</source>
<target>
<context value="t"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/sghi-identifier-codesystem"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="create the default FHIR ID identifier type"/>
<source>
<context value="src"/>
<element value="identifier"/>
<variable value="s_id"/>
</source>
<target>
<context value="tgt"/>
<element value="identifier"/>
<variable value="t_id"/>
</target>
<rule>
<name value="copyuse"/>
<source>
<context value="s_id"/>
<element value="use"/>
<variable value="vvv"/>
</source>
<target>
<context value="t_id"/>
<element value="use"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="id"/>
<source>
<context value="src"/>
<element value="id"/>
<variable value="uuid"/>
</source>
<target>
<context value="t_id"/>
<element value="value"/>
<transform value="copy"/>
<parameter>
<valueId value="uuid"/>
</parameter>
</target>
</rule>
<rule>
<name value="period"/>
<source>
<context value="s_id"/>
<element value="period"/>
<variable value="vvv"/>
</source>
<target>
<context value="t_id"/>
<element value="period"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="type"/>
<source>
<context value="s_id"/>
<element value="type"/>
<variable value="st"/>
</source>
<target>
<context value="t_id"/>
<element value="type"/>
<variable value="tt"/>
</target>
<rule>
<name value="coding"/>
<source>
<context value="st"/>
<element value="coding"/>
</source>
<target>
<context value="tt"/>
<element value="coding"/>
<variable value="tt"/>
<transform value="create"/>
<parameter>
<valueString value="CodeableConcept"/>
</parameter>
</target>
<target>
<context value="tt"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/sghi-identifier-codesystem"/>
</parameter>
</target>
<target>
<context value="tt"/>
<element value="code"/>
<transform value="copy"/>
<parameter>
<valueString value="fhir-id"/>
</parameter>
</target>
<target>
<context value="tt"/>
<element value="display"/>
<transform value="copy"/>
<parameter>
<valueString value="FHIR Id"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="SetFixedIdentifierSystem"/>
<source>
<context value="s_id"/>
</source>
<target>
<context value="t_id"/>
<element value="system"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/CodeSystem/sghi-identifier-codesystem"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="active"/>
<source>
<context value="src"/>
<element value="active"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="active"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="name"/>
<source>
<context value="src"/>
<element value="name"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="name"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="createcontact"/>
<source>
<context value="src"/>
</source>
<target>
<context value="tgt"/>
<element value="contact"/>
<variable value="t_contact"/>
<transform value="create"/>
<parameter>
<valueString value="ExtendedContactDetail"/>
</parameter>
</target>
<rule>
<name value="setcontact"/>
<source>
<context value="src"/>
<element value="telecom"/>
<variable value="s_contact"/>
</source>
<target>
<context value="t_contact"/>
<element value="telecom"/>
<variable value="t_contact"/>
</target>
<dependent>
<name value="SGHIContactPointMap"/>
<parameter>
<valueId value="s_contact"/>
</parameter>
<parameter>
<valueId value="t_contact"/>
</parameter>
</dependent>
</rule>
</rule>
<rule>
<name value="createhardcodedtext"/>
<source>
<context value="src"/>
</source>
<target>
<context value="tgt"/>
<element value="text"/>
<variable value="tgt_n"/>
<transform value="create"/>
<parameter>
<valueString value="Narrative"/>
</parameter>
</target>
<rule>
<name value="settextstatus"/>
<source>
<context value="src"/>
</source>
<target>
<context value="tgt_n"/>
<element value="status"/>
<transform value="copy"/>
<parameter>
<valueString value="generated"/>
</parameter>
</target>
</rule>
<rule>
<name value="settextdiv"/>
<source>
<context value="src"/>
</source>
<target>
<context value="tgt_n"/>
<element value="div"/>
<transform value="copy"/>
<parameter>
<valueString
value="<div xmlns="http://www.w3.org/1999/xhtml"><h1>Generated text</h1></div>"/>
</parameter>
</target>
</rule>
</rule>
<rule>
<name value="createhardcodedprofile"/>
<source>
<context value="src"/>
</source>
<target>
<context value="tgt"/>
<element value="meta"/>
<variable value="tm"/>
<transform value="create"/>
<parameter>
<valueString value="Meta"/>
</parameter>
</target>
<rule>
<name value="setprofileinmeta"/>
<source>
<context value="src"/>
</source>
<target>
<context value="tm"/>
<element value="profile"/>
<transform value="copy"/>
<parameter>
<valueString
value="https://fhir.slade360.co.ke/fhir/StructureDefinition/sghi-organization"/>
</parameter>
</target>
</rule>
</rule>
</group>
<group>
<name value="SGHIContactPointMap"/>
<extends value="ContactPoint"/>
<input>
<name value="src"/>
<mode value="source"/>
</input>
<input>
<name value="tgt"/>
<mode value="target"/>
</input>
<rule>
<name value="system"/>
<source>
<context value="src"/>
<element value="system"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="system"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="value"/>
<source>
<context value="src"/>
<element value="value"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="value"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="use"/>
<source>
<context value="src"/>
<element value="use"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="use"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="rank"/>
<source>
<context value="src"/>
<element value="rank"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="rank"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
<rule>
<name value="period"/>
<source>
<context value="src"/>
<element value="period"/>
<variable value="vvv"/>
</source>
<target>
<context value="tgt"/>
<element value="period"/>
<variable value="vvv"/>
<transform value="create"/>
</target>
<dependent>
<name value="DefaultMappingGroupAnonymousAlias"/>
<parameter>
<valueId value="vvv"/>
</parameter>
<parameter>
<valueId value="vvv"/>
</parameter>
</dependent>
</rule>
</group>
</StructureMap>