From cbf584c8d5d6212f73c5eaa1e209f5a7a75bf1b5 Mon Sep 17 00:00:00 2001 From: aegis301 Date: Fri, 19 Jul 2024 09:51:48 +0200 Subject: [PATCH 01/10] first mapping automation --- concepts/Adrenaline_dosage.yml | 17 ++++++ concepts/Age.yml | 17 ++++++ concepts/AirwayPlateauPressure.yml | 17 ++++++ concepts/BodyHeight.yml | 17 ++++++ concepts/BodyTemperature.yml | 17 ++++++ concepts/BodyWeight.yml | 17 ++++++ concepts/BreathingRate.yml | 17 ++++++ concepts/Creatinine_absolute_serum.yml | 17 ++++++ ...iastolicBloodPressue_Arterial_Invasive.yml | 17 ++++++ ...tolicBloodPressue_Arterial_noninvasive.yml | 17 ++++++ concepts/Dobutamine_dosage.yml | 17 ++++++ concepts/FiO2.yml | 17 ++++++ concepts/Gender.yml | 17 ++++++ .../MeanBloodPressue_Arterial_Invasive.yml | 17 ++++++ .../MeanBloodPressue_Arterial_Noninvasive.yml | 17 ++++++ concepts/Norepinephrine_dosage.yml | 17 ++++++ concepts/OxygenSaturation_Peripheral.yml | 17 ++++++ concepts/PEEP.yml | 17 ++++++ ...ystolicBloodPressure_Arterial_Invasive.yml | 17 ++++++ ...olicBloodPressure_Arterial_noninvasive.yml | 17 ++++++ concepts/TidalVolume.yml | 17 ++++++ concepts/UrineVolume.yml | 17 ++++++ concepts/Vancomycine_dosage.yml | 17 ++++++ concepts/Vasopressine_dosage.yml | 17 ++++++ main_mapping.csv | 59 +++++++++++++++++++ mapping_to_yaml.py | 44 ++++++++++++++ 26 files changed, 511 insertions(+) create mode 100644 concepts/Adrenaline_dosage.yml create mode 100644 concepts/Age.yml create mode 100644 concepts/AirwayPlateauPressure.yml create mode 100644 concepts/BodyHeight.yml create mode 100644 concepts/BodyTemperature.yml create mode 100644 concepts/BodyWeight.yml create mode 100644 concepts/BreathingRate.yml create mode 100644 concepts/Creatinine_absolute_serum.yml create mode 100644 concepts/DiastolicBloodPressue_Arterial_Invasive.yml create mode 100644 concepts/DiastolicBloodPressue_Arterial_noninvasive.yml create mode 100644 concepts/Dobutamine_dosage.yml create mode 100644 concepts/FiO2.yml create mode 100644 concepts/Gender.yml create mode 100644 concepts/MeanBloodPressue_Arterial_Invasive.yml create mode 100644 concepts/MeanBloodPressue_Arterial_Noninvasive.yml create mode 100644 concepts/Norepinephrine_dosage.yml create mode 100644 concepts/OxygenSaturation_Peripheral.yml create mode 100644 concepts/PEEP.yml create mode 100644 concepts/SystolicBloodPressure_Arterial_Invasive.yml create mode 100644 concepts/SystolicBloodPressure_Arterial_noninvasive.yml create mode 100644 concepts/TidalVolume.yml create mode 100644 concepts/UrineVolume.yml create mode 100644 concepts/Vancomycine_dosage.yml create mode 100644 concepts/Vasopressine_dosage.yml create mode 100644 main_mapping.csv create mode 100644 mapping_to_yaml.py diff --git a/concepts/Adrenaline_dosage.yml b/concepts/Adrenaline_dosage.yml new file mode 100644 index 0000000..2ad54f2 --- /dev/null +++ b/concepts/Adrenaline_dosage.yml @@ -0,0 +1,17 @@ +description: '' +identifiers: + loinc: '' + snomed: '' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '221289' + schema: mimiciv_icu + table: inputevents + source: mimiciv + unit: '' +name: Adrenaline_dosage +unit: ug/kg/min +upper_limit: 300 diff --git a/concepts/Age.yml b/concepts/Age.yml new file mode 100644 index 0000000..510e27a --- /dev/null +++ b/concepts/Age.yml @@ -0,0 +1,17 @@ +description: Patient's age +identifiers: + loinc: '' + snomed: '' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '' + schema: mimiciv_derived + table: age + source: mimiciv + unit: '' +name: Age +unit: years +upper_limit: 300 diff --git a/concepts/AirwayPlateauPressure.yml b/concepts/AirwayPlateauPressure.yml new file mode 100644 index 0000000..1eb0426 --- /dev/null +++ b/concepts/AirwayPlateauPressure.yml @@ -0,0 +1,17 @@ +description: Airway Plateau Pressure of a patient +identifiers: + loinc: '' + snomed: '' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '224696' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: '' +name: AirwayPlateauPressure +unit: mmHg +upper_limit: 300 diff --git a/concepts/BodyHeight.yml b/concepts/BodyHeight.yml new file mode 100644 index 0000000..2095017 --- /dev/null +++ b/concepts/BodyHeight.yml @@ -0,0 +1,17 @@ +description: Height of a patient's body +identifiers: + loinc: 8302-2 + snomed: '1153637007' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '226730' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: '' +name: BodyHeight +unit: cm +upper_limit: 300 diff --git a/concepts/BodyTemperature.yml b/concepts/BodyTemperature.yml new file mode 100644 index 0000000..0a143e6 --- /dev/null +++ b/concepts/BodyTemperature.yml @@ -0,0 +1,17 @@ +description: Temperature of a patient's body, irrespective of site +identifiers: + loinc: '' + snomed: '' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '223762' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: '' +name: BodyTemperature +unit: "\xB0C" +upper_limit: 300 diff --git a/concepts/BodyWeight.yml b/concepts/BodyWeight.yml new file mode 100644 index 0000000..dfb341b --- /dev/null +++ b/concepts/BodyWeight.yml @@ -0,0 +1,17 @@ +description: Weight of a patien's body +identifiers: + loinc: 29463-7 + snomed: '27113001' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '224639' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: '' +name: BodyWeight +unit: kg +upper_limit: 300 diff --git a/concepts/BreathingRate.yml b/concepts/BreathingRate.yml new file mode 100644 index 0000000..2776580 --- /dev/null +++ b/concepts/BreathingRate.yml @@ -0,0 +1,17 @@ +description: Actual breathing rate of patient +identifiers: + loinc: '' + snomed: '' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '224690' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: '' +name: BreathingRate +unit: 1/min +upper_limit: 300 diff --git a/concepts/Creatinine_absolute_serum.yml b/concepts/Creatinine_absolute_serum.yml new file mode 100644 index 0000000..092f65c --- /dev/null +++ b/concepts/Creatinine_absolute_serum.yml @@ -0,0 +1,17 @@ +description: '' +identifiers: + loinc: '' + snomed: '' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '220615' + schema: mimic_hosp + table: labevents + source: mimiciv + unit: '' +name: Creatinine_absolute_serum +unit: mg/dl +upper_limit: 300 diff --git a/concepts/DiastolicBloodPressue_Arterial_Invasive.yml b/concepts/DiastolicBloodPressue_Arterial_Invasive.yml new file mode 100644 index 0000000..bf014cd --- /dev/null +++ b/concepts/DiastolicBloodPressue_Arterial_Invasive.yml @@ -0,0 +1,17 @@ +description: Diastolic arterial pressure of a patient +identifiers: + loinc: 76213-8 + snomed: '251073000' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '220051' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: '' +name: DiastolicBloodPressue_Arterial_Invasive +unit: mmHg +upper_limit: 300 diff --git a/concepts/DiastolicBloodPressue_Arterial_noninvasive.yml b/concepts/DiastolicBloodPressue_Arterial_noninvasive.yml new file mode 100644 index 0000000..f6e96bb --- /dev/null +++ b/concepts/DiastolicBloodPressue_Arterial_noninvasive.yml @@ -0,0 +1,17 @@ +description: Diastolic venous pressure of a patient +identifiers: + loinc: '' + snomed: '251074006' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '220180' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: '' +name: DiastolicBloodPressue_Arterial_noninvasive +unit: mmHg +upper_limit: 300 diff --git a/concepts/Dobutamine_dosage.yml b/concepts/Dobutamine_dosage.yml new file mode 100644 index 0000000..c16f431 --- /dev/null +++ b/concepts/Dobutamine_dosage.yml @@ -0,0 +1,17 @@ +description: '' +identifiers: + loinc: '' + snomed: '' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '221653' + schema: mimiciv_icu + table: inputevents + source: mimiciv + unit: '' +name: Dobutamine_dosage +unit: ug/kg/min +upper_limit: 300 diff --git a/concepts/FiO2.yml b/concepts/FiO2.yml new file mode 100644 index 0000000..b092511 --- /dev/null +++ b/concepts/FiO2.yml @@ -0,0 +1,17 @@ +description: Inspired oxygen concentration of a patient +identifiers: + loinc: '' + snomed: '' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '223835' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: '' +name: FiO2 +unit: 1/1 +upper_limit: 300 diff --git a/concepts/Gender.yml b/concepts/Gender.yml new file mode 100644 index 0000000..999fdf0 --- /dev/null +++ b/concepts/Gender.yml @@ -0,0 +1,17 @@ +description: Patient's gender +identifiers: + loinc: '' + snomed: '' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '226228' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: '' +name: Gender +unit: '' +upper_limit: 300 diff --git a/concepts/MeanBloodPressue_Arterial_Invasive.yml b/concepts/MeanBloodPressue_Arterial_Invasive.yml new file mode 100644 index 0000000..483d4ac --- /dev/null +++ b/concepts/MeanBloodPressue_Arterial_Invasive.yml @@ -0,0 +1,17 @@ +description: Mean arterial pressure of a patient +identifiers: + loinc: '' + snomed: '251075007' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '220052' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: '' +name: MeanBloodPressue_Arterial_Invasive +unit: mmHg +upper_limit: 300 diff --git a/concepts/MeanBloodPressue_Arterial_Noninvasive.yml b/concepts/MeanBloodPressue_Arterial_Noninvasive.yml new file mode 100644 index 0000000..0a807f5 --- /dev/null +++ b/concepts/MeanBloodPressue_Arterial_Noninvasive.yml @@ -0,0 +1,17 @@ +description: Diastolic venous pressure of a patient +identifiers: + loinc: '' + snomed: '174255007' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '220181' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: '' +name: MeanBloodPressue_Arterial_Noninvasive +unit: mmHg +upper_limit: 300 diff --git a/concepts/Norepinephrine_dosage.yml b/concepts/Norepinephrine_dosage.yml new file mode 100644 index 0000000..72e2e70 --- /dev/null +++ b/concepts/Norepinephrine_dosage.yml @@ -0,0 +1,17 @@ +description: '' +identifiers: + loinc: '' + snomed: '' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '221906' + schema: mimiciv_icu + table: inputevents + source: mimiciv + unit: '' +name: Norepinephrine_dosage +unit: ug/kg/min +upper_limit: 300 diff --git a/concepts/OxygenSaturation_Peripheral.yml b/concepts/OxygenSaturation_Peripheral.yml new file mode 100644 index 0000000..648b01a --- /dev/null +++ b/concepts/OxygenSaturation_Peripheral.yml @@ -0,0 +1,17 @@ +description: Oxygen Saturation, irrespective of sample site +identifiers: + loinc: '' + snomed: '' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '220227' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: '' +name: OxygenSaturation_Peripheral +unit: '%' +upper_limit: 300 diff --git a/concepts/PEEP.yml b/concepts/PEEP.yml new file mode 100644 index 0000000..63a250b --- /dev/null +++ b/concepts/PEEP.yml @@ -0,0 +1,17 @@ +description: Positive end-expiratory pressure +identifiers: + loinc: '' + snomed: '' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '224700' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: '' +name: PEEP +unit: cm H2O +upper_limit: 300 diff --git a/concepts/SystolicBloodPressure_Arterial_Invasive.yml b/concepts/SystolicBloodPressure_Arterial_Invasive.yml new file mode 100644 index 0000000..214f8e4 --- /dev/null +++ b/concepts/SystolicBloodPressure_Arterial_Invasive.yml @@ -0,0 +1,17 @@ +description: Systolic arterial pressure of a patient +identifiers: + loinc: 76215-3 + snomed: '251071003' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '220050' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: '' +name: SystolicBloodPressure_Arterial_Invasive +unit: mmHg +upper_limit: 300 diff --git a/concepts/SystolicBloodPressure_Arterial_noninvasive.yml b/concepts/SystolicBloodPressure_Arterial_noninvasive.yml new file mode 100644 index 0000000..18f99a3 --- /dev/null +++ b/concepts/SystolicBloodPressure_Arterial_noninvasive.yml @@ -0,0 +1,17 @@ +description: Systolic venous pressure of a patient +identifiers: + loinc: '' + snomed: '251070002' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '220179' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: '' +name: SystolicBloodPressure_Arterial_noninvasive +unit: mmHg +upper_limit: 300 diff --git a/concepts/TidalVolume.yml b/concepts/TidalVolume.yml new file mode 100644 index 0000000..d5bf181 --- /dev/null +++ b/concepts/TidalVolume.yml @@ -0,0 +1,17 @@ +description: Actual tidal volume of a patient +identifiers: + loinc: '' + snomed: '' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '224685' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: '' +name: TidalVolume +unit: ml +upper_limit: 300 diff --git a/concepts/UrineVolume.yml b/concepts/UrineVolume.yml new file mode 100644 index 0000000..4940d7b --- /dev/null +++ b/concepts/UrineVolume.yml @@ -0,0 +1,17 @@ +description: Urine Volume measured at a certain point in time +identifiers: + loinc: '' + snomed: '' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '' + schema: mimiciv_derived + table: urineoutput + source: mimiciv + unit: '' +name: UrineVolume +unit: ml +upper_limit: 300 diff --git a/concepts/Vancomycine_dosage.yml b/concepts/Vancomycine_dosage.yml new file mode 100644 index 0000000..5dfd50f --- /dev/null +++ b/concepts/Vancomycine_dosage.yml @@ -0,0 +1,17 @@ +description: '' +identifiers: + loinc: '' + snomed: '' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '225798' + schema: mimiciv_icu + table: inputevents + source: mimiciv + unit: '' +name: Vancomycine_dosage +unit: mg +upper_limit: 300 diff --git a/concepts/Vasopressine_dosage.yml b/concepts/Vasopressine_dosage.yml new file mode 100644 index 0000000..786757e --- /dev/null +++ b/concepts/Vasopressine_dosage.yml @@ -0,0 +1,17 @@ +description: '' +identifiers: + loinc: '' + snomed: '' +lower_limit: 0 +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '222315' + schema: mimiciv_icu + table: inputevents + source: mimiciv + unit: '' +name: Vasopressine_dosage +unit: IE/kg/min +upper_limit: 300 diff --git a/main_mapping.csv b/main_mapping.csv new file mode 100644 index 0000000..edbb130 --- /dev/null +++ b/main_mapping.csv @@ -0,0 +1,59 @@ +Concept Name,Description,ready for conversion,Standard Unit,SCT CONEPT ID,SNOMED FSN,SCHEMA,LOINC ID,LOINC Code,MIMIC Mapper,MIMICIV schema,MIMICIV table,MIMICIV IDs,MIMIC Unit,AMDS table,AMDS IDs,eICU table,eICU column,eICU name +HeartRate,"heart rate of a patient, source agnostic",TRUE,bpm,364075005,364075005 |Heart rate (observable entity)|,FHIRObservation,Heart rate,8867-4,MimicObservationMapper,mimiciv_icu,chartevents,220045,,,,,, +SystolicBloodPressure_Arterial_Invasive,Systolic arterial pressure of a patient,TRUE,mmHg,251071003,251071003 |Invasive systolic arterial pressure (observable entity)|,FHIRObservation,Invasive Systolic blood pressure,76215-3,MimicObservationMapper,mimiciv_icu,chartevents,220050,,,,,, +DiastolicBloodPressue_Arterial_Invasive,Diastolic arterial pressure of a patient,TRUE,mmHg,251073000,251073000 |Invasive diastolic arterial pressure (observable entity)|,FHIRObservation,Invasive Diastolic blood pressure,76213-8,MimicObservationMapper,mimiciv_icu,chartevents,220051,,,,,, +MeanBloodPressue_Arterial_Invasive,Mean arterial pressure of a patient,TRUE,mmHg,251075007,251075007 |Invasive mean arterial pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,220052,,,,,, +SystolicBloodPressure_Arterial_noninvasive,Systolic venous pressure of a patient,TRUE,mmHg,251070002,251070002 |Non-invasive systolic arterial pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,220179,,,,,, +DiastolicBloodPressue_Arterial_noninvasive,Diastolic venous pressure of a patient,TRUE,mmHg,251074006,251074006 |Non-invasive mean arterial pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,220180,,,,,, +MeanBloodPressue_Arterial_Noninvasive,Diastolic venous pressure of a patient,TRUE,mmHg,174255007,174255007 |Non-invasive diastolic arterial pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,220181,,,,,, +BodyHeight,Height of a patient's body,TRUE,cm,1153637007,1153637007 |Body height (observable entity)|,FHIRObservation,Body height,8302-2,MimicObservationMapper,mimiciv_icu,chartevents,226730,,,,,, +BodyWeight,Weight of a patien's body,TRUE,kg,27113001,27113001 |Body weight (observable entity)|,FHIRObservation,Body weight,29463-7,MimicObservationMapper,mimiciv_icu,chartevents,224639,,,,,, +UrineVolume,Urine Volume measured at a certain point in time,TRUE,ml,,,FHIRObservation,,,MimicObservationMapper,mimiciv_derived,urineoutput,,,,,,, +UrineVolumePerDay,Urine Volume in 24h,,ml/24h,,395060000 |24 hour urine output (observable entity)|,,,,,,,,,,,,, +BodyTemperature,"Temperature of a patient's body, irrespective of site",TRUE,°C,,386725007 |Body temperature (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,223762,,,,,, +OxygenSaturation_Peripheral,"Oxygen Saturation, irrespective of sample site",TRUE,%,,103228002 |Hemoglobin saturation with oxygen (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,220227,,,,,, +Gender,Patient's gender,TRUE,,,263495000 |Gender (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,226228,,,,,, +Age,Patient's age,TRUE,years,,424144002 |Current chronological age (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_derived,age,,,,,,, +FiO2,Inspired oxygen concentration of a patient,TRUE,1/1,,250774007 |Inspired oxygen concentration (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,223835,,,,,, +PEEP,Positive end-expiratory pressure,TRUE,cm H2O,,250854009 |Positive end expiratory pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224700,,,,,, +BreathingRate,Actual breathing rate of patient,TRUE,1/min,,86290005 |Respiratory rate (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224690,,,,,, +TidalVolume,Actual tidal volume of a patient,TRUE,ml,,13621006 |Tidal volume (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224685,,,,,, +AirwayPlateauPressure,Airway Plateau Pressure of a patient,TRUE,mmHg,,698822002 |Airway plateau pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224696,,,,,, +Norepinephrine_dosage,,TRUE,ug/kg/min,,,FHIRMedicationStatement,,,MimicMedicationMapper,mimiciv_icu,inputevents,221906,,,,,, +Adrenaline_dosage,,TRUE,ug/kg/min,,,FHIRMedicationStatement,,,MimicMedicationMapper,mimiciv_icu,inputevents,221289,,,,,, +Vasopressine_dosage,,TRUE,IE/kg/min,,,FHIRMedicationStatement,,,MimicMedicationMapper,mimiciv_icu,inputevents,222315,,,,,, +Dobutamine_dosage,,TRUE,ug/kg/min,,,FHIRMedicationStatement,,,MimicMedicationMapper,mimiciv_icu,inputevents,221653,,,,,, +Vancomycine_dosage,,TRUE,mg,,,FHIRMedicationStatement,,,MimicMedicationMapper,mimiciv_icu,inputevents,225798,,,,,, +NaCl_dosage,,,,,,,,,,,,,,,,,, +Norepinephrine_rate_Medication,,,mg/kg/min,,,,,,,,,,,,,,, +Adrenaline_rate_Medication,,,mg/kg/min,,,,,,,,,,,,,,, +Vasopressine_rate_Medication,,,?,,,,,,,,,,,,,,, +Dobutamine_rate_Medication,,,?,,,,,,,,,,,,,,, +Dextrose_rate_Medication,,,?,,,,,,,,,,,,,,, +NaCl_rate_Medication,,,ml/h,,,,,,,,,,,,,,, +Albumine_rate_Medication,,,?,,,,,,,,,,,,,,, +Vancomycine_level_medication,,,?,,,,,,,,,,,,,,, +LeukozyteCount_absolute_blood,,,Gpt/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +PlateletCount_absolute_blood,,,Gpt/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +CRP_absolute_blood,,,mg/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Glucose_absolute_blood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Magnesium_absolute_blood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Calcium_absolute_blood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Phosphate_absolute_blood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Creatinine_absolute_serum,,TRUE,mg/dl,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,220615,,,,,, +Urea_absolute_blood,,,mol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Haemoglobin_absolute_lood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Lactate_absolute_arterial,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +pO2_absolute_arterial,,,mmHg,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +pH_absolute_arterial,,,-/-,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Bicarbonate_absolute_arterial,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Sodium_absolute_blood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Potassium_absolute_blood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Chloride_absolute_blood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Bilirubine_absolute_blood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +GOT_absolute_blood,,,nmol/(s•L),,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +GPT_absolute_blood,,,nmol/(s•L),,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +GGT_absolute_blood,,,nmol/(s•L),,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +LDH_absolute_serum,,,nmol/(s•L),,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +INR_relative,,,-/-,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Dialysis_therapy,,,yes/no,,,FHIRDeviceUsage,,,MimicDeviceMapper,,,,,,,,, \ No newline at end of file diff --git a/mapping_to_yaml.py b/mapping_to_yaml.py new file mode 100644 index 0000000..4a6c0ec --- /dev/null +++ b/mapping_to_yaml.py @@ -0,0 +1,44 @@ +import csv +import yaml +import os + + +with open('concepts/HeartRate.yml', 'r') as file: + yaml_template = yaml.safe_load(file) + + +def create_yaml_from_template(data, template, output_dir): + new_yaml = template.copy() + new_yaml['name'] = data['Concept Name'] + new_yaml['description'] = data['Description'] + new_yaml['unit'] = data['Standard Unit'] + new_yaml['identifiers']['snomed'] = data['SCT CONEPT ID'] + new_yaml['identifiers']['loinc'] = data['LOINC Code'] + + # Update mapper information + new_yaml['mapper'][0]['source'] = 'mimiciv' + new_yaml['mapper'][0]['unit'] = data['MIMIC Unit'] + new_yaml['mapper'][0]['params']['schema'] = data['MIMICIV schema'] + new_yaml['mapper'][0]['params']['table'] = data['MIMICIV table'] + new_yaml['mapper'][0]['params']['constraints']['itemid'] = data['MIMICIV IDs'] + + # Write to a new YAML file + output_file = os.path.join(output_dir, f"{data['Concept Name']}.yml") + with open(output_file, 'w') as outfile: + yaml.dump(new_yaml, outfile, default_flow_style=False) + + +# Read the CSV file and process flagged rows +csv_file = 'main_mapping.csv' +output_directory = 'concepts' + +# Create the output directory if it doesn't exist +os.makedirs(output_directory, exist_ok=True) + +with open(csv_file, 'r') as csvfile: + reader = csv.DictReader(csvfile) + for row in reader: + if row.get('ready for conversion') == "TRUE": + create_yaml_from_template(row, yaml_template, output_directory) + +print("Conversion completed. YAML files are created in the 'converted_yamls' directory.") From 4fc96093acecb4f3ceeb0d11ecb135263fed5a8e Mon Sep 17 00:00:00 2001 From: Christian Porschen Date: Fri, 19 Jul 2024 11:26:53 +0200 Subject: [PATCH 02/10] update concepts --- concepts/Adrenaline_dosage.yml | 6 +- concepts/Age.yml | 6 +- concepts/AirwayPlateauPressure.yml | 6 +- concepts/BodyHeight.yml | 6 +- concepts/BodyTemperature.yml | 8 +- concepts/BodyWeight.yml | 6 +- concepts/BreathingRate.yml | 6 +- concepts/Creatinine_absolute_serum.yml | 4 +- ...iastolicBloodPressue_Arterial_Invasive.yml | 6 +- ...tolicBloodPressue_Arterial_noninvasive.yml | 8 +- concepts/Dobutamine_dosage.yml | 6 +- concepts/FiO2.yml | 8 +- concepts/Gender.yml | 4 +- concepts/HeartRate.yml | 31 +++-- .../MeanBloodPressue_Arterial_Invasive.yml | 6 +- .../MeanBloodPressue_Arterial_Noninvasive.yml | 8 +- concepts/Norepinephrine_dosage.yml | 6 +- concepts/OxygenSaturation_Peripheral.yml | 6 +- concepts/PEEP.yml | 6 +- ...ystolicBloodPressure_Arterial_Invasive.yml | 6 +- ...olicBloodPressure_Arterial_noninvasive.yml | 8 +- concepts/TidalVolume.yml | 6 +- concepts/UrineVolume.yml | 6 +- concepts/Vancomycine_dosage.yml | 6 +- concepts/Vasopressine_dosage.yml | 6 +- example.yml | 26 ++-- main_mapping.csv | 117 +++++++++--------- mapping_to_yaml.py | 18 +-- 28 files changed, 172 insertions(+), 170 deletions(-) diff --git a/concepts/Adrenaline_dosage.yml b/concepts/Adrenaline_dosage.yml index 2ad54f2..7aa22e3 100644 --- a/concepts/Adrenaline_dosage.yml +++ b/concepts/Adrenaline_dosage.yml @@ -2,7 +2,7 @@ description: '' identifiers: loinc: '' snomed: '' -lower_limit: 0 +lower_limit: '' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: inputevents source: mimiciv - unit: '' + unit: mg/time name: Adrenaline_dosage unit: ug/kg/min -upper_limit: 300 +upper_limit: '' diff --git a/concepts/Age.yml b/concepts/Age.yml index 510e27a..d402216 100644 --- a/concepts/Age.yml +++ b/concepts/Age.yml @@ -2,7 +2,7 @@ description: Patient's age identifiers: loinc: '' snomed: '' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_derived table: age source: mimiciv - unit: '' + unit: years name: Age unit: years -upper_limit: 300 +upper_limit: '130' diff --git a/concepts/AirwayPlateauPressure.yml b/concepts/AirwayPlateauPressure.yml index 1eb0426..45dc0e9 100644 --- a/concepts/AirwayPlateauPressure.yml +++ b/concepts/AirwayPlateauPressure.yml @@ -2,7 +2,7 @@ description: Airway Plateau Pressure of a patient identifiers: loinc: '' snomed: '' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: chartevents source: mimiciv - unit: '' + unit: mmHg name: AirwayPlateauPressure unit: mmHg -upper_limit: 300 +upper_limit: '100' diff --git a/concepts/BodyHeight.yml b/concepts/BodyHeight.yml index 2095017..48bc93f 100644 --- a/concepts/BodyHeight.yml +++ b/concepts/BodyHeight.yml @@ -2,7 +2,7 @@ description: Height of a patient's body identifiers: loinc: 8302-2 snomed: '1153637007' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: chartevents source: mimiciv - unit: '' + unit: cm name: BodyHeight unit: cm -upper_limit: 300 +upper_limit: '300' diff --git a/concepts/BodyTemperature.yml b/concepts/BodyTemperature.yml index 0a143e6..df4d01a 100644 --- a/concepts/BodyTemperature.yml +++ b/concepts/BodyTemperature.yml @@ -2,7 +2,7 @@ description: Temperature of a patient's body, irrespective of site identifiers: loinc: '' snomed: '' -lower_limit: 0 +lower_limit: '20' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: chartevents source: mimiciv - unit: '' + unit: °C name: BodyTemperature -unit: "\xB0C" -upper_limit: 300 +unit: °C +upper_limit: '45' diff --git a/concepts/BodyWeight.yml b/concepts/BodyWeight.yml index dfb341b..88ddf3c 100644 --- a/concepts/BodyWeight.yml +++ b/concepts/BodyWeight.yml @@ -2,7 +2,7 @@ description: Weight of a patien's body identifiers: loinc: 29463-7 snomed: '27113001' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: chartevents source: mimiciv - unit: '' + unit: kg name: BodyWeight unit: kg -upper_limit: 300 +upper_limit: '500' diff --git a/concepts/BreathingRate.yml b/concepts/BreathingRate.yml index 2776580..2cf2d89 100644 --- a/concepts/BreathingRate.yml +++ b/concepts/BreathingRate.yml @@ -2,7 +2,7 @@ description: Actual breathing rate of patient identifiers: loinc: '' snomed: '' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: chartevents source: mimiciv - unit: '' + unit: 1/min name: BreathingRate unit: 1/min -upper_limit: 300 +upper_limit: '100' diff --git a/concepts/Creatinine_absolute_serum.yml b/concepts/Creatinine_absolute_serum.yml index 092f65c..3b1cd79 100644 --- a/concepts/Creatinine_absolute_serum.yml +++ b/concepts/Creatinine_absolute_serum.yml @@ -2,7 +2,7 @@ description: '' identifiers: loinc: '' snomed: '' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -14,4 +14,4 @@ mapper: unit: '' name: Creatinine_absolute_serum unit: mg/dl -upper_limit: 300 +upper_limit: '1000000' diff --git a/concepts/DiastolicBloodPressue_Arterial_Invasive.yml b/concepts/DiastolicBloodPressue_Arterial_Invasive.yml index bf014cd..a1c8f8a 100644 --- a/concepts/DiastolicBloodPressue_Arterial_Invasive.yml +++ b/concepts/DiastolicBloodPressue_Arterial_Invasive.yml @@ -2,7 +2,7 @@ description: Diastolic arterial pressure of a patient identifiers: loinc: 76213-8 snomed: '251073000' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: chartevents source: mimiciv - unit: '' + unit: mmHg name: DiastolicBloodPressue_Arterial_Invasive unit: mmHg -upper_limit: 300 +upper_limit: '200' diff --git a/concepts/DiastolicBloodPressue_Arterial_noninvasive.yml b/concepts/DiastolicBloodPressue_Arterial_noninvasive.yml index f6e96bb..41fad79 100644 --- a/concepts/DiastolicBloodPressue_Arterial_noninvasive.yml +++ b/concepts/DiastolicBloodPressue_Arterial_noninvasive.yml @@ -1,8 +1,8 @@ -description: Diastolic venous pressure of a patient +description: Diastolic arterial pressure of a patient identifiers: loinc: '' snomed: '251074006' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: chartevents source: mimiciv - unit: '' + unit: mmHg name: DiastolicBloodPressue_Arterial_noninvasive unit: mmHg -upper_limit: 300 +upper_limit: '200' diff --git a/concepts/Dobutamine_dosage.yml b/concepts/Dobutamine_dosage.yml index c16f431..687e768 100644 --- a/concepts/Dobutamine_dosage.yml +++ b/concepts/Dobutamine_dosage.yml @@ -2,7 +2,7 @@ description: '' identifiers: loinc: '' snomed: '' -lower_limit: 0 +lower_limit: '' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: inputevents source: mimiciv - unit: '' + unit: mg/time name: Dobutamine_dosage unit: ug/kg/min -upper_limit: 300 +upper_limit: '' diff --git a/concepts/FiO2.yml b/concepts/FiO2.yml index b092511..1d96352 100644 --- a/concepts/FiO2.yml +++ b/concepts/FiO2.yml @@ -2,7 +2,7 @@ description: Inspired oxygen concentration of a patient identifiers: loinc: '' snomed: '' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: chartevents source: mimiciv - unit: '' + unit: '%' name: FiO2 -unit: 1/1 -upper_limit: 300 +unit: '%' +upper_limit: '100' diff --git a/concepts/Gender.yml b/concepts/Gender.yml index 999fdf0..4a5a0d4 100644 --- a/concepts/Gender.yml +++ b/concepts/Gender.yml @@ -2,7 +2,7 @@ description: Patient's gender identifiers: loinc: '' snomed: '' -lower_limit: 0 +lower_limit: '' mapper: - klass: MimicObservationMapper params: @@ -14,4 +14,4 @@ mapper: unit: '' name: Gender unit: '' -upper_limit: 300 +upper_limit: '' diff --git a/concepts/HeartRate.yml b/concepts/HeartRate.yml index 4503621..dc66431 100644 --- a/concepts/HeartRate.yml +++ b/concepts/HeartRate.yml @@ -1,18 +1,17 @@ +description: heart rate of a patient, source agnostic +identifiers: + loinc: 8867-4 + snomed: '364075005' +lower_limit: '0' +mapper: +- klass: MimicObservationMapper + params: + constraints: + itemid: '220045' + schema: mimiciv_icu + table: chartevents + source: mimiciv + unit: bpm name: HeartRate -description: Heart rate is the speed of the heartbeat measured by the number of contractions of the heart per minute (bpm). unit: bpm -upper_limit: 300 -lower_limit: 0 -identifiers: - snomed: "364075005" - loinc: "8867-4" -#schema: FHIRObservation -mapper: - - klass: MimicObservationMapper - source: mimic - unit: bpm - params: - schema: mimiciv_icu - table: chartevents - constraints: - itemid: "220045" \ No newline at end of file +upper_limit: '300' diff --git a/concepts/MeanBloodPressue_Arterial_Invasive.yml b/concepts/MeanBloodPressue_Arterial_Invasive.yml index 483d4ac..a0aa170 100644 --- a/concepts/MeanBloodPressue_Arterial_Invasive.yml +++ b/concepts/MeanBloodPressue_Arterial_Invasive.yml @@ -2,7 +2,7 @@ description: Mean arterial pressure of a patient identifiers: loinc: '' snomed: '251075007' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: chartevents source: mimiciv - unit: '' + unit: mmHg name: MeanBloodPressue_Arterial_Invasive unit: mmHg -upper_limit: 300 +upper_limit: '200' diff --git a/concepts/MeanBloodPressue_Arterial_Noninvasive.yml b/concepts/MeanBloodPressue_Arterial_Noninvasive.yml index 0a807f5..9f8d9fe 100644 --- a/concepts/MeanBloodPressue_Arterial_Noninvasive.yml +++ b/concepts/MeanBloodPressue_Arterial_Noninvasive.yml @@ -1,8 +1,8 @@ -description: Diastolic venous pressure of a patient +description: Diastolic arterial pressure of a patient identifiers: loinc: '' snomed: '174255007' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: chartevents source: mimiciv - unit: '' + unit: mmHg name: MeanBloodPressue_Arterial_Noninvasive unit: mmHg -upper_limit: 300 +upper_limit: '200' diff --git a/concepts/Norepinephrine_dosage.yml b/concepts/Norepinephrine_dosage.yml index 72e2e70..c73c2bf 100644 --- a/concepts/Norepinephrine_dosage.yml +++ b/concepts/Norepinephrine_dosage.yml @@ -2,7 +2,7 @@ description: '' identifiers: loinc: '' snomed: '' -lower_limit: 0 +lower_limit: '' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: inputevents source: mimiciv - unit: '' + unit: mg/time name: Norepinephrine_dosage unit: ug/kg/min -upper_limit: 300 +upper_limit: '' diff --git a/concepts/OxygenSaturation_Peripheral.yml b/concepts/OxygenSaturation_Peripheral.yml index 648b01a..c3da6a0 100644 --- a/concepts/OxygenSaturation_Peripheral.yml +++ b/concepts/OxygenSaturation_Peripheral.yml @@ -2,7 +2,7 @@ description: Oxygen Saturation, irrespective of sample site identifiers: loinc: '' snomed: '' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: chartevents source: mimiciv - unit: '' + unit: '%' name: OxygenSaturation_Peripheral unit: '%' -upper_limit: 300 +upper_limit: '100' diff --git a/concepts/PEEP.yml b/concepts/PEEP.yml index 63a250b..67314e2 100644 --- a/concepts/PEEP.yml +++ b/concepts/PEEP.yml @@ -2,7 +2,7 @@ description: Positive end-expiratory pressure identifiers: loinc: '' snomed: '' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: chartevents source: mimiciv - unit: '' + unit: cm H2O name: PEEP unit: cm H2O -upper_limit: 300 +upper_limit: '40' diff --git a/concepts/SystolicBloodPressure_Arterial_Invasive.yml b/concepts/SystolicBloodPressure_Arterial_Invasive.yml index 214f8e4..714f507 100644 --- a/concepts/SystolicBloodPressure_Arterial_Invasive.yml +++ b/concepts/SystolicBloodPressure_Arterial_Invasive.yml @@ -2,7 +2,7 @@ description: Systolic arterial pressure of a patient identifiers: loinc: 76215-3 snomed: '251071003' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: chartevents source: mimiciv - unit: '' + unit: mmHg name: SystolicBloodPressure_Arterial_Invasive unit: mmHg -upper_limit: 300 +upper_limit: '300' diff --git a/concepts/SystolicBloodPressure_Arterial_noninvasive.yml b/concepts/SystolicBloodPressure_Arterial_noninvasive.yml index 18f99a3..87bdcd9 100644 --- a/concepts/SystolicBloodPressure_Arterial_noninvasive.yml +++ b/concepts/SystolicBloodPressure_Arterial_noninvasive.yml @@ -1,8 +1,8 @@ -description: Systolic venous pressure of a patient +description: Systolic arterial pressure of a patient identifiers: loinc: '' snomed: '251070002' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: chartevents source: mimiciv - unit: '' + unit: mmHg name: SystolicBloodPressure_Arterial_noninvasive unit: mmHg -upper_limit: 300 +upper_limit: '200' diff --git a/concepts/TidalVolume.yml b/concepts/TidalVolume.yml index d5bf181..2583e96 100644 --- a/concepts/TidalVolume.yml +++ b/concepts/TidalVolume.yml @@ -2,7 +2,7 @@ description: Actual tidal volume of a patient identifiers: loinc: '' snomed: '' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: chartevents source: mimiciv - unit: '' + unit: ml name: TidalVolume unit: ml -upper_limit: 300 +upper_limit: '10000' diff --git a/concepts/UrineVolume.yml b/concepts/UrineVolume.yml index 4940d7b..a834e03 100644 --- a/concepts/UrineVolume.yml +++ b/concepts/UrineVolume.yml @@ -2,7 +2,7 @@ description: Urine Volume measured at a certain point in time identifiers: loinc: '' snomed: '' -lower_limit: 0 +lower_limit: '0' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_derived table: urineoutput source: mimiciv - unit: '' + unit: ml name: UrineVolume unit: ml -upper_limit: 300 +upper_limit: '10000' diff --git a/concepts/Vancomycine_dosage.yml b/concepts/Vancomycine_dosage.yml index 5dfd50f..b9d9fce 100644 --- a/concepts/Vancomycine_dosage.yml +++ b/concepts/Vancomycine_dosage.yml @@ -2,7 +2,7 @@ description: '' identifiers: loinc: '' snomed: '' -lower_limit: 0 +lower_limit: '' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: inputevents source: mimiciv - unit: '' + unit: mg name: Vancomycine_dosage unit: mg -upper_limit: 300 +upper_limit: '' diff --git a/concepts/Vasopressine_dosage.yml b/concepts/Vasopressine_dosage.yml index 786757e..21acf64 100644 --- a/concepts/Vasopressine_dosage.yml +++ b/concepts/Vasopressine_dosage.yml @@ -2,7 +2,7 @@ description: '' identifiers: loinc: '' snomed: '' -lower_limit: 0 +lower_limit: '' mapper: - klass: MimicObservationMapper params: @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: inputevents source: mimiciv - unit: '' + unit: IE/time name: Vasopressine_dosage unit: IE/kg/min -upper_limit: 300 +upper_limit: '' diff --git a/example.yml b/example.yml index 0d9e724..4503621 100644 --- a/example.yml +++ b/example.yml @@ -1,18 +1,18 @@ -name: HeartRate # naming according to our naming convention -description: Heart rate is the speed of the heartbeat measured by the number of contractions of the heart per minute (bpm). # human understandable description of the item -unit: bpm # unit that should be used for this item -upper_limit: 300 # upper limit -lower_limit: 0 # lower limit -identifiers: # collection of identifiers, more can be added - snomed: "364075005" # snomed identifications ID - loinc: "8867-4" # loinc identifications CODE -#schema: FHIRObservation # available export schemas -mapper: # mapping on where and how to find the variable in public databases - - klass: MimicObservationMapper # class that is used for extraction +name: HeartRate +description: Heart rate is the speed of the heartbeat measured by the number of contractions of the heart per minute (bpm). +unit: bpm +upper_limit: 300 +lower_limit: 0 +identifiers: + snomed: "364075005" + loinc: "8867-4" +#schema: FHIRObservation +mapper: + - klass: MimicObservationMapper source: mimic - unit: bpm # unit used in the database + unit: bpm params: schema: mimiciv_icu table: chartevents constraints: - itemid: "220045" + itemid: "220045" \ No newline at end of file diff --git a/main_mapping.csv b/main_mapping.csv index edbb130..6f322c3 100644 --- a/main_mapping.csv +++ b/main_mapping.csv @@ -1,59 +1,58 @@ -Concept Name,Description,ready for conversion,Standard Unit,SCT CONEPT ID,SNOMED FSN,SCHEMA,LOINC ID,LOINC Code,MIMIC Mapper,MIMICIV schema,MIMICIV table,MIMICIV IDs,MIMIC Unit,AMDS table,AMDS IDs,eICU table,eICU column,eICU name -HeartRate,"heart rate of a patient, source agnostic",TRUE,bpm,364075005,364075005 |Heart rate (observable entity)|,FHIRObservation,Heart rate,8867-4,MimicObservationMapper,mimiciv_icu,chartevents,220045,,,,,, -SystolicBloodPressure_Arterial_Invasive,Systolic arterial pressure of a patient,TRUE,mmHg,251071003,251071003 |Invasive systolic arterial pressure (observable entity)|,FHIRObservation,Invasive Systolic blood pressure,76215-3,MimicObservationMapper,mimiciv_icu,chartevents,220050,,,,,, -DiastolicBloodPressue_Arterial_Invasive,Diastolic arterial pressure of a patient,TRUE,mmHg,251073000,251073000 |Invasive diastolic arterial pressure (observable entity)|,FHIRObservation,Invasive Diastolic blood pressure,76213-8,MimicObservationMapper,mimiciv_icu,chartevents,220051,,,,,, -MeanBloodPressue_Arterial_Invasive,Mean arterial pressure of a patient,TRUE,mmHg,251075007,251075007 |Invasive mean arterial pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,220052,,,,,, -SystolicBloodPressure_Arterial_noninvasive,Systolic venous pressure of a patient,TRUE,mmHg,251070002,251070002 |Non-invasive systolic arterial pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,220179,,,,,, -DiastolicBloodPressue_Arterial_noninvasive,Diastolic venous pressure of a patient,TRUE,mmHg,251074006,251074006 |Non-invasive mean arterial pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,220180,,,,,, -MeanBloodPressue_Arterial_Noninvasive,Diastolic venous pressure of a patient,TRUE,mmHg,174255007,174255007 |Non-invasive diastolic arterial pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,220181,,,,,, -BodyHeight,Height of a patient's body,TRUE,cm,1153637007,1153637007 |Body height (observable entity)|,FHIRObservation,Body height,8302-2,MimicObservationMapper,mimiciv_icu,chartevents,226730,,,,,, -BodyWeight,Weight of a patien's body,TRUE,kg,27113001,27113001 |Body weight (observable entity)|,FHIRObservation,Body weight,29463-7,MimicObservationMapper,mimiciv_icu,chartevents,224639,,,,,, -UrineVolume,Urine Volume measured at a certain point in time,TRUE,ml,,,FHIRObservation,,,MimicObservationMapper,mimiciv_derived,urineoutput,,,,,,, -UrineVolumePerDay,Urine Volume in 24h,,ml/24h,,395060000 |24 hour urine output (observable entity)|,,,,,,,,,,,,, -BodyTemperature,"Temperature of a patient's body, irrespective of site",TRUE,°C,,386725007 |Body temperature (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,223762,,,,,, -OxygenSaturation_Peripheral,"Oxygen Saturation, irrespective of sample site",TRUE,%,,103228002 |Hemoglobin saturation with oxygen (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,220227,,,,,, -Gender,Patient's gender,TRUE,,,263495000 |Gender (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,226228,,,,,, -Age,Patient's age,TRUE,years,,424144002 |Current chronological age (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_derived,age,,,,,,, -FiO2,Inspired oxygen concentration of a patient,TRUE,1/1,,250774007 |Inspired oxygen concentration (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,223835,,,,,, -PEEP,Positive end-expiratory pressure,TRUE,cm H2O,,250854009 |Positive end expiratory pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224700,,,,,, -BreathingRate,Actual breathing rate of patient,TRUE,1/min,,86290005 |Respiratory rate (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224690,,,,,, -TidalVolume,Actual tidal volume of a patient,TRUE,ml,,13621006 |Tidal volume (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224685,,,,,, -AirwayPlateauPressure,Airway Plateau Pressure of a patient,TRUE,mmHg,,698822002 |Airway plateau pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224696,,,,,, -Norepinephrine_dosage,,TRUE,ug/kg/min,,,FHIRMedicationStatement,,,MimicMedicationMapper,mimiciv_icu,inputevents,221906,,,,,, -Adrenaline_dosage,,TRUE,ug/kg/min,,,FHIRMedicationStatement,,,MimicMedicationMapper,mimiciv_icu,inputevents,221289,,,,,, -Vasopressine_dosage,,TRUE,IE/kg/min,,,FHIRMedicationStatement,,,MimicMedicationMapper,mimiciv_icu,inputevents,222315,,,,,, -Dobutamine_dosage,,TRUE,ug/kg/min,,,FHIRMedicationStatement,,,MimicMedicationMapper,mimiciv_icu,inputevents,221653,,,,,, -Vancomycine_dosage,,TRUE,mg,,,FHIRMedicationStatement,,,MimicMedicationMapper,mimiciv_icu,inputevents,225798,,,,,, -NaCl_dosage,,,,,,,,,,,,,,,,,, -Norepinephrine_rate_Medication,,,mg/kg/min,,,,,,,,,,,,,,, -Adrenaline_rate_Medication,,,mg/kg/min,,,,,,,,,,,,,,, -Vasopressine_rate_Medication,,,?,,,,,,,,,,,,,,, -Dobutamine_rate_Medication,,,?,,,,,,,,,,,,,,, -Dextrose_rate_Medication,,,?,,,,,,,,,,,,,,, -NaCl_rate_Medication,,,ml/h,,,,,,,,,,,,,,, -Albumine_rate_Medication,,,?,,,,,,,,,,,,,,, -Vancomycine_level_medication,,,?,,,,,,,,,,,,,,, -LeukozyteCount_absolute_blood,,,Gpt/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -PlateletCount_absolute_blood,,,Gpt/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -CRP_absolute_blood,,,mg/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -Glucose_absolute_blood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -Magnesium_absolute_blood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -Calcium_absolute_blood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -Phosphate_absolute_blood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -Creatinine_absolute_serum,,TRUE,mg/dl,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,220615,,,,,, -Urea_absolute_blood,,,mol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -Haemoglobin_absolute_lood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -Lactate_absolute_arterial,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -pO2_absolute_arterial,,,mmHg,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -pH_absolute_arterial,,,-/-,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -Bicarbonate_absolute_arterial,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -Sodium_absolute_blood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -Potassium_absolute_blood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -Chloride_absolute_blood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -Bilirubine_absolute_blood,,,mmol/l,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -GOT_absolute_blood,,,nmol/(s•L),,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -GPT_absolute_blood,,,nmol/(s•L),,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -GGT_absolute_blood,,,nmol/(s•L),,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -LDH_absolute_serum,,,nmol/(s•L),,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -INR_relative,,,-/-,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, -Dialysis_therapy,,,yes/no,,,FHIRDeviceUsage,,,MimicDeviceMapper,,,,,,,,, \ No newline at end of file +Concept Name,Description,ready for conversion,Standard Unit,Absolute Upper,Absolute Lower,SCT CONEPT ID,SNOMED FSN,SCHEMA,LOINC ID,LOINC Code,MIMIC Mapper,MIMICIV schema,MIMICIV table,MIMICIV IDs,MIMIC Unit,AMDS table,AMDS IDs,eICU table,eICU column,eICU name +HeartRate,"heart rate of a patient, source agnostic",TRUE,bpm,300,0,364075005,364075005 |Heart rate (observable entity)|,FHIRObservation,Heart rate,8867-4,MimicObservationMapper,mimiciv_icu,chartevents,220045,bpm,,,,, +SystolicBloodPressure_Arterial_Invasive,Systolic arterial pressure of a patient,TRUE,mmHg,300,0,251071003,251071003 |Invasive systolic arterial pressure (observable entity)|,FHIRObservation,Invasive Systolic blood pressure,76215-3,MimicObservationMapper,mimiciv_icu,chartevents,220050,mmHg,,,,, +DiastolicBloodPressue_Arterial_Invasive,Diastolic arterial pressure of a patient,TRUE,mmHg,200,0,251073000,251073000 |Invasive diastolic arterial pressure (observable entity)|,FHIRObservation,Invasive Diastolic blood pressure,76213-8,MimicObservationMapper,mimiciv_icu,chartevents,220051,mmHg,,,,, +MeanBloodPressue_Arterial_Invasive,Mean arterial pressure of a patient,TRUE,mmHg,200,0,251075007,251075007 |Invasive mean arterial pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,220052,mmHg,,,,, +SystolicBloodPressure_Arterial_noninvasive,Systolic arterial pressure of a patient,TRUE,mmHg,200,0,251070002,251070002 |Non-invasive systolic arterial pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,220179,mmHg,,,,, +DiastolicBloodPressue_Arterial_noninvasive,Diastolic arterial pressure of a patient,TRUE,mmHg,200,0,251074006,251074006 |Non-invasive mean arterial pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,220180,mmHg,,,,, +MeanBloodPressue_Arterial_Noninvasive,Diastolic arterial pressure of a patient,TRUE,mmHg,200,0,174255007,174255007 |Non-invasive diastolic arterial pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,220181,mmHg,,,,, +BodyHeight,Height of a patient's body,TRUE,cm,300,0,1153637007,1153637007 |Body height (observable entity)|,FHIRObservation,Body height,8302-2,MimicObservationMapper,mimiciv_icu,chartevents,226730,cm,,,,, +BodyWeight,Weight of a patien's body,TRUE,kg,500,0,27113001,27113001 |Body weight (observable entity)|,FHIRObservation,Body weight,29463-7,MimicObservationMapper,mimiciv_icu,chartevents,224639,kg,,,,, +UrineVolume,Urine Volume measured at a certain point in time,TRUE,ml,10000,0,,,FHIRObservation,,,MimicObservationMapper,mimiciv_derived,urineoutput,,ml,,,,, +BodyTemperature,"Temperature of a patient's body, irrespective of site",TRUE,°C,45,20,,386725007 |Body temperature (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,223762,°C,,,,, +OxygenSaturation_Peripheral,"Oxygen Saturation, irrespective of sample site",TRUE,%,100,0,,103228002 |Hemoglobin saturation with oxygen (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,220227,%,,,,, +Gender,Patient's gender,TRUE,,,,,263495000 |Gender (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,226228,,,,,, +Age,Patient's age,TRUE,years,130,0,,424144002 |Current chronological age (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_derived,age,,years,,,,, +FiO2,Inspired oxygen concentration of a patient,TRUE,%,100,0,,250774007 |Inspired oxygen concentration (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,223835,%,,,,, +PEEP,Positive end-expiratory pressure,TRUE,cm H2O,40,0,,250854009 |Positive end expiratory pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224700,cm H2O,,,,, +BreathingRate,Actual breathing rate of patient,TRUE,1/min,100,0,,86290005 |Respiratory rate (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224690,1/min,,,,, +TidalVolume,Actual tidal volume of a patient,TRUE,ml,10000,0,,13621006 |Tidal volume (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224685,ml,,,,, +AirwayPlateauPressure,Airway Plateau Pressure of a patient,TRUE,mmHg,100,0,,698822002 |Airway plateau pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224696,mmHg,,,,, +Norepinephrine_dosage,,TRUE,ug/kg/min,,,,,FHIRMedicationStatement,,,MimicMedicationMapper,mimiciv_icu,inputevents,221906,mg/time,,,,, +Adrenaline_dosage,,TRUE,ug/kg/min,,,,,FHIRMedicationStatement,,,MimicMedicationMapper,mimiciv_icu,inputevents,221289,mg/time,,,,, +Vasopressine_dosage,,TRUE,IE/kg/min,,,,,FHIRMedicationStatement,,,MimicMedicationMapper,mimiciv_icu,inputevents,222315,IE/time,,,,, +Dobutamine_dosage,,TRUE,ug/kg/min,,,,,FHIRMedicationStatement,,,MimicMedicationMapper,mimiciv_icu,inputevents,221653,mg/time,,,,, +Vancomycine_dosage,,TRUE,mg,,,,,FHIRMedicationStatement,,,MimicMedicationMapper,mimiciv_icu,inputevents,225798,mg,,,,, +NaCl_dosage,,,,,,,,,,,,,,,,,,,, +Norepinephrine_rate_Medication,,,mg/kg/min,,,,,,,,,,,,,,,,, +Adrenaline_rate_Medication,,,mg/kg/min,,,,,,,,,,,,,,,,, +Vasopressine_rate_Medication,,,?,,,,,,,,,,,,,,,,, +Dobutamine_rate_Medication,,,?,,,,,,,,,,,,,,,,, +Dextrose_rate_Medication,,,?,,,,,,,,,,,,,,,,, +NaCl_rate_Medication,,,ml/h,,,,,,,,,,,,,,,,, +Albumine_rate_Medication,,,?,,,,,,,,,,,,,,,,, +Vancomycine_level_medication,,,?,,,,,,,,,,,,,,,,, +LeukozyteCount_absolute_blood,,,Gpt/l,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +PlateletCount_absolute_blood,,,Gpt/l,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +CRP_absolute_blood,,,mg/l,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Glucose_absolute_blood,,,mmol/l,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Magnesium_absolute_blood,,,mmol/l,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Calcium_absolute_blood,,,mmol/l,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Phosphate_absolute_blood,,,mmol/l,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Creatinine_absolute_serum,,TRUE,mg/dl,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,220615,,,,,, +Urea_absolute_blood,,,mol/l,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Haemoglobin_absolute_lood,,,mmol/l,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Lactate_absolute_arterial,,,mmol/l,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +pO2_absolute_arterial,,,mmHg,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +pH_absolute_arterial,,,-/-,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Bicarbonate_absolute_arterial,,,mmol/l,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Sodium_absolute_blood,,,mmol/l,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Potassium_absolute_blood,,,mmol/l,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Chloride_absolute_blood,,,mmol/l,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Bilirubine_absolute_blood,,,mmol/l,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +GOT_absolute_blood,,,nmol/(s•L),1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +GPT_absolute_blood,,,nmol/(s•L),1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +GGT_absolute_blood,,,nmol/(s•L),1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +LDH_absolute_serum,,,nmol/(s•L),1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +INR_relative,,,-/-,1000000,0,,,FHIRObservation,,,MimicObservationMapper,mimic_hosp,labevents,,,,,,, +Dialysis_therapy,,,yes/no,,,,,FHIRDeviceUsage,,,MimicDeviceMapper,,,,,,,,, diff --git a/mapping_to_yaml.py b/mapping_to_yaml.py index 4a6c0ec..afb3802 100644 --- a/mapping_to_yaml.py +++ b/mapping_to_yaml.py @@ -1,31 +1,35 @@ import csv import yaml import os +from copy import deepcopy - -with open('concepts/HeartRate.yml', 'r') as file: +with open('example.yml', 'r') as file: yaml_template = yaml.safe_load(file) def create_yaml_from_template(data, template, output_dir): - new_yaml = template.copy() + # Use deepcopy to ensure the template is not modified + new_yaml = deepcopy(template) + print(data['Concept Name']) + # Directly update the necessary fields new_yaml['name'] = data['Concept Name'] new_yaml['description'] = data['Description'] new_yaml['unit'] = data['Standard Unit'] + new_yaml['upper_limit'] = data['Absolute Upper'] + new_yaml['lower_limit'] = data['Absolute Lower'] new_yaml['identifiers']['snomed'] = data['SCT CONEPT ID'] new_yaml['identifiers']['loinc'] = data['LOINC Code'] - - # Update mapper information new_yaml['mapper'][0]['source'] = 'mimiciv' new_yaml['mapper'][0]['unit'] = data['MIMIC Unit'] new_yaml['mapper'][0]['params']['schema'] = data['MIMICIV schema'] new_yaml['mapper'][0]['params']['table'] = data['MIMICIV table'] new_yaml['mapper'][0]['params']['constraints']['itemid'] = data['MIMICIV IDs'] - # Write to a new YAML file + # Write the updated YAML to a new file output_file = os.path.join(output_dir, f"{data['Concept Name']}.yml") with open(output_file, 'w') as outfile: - yaml.dump(new_yaml, outfile, default_flow_style=False) + yaml.dump(new_yaml, outfile, allow_unicode=True, + default_flow_style=False) # Read the CSV file and process flagged rows From a18064672e3133b4dd8423e0cc1aac5d79cbf037 Mon Sep 17 00:00:00 2001 From: Michael Fujarski Date: Mon, 22 Jul 2024 13:03:37 +0200 Subject: [PATCH 03/10] remove blank space in cmH2O. Renamed years to year. --- concepts/Age.yml | 14 ++++++++------ concepts/PEEP.yml | 4 ++-- concepts/SystolicBloodPressure.yml | 2 +- main_mapping.csv | 4 ++-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/concepts/Age.yml b/concepts/Age.yml index d402216..64414ef 100644 --- a/concepts/Age.yml +++ b/concepts/Age.yml @@ -1,17 +1,19 @@ description: Patient's age identifiers: - loinc: '' - snomed: '' + loinc: '30525-0' + snomed: '397669002' lower_limit: '0' mapper: - klass: MimicObservationMapper params: - constraints: - itemid: '' + fields: + value: age + timestamp: admittime + constraints: {} schema: mimiciv_derived table: age source: mimiciv - unit: years + unit: year name: Age -unit: years +unit: year upper_limit: '130' diff --git a/concepts/PEEP.yml b/concepts/PEEP.yml index 67314e2..bfd30bb 100644 --- a/concepts/PEEP.yml +++ b/concepts/PEEP.yml @@ -11,7 +11,7 @@ mapper: schema: mimiciv_icu table: chartevents source: mimiciv - unit: cm H2O + unit: cmH2O name: PEEP -unit: cm H2O +unit: cmH2O upper_limit: '40' diff --git a/concepts/SystolicBloodPressure.yml b/concepts/SystolicBloodPressure.yml index 8b3709e..61dc35d 100644 --- a/concepts/SystolicBloodPressure.yml +++ b/concepts/SystolicBloodPressure.yml @@ -9,7 +9,7 @@ identifiers: schema: FHIRObservation mapper: - klass: MimicObservationMapper - source: mimic + source: mimiciv unit: mmHg params: schema: mimiciv_icu diff --git a/main_mapping.csv b/main_mapping.csv index 6f322c3..0d3a08e 100644 --- a/main_mapping.csv +++ b/main_mapping.csv @@ -12,9 +12,9 @@ UrineVolume,Urine Volume measured at a certain point in time,TRUE,ml,10000,0,,,F BodyTemperature,"Temperature of a patient's body, irrespective of site",TRUE,°C,45,20,,386725007 |Body temperature (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,223762,°C,,,,, OxygenSaturation_Peripheral,"Oxygen Saturation, irrespective of sample site",TRUE,%,100,0,,103228002 |Hemoglobin saturation with oxygen (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,220227,%,,,,, Gender,Patient's gender,TRUE,,,,,263495000 |Gender (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,226228,,,,,, -Age,Patient's age,TRUE,years,130,0,,424144002 |Current chronological age (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_derived,age,,years,,,,, +Age,Patient's age,TRUE,year,130,0,,424144002 |Current chronological age (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_derived,age,,year,,,,, FiO2,Inspired oxygen concentration of a patient,TRUE,%,100,0,,250774007 |Inspired oxygen concentration (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,223835,%,,,,, -PEEP,Positive end-expiratory pressure,TRUE,cm H2O,40,0,,250854009 |Positive end expiratory pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224700,cm H2O,,,,, +PEEP,Positive end-expiratory pressure,TRUE,cmH2O,40,0,,250854009 |Positive end expiratory pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224700,cmH2O,,,,, BreathingRate,Actual breathing rate of patient,TRUE,1/min,100,0,,86290005 |Respiratory rate (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224690,1/min,,,,, TidalVolume,Actual tidal volume of a patient,TRUE,ml,10000,0,,13621006 |Tidal volume (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224685,ml,,,,, AirwayPlateauPressure,Airway Plateau Pressure of a patient,TRUE,mmHg,100,0,,698822002 |Airway plateau pressure (observable entity)|,FHIRObservation,,,MimicObservationMapper,mimiciv_icu,chartevents,224696,mmHg,,,,, From 92e366be1ce83687f09dac785c6465b1149803e8 Mon Sep 17 00:00:00 2001 From: Paul-B98 <115164840+Paul-B98@users.noreply.github.com> Date: Mon, 16 Sep 2024 21:00:39 +0200 Subject: [PATCH 04/10] update heart rate --- concepts/HeartRate.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/concepts/HeartRate.yml b/concepts/HeartRate.yml index dc66431..60a7cf8 100644 --- a/concepts/HeartRate.yml +++ b/concepts/HeartRate.yml @@ -12,6 +12,14 @@ mapper: table: chartevents source: mimiciv unit: bpm +- klass: EICUObservationMapper + params: + fields: + value: heartrate + schema: eicu_crd + table: vitalperiodic + source: eicu + unit: bpm name: HeartRate unit: bpm upper_limit: '300' From 8dc6743dd48e1ffdba3964fdccededd253eb169d Mon Sep 17 00:00:00 2001 From: Paul-B98 <115164840+Paul-B98@users.noreply.github.com> Date: Mon, 16 Sep 2024 21:38:30 +0200 Subject: [PATCH 05/10] update concepts --- concepts/BodyTemperature.yml | 8 ++++++++ concepts/DiastolicBloodPressue_Arterial_Invasive.yml | 8 ++++++++ concepts/DiastolicBloodPressue_Arterial_noninvasive.yml | 8 ++++++++ concepts/MeanBloodPressue_Arterial_Invasive.yml | 8 ++++++++ concepts/MeanBloodPressue_Arterial_Noninvasive.yml | 8 ++++++++ concepts/OxygenSaturation_Peripheral.yml | 8 ++++++++ concepts/SystolicBloodPressure_Arterial_Invasive.yml | 8 ++++++++ concepts/SystolicBloodPressure_Arterial_noninvasive.yml | 8 ++++++++ 8 files changed, 64 insertions(+) diff --git a/concepts/BodyTemperature.yml b/concepts/BodyTemperature.yml index df4d01a..053132e 100644 --- a/concepts/BodyTemperature.yml +++ b/concepts/BodyTemperature.yml @@ -12,6 +12,14 @@ mapper: table: chartevents source: mimiciv unit: °C +- klass: EICUObservationMapper + params: + fields: + value: temperature + schema: eicu_crd + table: vitalperiodic + source: eicu + unit: °C name: BodyTemperature unit: °C upper_limit: '45' diff --git a/concepts/DiastolicBloodPressue_Arterial_Invasive.yml b/concepts/DiastolicBloodPressue_Arterial_Invasive.yml index a1c8f8a..75f63a7 100644 --- a/concepts/DiastolicBloodPressue_Arterial_Invasive.yml +++ b/concepts/DiastolicBloodPressue_Arterial_Invasive.yml @@ -12,6 +12,14 @@ mapper: table: chartevents source: mimiciv unit: mmHg +- klass: EICUObservationMapper + params: + fields: + value: systemicdiastolic + schema: eicu_crd + table: vitalperiodic + source: eicu + unit: mmHg name: DiastolicBloodPressue_Arterial_Invasive unit: mmHg upper_limit: '200' diff --git a/concepts/DiastolicBloodPressue_Arterial_noninvasive.yml b/concepts/DiastolicBloodPressue_Arterial_noninvasive.yml index 41fad79..e89de0f 100644 --- a/concepts/DiastolicBloodPressue_Arterial_noninvasive.yml +++ b/concepts/DiastolicBloodPressue_Arterial_noninvasive.yml @@ -12,6 +12,14 @@ mapper: table: chartevents source: mimiciv unit: mmHg +- klass: EICUObservationMapper + params: + fields: + value: noninvasivediasystolic + schema: eicu_crd + table: vitalaperiodic + source: eicu + unit: mmHg name: DiastolicBloodPressue_Arterial_noninvasive unit: mmHg upper_limit: '200' diff --git a/concepts/MeanBloodPressue_Arterial_Invasive.yml b/concepts/MeanBloodPressue_Arterial_Invasive.yml index a0aa170..e5dfad6 100644 --- a/concepts/MeanBloodPressue_Arterial_Invasive.yml +++ b/concepts/MeanBloodPressue_Arterial_Invasive.yml @@ -12,6 +12,14 @@ mapper: table: chartevents source: mimiciv unit: mmHg +- klass: EICUObservationMapper + params: + fields: + value: systemicmean + schema: eicu_crd + table: vitalperiodic + source: eicu + unit: mmHg name: MeanBloodPressue_Arterial_Invasive unit: mmHg upper_limit: '200' diff --git a/concepts/MeanBloodPressue_Arterial_Noninvasive.yml b/concepts/MeanBloodPressue_Arterial_Noninvasive.yml index 9f8d9fe..73ba465 100644 --- a/concepts/MeanBloodPressue_Arterial_Noninvasive.yml +++ b/concepts/MeanBloodPressue_Arterial_Noninvasive.yml @@ -12,6 +12,14 @@ mapper: table: chartevents source: mimiciv unit: mmHg +- klass: EICUObservationMapper + params: + fields: + value: noninvasivemean + schema: eicu_crd + table: vitalaperiodic + source: eicu + unit: mmHg name: MeanBloodPressue_Arterial_Noninvasive unit: mmHg upper_limit: '200' diff --git a/concepts/OxygenSaturation_Peripheral.yml b/concepts/OxygenSaturation_Peripheral.yml index c3da6a0..e9361f6 100644 --- a/concepts/OxygenSaturation_Peripheral.yml +++ b/concepts/OxygenSaturation_Peripheral.yml @@ -12,6 +12,14 @@ mapper: table: chartevents source: mimiciv unit: '%' +- klass: EICUObservationMapper + params: + fields: + value: sao2 + schema: eicu_crd + table: vitalperiodic + source: eicu + unit: '%' name: OxygenSaturation_Peripheral unit: '%' upper_limit: '100' diff --git a/concepts/SystolicBloodPressure_Arterial_Invasive.yml b/concepts/SystolicBloodPressure_Arterial_Invasive.yml index 714f507..33ed4c9 100644 --- a/concepts/SystolicBloodPressure_Arterial_Invasive.yml +++ b/concepts/SystolicBloodPressure_Arterial_Invasive.yml @@ -12,6 +12,14 @@ mapper: table: chartevents source: mimiciv unit: mmHg +- klass: EICUObservationMapper + params: + fields: + value: systemicsystolic + schema: eicu_crd + table: vitalperiodic + source: eicu + unit: mmHg name: SystolicBloodPressure_Arterial_Invasive unit: mmHg upper_limit: '300' diff --git a/concepts/SystolicBloodPressure_Arterial_noninvasive.yml b/concepts/SystolicBloodPressure_Arterial_noninvasive.yml index 87bdcd9..7cd9339 100644 --- a/concepts/SystolicBloodPressure_Arterial_noninvasive.yml +++ b/concepts/SystolicBloodPressure_Arterial_noninvasive.yml @@ -12,6 +12,14 @@ mapper: table: chartevents source: mimiciv unit: mmHg +- klass: EICUObservationMapper + params: + fields: + value: noninvasivesystolic + schema: eicu_crd + table: vitalaperiodic + source: eicu + unit: mmHg name: SystolicBloodPressure_Arterial_noninvasive unit: mmHg upper_limit: '200' From 6da3fab7112fcbefc4d6897fc51c809701b0ab5f Mon Sep 17 00:00:00 2001 From: Paul-B98 <115164840+Paul-B98@users.noreply.github.com> Date: Thu, 19 Sep 2024 21:03:24 +0200 Subject: [PATCH 06/10] add concepts --- concepts/Age.yml | 8 ++++++++ concepts/BodyHeight.yml | 8 ++++++++ concepts/Gender.yml | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/concepts/Age.yml b/concepts/Age.yml index 64414ef..42aa8c3 100644 --- a/concepts/Age.yml +++ b/concepts/Age.yml @@ -14,6 +14,14 @@ mapper: table: age source: mimiciv unit: year +- klass: EICUPationObservationMapper + params: + fields: + value: age + schema: eicu_crd + table: patient + source: eicu + unit: year name: Age unit: year upper_limit: '130' diff --git a/concepts/BodyHeight.yml b/concepts/BodyHeight.yml index 48bc93f..1ff260a 100644 --- a/concepts/BodyHeight.yml +++ b/concepts/BodyHeight.yml @@ -12,6 +12,14 @@ mapper: table: chartevents source: mimiciv unit: cm +- klass: EICUPationObservationMapper + params: + fields: + value: admissionheight + schema: eicu_crd + table: patient + source: eicu + unit: cm name: BodyHeight unit: cm upper_limit: '300' diff --git a/concepts/Gender.yml b/concepts/Gender.yml index 4a5a0d4..e6f34fb 100644 --- a/concepts/Gender.yml +++ b/concepts/Gender.yml @@ -12,6 +12,14 @@ mapper: table: chartevents source: mimiciv unit: '' +- klass: EICUPationObservationMapper + params: + fields: + value: gender + schema: eicu_crd + table: patient + source: eicu + unit: '' name: Gender unit: '' upper_limit: '' From 34dfdc6fe8912bb86a7c9a37b473c768df9965de Mon Sep 17 00:00:00 2001 From: Paul-B98 <115164840+Paul-B98@users.noreply.github.com> Date: Mon, 23 Sep 2024 20:53:17 +0200 Subject: [PATCH 07/10] fix definitions --- concepts/Adrenaline_dosage.yml | 2 +- concepts/Dobutamine_dosage.yml | 2 +- concepts/Norepinephrine_dosage.yml | 2 +- concepts/Vancomycine_dosage.yml | 2 +- concepts/Vasopressine_dosage.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/concepts/Adrenaline_dosage.yml b/concepts/Adrenaline_dosage.yml index 7aa22e3..8838920 100644 --- a/concepts/Adrenaline_dosage.yml +++ b/concepts/Adrenaline_dosage.yml @@ -4,7 +4,7 @@ identifiers: snomed: '' lower_limit: '' mapper: -- klass: MimicObservationMapper +- klass: MimicDosageMapper params: constraints: itemid: '221289' diff --git a/concepts/Dobutamine_dosage.yml b/concepts/Dobutamine_dosage.yml index 687e768..5db0a1c 100644 --- a/concepts/Dobutamine_dosage.yml +++ b/concepts/Dobutamine_dosage.yml @@ -4,7 +4,7 @@ identifiers: snomed: '' lower_limit: '' mapper: -- klass: MimicObservationMapper +- klass: MimicDosageMapper params: constraints: itemid: '221653' diff --git a/concepts/Norepinephrine_dosage.yml b/concepts/Norepinephrine_dosage.yml index c73c2bf..59b0436 100644 --- a/concepts/Norepinephrine_dosage.yml +++ b/concepts/Norepinephrine_dosage.yml @@ -4,7 +4,7 @@ identifiers: snomed: '' lower_limit: '' mapper: -- klass: MimicObservationMapper +- klass: MimicDosageMapper params: constraints: itemid: '221906' diff --git a/concepts/Vancomycine_dosage.yml b/concepts/Vancomycine_dosage.yml index b9d9fce..4f57af2 100644 --- a/concepts/Vancomycine_dosage.yml +++ b/concepts/Vancomycine_dosage.yml @@ -4,7 +4,7 @@ identifiers: snomed: '' lower_limit: '' mapper: -- klass: MimicObservationMapper +- klass: MimicDosageMapper params: constraints: itemid: '225798' diff --git a/concepts/Vasopressine_dosage.yml b/concepts/Vasopressine_dosage.yml index 21acf64..84381d1 100644 --- a/concepts/Vasopressine_dosage.yml +++ b/concepts/Vasopressine_dosage.yml @@ -4,7 +4,7 @@ identifiers: snomed: '' lower_limit: '' mapper: -- klass: MimicObservationMapper +- klass: MimicDosageMapper params: constraints: itemid: '222315' From 345c761bca1531b3ee72c92cb1ee10d65681fef7 Mon Sep 17 00:00:00 2001 From: Paul-B98 <115164840+Paul-B98@users.noreply.github.com> Date: Fri, 4 Oct 2024 15:37:23 +0200 Subject: [PATCH 08/10] fix mimic concepts --- concepts/Creatinine_absolute_serum.yml | 6 +++--- concepts/Gender.yml | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/concepts/Creatinine_absolute_serum.yml b/concepts/Creatinine_absolute_serum.yml index 3b1cd79..b017c79 100644 --- a/concepts/Creatinine_absolute_serum.yml +++ b/concepts/Creatinine_absolute_serum.yml @@ -8,10 +8,10 @@ mapper: params: constraints: itemid: '220615' - schema: mimic_hosp - table: labevents + schema: mimiciv_icu + table: chartevents source: mimiciv - unit: '' + unit: 'mg/dl' name: Creatinine_absolute_serum unit: mg/dl upper_limit: '1000000' diff --git a/concepts/Gender.yml b/concepts/Gender.yml index e6f34fb..c292eac 100644 --- a/concepts/Gender.yml +++ b/concepts/Gender.yml @@ -6,10 +6,12 @@ lower_limit: '' mapper: - klass: MimicObservationMapper params: - constraints: - itemid: '226228' - schema: mimiciv_icu - table: chartevents + fields: + value: gender + timestamp: anchor_year + constraints: {} + schema: mimiciv_hosp + table: patients source: mimiciv unit: '' - klass: EICUPationObservationMapper From cdc83336010405a13511746965d4bce270548a65 Mon Sep 17 00:00:00 2001 From: Paul-B98 <115164840+Paul-B98@users.noreply.github.com> Date: Mon, 7 Oct 2024 17:09:08 +0200 Subject: [PATCH 09/10] fix uo concept for mimic --- concepts/UrineVolume.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/concepts/UrineVolume.yml b/concepts/UrineVolume.yml index a834e03..496041a 100644 --- a/concepts/UrineVolume.yml +++ b/concepts/UrineVolume.yml @@ -6,10 +6,14 @@ lower_limit: '0' mapper: - klass: MimicObservationMapper params: - constraints: - itemid: '' + constraints: {} schema: mimiciv_derived - table: urineoutput + table: urine_output + fields: + value: urineoutput + joins: + mimiciv_icu.icustays: + mimiciv_icu.icustays.stay_id: mimiciv_derived.urine_output.stay_id source: mimiciv unit: ml name: UrineVolume From 53f849d23f50eb17f9628f60ce08265643a5d51e Mon Sep 17 00:00:00 2001 From: Paul-B98 <115164840+Paul-B98@users.noreply.github.com> Date: Mon, 7 Oct 2024 17:32:27 +0200 Subject: [PATCH 10/10] add eICU concepts --- concepts/BodyWeight.yml | 8 ++++++++ concepts/BreathingRate.yml | 8 ++++++++ concepts/SystolicBloodPressure.yml | 32 ++++++++++++++++++++++-------- 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/concepts/BodyWeight.yml b/concepts/BodyWeight.yml index 88ddf3c..a933346 100644 --- a/concepts/BodyWeight.yml +++ b/concepts/BodyWeight.yml @@ -12,6 +12,14 @@ mapper: table: chartevents source: mimiciv unit: kg +- klass: EICUPationObservationMapper + params: + fields: + value: admissionWeight + schema: eicu_crd + table: patient + source: eicu + unit: cm name: BodyWeight unit: kg upper_limit: '500' diff --git a/concepts/BreathingRate.yml b/concepts/BreathingRate.yml index 2cf2d89..da86c10 100644 --- a/concepts/BreathingRate.yml +++ b/concepts/BreathingRate.yml @@ -12,6 +12,14 @@ mapper: table: chartevents source: mimiciv unit: 1/min +- klass: EICUObservationMapper + params: + fields: + value: respiration + schema: eicu_crd + table: vitalperiodic + source: eicu + unit: 1/min name: BreathingRate unit: 1/min upper_limit: '100' diff --git a/concepts/SystolicBloodPressure.yml b/concepts/SystolicBloodPressure.yml index 61dc35d..eb0a821 100644 --- a/concepts/SystolicBloodPressure.yml +++ b/concepts/SystolicBloodPressure.yml @@ -8,11 +8,27 @@ identifiers: loinc: "8480-6" schema: FHIRObservation mapper: - - klass: MimicObservationMapper - source: mimiciv - unit: mmHg - params: - schema: mimiciv_icu - table: chartevents - constraints: - itemid: ["220050", "220179"] \ No newline at end of file +- klass: MimicObservationMapper + source: mimiciv + unit: mmHg + params: + schema: mimiciv_icu + table: chartevents + constraints: + itemid: ["220050", "220179"] +- klass: EICUObservationMapper + params: + fields: + value: systemicsystolic + schema: eicu_crd + table: vitalperiodic + source: eicu + unit: mmHg +- klass: EICUObservationMapper + params: + fields: + value: noninvasivesystolic + schema: eicu_crd + table: vitalaperiodic + source: eicu + unit: mmHg \ No newline at end of file