Skip to content

Commit ad293e2

Browse files
authored
Merge pull request #1210 from MIT-LCP/fix_make
syntax fixes
2 parents 3e951e1 + e294a8e commit ad293e2

File tree

20 files changed

+38
-20
lines changed

20 files changed

+38
-20
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
run: |
2323
echo "Generating tables on BigQuery"
2424
cd mimic-iv/concepts
25-
bash make_concepts.sh > /dev/null
25+
bash make_concepts.sh

mimic-iv/concepts/make_concepts.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ do
3131

3232
# not skipping - so generate the table on bigquery
3333
echo "Generating ${TARGET_DATASET}.${tbl}"
34-
bq query --use_legacy_sql=False --replace --destination_table=${TARGET_DATASET}.${tbl} < ${d}/${fn}
34+
bq query --quiet --use_legacy_sql=False --replace --destination_table=${TARGET_DATASET}.${tbl} < ${d}/${fn}
3535
fi
3636
done
3737
done
@@ -43,5 +43,5 @@ do
4343
table=`echo $table_path | rev | cut -d/ -f1 | rev`
4444

4545
echo "Generating ${TARGET_DATASET}.${table}"
46-
bq query --use_legacy_sql=False --replace --destination_table=${TARGET_DATASET}.${table} < ${table_path}.sql
46+
bq query --quiet --use_legacy_sql=False --replace --destination_table=${TARGET_DATASET}.${table} < ${table_path}.sql
4747
done

mimic-iv/concepts/medication/norepinephrine.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ select
77
-- below row is written for completion, but doesn't impact rows
88
WHEN rateuom = 'mg/kg/min' THEN rate * 1000.0
99
ELSE rate END AS vaso_rate
10-
, rate as vaso_rate
1110
, amount as vaso_amount
1211
, starttime
1312
, endtime

mimic-iv/concepts/medication/norepinephrine_equivalent_dose.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ SELECT stay_id, starttime, endtime
1414
, 4) AS norepinephrine_equivalent_dose
1515
-- angotensin_ii*10 -- angitensin ii rarely used, currently not incorporated
1616
-- (it could be included due to norepinephrine sparing effects)
17-
AS norepinephrine_equivalent_dose
1817
FROM mimic_derived.vasoactive_agent
1918
WHERE norepinephrine IS NOT NULL
2019
OR epinephrine IS NOT NULL

mimic-iv/concepts/postgres/measurement/cardiac_marker.sql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@ SELECT
77
, MAX(charttime) AS charttime
88
, le.specimen_id
99
-- convert from itemid into a meaningful column
10-
, MAX(CASE WHEN itemid = 51002 THEN value ELSE NULL END) AS troponin_i
1110
, MAX(CASE WHEN itemid = 51003 THEN value ELSE NULL END) AS troponin_t
1211
, MAX(CASE WHEN itemid = 50911 THEN valuenum ELSE NULL END) AS ck_mb
12+
, MAX(CASE WHEN itemid = 50963 THEN valuenum ELSE NULL END) AS ntprobnp
1313
FROM mimic_hosp.labevents le
1414
WHERE le.itemid IN
1515
(
1616
-- 51002, -- Troponin I (troponin-I is not measured in MIMIC-IV)
1717
-- 52598, -- Troponin I, point of care, rare/poor quality
1818
51003, -- Troponin T
19-
50911 -- Creatinine Kinase, MB isoenzyme
19+
50911, -- Creatinine Kinase, MB isoenzyme
20+
50963 -- N-terminal (NT)-pro hormone BNP (NT-proBNP)
2021
)
22+
AND valuenum IS NOT NULL
2123
GROUP BY le.specimen_id
2224
;

mimic-iv/concepts/postgres/medication/dobutamine.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ DROP TABLE IF EXISTS dobutamine; CREATE TABLE dobutamine AS
33
-- This query extracts dose+durations of dopamine administration
44
select
55
stay_id, linkorderid
6+
-- all rows in mcg/kg/min
67
, rate as vaso_rate
78
, amount as vaso_amount
89
, starttime

mimic-iv/concepts/postgres/medication/dopamine.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ DROP TABLE IF EXISTS dopamine; CREATE TABLE dopamine AS
33
-- This query extracts dose+durations of dopamine administration
44
select
55
stay_id, linkorderid
6+
-- all rows in mcg/kg/min
67
, rate as vaso_rate
78
, amount as vaso_amount
89
, starttime

mimic-iv/concepts/postgres/medication/epinephrine.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ DROP TABLE IF EXISTS epinephrine; CREATE TABLE epinephrine AS
33
-- This query extracts dose+durations of epinephrine administration
44
select
55
stay_id, linkorderid
6+
-- all rows in mcg/kg/min
67
, rate as vaso_rate
78
, amount as vaso_amount
89
, starttime

mimic-iv/concepts/postgres/medication/norepinephrine.sql

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ DROP TABLE IF EXISTS norepinephrine; CREATE TABLE norepinephrine AS
33
-- This query extracts dose+durations of norepinephrine administration
44
select
55
stay_id, linkorderid
6-
, rate as vaso_rate
6+
-- two rows in mg/kg/min... rest in mcg/kg/min
7+
-- the rows in mg/kg/min are documented incorrectly
8+
, CASE WHEN rateuom = 'mg/kg/min' AND patientweight = 1 THEN rate
9+
-- below row is written for completion, but doesn't impact rows
10+
WHEN rateuom = 'mg/kg/min' THEN rate * 1000.0
11+
ELSE rate END AS vaso_rate
712
, amount as vaso_amount
813
, starttime
914
, endtime

mimic-iv/concepts/postgres/medication/phenylephrine.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ DROP TABLE IF EXISTS phenylephrine; CREATE TABLE phenylephrine AS
33
-- This query extracts dose+durations of phenylephrine administration
44
select
55
stay_id, linkorderid
6-
, rate as vaso_rate
6+
-- one row in mcg/min, the rest in mcg/kg/min
7+
, CASE WHEN rateuom = 'mcg/min' THEN rate / patientweight
8+
ELSE rate END as vaso_rate
79
, amount as vaso_amount
810
, starttime
911
, endtime

0 commit comments

Comments
 (0)