Skip to content

Commit 3275690

Browse files
kellyspethalistairewj
authored andcommitted
Update colloid_bolus.sql
1) Edit datatable names so they are compatible with BigQuery; 2) also change from UNION to "UNION ALL"
1 parent 61ae77e commit 3275690

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

mimic-iii/concepts/fluid_balance/colloid_bolus.sql

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ with t1 as
1515
when mv.amountuom = 'ml'
1616
then mv.amount
1717
else null end) as amount
18-
from inputevents_mv mv
18+
from `physionet-data.mimiciii_clinical.inputevents_mv` mv
1919
where mv.itemid in
2020
(
2121
220864, -- Albumin 5% 7466 132 7466
@@ -44,7 +44,7 @@ with t1 as
4444
, cv.charttime
4545
-- carevue always has units in millilitres (or null)
4646
, round(cv.amount) as amount
47-
from inputevents_cv cv
47+
from `physionet-data.mimiciii_clinical.inputevents_cv` cv
4848
where cv.itemid in
4949
(
5050
30008 -- Albumin 5%
@@ -82,7 +82,7 @@ with t1 as
8282
, ce.charttime
8383
-- carevue always has units in millilitres (or null)
8484
, round(ce.valuenum) as amount
85-
from chartevents ce
85+
from `physionet-data.mimiciii_clinical.chartevents` ce
8686
where ce.itemid in
8787
(
8888
2510 -- DEXTRAN LML 10%
@@ -103,18 +103,19 @@ from t1
103103
-- just because the rate was high enough, does *not* mean the final amount was
104104
where amount > 100
105105
group by t1.icustay_id, t1.charttime
106-
UNION
106+
UNION ALL
107107
select
108108
icustay_id
109109
, charttime
110110
, sum(amount) as colloid_bolus
111111
from t2
112112
group by t2.icustay_id, t2.charttime
113-
UNION
113+
UNION ALL
114114
select
115115
icustay_id
116116
, charttime
117117
, sum(amount) as colloid_bolus
118118
from t3
119119
group by t3.icustay_id, t3.charttime
120120
order by icustay_id, charttime;
121+

0 commit comments

Comments
 (0)