Skip to contents

length_of_stay returns Length of Stay for hospital admissions in unit of hours and days.

Usage

length_of_stay(
  ipadmdad,
  adm_dtvar = "admission_date_time",
  dis_dtvar = "discharge_date_time"
)

Arguments

ipadmdad

(data.frame or data.table)
Table with all relevant encounters of interest from DRM table "ipadmdad" (see GEMINI Data Repository Dictionary). Must contain three fields: encounter ID (genc_id), and two date-time variables corresponding to admission and discharge (typically admission_date_time and discharge_date_time). Date-time variables must be in "yyyy-mm-dd hh:mm" format.

adm_dtvar

(character)
Character string defining the column name for admission date-time (typically "admission_date_time").

dis_dtvar

(character)
Character string defining the column name for discharge date-time (typically "discharge_date_time").

Value

data.table with the same number of rows as input "ipadmdad", with additional derived numeric fields labelled as "los_hrs_derived" and "los_days_derived".

Details

Length of Stay is defined as the duration of hospital in-patient stay, thus, calculated as (discharge_date_time - admission_date_time). It is currently a major patient outcome in various research studies and one of the physician performance indicators in MyPracticeReport. Researchers might consider a few modifications to this metric. One example will be adjusting for patient who receives palliative care. If transfer to palliative unit within the hospital is trackable (e.g. through room transfer data), then it might be good idea to re-define discharge point to the palliative unit entrance. This will reduce bias in metric since patient care under palliative order is very different.

Warning

NA values in returned data.table indicates either missing admission/discharge date and time or its format is incorrect.

Note

The function takes two optional input arguments defining the admission and discharge date-time variables of interest (by default admission_date_time and discharge_date_time).