Closed mlondschien closed 9 months ago
Sorry, this response might be a bit late. Also not sure whether it is helpful, as what I'm going to suggest is not used anywhere and is therefore untested.
What is happening in
is that settings like id_var
(and more interesting for you time_vars
) are extracted from the "item" definition and used to override the table defaults. Only columns that are considered time_vars
are converted to difftime
, so if you make sure the column you'll be passing to weekday()
is not among time_vars
, you should be fine.
As to why we are doing this: for our work, we were never interested in absolute timestamps, but only times relative to certain events (icu admission, death, etc.). Additionally some datasets do not offer absolute timestamps (AUMC I believe) for something as central as timestamps (for time-series data) we needed to have something that works for all datasets.
I seem to remember that weekdays have been preserved in the MIMIC time-stamp-randomization procedure. If you're unsure, this'd be something to check if you want to use this data. Not sure about HiRID.
Thanks! So you're suggesting to pass another variable explicitly as time_vars
? Can this be empty?
One (slightly hacky) thing that could work is setting in your concept definition the field time_vars
to some column that (could be considered a "time var" but) is not the variable you're interested in using for other purposes (for mimic "admissions" that could be dischtime
).
Another thing you could try is setting this to a value like NULL
(or in JSON maybe null
). Not sure if this makes it through to load_id()
. If it does, you have more cleanly conveyed your intention of "not time vars". If it does not, it might be straightforward to fix this and I feel, this could potentially be useful.
Thanks. Late reply: null
does not work (gets ignored I think), but passing any other column works. This doesn't need to be a time variable, e.g., sex
in hirid works.
Hey @mlondschien, you are correct, I usually pass something that is a dummy variable (such as sex
or age
). It is a hacky way, but the abuse does not seem too bad.
I'd like to write a concept retrieving the day of the week at admission.
However,
fails with
Some monkey-debugging yields that
admittime
(andadmissiontime
in hirid) is internally transformed to adifftime
(relative to hospital admission?) somewhere. Why? How can I implement the above concept?