-
Notifications
You must be signed in to change notification settings - Fork 6
Overview of OMOP to MEDS Transformations
Michael Wornow edited this page Oct 17, 2024
·
1 revision
This page was accurate as of 2024.10.17 (MEDS 0.3.3, MEDS_ETL 0.3.8).
The purpose of this page is to provide a brief overview of all the data transformations that happen when converting OMOP => MEDS
- Link to Code
- Effect: We drop all OMOP tables except for these 11 tables: person, drug_exposure, visit_occurrence, condition_occurrence, death, procedure_occurrence, device_exposure, measurement, observation, note, visit_detail
- Link to Code
-
Effect: If event is from
person
table, then usebirth_datetime
see here. Otherwise, try these column names in order:["_start_datetime", "_start_date", "_datetime", "_date"]
and force datetimes without a time to have a time of 23:59:59 (i.e. move to midnight) see here.
- Link to Code
-
Effect: For the
person
anddeath
tables, we force the code to beMEDS_BIRTH
andMEDS_DEATH
, respectively, per the schema definition here. Otherwise, we try assigning the code to be the source concept ID (column with suffix_source_concept_id
). If it's not available, then we use the concept ID (column with suffix_concept_id
). If that's not available, then we us a fallback concept ID (defined as8
for events from thevisit_occurrence
table,46235038
for events from thenote
table, and4203722
for events from thevisit_detail
table. We use the following base column names for each table (to which we append the suffixes_source_concept_id
,_concept_id
) per here:-
drug_exposure
=>drug_concept_id
-
visit
=>visit_concept_id
-
condition_occurrence
=>condition_concept_id
-
procedure_occurrence
=>procedure_concept_id
-
device_exposure
=>device_concept_id
-
measurement
=>measurement_concept_id
-
observation
=>observation_concept_id
-
note
=>note_class_concept_id
-
- Link to Code
-
Effect: Replaces concept IDs with concept codes per the
concept
table.
- Link to Code
-
Effect: All events default to
value = None
. If the event is from themeasurement
table, then try the following columns in order (stopping once we hit a non-null value):value_as_number
as a number,value_source_value
as a string, andvalue_as_concept_id
as a concept ID see here. If the event is from theobservation
table, then try the following columns in order (stopping once we hit a non-null value):value_as_number
as a number,value_as_string
as a string, andvalue_as_concept_id
as a concept ID see here. If the event is from thenote
table, then try only the columnnote_text
as a string see here
- Link to Code
-
Effect: Adds the following columns:
-
table
=> name of OMOP source table -
visit_id
(Optional) => value ofvisit_occurrence_id
column (if exists) -
unit
(Optional) => value ofunit_source_value
column if exists, otherwise value ofunit_concept_id
column if exists -
clarity_table
(Optional) => value ofload_table_id
column (if exists) -
note_id
(Optional) => value ofnote_id
column (if exists) -
end
(Optional) => value of{table_name}_end_datetime
column (if exists)
-
- Link to Code
-
Effect: Drops all events that have
code = None
Note: This is all triggered by running meds_etl_omop [OMOP_SOURCE_DIR] [MEDS_OUTPUT_DIR]