Starter FHIR Implementation Guide
1.0.1 - draft International flag

Starter FHIR Implementation Guide, published by Jembi Health Systems. This guide is not an authorized publication; it is the continuous build for version 1.0.1 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/jembi/Starter-FHIR-IG/ and changes regularly. See the Directory of published versions

: Map CHT Patient to FHIR Patient - XML Representation

Draft as of 2024-11-08

Raw xml | Download


<StructureMap xmlns="http://hl7.org/fhir">
  <id value="CHTPatientToFHIRR4Patient"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap CHTPatientToFHIRR4Patient</b></p><a name="CHTPatientToFHIRR4Patient"> </a><a name="hcCHTPatientToFHIRR4Patient"> </a><a name="CHTPatientToFHIRR4Patient-en-US"> </a><pre class="fml">
<b>map</b><span style="color: navy"> &quot;</span>http://jembi.org/fhir/StructureMap/CHTPatientToFHIRR4Patient<span style="color: navy">&quot; = &quot;</span>CHTPatientToFHIRR4Patient<span style="color: navy">&quot;

</span><b>uses</b><span style="color: navy"> &quot;</span><a href="StructureDefinition-CHTPatientLogicalModel.html" title="CHT Patient Logical Model">http://jembi.org/fhir/StructureDefinition/CHTPatientLogicalModel</a><span style="color: navy">&quot; </span><b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> &quot;</span><a href="http://hl7.org/fhir/R4/patient.html" title="Patient">http://hl7.org/fhir/StructureDefinition/Patient</a><span style="color: navy">&quot; </span><b>as </b><b>target</b>

<b>group </b>CHTPatientToFHIRR4Patient<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>CHTPatientLogicalModel, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>Patient<span style="color: navy">)</span><span style="color: navy"> {
</span>  src._id<b> as </b><span style="color: maroon">srcID</span><span style="color: navy"><b> -&gt; </b></span>tgt.id = <span style="color: maroon">srcID</span> <i>&quot;SetPatientResourceId&quot;</i><span style="color: navy">;</span>
  src.name<b> as </b><span style="color: maroon">srcName</span><span style="color: navy"><b> -&gt; </b></span>tgt.name<b> as </b><span style="color: maroon">pName</span><b> then</b><span style="color: navy"> {
</span>    srcName<span style="color: navy"><b> -&gt; </b></span>pName.text = <span style="color: maroon">srcName</span> <i>&quot;SetPatientFullName&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span><span style="color: navy">;</span>
  src.phone<b> as </b><span style="color: maroon">srcPhoneNumber</span><span style="color: navy"><b> -&gt; </b></span>tgt.telecom<b> as </b><span style="color: maroon">pTelecom</span><b> then</b><span style="color: navy"> {
</span>    srcPhoneNumber<span style="color: navy"><b> -&gt; </b></span>pTelecom.system = <span style="color: blue">'phone'</span> <i>&quot;SetPatientTelecomCodeAsPhone&quot;</i><span style="color: navy">;</span>
    srcPhoneNumber<span style="color: navy"><b> -&gt; </b></span>pTelecom.value = <span style="color: maroon">srcPhoneNumber</span> <i>&quot;SetPatientTelecomValue&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span><span style="color: navy">;</span>
  src.date_of_birth<b> as </b><span style="color: maroon">dob</span><span style="color: navy"><b> -&gt; </b></span>tgt.birthDate = <span style="color: maroon">dob</span> <i>&quot;SetPatientBirthDate&quot;</i><span style="color: navy">;</span>
  src.sex<b> as </b><span style="color: maroon">sex</span><span style="color: navy"><b> -&gt; </b></span>tgt.gender = <span style="color: maroon">sex</span> <i>&quot;SetPatientGender&quot;</i><span style="color: navy">;</span>
  src.patient_id<b> as </b><span style="color: maroon">srcBusinessID</span><span style="color: navy"><b> -&gt; </b></span>tgt.identifier<b> as </b><span style="color: maroon">tgtBusinessID</span><b> then</b><span style="color: navy"> {
</span>    srcBusinessID<span style="color: navy"><b> -&gt; </b></span>tgtBusinessID.value = <span style="color: maroon">srcBusinessID</span> <i>&quot;SetBusinessIDValue&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;patientId&quot;</i><span style="color: navy">;</span>
  src.nationality<b> as </b><span style="color: maroon">nationality</span><span style="color: navy"><b> -&gt; </b></span>tgt.extension = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Extension'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">nationalityExt</span><b> then</b><span style="color: navy"> {
</span>    nationality<span style="color: navy"><b> -&gt; </b></span>nationalityExt.url = <span style="color: blue">'http://hl7.org/fhir/StructureDefinition/patient-nationality'</span> <i>&quot;SetNationalityUrl&quot;</i><span style="color: navy">;</span>
    nationality<span style="color: navy"><b> -&gt; </b></span>nationalityExt.extension = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Extension'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">countryCodeExtension</span><b> then</b><span style="color: navy"> {
</span>      nationality<span style="color: navy"><b> -&gt; </b></span>countryCodeExtension.url = <span style="color: blue">'code'</span> <i>&quot;SetCountryCodeUrl&quot;</i><span style="color: navy">;</span>
      nationality<span style="color: navy"><b> -&gt; </b></span>countryCodeExtension.value = <b>create</b><span style="color: navy">(</span><span style="color: blue">'CodeableConcept'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">countryCode</span><b> then</b><span style="color: navy"> {
</span>        nationality<span style="color: navy"><b> -&gt; </b></span>countryCode.coding = <b>create</b><span style="color: navy">(</span><span style="color: blue">'Coding'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">coding</span><b> then</b><span style="color: navy"> {
</span>          nationality<span style="color: navy"><b> -&gt; </b></span>coding.system = <span style="color: blue">'urn:iso:std:iso:3166'</span> <i>&quot;SetCountryCodeSystem&quot;</i><span style="color: navy">;</span>
          nationality<span style="color: navy"><b> -&gt; </b></span>coding.code = <span style="color: maroon">nationality</span> <i>&quot;SetCountryCodeCode&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;SetCountryCodeCoding&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;ProcessCountryCodeCodeableConcept&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;ProcessCountryCode&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span><span style="color: navy">;</span>
<span style="color: navy">}

</span></pre></div>
  </text>
  <url value="http://jembi.org/fhir/StructureMap/CHTPatientToFHIRR4Patient"/>
  <version value="1.0.1"/>
  <name value="CHTPatientToFHIRR4Patient"/>
  <status value="draft"/>
  <date value="2024-11-08T15:08:21+02:00"/>
  <publisher value="Jembi Health Systems"/>
  <contact>
    <name value="Jembi Health Systems"/>
    <telecom>
      <system value="url"/>
      <value value="https://www.jembi.org/"/>
    </telecom>
    <telecom>
      <system value="email"/>
      <value value="info@jembi.org"/>
    </telecom>
  </contact>
  <contact>
    <name value="Richard Langford"/>
    <telecom>
      <system value="email"/>
      <value value="richard.langford@jembi.org"/>
      <use value="work"/>
    </telecom>
  </contact>
  <jurisdiction>
    <coding>
      <system value="http://unstats.un.org/unsd/methods/m49/m49.htm"/>
      <code value="001"/>
      <display value="World"/>
    </coding>
  </jurisdiction>
  <structure>
    <url
         value="http://jembi.org/fhir/StructureDefinition/CHTPatientLogicalModel"/>
    <mode value="source"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/StructureDefinition/Patient"/>
    <mode value="target"/>
  </structure>
  <group>
    <name value="CHTPatientToFHIRR4Patient"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <type value="CHTPatientLogicalModel"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="Patient"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="SetPatientResourceId"/>
      <source>
        <context value="src"/>
        <element value="_id"/>
        <variable value="srcID"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="id"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="srcID"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="name"/>
      <source>
        <context value="src"/>
        <element value="name"/>
        <variable value="srcName"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="name"/>
        <variable value="pName"/>
      </target>
      <rule>
        <name value="SetPatientFullName"/>
        <source>
          <context value="srcName"/>
        </source>
        <target>
          <context value="pName"/>
          <contextType value="variable"/>
          <element value="text"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="srcName"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="phone"/>
      <source>
        <context value="src"/>
        <element value="phone"/>
        <variable value="srcPhoneNumber"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="telecom"/>
        <variable value="pTelecom"/>
      </target>
      <rule>
        <name value="SetPatientTelecomCodeAsPhone"/>
        <source>
          <context value="srcPhoneNumber"/>
        </source>
        <target>
          <context value="pTelecom"/>
          <contextType value="variable"/>
          <element value="system"/>
          <transform value="copy"/>
          <parameter>
            <valueString value="phone"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="SetPatientTelecomValue"/>
        <source>
          <context value="srcPhoneNumber"/>
        </source>
        <target>
          <context value="pTelecom"/>
          <contextType value="variable"/>
          <element value="value"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="srcPhoneNumber"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="SetPatientBirthDate"/>
      <source>
        <context value="src"/>
        <element value="date_of_birth"/>
        <variable value="dob"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="birthDate"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="dob"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="SetPatientGender"/>
      <source>
        <context value="src"/>
        <element value="sex"/>
        <variable value="sex"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="gender"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="sex"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="patientId"/>
      <source>
        <context value="src"/>
        <element value="patient_id"/>
        <variable value="srcBusinessID"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="identifier"/>
        <variable value="tgtBusinessID"/>
      </target>
      <rule>
        <name value="SetBusinessIDValue"/>
        <source>
          <context value="srcBusinessID"/>
        </source>
        <target>
          <context value="tgtBusinessID"/>
          <contextType value="variable"/>
          <element value="value"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="srcBusinessID"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="nationality"/>
      <source>
        <context value="src"/>
        <element value="nationality"/>
        <variable value="nationality"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="extension"/>
        <variable value="nationalityExt"/>
        <transform value="create"/>
        <parameter>
          <valueString value="Extension"/>
        </parameter>
      </target>
      <rule>
        <name value="SetNationalityUrl"/>
        <source>
          <context value="nationality"/>
        </source>
        <target>
          <context value="nationalityExt"/>
          <contextType value="variable"/>
          <element value="url"/>
          <transform value="copy"/>
          <parameter>
            <valueString
                         value="http://hl7.org/fhir/StructureDefinition/patient-nationality"/>
          </parameter>
        </target>
      </rule>
      <rule>
        <name value="ProcessCountryCode"/>
        <source>
          <context value="nationality"/>
        </source>
        <target>
          <context value="nationalityExt"/>
          <contextType value="variable"/>
          <element value="extension"/>
          <variable value="countryCodeExtension"/>
          <transform value="create"/>
          <parameter>
            <valueString value="Extension"/>
          </parameter>
        </target>
        <rule>
          <name value="SetCountryCodeUrl"/>
          <source>
            <context value="nationality"/>
          </source>
          <target>
            <context value="countryCodeExtension"/>
            <contextType value="variable"/>
            <element value="url"/>
            <transform value="copy"/>
            <parameter>
              <valueString value="code"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="ProcessCountryCodeCodeableConcept"/>
          <source>
            <context value="nationality"/>
          </source>
          <target>
            <context value="countryCodeExtension"/>
            <contextType value="variable"/>
            <element value="value"/>
            <variable value="countryCode"/>
            <transform value="create"/>
            <parameter>
              <valueString value="CodeableConcept"/>
            </parameter>
          </target>
          <rule>
            <name value="SetCountryCodeCoding"/>
            <source>
              <context value="nationality"/>
            </source>
            <target>
              <context value="countryCode"/>
              <contextType value="variable"/>
              <element value="coding"/>
              <variable value="coding"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Coding"/>
              </parameter>
            </target>
            <rule>
              <name value="SetCountryCodeSystem"/>
              <source>
                <context value="nationality"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="system"/>
                <transform value="copy"/>
                <parameter>
                  <valueString value="urn:iso:std:iso:3166"/>
                </parameter>
              </target>
            </rule>
            <rule>
              <name value="SetCountryCodeCode"/>
              <source>
                <context value="nationality"/>
              </source>
              <target>
                <context value="coding"/>
                <contextType value="variable"/>
                <element value="code"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="nationality"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
</StructureMap>