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 FHIR Patient to CHT Patient - XML Representation

Draft as of 2024-11-08

Raw xml | Download


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

</span><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>source</b>
<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>target</b>

<b>group </b>FHIRR4PatientToCHTPatient<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>Patient, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>CHTPatientLogicalModel<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><b> then</b><span style="color: navy"> {
</span>    srcName.text<b> as </b><span style="color: maroon">name</span><span style="color: navy"><b> -&gt; </b></span>tgt.name = <span style="color: maroon">name</span> <i>&quot;SetPatientFullName&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span><span style="color: navy">;</span>
  src.telecom<b> as </b><span style="color: maroon">srcPhone</span><b> then</b><span style="color: navy"> {
</span>    srcPhone.value<b> as </b><span style="color: maroon">phone</span><span style="color: navy"><b> -&gt; </b></span>tgt.phone = <span style="color: maroon">phone</span> <i>&quot;SetPatientTelecomValue&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span><span style="color: navy">;</span>
  src.birthDate<b> as </b><span style="color: maroon">dob</span><span style="color: navy"><b> -&gt; </b></span>tgt.date_of_birth = <span style="color: maroon">dob</span> <i>&quot;SetPatientBirthDate&quot;</i><span style="color: navy">;</span>
  src.gender<b> as </b><span style="color: maroon">gender</span><span style="color: navy"><b> -&gt; </b></span>tgt.sex = <span style="color: maroon">gender</span> <i>&quot;SetPatientGender&quot;</i><span style="color: navy">;</span>
  src.identifier<b> as </b><span style="color: maroon">srcBusinessID</span><b> then</b><span style="color: navy"> {
</span>    srcBusinessID.value<b> as </b><span style="color: maroon">businessID</span><span style="color: navy"><b> -&gt; </b></span>tgt.patient_id = <span style="color: maroon">businessID</span> <i>&quot;SetBusinessIDValue&quot;</i><span style="color: navy">;</span>
  <span style="color: navy">}</span><span style="color: navy">;</span>
  src.extension<b> as </b><span style="color: maroon">nationalityExt</span><b> where </b>(url = 'http://hl7.org/fhir/StructureDefinition/patient-nationality')<b> then</b><span style="color: navy"> {
</span>    nationalityExt.extension<b> as </b><span style="color: maroon">countryCodeExtension</span><b> where </b>(url = 'code')<b> then</b><span style="color: navy"> {
</span>      countryCodeExtension.value<span style="color: navy"> : </span>CodeableConcept<b> as </b><span style="color: maroon">codeableConcept</span><b> then</b><span style="color: navy"> {
</span>        codeableConcept.coding<b> as </b><span style="color: maroon">coding</span><b> then</b><span style="color: navy"> {
</span>          coding.code<b> as </b><span style="color: maroon">code</span><span style="color: navy"><b> -&gt; </b></span>tgt.nationality = <span style="color: maroon">code</span> <i>&quot;SetCountryCode&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span><span style="color: navy">;</span>
      <span style="color: navy">}</span><span style="color: navy">;</span>
    <span style="color: navy">}</span><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/FHIRR4PatientToCHTPatient"/>
  <version value="1.0.1"/>
  <name value="FHIRR4PatientToCHTPatient"/>
  <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://hl7.org/fhir/StructureDefinition/Patient"/>
    <mode value="source"/>
  </structure>
  <structure>
    <url
         value="http://jembi.org/fhir/StructureDefinition/CHTPatientLogicalModel"/>
    <mode value="target"/>
  </structure>
  <group>
    <name value="FHIRR4PatientToCHTPatient"/>
    <typeMode value="none"/>
    <input>
      <name value="src"/>
      <type value="Patient"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="CHTPatientLogicalModel"/>
      <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>
      <rule>
        <name value="SetPatientFullName"/>
        <source>
          <context value="srcName"/>
          <element value="text"/>
          <variable value="name"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="name"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="name"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="telecom"/>
      <source>
        <context value="src"/>
        <element value="telecom"/>
        <variable value="srcPhone"/>
      </source>
      <rule>
        <name value="SetPatientTelecomValue"/>
        <source>
          <context value="srcPhone"/>
          <element value="value"/>
          <variable value="phone"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="phone"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="phone"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="SetPatientBirthDate"/>
      <source>
        <context value="src"/>
        <element value="birthDate"/>
        <variable value="dob"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="date_of_birth"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="dob"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="SetPatientGender"/>
      <source>
        <context value="src"/>
        <element value="gender"/>
        <variable value="gender"/>
      </source>
      <target>
        <context value="tgt"/>
        <contextType value="variable"/>
        <element value="sex"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="gender"/>
        </parameter>
      </target>
    </rule>
    <rule>
      <name value="identifier"/>
      <source>
        <context value="src"/>
        <element value="identifier"/>
        <variable value="srcBusinessID"/>
      </source>
      <rule>
        <name value="SetBusinessIDValue"/>
        <source>
          <context value="srcBusinessID"/>
          <element value="value"/>
          <variable value="businessID"/>
        </source>
        <target>
          <context value="tgt"/>
          <contextType value="variable"/>
          <element value="patient_id"/>
          <transform value="copy"/>
          <parameter>
            <valueId value="businessID"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="extension"/>
      <source>
        <context value="src"/>
        <element value="extension"/>
        <variable value="nationalityExt"/>
        <condition
                   value="(url = 'http://hl7.org/fhir/StructureDefinition/patient-nationality')"/>
      </source>
      <rule>
        <name value="extension"/>
        <source>
          <context value="nationalityExt"/>
          <element value="extension"/>
          <variable value="countryCodeExtension"/>
          <condition value="(url = 'code')"/>
        </source>
        <rule>
          <name value="valueCodeableConcept"/>
          <source>
            <context value="countryCodeExtension"/>
            <type value="CodeableConcept"/>
            <element value="value"/>
            <variable value="codeableConcept"/>
          </source>
          <rule>
            <name value="coding"/>
            <source>
              <context value="codeableConcept"/>
              <element value="coding"/>
              <variable value="coding"/>
            </source>
            <rule>
              <name value="SetCountryCode"/>
              <source>
                <context value="coding"/>
                <element value="code"/>
                <variable value="code"/>
              </source>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="nationality"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="code"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
      </rule>
    </rule>
  </group>
</StructureMap>