You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AUMCdb, like eICU, does not provide dates but instead reports times since admission. For this reason, both databases are loaded in ricu via that load_eiau function.
Problem
The calculation of times -- while similar -- is not equal between eICU and AUMCdb. While in eICU times denote the number of minutes from unit admit time, in AUMCdb they represent milliseconds since the first ICU admission. That is, while eICU provides the time since current admission, AUMCdb gives the time since the first admission. load_eiau however treats them both the same, which leads to incorrect times for AUMCdb
Example
library(ricu)
# Two admissions for one patient. Note that the first admittedat is always 0, # whereas the second is relative to the firstaumc$admissions[aumc$admissions$patientid==38, c("admissionid", "admittedat", "dischargedat")]
#> admissionid admittedat dischargedat#> 1: 40 0 56820000#> 2: 41 164280000 325620000# For heart rates during the first admission, everything works correctlyaumc$numericitems[aumc$numericitems$admissionid==40&aumc$numericitems$itemid==6640, c("admissionid", "measuredat", "value")][1]
#> admissionid measuredat value#> 1: 40 300000 86
load_concepts("hr", "aumc", patient_ids=40, interval= mins(1L))[1]
#> admissionid measuredat hr#> <int> <drtn> <dbl>#> 1 40 5 mins 86ricu:::ms_as_mins(300000-0) # <-- correct#> Time difference of 5 mins# For heart rates during the second admission, ricu calculates difftimes since *first* admission aumc$numericitems[aumc$numericitems$admissionid==41&aumc$numericitems$itemid==6640, c("admissionid", "measuredat", "value")][1]
#> admissionid measuredat value#> 1: 41 167280000 118
load_concepts("hr", "aumc", patient_ids=41, interval= mins(1L))[1]
#> admissionid measuredat hr#> <int> <drtn> <dbl>#> 1 41 2788 mins 118ricu:::ms_as_mins(167280000-0) # <-- incorrect#> Time difference of 2788 minsricu:::ms_as_mins(167280000-164280000) # <-- should be this#> Time difference of 50 mins
Note that the output above has been been shortened a little for readability.
The text was updated successfully, but these errors were encountered:
Very good catch, thanks @prockenschaub. The PR currently seems to have a lot going on, unrelated to this issue (if I am not mistaken).
Could you open a simple pull request building off the current main which bumped ricu to 0.6.0? It would simplify things considerably for me. Thanks for the help!
AUMCdb, like eICU, does not provide dates but instead reports times since admission. For this reason, both databases are loaded in ricu via that
load_eiau
function.Problem
The calculation of times -- while similar -- is not equal between eICU and AUMCdb. While in eICU times denote the number of minutes from unit admit time, in AUMCdb they represent milliseconds since the first ICU admission. That is, while eICU provides the time since current admission, AUMCdb gives the time since the first admission.
load_eiau
however treats them both the same, which leads to incorrect times for AUMCdbExample
Note that the output above has been been shortened a little for readability.
The text was updated successfully, but these errors were encountered: