Affected functions: Any functions using date-time variables
daily_census
day_time_of_admission
episodes_of_care
er_los
hospital_fiscal_year
icu_entry
icu_los
length_of_stay
season
The above-mentioned functions currently do not work if a user preprocesses the date-time inputs with lubridate::ymd_hm() prior to running the function. Ideally, functions using date-time variables should check the format of the user-provided input, and only apply ymd_hm() if the input is of type character.
As an example, the icu_entry function runs fine when date-times are provided as characters:
Given that many users will preprocess date-times prior to deriving additional variables, it would be useful to adapt the functions dealing with date-time variables to handle both character and POSIXct formats.
We should probably add this as a utility function that checks/converts date-times. This function can also produce a warning message for entries that don't have a time stamp (but only date). This would automatically also address issue #68.
New Feature Request
Affected functions: Any functions using date-time variables
daily_census
day_time_of_admission
episodes_of_care
er_los
hospital_fiscal_year
icu_entry
icu_los
length_of_stay
season
The above-mentioned functions currently do not work if a user preprocesses the date-time inputs with
lubridate::ymd_hm()
prior to running the function. Ideally, functions using date-time variables should check the format of the user-provided input, and only applyymd_hm()
if the input is of typecharacter
.As an example, the
icu_entry
function runs fine when date-times are provided ascharacters
:However, the function will return a warning that all "All formats failed to parse" if a user provides date-times in
POSIXct/POSIXt
format:Given that many users will preprocess date-times prior to deriving additional variables, it would be useful to adapt the functions dealing with date-time variables to handle both character and POSIXct formats.
We should probably add this as a utility function that checks/converts date-times. This function can also produce a warning message for entries that don't have a time stamp (but only date). This would automatically also address issue #68.