Skip to content

Commit

Permalink
add vasoactive agent changes to postgres scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
alistairewj committed Dec 15, 2021
1 parent 3e951e1 commit 7d4104c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions mimic-iv/concepts/postgres/medication/dobutamine.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ DROP TABLE IF EXISTS dobutamine; CREATE TABLE dobutamine AS
-- This query extracts dose+durations of dopamine administration
select
stay_id, linkorderid
-- all rows in mcg/kg/min
, rate as vaso_rate
, amount as vaso_amount
, starttime
Expand Down
1 change: 1 addition & 0 deletions mimic-iv/concepts/postgres/medication/dopamine.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ DROP TABLE IF EXISTS dopamine; CREATE TABLE dopamine AS
-- This query extracts dose+durations of dopamine administration
select
stay_id, linkorderid
-- all rows in mcg/kg/min
, rate as vaso_rate
, amount as vaso_amount
, starttime
Expand Down
1 change: 1 addition & 0 deletions mimic-iv/concepts/postgres/medication/epinephrine.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ DROP TABLE IF EXISTS epinephrine; CREATE TABLE epinephrine AS
-- This query extracts dose+durations of epinephrine administration
select
stay_id, linkorderid
-- all rows in mcg/kg/min
, rate as vaso_rate
, amount as vaso_amount
, starttime
Expand Down
6 changes: 6 additions & 0 deletions mimic-iv/concepts/postgres/medication/norepinephrine.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ DROP TABLE IF EXISTS norepinephrine; CREATE TABLE norepinephrine AS
-- This query extracts dose+durations of norepinephrine administration
select
stay_id, linkorderid
-- two rows in mg/kg/min... rest in mcg/kg/min
-- the rows in mg/kg/min are documented incorrectly
, CASE WHEN rateuom = 'mg/kg/min' AND patientweight = 1 THEN rate
-- below row is written for completion, but doesn't impact rows
WHEN rateuom = 'mg/kg/min' THEN rate * 1000.0
ELSE rate END AS vaso_rate
, rate as vaso_rate
, amount as vaso_amount
, starttime
Expand Down
4 changes: 3 additions & 1 deletion mimic-iv/concepts/postgres/medication/phenylephrine.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ DROP TABLE IF EXISTS phenylephrine; CREATE TABLE phenylephrine AS
-- This query extracts dose+durations of phenylephrine administration
select
stay_id, linkorderid
, rate as vaso_rate
-- one row in mcg/min, the rest in mcg/kg/min
, CASE WHEN rateuom = 'mcg/min' THEN rate / patientweight
ELSE rate END as vaso_rate
, amount as vaso_amount
, starttime
, endtime
Expand Down
5 changes: 4 additions & 1 deletion mimic-iv/concepts/postgres/medication/vasopressin.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ DROP TABLE IF EXISTS vasopressin; CREATE TABLE vasopressin AS
-- This query extracts dose+durations of vasopressin administration
select
stay_id, linkorderid
, rate as vaso_rate
-- three rows in units/min, rest in units/hour
-- the three rows in units/min look reasonable and fit with the patient course
, CASE WHEN rateuom = 'units/min' THEN rate * 60.0
ELSE rate END AS vaso_rate
, amount as vaso_amount
, starttime
, endtime
Expand Down

0 comments on commit 7d4104c

Please sign in to comment.