FHIR to OMOP FHIR IG
1.0.0 - INFORMATIVE 1 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 1.0.0 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

StructureMap: Mapping Blood Pressure Vital Signs resource to Measurement OMOP Domain

Official URL: http://hl7.org/fhir/uv/omop/StructureMap/BloodPressureVitalSignsMap Version: 1.0.0
Standards status: Informative Maturity Level: 2 Computable Name: BloodPressureVitalSignsMap

This mapping maps blood pressure FHIR Vital Signs instances that are considered measurements to OMOP Measurement Table objects.

Blood Pressure Mapping

This mapping handles the standard Blood Pressure profile defined in the FHIR Core Specification. This mapping results in three OMOP Measurement records created - one for the overall Blood Pressure measurement, and one for each of the Systolic and Diastolic component measurements.

Mapping

Language: en

/// url = 'http://hl7.org/fhir/uv/omop/StructureMap/BloodPressureVitalSignsMap'
/// name = 'BloodPressureVitalSignsMap'
/// title = 'Mapping Blood Pressure Vital Signs resource to Measurement OMOP Domain'
/// status = 'draft'

uses "http://hl7.org/fhir/StructureDefinition/bp" alias BloodPressure as source
uses "http://hl7.org/fhir/StructureDefinition/Bundle" as target
uses "http://hl7.org/fhir/uv/omop/StructureDefinition/Measurement" alias Measurement as target // make the bundle

group bpMap(source src : BloodPressure, target bundle : Bundle) {
  src -> bundle.id = uuid() "bundleid";
  src -> bundle.type = 'collection' "bundletype";
  src as parent -> bundle.entry as entry then {
    parent -> entry.fullUrl = 'BloodPressure' "entryURL";
    parent -> entry.resource = create('Measurement') as parentTable then parentTable(parent, parentTable) "bpEntryResource";
  } "bpBundleEntry";
  src.component as comp -> bundle.entry as entry then {
    comp -> entry.fullUrl = 'Component 1' "entryURL";
    comp where (comp.code.coding.code = '8480-6') -> entry.resource = create('Measurement') as sysTable then systolicTable(comp, sysTable) "systolicEntryResource";
    comp where (comp.code.coding.code = '8462-4') -> entry.resource = create('Measurement') as diasTable then diastolicTable(comp, diasTable) "diastolicEntryResource";
  } "bpComponentEntries";
}

group systolicTable(source comp, target sysTable : Measurement) {
  comp.code -> sysTable.measurement_concept_id = '3004249';
  comp.value : quantity as qty -> sysTable then {
    qty.value -> sysTable.value_as_number;
    qty.unit -> sysTable.unit_concept_id;
  } "systolicMeasure";
}

group diastolicTable(source comp, target diasTable : Measurement) {
  comp.code -> diasTable.measurement_concept_id = '3012888';
  comp.value : quantity as qty -> diasTable then {
    qty.value -> diasTable.value_as_number;
    qty.unit -> diasTable.unit_concept_id;
  } "diastolicMeasure";
}

group parentTable(source src : BloodPressure, target tgt : Measurement) {
  src.code as s -> tgt then {
    s.coding as sc -> tgt then {
      sc.code as a -> tgt.measurement_type_concept_id = translate(a, 'http://hl7.org/fhir/uv/omop/ConceptMap/BloodPressureCodes', 'code');
    };
  };
  src.effective : dateTime as edt ->  tgt.measurement_datetime = edt,  tgt.measurement_date = cast(edt, 'date');
  src.effective : Period as s -> tgt then {
    s.start as eps ->  tgt.measurement_datetime = cast(eps, 'dateTime'),  tgt.measurement_date = cast(eps, 'date');
  };
  src.issued as s where (src.issued.toDate != src.effectiveDateTime) -> tgt.measurement_source_value = cast(s, 'string');
}