@@ -127,22 +127,6 @@ where bg.po2 is not null
127127select bg.*
128128 , ROW_NUMBER() OVER (partition by bg .subject_id , bg .charttime order by s2 .charttime DESC ) as lastRowFiO2
129129 , s2 .fio2_chartevents
130- -- create our specimen prediction
131- , 1 / (1 + exp(- (- 0 .02544
132- + 0 .04598 * po2
133- + coalesce(- 0 .15356 * spo2 , - 0 .15356 * 97 .49420 + 0 .13429 )
134- + coalesce( 0 .00621 * fio2_chartevents , 0 .00621 * 51 .49550 + - 0 .24958 )
135- + coalesce( 0 .10559 * hemoglobin , 0 .10559 * 10 .32307 + 0 .05954 )
136- + coalesce( 0 .13251 * so2 , 0 .13251 * 93 .66539 + - 0 .23172 )
137- + coalesce(- 0 .01511 * pco2 , - 0 .01511 * 42 .08866 + - 0 .01630 )
138- + coalesce( 0 .01480 * fio2 , 0 .01480 * 63 .97836 + - 0 .31142 )
139- + coalesce(- 0 .00200 * aado2 , - 0 .00200 * 442 .21186 + - 0 .01328 )
140- + coalesce(- 0 .03220 * bicarbonate , - 0 .03220 * 22 .96894 + - 0 .06535 )
141- + coalesce( 0 .05384 * totalco2 , 0 .05384 * 24 .72632 + - 0 .01405 )
142- + coalesce( 0 .08202 * lactate , 0 .08202 * 3 .06436 + 0 .06038 )
143- + coalesce( 0 .10956 * ph , 0 .10956 * 7 .36233 + - 0 .00617 )
144- + coalesce( 0 .00848 * o2flow , 0 .00848 * 7 .59362 + - 0 .35803 )
145- ))) as specimen_prob
146130from stg2 bg
147131left join stg_fio2 s2
148132 -- same patient
@@ -156,14 +140,8 @@ select
156140 stg3 .subject_id
157141 , stg3 .hadm_id
158142 , stg3 .charttime
159- -- raw data indicating sample type
143+ -- drop down text indicating the specimen type
160144 , specimen
161- -- prediction of specimen for obs missing the actual specimen
162- , case
163- when specimen is not null then specimen
164- when specimen_prob > 0 .75 then ' ART.'
165- else null end as specimen_pred
166- , specimen_prob
167145
168146 -- oxygen related parameters
169147 , so2
0 commit comments