FHIR to OMOP FHIR IG
2.0.0-ballot - STU 1 Ballot International flag

FHIR to OMOP FHIR IG, published by HL7 International / Biomedical Research and Regulation. This guide is not an authorized publication; it is the continuous build for version 2.0.0-ballot built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/fhir-omop-ig/ and changes regularly. See the Directory of published versions

: Mapping an International Patient Summary resource to OMOP domains collected in a RecordSet resource

Page standards status: Trial-use Maturity Level: 2

Raw xml | Download


<StructureMap xmlns="http://hl7.org/fhir">
  <id value="RecordSetMap"/>
  <language value="en"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureMap RecordSetMap</b></p><a name="RecordSetMap"> </a><a name="hcRecordSetMap"> </a><pre class="fml">
<span style="color: #cc00cc">/// <b>url</b> = </span><span style="color: blue">'http://hl7.org/fhir/uv/omop/StructureMap/RecordSetMap'</span>
<span style="color: #cc00cc">/// <b>name</b> = </span><span style="color: blue">'RecordSetMap'</span>
<span style="color: #cc00cc">/// <b>title</b> = </span><span style="color: blue">'Mapping an International Patient Summary resource to OMOP domains collected in a RecordSet resource'</span>
<span style="color: #cc00cc">/// <b>status</b> = </span><span style="color: blue">'active'</span>
<span style="color: #cc00cc">/// <b>description</b> = </span><span style="color: blue">'This mapping maps a FHIR International Patient Summary Bundle to a set of OMOP Patient records collected in a RecordSet resource.'</span>

<b>uses</b><span style="color: navy"> &quot;</span><a href="http://hl7.org/fhir/R5/bundle.html" title="Bundle">http://hl7.org/fhir/StructureDefinition/Bundle</a><span style="color: navy">&quot; </span><b>alias </b>Bundle <b>as </b><b>source</b>
<b>uses</b><span style="color: navy"> &quot;</span><a href="StructureDefinition-RecordSet.html" title="Patient Record Setting">http://hl7.org/fhir/uv/omop/StructureDefinition/RecordSet</a><span style="color: navy">&quot; </span><b>alias </b>RecordSetTable <b>as </b><b>target</b>

<b>imports</b><span style="color: navy"> &quot;</span><a href="StructureMap-AllergyMap.html" title="Mapping Allergy resource to Observation OMOP Domain">http://hl7.org/fhir/uv/omop/StructureMap/AllergyMap</a><span style="color: navy">&quot;
</span><b>imports</b><span style="color: navy"> &quot;</span><a href="StructureMap-BloodPressureVitalSignsMap.html" title="Mapping Blood Pressure Vital Signs resource to Measurement OMOP Domain">http://hl7.org/fhir/uv/omop/StructureMap/BloodPressureVitalSignsMap</a><span style="color: navy">&quot;
</span><b>imports</b><span style="color: navy"> &quot;</span><a href="StructureMap-ConditionMap.html" title="Mapping Condition resource to Condition Occurrence OMOP Domain">http://hl7.org/fhir/uv/omop/StructureMap/ConditionMap</a><span style="color: navy">&quot;
</span><b>imports</b><span style="color: navy"> &quot;</span><a href="StructureMap-EncounterVisitMap.html" title="Mapping Encounter resource to VisitOccurrence OMOP Domain">http://hl7.org/fhir/uv/omop/StructureMap/EncounterVisitMap</a><span style="color: navy">&quot;
</span><b>imports</b><span style="color: navy"> &quot;</span><a href="StructureMap-ImmunizationMap.html" title="Mapping Immunization resource to Drug Exposure OMOP Domain">http://hl7.org/fhir/uv/omop/StructureMap/ImmunizationMap</a><span style="color: navy">&quot;
</span><b>imports</b><span style="color: navy"> &quot;</span><a href="StructureMap-MeasurementMap.html" title="Mapping Observation resource to Measurement  OMOP Domain">http://hl7.org/fhir/uv/omop/StructureMap/MeasurementMap</a><span style="color: navy">&quot;
</span><b>imports</b><span style="color: navy"> &quot;</span><a href="StructureMap-PersonMap.html" title="Mapping Patient resource to Person OMOP Domain">http://hl7.org/fhir/uv/omop/StructureMap/PersonMap</a><span style="color: navy">&quot;
</span><b>imports</b><span style="color: navy"> &quot;</span><a href="StructureMap-ProcedureMap.html" title="Mapping Procedure resource to Procedure Occurrence OMOP Domain">http://hl7.org/fhir/uv/omop/StructureMap/ProcedureMap</a><span style="color: navy">&quot;
</span><b>imports</b><span style="color: navy"> &quot;</span><a href="StructureMap-SimpleVitalSignsMap.html" title="Mapping Vital Ssigns resource to Measurement OMOP Domain">http://hl7.org/fhir/uv/omop/StructureMap/SimpleVitalSignsMap</a><span style="color: navy">&quot;
</span>
<b>group </b>RecordSet<span style="color: navy">(</span><b>source</b> <span style="color: maroon">src</span><span style="color: navy"> : </span>Bundle, <b>target</b> <span style="color: maroon">tgt</span><span style="color: navy"> : </span>RecordSetTable<span style="color: navy">)</span><span style="color: navy"> {
</span>  src.id<b> as </b><span style="color: maroon">s</span><span style="color: navy"><b> -&gt; </b></span>tgt<b> then</b><span style="color: navy"> {
</span>    s.id<b> as </b><span style="color: maroon">id</span><span style="color: navy"><b> -&gt; </b></span>tgt.record_id = <span style="color: navy">(</span>%id.substring(%id.indexOf('/') + 1)<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: green">Map bundle timestamp</span>
  src.timestamp<b> as </b><span style="color: maroon">ts</span><span style="color: navy"><b> -&gt; </b></span>tgt.record_set_timestamp = <span style="color: maroon">ts</span><span style="color: navy">;</span>
  <span style="color: navy">// </span><span style="color: green">Map bundle entries</span>
  src.entry<b> as </b><span style="color: maroon">entry</span><span style="color: navy"><b> -&gt; </b></span>tgt<b> then</b><span style="color: navy"> {
</span>    entry.resource<span style="color: navy"> : </span>AllergyIntolerance<b> as </b><span style="color: maroon">a</span><span style="color: navy"><b> -&gt; </b></span>tgt<b> then</b><span style="color: navy"> {
</span>      a<span style="color: navy"><b> -&gt; </b></span>tgt.allergy<b> as </b><span style="color: maroon">allergy</span><b> then </b>Allergy<span style="color: navy">(</span><span style="color: maroon">a</span><span style="color: navy">, </span><span style="color: maroon">allergy</span><span style="color: navy">)</span> <i>&quot;allergyEntry&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;allergyIntoleranceEntry&quot;</i><span style="color: navy">;</span>
    entry.resource<span style="color: navy"> : </span>Condition<b> as </b><span style="color: maroon">condition</span><span style="color: navy"><b> -&gt; </b></span>tgt<b> then</b><span style="color: navy"> {
</span>      condition<span style="color: navy"><b> -&gt; </b></span>tgt.condition<b> as </b><span style="color: maroon">conditionOccurrence</span><b> then </b>ConditionOccurrence<span style="color: navy">(</span><span style="color: maroon">condition</span><span style="color: navy">, </span><span style="color: maroon">conditionOccurrence</span><span style="color: navy">)</span> <i>&quot;conditionEntry&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;conditionOccurenceEntry&quot;</i><span style="color: navy">;</span>
    entry.resource<span style="color: navy"> : </span>Encounter<b> as </b><span style="color: maroon">encounter</span><span style="color: navy"><b> -&gt; </b></span>tgt<b> then</b><span style="color: navy"> {
</span>      encounter<span style="color: navy"><b> -&gt; </b></span>tgt.visitOccurrence<b> as </b><span style="color: maroon">visitOccurrence</span><b> then </b>VisitOccurrence<span style="color: navy">(</span><span style="color: maroon">encounter</span><span style="color: navy">, </span><span style="color: maroon">visitOccurrence</span><span style="color: navy">)</span> <i>&quot;encounterEntry&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;conditionOccurenceEntry&quot;</i><span style="color: navy">;</span>
    entry.resource<span style="color: navy"> : </span>Observation<b> as </b><span style="color: maroon">observation</span><span style="color: navy"><b> -&gt; </b></span>tgt<b> then</b><span style="color: navy"> {
</span>      observation<span style="color: navy"><b> -&gt; </b></span>tgt.measurement<b> as </b><span style="color: maroon">measurement</span><b> then </b>Measures<span style="color: navy">(</span><span style="color: maroon">observation</span><span style="color: navy">, </span><span style="color: maroon">measurement</span><span style="color: navy">)</span> <i>&quot;measurementEntry&quot;</i><span style="color: navy">;</span>
      observation<span style="color: navy"><b> -&gt; </b></span>tgt<b> as </b><span style="color: maroon">recordSet</span><b> then </b>BloodPressure<span style="color: navy">(</span><span style="color: maroon">observation</span><span style="color: navy">, </span><span style="color: maroon">recordSet</span><span style="color: navy">)</span> <i>&quot;bloodPressureEntry&quot;</i><span style="color: navy">;</span>
      observation<span style="color: navy"><b> -&gt; </b></span>tgt.measurement<b> as </b><span style="color: maroon">vitalSign</span><b> then </b>VitalSigns<span style="color: navy">(</span><span style="color: maroon">observation</span><span style="color: navy">, </span><span style="color: maroon">vitalSign</span><span style="color: navy">)</span> <i>&quot;simpleVitalSignEntry&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span> <i>&quot;observationEntry&quot;</i><span style="color: navy">;</span>
    entry.resource<span style="color: navy"> : </span>Patient<b> as </b><span style="color: maroon">patient</span><span style="color: navy"><b> -&gt; </b></span>tgt<b> then</b><span style="color: navy"> {
</span>      patient<b> as </b><span style="color: maroon">s</span><span style="color: navy"><b> -&gt; </b></span>tgt<b> then</b><span style="color: navy"> {
</span>        s.id<b> as </b><span style="color: maroon">id</span><span style="color: navy"><b> -&gt; </b></span>tgt.patient_id = <b>cast</b><span style="color: navy">(</span><span style="color: maroon">id</span><span style="color: navy">, </span><span style="color: blue">'integer'</span><span style="color: navy">)</span><span style="color: navy">;</span>
      <span style="color: navy">}</span> <i>&quot;personID&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span><span style="color: navy">;</span>
    entry.resource<span style="color: navy"> : </span>Encounter<b> as </b><span style="color: maroon">encounter</span><span style="color: navy"><b> -&gt; </b></span>tgt<b> then</b><span style="color: navy"> {
</span>      encounter<span style="color: navy"><b> -&gt; </b></span>tgt.visitOccurrence<b> as </b><span style="color: maroon">visit</span><b> then </b>VisitOccurrence<span style="color: navy">(</span><span style="color: maroon">encounter</span><span style="color: navy">, </span><span style="color: maroon">visit</span><span style="color: navy">)</span> <i>&quot;visit&quot;</i><span style="color: navy">;</span>
    <span style="color: navy">}</span><span style="color: navy">;</span>
  <span style="color: navy">}</span> <i>&quot;bundleEntry&quot;</i><span style="color: navy">;</span>
<span style="color: navy">}

</span></pre></div>
  </text>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
    <valueCode value="brr"/>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
    <valueInteger value="2">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom">
        <valueCanonical
                        value="http://hl7.org/fhir/uv/omop/ImplementationGuide/hl7.fhir.uv.omop"/>
      </extension>
    </valueInteger>
  </extension>
  <extension
             url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
    <valueCode value="trial-use">
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom">
        <valueCanonical
                        value="http://hl7.org/fhir/uv/omop/ImplementationGuide/hl7.fhir.uv.omop"/>
      </extension>
    </valueCode>
  </extension>
  <url value="http://hl7.org/fhir/uv/omop/StructureMap/RecordSetMap"/>
  <identifier>
    <system value="urn:ietf:rfc:3986"/>
    <value value="urn:oid:2.16.840.1.113883.4.642.40.77.43.10"/>
  </identifier>
  <version value="2.0.0-ballot"/>
  <name value="RecordSetMap"/>
  <title
         value="Mapping an International Patient Summary resource to OMOP domains collected in a RecordSet resource"/>
  <status value="active"/>
  <date value="2026-08-08T01:17:21+00:00"/>
  <publisher value="HL7 International / Biomedical Research and Regulation"/>
  <contact>
    <name value="HL7 International / Biomedical Research and Regulation"/>
    <telecom>
      <system value="url"/>
      <value value="http://www.hl7.org/Special/committees/rcrim"/>
    </telecom>
  </contact>
  <description
               value="This mapping maps a FHIR International Patient Summary Bundle to a set of OMOP Patient records collected in a RecordSet resource."/>
  <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/Bundle"/>
    <mode value="source"/>
    <alias value="Bundle"/>
  </structure>
  <structure>
    <url value="http://hl7.org/fhir/uv/omop/StructureDefinition/RecordSet"/>
    <mode value="target"/>
    <alias value="RecordSetTable"/>
  </structure>
  <import value="http://hl7.org/fhir/uv/omop/StructureMap/AllergyMap"/>
  <import
          value="http://hl7.org/fhir/uv/omop/StructureMap/BloodPressureVitalSignsMap"/>
  <import value="http://hl7.org/fhir/uv/omop/StructureMap/ConditionMap"/>
  <import value="http://hl7.org/fhir/uv/omop/StructureMap/EncounterVisitMap"/>
  <import value="http://hl7.org/fhir/uv/omop/StructureMap/ImmunizationMap"/>
  <import value="http://hl7.org/fhir/uv/omop/StructureMap/MeasurementMap"/>
  <import value="http://hl7.org/fhir/uv/omop/StructureMap/PersonMap"/>
  <import value="http://hl7.org/fhir/uv/omop/StructureMap/ProcedureMap"/>
  <import
          value="http://hl7.org/fhir/uv/omop/StructureMap/SimpleVitalSignsMap"/>
  <group>
    <name value="RecordSet"/>
    <input>
      <name value="src"/>
      <type value="Bundle"/>
      <mode value="source"/>
    </input>
    <input>
      <name value="tgt"/>
      <type value="RecordSetTable"/>
      <mode value="target"/>
    </input>
    <rule>
      <name value="id"/>
      <source>
        <context value="src"/>
        <element value="id"/>
        <variable value="s"/>
      </source>
      <target>
        <context value="tgt"/>
      </target>
      <rule>
        <name value="id"/>
        <source>
          <context value="s"/>
          <element value="id"/>
          <variable value="id"/>
        </source>
        <target>
          <context value="tgt"/>
          <element value="record_id"/>
          <transform value="evaluate"/>
          <parameter>
            <valueString value="%id.substring(%id.indexOf('/') + 1)"/>
          </parameter>
        </target>
      </rule>
    </rule>
    <rule>
      <name value="timestamp"/>
      <source>
        <context value="src"/>
        <element value="timestamp"/>
        <variable value="ts"/>
      </source>
      <target>
        <context value="tgt"/>
        <element value="record_set_timestamp"/>
        <transform value="copy"/>
        <parameter>
          <valueId value="ts"/>
        </parameter>
      </target>
      <documentation value="Map bundle timestamp"/>
    </rule>
    <rule>
      <name value="bundleEntry"/>
      <source>
        <context value="src"/>
        <element value="entry"/>
        <variable value="entry"/>
      </source>
      <target>
        <context value="tgt"/>
      </target>
      <rule>
        <name value="allergyIntoleranceEntry"/>
        <source>
          <context value="entry"/>
          <type value="AllergyIntolerance"/>
          <element value="resource"/>
          <variable value="a"/>
        </source>
        <target>
          <context value="tgt"/>
        </target>
        <rule>
          <name value="allergyEntry"/>
          <source>
            <context value="a"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="allergy"/>
            <variable value="allergy"/>
          </target>
          <dependent>
            <name value="Allergy"/>
            <parameter>
              <valueId value="a"/>
            </parameter>
            <parameter>
              <valueId value="allergy"/>
            </parameter>
          </dependent>
        </rule>
      </rule>
      <rule>
        <name value="conditionOccurenceEntry"/>
        <source>
          <context value="entry"/>
          <type value="Condition"/>
          <element value="resource"/>
          <variable value="condition"/>
        </source>
        <target>
          <context value="tgt"/>
        </target>
        <rule>
          <name value="conditionEntry"/>
          <source>
            <context value="condition"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="condition"/>
            <variable value="conditionOccurrence"/>
          </target>
          <dependent>
            <name value="ConditionOccurrence"/>
            <parameter>
              <valueId value="condition"/>
            </parameter>
            <parameter>
              <valueId value="conditionOccurrence"/>
            </parameter>
          </dependent>
        </rule>
      </rule>
      <rule>
        <name value="conditionOccurenceEntry"/>
        <source>
          <context value="entry"/>
          <type value="Encounter"/>
          <element value="resource"/>
          <variable value="encounter"/>
        </source>
        <target>
          <context value="tgt"/>
        </target>
        <rule>
          <name value="encounterEntry"/>
          <source>
            <context value="encounter"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="visitOccurrence"/>
            <variable value="visitOccurrence"/>
          </target>
          <dependent>
            <name value="VisitOccurrence"/>
            <parameter>
              <valueId value="encounter"/>
            </parameter>
            <parameter>
              <valueId value="visitOccurrence"/>
            </parameter>
          </dependent>
        </rule>
      </rule>
      <rule>
        <name value="observationEntry"/>
        <source>
          <context value="entry"/>
          <type value="Observation"/>
          <element value="resource"/>
          <variable value="observation"/>
        </source>
        <target>
          <context value="tgt"/>
        </target>
        <rule>
          <name value="measurementEntry"/>
          <source>
            <context value="observation"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="measurement"/>
            <variable value="measurement"/>
          </target>
          <dependent>
            <name value="Measures"/>
            <parameter>
              <valueId value="observation"/>
            </parameter>
            <parameter>
              <valueId value="measurement"/>
            </parameter>
          </dependent>
        </rule>
        <rule>
          <name value="bloodPressureEntry"/>
          <source>
            <context value="observation"/>
          </source>
          <target>
            <context value="tgt"/>
            <variable value="recordSet"/>
          </target>
          <dependent>
            <name value="BloodPressure"/>
            <parameter>
              <valueId value="observation"/>
            </parameter>
            <parameter>
              <valueId value="recordSet"/>
            </parameter>
          </dependent>
        </rule>
        <rule>
          <name value="simpleVitalSignEntry"/>
          <source>
            <context value="observation"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="measurement"/>
            <variable value="vitalSign"/>
          </target>
          <dependent>
            <name value="VitalSigns"/>
            <parameter>
              <valueId value="observation"/>
            </parameter>
            <parameter>
              <valueId value="vitalSign"/>
            </parameter>
          </dependent>
        </rule>
      </rule>
      <rule>
        <name value="resourcePatient"/>
        <source>
          <context value="entry"/>
          <type value="Patient"/>
          <element value="resource"/>
          <variable value="patient"/>
        </source>
        <target>
          <context value="tgt"/>
        </target>
        <rule>
          <name value="personID"/>
          <source>
            <context value="patient"/>
            <variable value="s"/>
          </source>
          <target>
            <context value="tgt"/>
          </target>
          <rule>
            <name value="id"/>
            <source>
              <context value="s"/>
              <element value="id"/>
              <variable value="id"/>
            </source>
            <target>
              <context value="tgt"/>
              <element value="patient_id"/>
              <transform value="cast"/>
              <parameter>
                <valueId value="id"/>
              </parameter>
              <parameter>
                <valueString value="integer"/>
              </parameter>
            </target>
          </rule>
        </rule>
      </rule>
      <rule>
        <name value="resourceEncounter"/>
        <source>
          <context value="entry"/>
          <type value="Encounter"/>
          <element value="resource"/>
          <variable value="encounter"/>
        </source>
        <target>
          <context value="tgt"/>
        </target>
        <rule>
          <name value="visit"/>
          <source>
            <context value="encounter"/>
          </source>
          <target>
            <context value="tgt"/>
            <element value="visitOccurrence"/>
            <variable value="visit"/>
          </target>
          <dependent>
            <name value="VisitOccurrence"/>
            <parameter>
              <valueId value="encounter"/>
            </parameter>
            <parameter>
              <valueId value="visit"/>
            </parameter>
          </dependent>
        </rule>
      </rule>
      <documentation value="Map bundle entries"/>
    </rule>
  </group>
</StructureMap>