MIT-LCP / eicu-code

Code and website related to the eICU Collaborative Research Database
https://eicu-crd.mit.edu
MIT License
307 stars 212 forks source link

labresults with the same labresultoffset #13

Closed yongfanbeta closed 7 years ago

yongfanbeta commented 7 years ago

@tompollard when I selected some variables from lab table, found out there are several different lab results with the same labresultoffset, it means different values in the same time? how can it be!

for example, patientunitstayid = 245087 and labresultoffset = 11, there are two different ph values.

alistairewj commented 7 years ago

It appears the labs were revised at a later time.

Here is a query that shows the issue you are raising, multiple distinct lab results at the same time:

select labname, labresultoffset
, count(labresult) as num_labs
, count(distinct labresult) as num_distinct_labs
from lab 
where patientunitstayid = 245087 
and labresultoffset = 11 
group by labname, labresultoffset
order by labname;
labname labresultoffset num_labs num_distinct_labs
Base Excess 11 2 2
FiO2 11 1 1
HCO3 11 2 2
O2 Sat (%) 11 2 2
paCO2 11 2 2
paO2 11 2 2
PEEP 11 1 1
pH 11 2 2
Respiratory Rate 11 1 1
Temperature 11 2 2
TV 11 1 1

When we add labresultrevisedoffset, which tracks the last change made to a lab, there are no longer two distinct labs at the same time.

select labname, labresultoffset, labresultrevisedoffset
, count(labresult) as num_labs
, count(distinct labresult) as num_distinct_labs
from lab 
where patientunitstayid = 245087 
and labresultoffset = 11 
group by labname, labresultoffset, labresultrevisedoffset
order by labname;
labname labresultoffset labresultrevisedoffset num_labs num_distinct_labs
Base Excess 11 52 1 1
Base Excess 11 78 1 1
FiO2 11 79 1 1
HCO3 11 52 1 1
HCO3 11 78 1 1
O2 Sat (%) 11 52 1 1
O2 Sat (%) 11 78 1 1
paCO2 11 52 1 1
paCO2 11 78 1 1
paO2 11 52 1 1
paO2 11 78 1 1
PEEP 11 79 1 1
pH 11 52 1 1
pH 11 78 1 1
Respiratory Rate 11 79 1 1
Temperature 11 52 1 1
Temperature 11 79 1 1
TV 11 79 1 1
yongfanbeta commented 7 years ago

thanks @alistairewj if I only use labresultrevisedoffset as our time to find variables, it exists same problem. for example, patientunitstayid = 141233 and labresultrevisedoffset = 1675. So if I want to find variables done in the same time, both labresultoffset and labresultrevisedoffset should be the same? I can't understand it, why two time?

alistairewj commented 7 years ago

Life is never easy!

Details on the columns are available here: http://eicu-crd.mit.edu/eicutables/lab/

Many reasons why labs could be entered at the same time. For example, they could be doing an arterial/mixed venous measurement at the same time to calculate oxygen consumption. More than that we can't tell you and you should consult with a domain expert.