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 simple Observation laboratory resources to Measurement OMOP Domain - XML Representation

Draft as of 2025-10-23

Raw xml | Download

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

    </span><span style="color: navy">// </span><span style="color: green">Mapping simple Observation laboratory resources to Measurement OMOP Domain</span>

    <b>uses</b><span style="color: navy"> &quot;</span><a href="http://hl7.org/fhir/R4/observation.html" title="Observation">http://hl7.org/fhir/StructureDefinition/Observation</a><span style="color: navy">&quot; </span><b>alias </b>LabObs <b>as </b><b>source</b>
    <b>uses</b><span style="color: navy"> &quot;</span><a href="StructureDefinition-OMOPMeasurement.html" title="Measurement OMOP Table">https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/OMOPMeasurement</a><span style="color: navy">&quot; </span><b>alias </b>MeasurementTable <b>as </b><b>target</b>

    <b>group </b>SimpleObservation<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>LabObs, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>MeasurementTable<span style="color: navy">)</span><span style="color: navy"> {
    </span>  src.subject<b> as </b><span style="color: maroon">srcSubject</span><span style="color: navy"><b> -&gt; </b></span>tgt.person_id = <span style="color: maroon">srcSubject</span> <i>&quot;setSubject&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">reference impropre dans le monde OMOP mais permet d'illustrer l'information qui doit être utilisée pour retrouver la bonne OMOPPerson</span>
      src.code<b> as </b><span style="color: maroon">srcCode</span><span style="color: navy"><b> -&gt; </b></span>tgt.measurement_concept_id = <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">tgtReference</span><b> then</b><span style="color: navy"> {
    </span>    srcCode.coding<b> as </b><span style="color: maroon">srcCoding</span><span style="color: navy"><b> -&gt; </b></span> <b>translate</b><span style="color: navy">(</span><span style="color: maroon">srcCoding</span><span style="color: navy">, </span><span style="color: blue">'https://interop.aphp.fr/ig/fhir/dm/ConceptMap/LabAnalyses'</span><span style="color: navy">, </span><span style="color: blue">'code'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">measurementCode</span><span style="color: navy">, </span> tgtReference.reference = <b>append</b><span style="color: navy">(</span><span style="color: blue">'Concept/'</span><span style="color: navy">, </span><span style="color: maroon">measurementCode</span><span style="color: navy">)</span> <i>&quot;setMeasurementConcept&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;createMeasurementConcept&quot;</i><span style="color: navy">;</span>
      src.effective<span style="color: navy"> : </span>dateTime<b> as </b><span style="color: maroon">srcDateTime</span><b> then</b><span style="color: navy"> {
    </span>    srcDateTime<span style="color: navy"><b> -&gt; </b></span>tgt.measurement_datetime = <span style="color: maroon">srcDateTime</span> <i>&quot;setDateTime&quot;</i><span style="color: navy">;</span>
        srcDateTime<span style="color: navy"><b> -&gt; </b></span>tgt.measurement_date = <span style="color: navy">(</span>%srcDateTime.toString().substring(0, 10)<span style="color: navy">)</span> <i>&quot;setDateNotTime&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;SetDate&quot;</i><span style="color: navy">;</span>
      src.value<span style="color: navy"> : </span>Quantity<b> as </b><span style="color: maroon">srcValueQuantity</span><b> then</b><span style="color: navy"> {
    </span>    srcValueQuantity.value<b> as </b><span style="color: maroon">srcResultValue</span><span style="color: navy"><b> -&gt; </b></span>tgt.value_as_number = <span style="color: maroon">srcResultValue</span> <i>&quot;setResultValue&quot;</i><span style="color: navy">;</span>
        srcValueQuantity<span style="color: navy"><b> -&gt; </b></span>tgt.operator_concept_id = <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">tgtReference</span><b> then</b><span style="color: navy"> {
    </span>      srcValueQuantity.comparator<b> as </b><span style="color: maroon">srcValueComparator</span><span style="color: navy"><b> -&gt; </b></span> <b>translate</b><span style="color: navy">(</span><span style="color: maroon">srcValueComparator</span><span style="color: navy">, </span><span style="color: blue">'https://interop.aphp.fr/ig/fhir/dm/ConceptMap/LabComparator'</span><span style="color: navy">, </span><span style="color: blue">'code'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">comparatorCode</span><span style="color: navy">, </span> tgtReference.reference = <b>append</b><span style="color: navy">(</span><span style="color: blue">'Concept/'</span><span style="color: navy">, </span><span style="color: maroon">comparatorCode</span><span style="color: navy">)</span> <i>&quot;setComparatorConcept&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;createComparatorConcept&quot;</i><span style="color: navy">;</span>
        srcValueQuantity<span style="color: navy"><b> -&gt; </b></span>tgt.unit_concept_id = <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">tgtReference</span><b> then</b><span style="color: navy"> {
    </span>      srcValueQuantity.code<b> as </b><span style="color: maroon">srcValueCode</span><span style="color: navy"><b> -&gt; </b></span> <b>translate</b><span style="color: navy">(</span><span style="color: maroon">srcValueCode</span><span style="color: navy">, </span><span style="color: blue">'https://interop.aphp.fr/ig/fhir/dm/ConceptMap/LabUnit'</span><span style="color: navy">, </span><span style="color: blue">'code'</span><span style="color: navy">)</span><b> as </b><span style="color: maroon">unitCode</span><span style="color: navy">, </span> tgtReference.reference = <b>append</b><span style="color: navy">(</span><span style="color: blue">'Concept/'</span><span style="color: navy">, </span><span style="color: maroon">unitCode</span><span style="color: navy">)</span> <i>&quot;createUnitConcept&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;setUnitConcept&quot;</i><span style="color: navy">;</span>
        srcValueQuantity.code<b> as </b><span style="color: maroon">srcValueCode</span><span style="color: navy"><b> -&gt; </b></span>tgt.unit_source_value = <span style="color: maroon">srcValueCode</span> <i>&quot;setUnitSourceValue&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;SetValue&quot;</i><span style="color: navy">;</span>
      src.referenceRange<b> as </b><span style="color: maroon">srcRange</span><b> then</b><span style="color: navy"> {
    </span>    srcRange.low<b> as </b><span style="color: maroon">srcRangeLow</span><b> then</b><span style="color: navy"> {
    </span>      srcRangeLow.value<b> as </b><span style="color: maroon">srcRangeLowValue</span><span style="color: navy"><b> -&gt; </b></span>tgt.range_low = <span style="color: maroon">srcRangeLowValue</span> <i>&quot;setRangeLow1&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;setRangeLow0&quot;</i><span style="color: navy">;</span>
        srcRange.high<b> as </b><span style="color: maroon">srcRangeHigh</span><b> then</b><span style="color: navy"> {
    </span>      srcRangeHigh.value<b> as </b><span style="color: maroon">srcRangeHighValue</span><span style="color: navy"><b> -&gt; </b></span>tgt.range_high = <span style="color: maroon">srcRangeHighValue</span> <i>&quot;setRangeHigh1&quot;</i><span style="color: navy">;</span>
        <span style="color: navy">}</span> <i>&quot;setRangeHigh0&quot;</i><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;setRange&quot;</i><span style="color: navy">;</span>
      src.performer<b> as </b><span style="color: maroon">srcPerformer</span><span style="color: navy"><b> -&gt; </b></span>tgt.provider_id = <span style="color: maroon">srcPerformer</span> <i>&quot;setPerformer&quot;</i><span style="color: navy">;</span> <span style="color: navy">// </span><span style="color: green">reference impropre dans le monde OMOP mais permet d'illustrer l'information qui doit être utilisée pour retrouver le bon OMOPProvider</span>
    <span style="color: navy">}

    </span></pre></div>
      </text>
      <url
           value="https://interop.aphp.fr/ig/fhir/dm/StructureMap/CoreSimpleObservation2OMOPMeasurement"/>
      <version value="0.1.0"/>
      <name value="CoreSimpleObservation2OMOPMeasurement"/>
      <title
             value="Mapping simple Observation laboratory resources to Measurement 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 simple Observation laboratory resources to Measurement 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/Observation"/>
        <mode value="source"/>
        <alias value="LabObs"/>
      </structure>
      <structure>
        <url
             value="https://interop.aphp.fr/ig/fhir/dm/StructureDefinition/OMOPMeasurement"/>
        <mode value="target"/>
        <alias value="MeasurementTable"/>
      </structure>
      <group>
        <name value="SimpleObservation"/>
        <typeMode value="none"/>
        <input>
          <name value="src"/>
          <type value="LabObs"/>
          <mode value="source"/>
        </input>
        <input>
          <name value="tgt"/>
          <type value="MeasurementTable"/>
          <mode value="target"/>
        </input>
        <rule>
          <name value="setSubject"/>
          <source>
            <context value="src"/>
            <element value="subject"/>
            <variable value="srcSubject"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="person_id"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="srcSubject"/>
            </parameter>
          </target>
          <documentation
                         value="reference impropre dans le monde OMOP mais permet d'illustrer l'information qui doit être utilisée pour retrouver la bonne OMOPPerson"/>
        </rule>
        <rule>
          <name value="createMeasurementConcept"/>
          <source>
            <context value="src"/>
            <element value="code"/>
            <variable value="srcCode"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="measurement_concept_id"/>
            <variable value="tgtReference"/>
            <transform value="create"/>
            <parameter>
              <valueString value="Reference"/>
            </parameter>
          </target>
          <rule>
            <name value="setMeasurementConcept"/>
            <source>
              <context value="srcCode"/>
              <element value="coding"/>
              <variable value="srcCoding"/>
            </source>
            <target>
              <contextType value="variable"/>
              <variable value="measurementCode"/>
              <transform value="translate"/>
              <parameter>
                <valueId value="srcCoding"/>
              </parameter>
              <parameter>
                <valueString
                             value="https://interop.aphp.fr/ig/fhir/dm/ConceptMap/LabAnalyses"/>
              </parameter>
              <parameter>
                <valueString value="code"/>
              </parameter>
            </target>
            <target>
              <context value="tgtReference"/>
              <contextType value="variable"/>
              <element value="reference"/>
              <transform value="append"/>
              <parameter>
                <valueString value="Concept/"/>
              </parameter>
              <parameter>
                <valueId value="measurementCode"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="SetDate"/>
          <source>
            <context value="src"/>
            <type value="dateTime"/>
            <element value="effective"/>
            <variable value="srcDateTime"/>
          </source>
          <rule>
            <name value="setDateTime"/>
            <source>
              <context value="srcDateTime"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="measurement_datetime"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="srcDateTime"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="setDateNotTime"/>
            <source>
              <context value="srcDateTime"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="measurement_date"/>
              <transform value="evaluate"/>
              <parameter>
                <valueString value="%srcDateTime.toString().substring(0, 10)"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="SetValue"/>
          <source>
            <context value="src"/>
            <type value="Quantity"/>
            <element value="value"/>
            <variable value="srcValueQuantity"/>
          </source>
          <rule>
            <name value="setResultValue"/>
            <source>
              <context value="srcValueQuantity"/>
              <element value="value"/>
              <variable value="srcResultValue"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="value_as_number"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="srcResultValue"/>
              </parameter>
            </target>
          </rule>
          <rule>
            <name value="createComparatorConcept"/>
            <source>
              <context value="srcValueQuantity"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="operator_concept_id"/>
              <variable value="tgtReference"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Reference"/>
              </parameter>
            </target>
            <rule>
              <name value="setComparatorConcept"/>
              <source>
                <context value="srcValueQuantity"/>
                <element value="comparator"/>
                <variable value="srcValueComparator"/>
              </source>
              <target>
                <contextType value="variable"/>
                <variable value="comparatorCode"/>
                <transform value="translate"/>
                <parameter>
                  <valueId value="srcValueComparator"/>
                </parameter>
                <parameter>
                  <valueString
                               value="https://interop.aphp.fr/ig/fhir/dm/ConceptMap/LabComparator"/>
                </parameter>
                <parameter>
                  <valueString value="code"/>
                </parameter>
              </target>
              <target>
                <context value="tgtReference"/>
                <contextType value="variable"/>
                <element value="reference"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="Concept/"/>
                </parameter>
                <parameter>
                  <valueId value="comparatorCode"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="setUnitConcept"/>
            <source>
              <context value="srcValueQuantity"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="unit_concept_id"/>
              <variable value="tgtReference"/>
              <transform value="create"/>
              <parameter>
                <valueString value="Reference"/>
              </parameter>
            </target>
            <rule>
              <name value="createUnitConcept"/>
              <source>
                <context value="srcValueQuantity"/>
                <element value="code"/>
                <variable value="srcValueCode"/>
              </source>
              <target>
                <contextType value="variable"/>
                <variable value="unitCode"/>
                <transform value="translate"/>
                <parameter>
                  <valueId value="srcValueCode"/>
                </parameter>
                <parameter>
                  <valueString
                               value="https://interop.aphp.fr/ig/fhir/dm/ConceptMap/LabUnit"/>
                </parameter>
                <parameter>
                  <valueString value="code"/>
                </parameter>
              </target>
              <target>
                <context value="tgtReference"/>
                <contextType value="variable"/>
                <element value="reference"/>
                <transform value="append"/>
                <parameter>
                  <valueString value="Concept/"/>
                </parameter>
                <parameter>
                  <valueId value="unitCode"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="setUnitSourceValue"/>
            <source>
              <context value="srcValueQuantity"/>
              <element value="code"/>
              <variable value="srcValueCode"/>
            </source>
            <target>
              <context value="tgt"/>
              <contextType value="variable"/>
              <element value="unit_source_value"/>
              <transform value="copy"/>
              <parameter>
                <valueId value="srcValueCode"/>
              </parameter>
            </target>
          </rule>
        </rule>
        <rule>
          <name value="setRange"/>
          <source>
            <context value="src"/>
            <element value="referenceRange"/>
            <variable value="srcRange"/>
          </source>
          <rule>
            <name value="setRangeLow0"/>
            <source>
              <context value="srcRange"/>
              <element value="low"/>
              <variable value="srcRangeLow"/>
            </source>
            <rule>
              <name value="setRangeLow1"/>
              <source>
                <context value="srcRangeLow"/>
                <element value="value"/>
                <variable value="srcRangeLowValue"/>
              </source>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="range_low"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="srcRangeLowValue"/>
                </parameter>
              </target>
            </rule>
          </rule>
          <rule>
            <name value="setRangeHigh0"/>
            <source>
              <context value="srcRange"/>
              <element value="high"/>
              <variable value="srcRangeHigh"/>
            </source>
            <rule>
              <name value="setRangeHigh1"/>
              <source>
                <context value="srcRangeHigh"/>
                <element value="value"/>
                <variable value="srcRangeHighValue"/>
              </source>
              <target>
                <context value="tgt"/>
                <contextType value="variable"/>
                <element value="range_high"/>
                <transform value="copy"/>
                <parameter>
                  <valueId value="srcRangeHighValue"/>
                </parameter>
              </target>
            </rule>
          </rule>
        </rule>
        <rule>
          <name value="setPerformer"/>
          <source>
            <context value="src"/>
            <element value="performer"/>
            <variable value="srcPerformer"/>
          </source>
          <target>
            <context value="tgt"/>
            <contextType value="variable"/>
            <element value="provider_id"/>
            <transform value="copy"/>
            <parameter>
              <valueId value="srcPerformer"/>
            </parameter>
          </target>
          <documentation
                         value="reference impropre dans le monde OMOP mais permet d'illustrer l'information qui doit être utilisée pour retrouver le bon OMOPProvider"/>
        </rule>
      </group>
    </StructureMap>