You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
drug_exposure_start_datetime or drug_exposure_end_datetime are null (because there is no end charttime in inputevents_cv).
As provided on physionet "For amounts received (usually volumes), the CHARTTIME represents the time at which that volume was received. That is, it can be considered an “end time”, i.e. X millilitres of solution was administered to the patient by this CHARTTIME. For rates, the CHARTTIME represents the time at which that rate was set. That is, it can be considered a “start time”, i.e. the patient is now receiving X mcg/kg/min of a drug at this CHARTTIME".
We choose not to infer missing times. So amount have no starttime and rates have no endtime!
SELECT concept_name, drug_type_concept_id, count(1)
FROM drug_exposure
JOIN concept ON drug_type_concept_id = concept_id
GROUP BY concept_name, drug_type_concept_id ORDER BYcount(1) desc;
concept_name
drug_type_concept_id
count
Inpatient administration
38000180
53225
Prescription written
38000177
9715
explanation of the route_concept_id
SELECT distinct(concept_name)
FROM drug_exposure
JOIN concept ON route_concept_id = concept_id;
concept_name
Intraocular
Infusion, intravenous catheter, continuous
Subcutaneous
Injection, intravenous, rapid push
Nasal
No matching concept
Sublingual
Buccal
Oral
Intrathecal
Intraperitoneal
Rectal
Endotracheopulmonary
Intracerebroventricular
Genitourinary therapy
Auricular
Administration of substance via oral route
Intramuscular
Administration of substance via subcutaneous route
Intravenous injection
Regional perfusion
Intraarticular
Intravaginal
Inhalation
Haemodialysis
Intraventricular cardiac
Transdermal
Epidural
Topical
Intravenous
Intrapleural
repartition of drug, with non omop mimic labels
-- as used in prescriptions table (= prescribed medications)SELECT drug_source_value, count(1)
FROM drug_exposure
WHERE drug_type_concept_id =38000177-- concept.concept_name = 'Prescription written'GROUP BY1ORDER BYcount(1) desclimit10;
drug_source_value
count
Potassium Chloride
477
0.9% Sodium Chloride
378
D5W
334
NS
297
Insulin
274
Furosemide
253
Iso-Osmotic Dextrose
238
Magnesium Sulfate
220
SW
198
Acetaminophen
183
repartition of drug, with omop concept = RxNorm mapping
-- as used in prescriptions table (= prescribed medications)SELECT concept_id, concept_name, count(1)
FROM drug_exposure
JOIN CONCEPT ON drug_concept_id = concept_id
WHERE drug_type_concept_id =38000177-- concept.concept_name = 'Prescription written'GROUP BY1, 2ORDER BYcount(1) desclimit10;
concept_id
concept_name
count
19096877
Anhydrous Dextrose
407
0
No matching concept
385
967823
Sodium Chloride
322
19010309
Water
260
40220357
1000 ML Sodium Chloride 9 MG/ML Injection
205
36249737
250 ML Glucose 50 MG/ML Injection
199
1718752
50 ML Potassium Chloride 0.4 MEQ/ML Injection
165
1596977
Regular Insulin, Human
164
40221385
100 ML Sodium Chloride 9 MG/ML Injection
152
35603227
4 ML Furosemide 10 MG/ML Injection
139
drugs are linked in fact_relationship table
-- two levels of links to represent linkorderid and orderid in mimic-- Warning : fact_id_1 and fact_id_2 may be the solution or the main drugSELECTdrug_1.drug_source_valueas drug_1, drug_2.drug_source_valueas drug_2
FROM
(
SELECT fact_id_1, fact_id_2
FROM fact_relationship
WHERE fact_id_1 IN
(
SELECT drug_exposure_id
FROM drug_exposure
WHERE drug_type_concept_id =38000180-- concept.concept_name = 'Inpatient administration'
)
) as couple
JOIN drug_exposure drug_1 ONdrug_1.drug_exposure_id= fact_id_1
JOIN drug_exposure drug_2 ONdrug_2.drug_exposure_id= fact_id_2
WHEREdrug_1.drug_source_value!=drug_2.drug_source_valueANDdrug_1.drug_source_valueis not nullANDdrug_2.drug_source_valueis not nullLIMIT10;
drug_1
drug_2
Cefazolin
NaCl 0.9%
Norepinephrine
NaCl 0.9%
Potassium Chloride
KCL (Bolus)
Solution
Propofol
NaCl 0.9%
Pantoprazole (Protonix)
NaCl 0.9%
Norepinephrine
Solution
Famotidine (Pepcid)
Levofloxacin
Dextrose 5%
Calcium Gluconate (CRRT)
Dextrose 5%
NaCl 0.9%
Norepinephrine
to extract only the non omop mimic id from inputevents_cv
-- warning : when the drug is IV, with a rate record, drug_exposure_end_datetime is always null-- warning : when the drug is IV, whis an amount recorded drug_exposure_start_datetime is always nullSELECT*FROM drug_exposure
WHERE drug_source_concept_id IN
(
SELECT concept_id
FROM concept
WHERE concept_name ILIKE '%carevue%'
)
AND drug_type_concept_id =38000180; -- concept.concept_name = 'Inpatient administration'
to extract only the non omop mimic id from inputevents_mv
SELECT*FROM drug_exposure
WHERE drug_source_concept_id IN
(
SELECT concept_id
FROM concept
WHERE concept_name ILIKE '%metavision%'
)
AND drug_type_concept_id =38000180; -- concept.concept_name = 'Inpatient administration'
to find IV continuous drugs recorded in rate
SELECT distincton (drug_source_value) quantity, dose_unit_source_value, drug_source_value, drug_source_concept_id, drug_exposure_start_datetime, drug_exposure_end_datetime
FROM drug_exposure
WHERE route_concept_id =45879918-- concept.concept_name = 'Infusion, intravenous catheter, continuous'AND dose_unit_source_value ILIKE '%/%'ORDER BY drug_source_value, drug_exposure_start_datetime
LIMIT10;
quantity
dose_unit_source_value
drug_source_value
drug_source_concept_id
drug_exposure_start_datetime
drug_exposure_end_datetime
300
mL/hour
Albumin 25%
2001030521
2135-05-17 18:22:00
2135-05-17 17:22:00
499.99998
mL/hour
Albumin 5%
2001030523
2130-11-14 19:19:00
2130-11-14 18:49:00
1.0016694
mg/min
Amiodarone
2001027331
2101-06-06 23:44:00
2101-06-06 17:00:00
0.5
mg/hour
Ativan
2001024300
2110-06-18 11:00:00
0.1000033297
mg/kg/hour
Cisatracurium
2001027337
2181-05-20 22:06:00
2181-05-20 21:57:00
49.9999986
mL/hour
D5 1/2NS
2001028689
2130-08-13 09:00:00
2130-08-13 04:00:00
49.9999986
mL/hour
D5LR
2001028691
2181-05-23 19:56:00
2181-05-23 11:10:00
249.991524
mL/hour
D5NS
2001028690
2185-08-14 14:56:00
2185-08-14 11:00:00
0.2001280807
mcg/kg/hour
Dexmedetomidine (Precedex)
2001030569
2133-11-15 03:00:00
2133-11-14 20:25:00
150
mL/hour
Dextrose 5%
2001030526
2101-06-02 02:49:00
2101-06-01 20:10:00
to find IV continuous drugs recorded in amount
SELECT distincton (drug_source_value) quantity, dose_unit_source_value, drug_source_value, drug_source_concept_id, drug_exposure_start_datetime, drug_exposure_end_datetime
FROM drug_exposure
WHERE route_concept_id =45879918-- concept.concept_name = 'Infusion, intravenous catheter, continuous'AND dose_unit_source_value NOT ILIKE '%/%'ORDER BY drug_source_value, drug_exposure_start_datetime
LIMIT10;