Data Management with FHIR
0.1.0 - ci-build

Data Management with FHIR - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

## : Mapping Patient resource to Location OMOP Domain - XML Representation

Draft as of 2025-10-23

Raw xml | Download

    <StructureMap xmlns="http://hl7.org/fhir">
      <id value="CoreFHIR2OMOPLocation"/>
      <text>
        <status value="generated"/>
        <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Narratif généré : StructureMap CoreFHIR2OMOPLocation</b></p><a name="CoreFHIR2OMOPLocation"> </a><a name="hcCoreFHIR2OMOPLocation"> </a><pre class="fml">
    <b>map</b><span style="color: navy"> &quot;</span>https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreFHIR2OMOPLocation<span style="color: navy">&quot; = &quot;</span>CoreFHIR2OMOPLocation<span style="color: navy">&quot;

    </span><span style="color: navy">// </span><span style="color: green">Mapping Patient resource to Location OMOP Domain</span>

    <b>uses</b><span style="color: navy"> &quot;</span><a href="http://hl7.org/fhir/R4/datatypes.html#Address" title="Address">http://hl7.org/fhir/StructureDefinition/Address</a><span style="color: navy">&quot; </span><b>alias </b>Address <b>as </b><b>source</b>
    <b>uses</b><span style="color: navy"> &quot;</span><a href="StructureDefinition-OMOPLocation.html" title="Location OMOP Table">https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/OMOPLocation</a><span style="color: navy">&quot; </span><b>alias </b>LocationTable <b>as </b><b>target</b>

    <b>group </b>Location<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>Address, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>LocationTable<span style="color: navy">)</span><span style="color: navy"> {
    </span>  src.line first<b> as </b><span style="color: maroon">srcLine1</span><span style="color: navy"><b> -&gt; </b></span>tgt.address_1 = <span style="color: maroon">srcLine1</span> <i>&quot;setLineOne&quot;</i><span style="color: navy">;</span>
      src.line not_first<b> as </b><span style="color: maroon">srcLine2</span><span style="color: navy"><b> -&gt; </b></span>tgt.address_2 = <span style="color: maroon">srcLine2</span> <i>&quot;setLineTwo&quot;</i><span style="color: navy">;</span>
      src.city<b> as </b><span style="color: maroon">srcCity</span><span style="color: navy"><b> -&gt; </b></span>tgt.city = <span style="color: maroon">srcCity</span> <i>&quot;setCity&quot;</i><span style="color: navy">;</span>
      src.postalCode<b> as </b><span style="color: maroon">srcZip</span><span style="color: navy"><b> -&gt; </b></span>tgt.zip = <span style="color: maroon">srcZip</span> <i>&quot;setZip&quot;</i><span style="color: navy">;</span>
      src.country<b> as </b><span style="color: maroon">srcCountry</span><span style="color: navy"><b> -&gt; </b></span>tgt.country_source_value = <span style="color: maroon">srcCountry</span> <i>&quot;setCountry&quot;</i><span style="color: navy">;</span>
      src.text<b> as </b><span style="color: maroon">srcText</span><span style="color: navy"><b> -&gt; </b></span>tgt.location_source_value = <b>truncate</b><span style="color: navy">(</span><span style="color: maroon">srcText</span><span style="color: navy">, </span><span style="color: blue">50</span><span style="color: navy">)</span> <i>&quot;setVerbatim&quot;</i><span style="color: navy">;</span>
      src.extension<b> as </b><span style="color: maroon">geolocation</span><b> where </b>(url = 'http://hl7.org/fhir/StructureDefinition/geolocation')<b> then</b><span style="color: navy"> {
    </span>    geolocation.extension<b> as </b><span style="color: maroon">latitude</span><b> where </b>(url = 'latitude')<span style="color: navy"><b> -&gt; </b></span>tgt.latitude = <span style="color: navy">(</span>%latitude.value<span style="color: navy">)</span> <i>&quot;setLatitude&quot;</i><span style="color: navy">;</span>
        geolocation.extension<b> as </b><span style="color: maroon">longitude</span><b> where </b>(url = 'longitude')<span style="color: navy"><b> -&gt; </b></span>tgt.longitude = <span style="color: navy">(</span>%longitude.value<span style="color: navy">)</span> <i>&quot;setLongitude&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;setGeolocation&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}

    </span></pre></div>
      </text>
      <url
           value="https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreFHIR2OMOPLocation"/>
      <version value="0.1.0"/>
      <name value="CoreFHIR2OMOPLocation"/>
      <title value="Mapping Patient resource to Location OMOP Domain"/>
      <status value="draft"/>
      <date value="2025-10-23T20:49:03+00:00"/>
      <publisher value="AP-HP"/>
      <contact>
        <name value="AP-HP"/>
        <telecom>
          <system value="url"/>
          <value value="https://aphp.fr"/>
        </telecom>
      </contact>
      <description value="Mapping Patient resource to Location OMOP Domain"/>
      <jurisdiction>
        <coding>
          <system value="urn:iso:std:iso:3166"/>
          <code value="FR"/>
          <display value="France"/>
        </coding>
      </jurisdiction>
      <structure>
        <url value="http://hl7.org/fhir/StructureDefinition/Address"/>
        <mode value="source"/>
        <alias value="Address"/>
      </structure>
      <structure>
        <url
             value="https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/OMOPLocation"/>
        <mode value="target"/>
        <alias value="LocationTable"/>
      </structure>
      <group>
        <name value="Location"/>
        <typeMode value="none"/>
        <input>
          <name value="src"/>
          <type value="Address"/>
          <mode value="source"/>
        </input>
        <input>
          <name value="tgt"/>
          <type value="LocationTable"/>
          <mode value="target"/>
        </input>
        <rule>
          <name value="setLineOne"/>
          <source>
            <context value="src"/>
            <element value="line"/>
            <listMode value="first"/>
            <variable value="srcLine1"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="address_1"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="srcLine1"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="setLineTwo"/>
          <source>
            <context value="src"/>
            <element value="line"/>
            <listMode value="not_first"/>
            <variable value="srcLine2"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="address_2"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="srcLine2"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="setCity"/>
          <source>
            <context value="src"/>
            <element value="city"/>
            <variable value="srcCity"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="city"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="srcCity"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="setZip"/>
          <source>
            <context value="src"/>
            <element value="postalCode"/>
            <variable value="srcZip"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="zip"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="srcZip"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="setCountry"/>
          <source>
            <context value="src"/>
            <element value="country"/>
            <variable value="srcCountry"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="country_source_value"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="srcCountry"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="setVerbatim"/>
          <source>
            <context value="src"/>
            <element value="text"/>
            <variable value="srcText"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="location_source_value"/>
            <transform value="truncate"/>
            <parameter>
              <valueId value="srcText"/>
            </parameter>
            <parameter>
              <valueInteger value="50"/>
            </parameter>
          </target>
        </rule>
        <rule>
          <name value="setGeolocation"/>
          <source>
            <context value="src"/>
            <element value="extension"/>
            <variable value="geolocation"/>
            <condition
                       value="(url = 'http://hl7.org/fhir/StructureDefinition/geolocation')"/>
          </source>
          <rule>
            <name value="setLatitude"/>
            <source>
              <context value="geolocation"/>
              <element value="extension"/>
              <variable value="latitude"/>
              <condition value="(url = 'latitude')"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="latitude"/>
              <transform value="evaluate"/>
              <parameter>
                <valueString value="%latitude.value"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="setLongitude"/>
            <source>
              <context value="geolocation"/>
              <element value="extension"/>
              <variable value="longitude"/>
              <condition value="(url = 'longitude')"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="longitude"/>
              <transform value="evaluate"/>
              <parameter>
                <valueString value="%longitude.value"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </group>
    </StructureMap>