Carson-Shively commited on
Commit
85293c3
·
verified ·
1 Parent(s): 5cfdba8

Create online_gold.sql

Browse files
Files changed (1) hide show
  1. data/gold/online_gold.sql +31 -0
data/gold/online_gold.sql ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CREATE OR REPLACE MACRO gold_online_row(
2
+ age, anaemia, diabetes, hbp, smoking, sex,
3
+ cpk, ef, plts, scr, na
4
+ ) AS TABLE
5
+ SELECT
6
+ age::DOUBLE AS age,
7
+ anaemia::INTEGER AS anaemia,
8
+ diabetes::INTEGER AS diabetes,
9
+ hbp::INTEGER AS high_blood_pressure,
10
+ smoking::INTEGER AS smoking,
11
+ sex::INTEGER AS sex,
12
+ cpk::INTEGER AS creatinine_phosphokinase,
13
+ ef::INTEGER AS ejection_fraction,
14
+ plts::DOUBLE AS platelets,
15
+ scr::DOUBLE AS serum_creatinine,
16
+ na::INTEGER AS serum_sodium,
17
+
18
+ ef_deficit(ef) AS ef_deficit,
19
+ sodium_dev(na) AS sodium_dev,
20
+ hyponatremia(na) AS hyponatremia,
21
+ hypernatremia(na) AS hypernatremia,
22
+ creatinine_high(scr) AS creatinine_high,
23
+ cpk_very_high(cpk) AS cpk_very_high,
24
+ thrombocytopenia(plts) AS thrombocytopenia,
25
+ thrombocytosis(plts) AS thrombocytosis,
26
+ ef_hfref(ef) AS ef_hfref,
27
+ ef_hfmrEF(ef) AS ef_hfmrEF,
28
+ ef_hfpef(ef) AS ef_hfpef,
29
+ comorbidity_count(anaemia, diabetes, hbp, smoking) AS comorbidity_count,
30
+ metabolic_risk(diabetes, hbp) AS metabolic_risk,
31
+ anaemia_or_ckd(anaemia, scr) AS anaemia_or_ckd;