Derive in-hospital death, length of stay, and discharge disposition.
Value
The input with three columns added or replaced:
in_hospital_death:FALSEfor discharge alive andTRUEfor in-hospital death fromDIED.los_days: elapsed days fromLOS, including zero for same-day stays. Values outside the HCUP inpatient range of 0 to 365 whole days become missing.discharge_disposition: numeric codes fromDISPUNIFORM. Usenis_label()after collecting ornis_design()to attach factor labels. Codes 1, 2, 5, 6, 7, and 20 distinguish routine home/self-care, short-term hospital transfer, other facility transfer, home health care, discharge against medical advice, and in-hospital death. Codes 21 (court/law enforcement) and 99 (alive, destination unknown) are valid codes.
For a lazy DuckDB input, the result is a lazy query.
Details
In-hospital death uses DIED. Discharge disposition uses
DISPUNIFORM. Length of stay uses LOS, including zero for same-day
stays. Missing values, HCUP sentinel values, and invalid codes produce
missing outcomes.
See also
Derive outcomes, comorbidities, and costs, nis_cost()
Other outcomes and costs:
nis_comorbidity(),
nis_comorbidity_condition_map(),
nis_cost(),
nis_cost_provenance()
Examples
nis_open(nis_example(years = 2024)) |>
nis_outcomes() |>
dplyr::count(discharge_disposition) |>
dplyr::collect() |>
nis_label()
#> # A tibble: 8 × 2
#> discharge_disposition n
#> <fct> <dbl>
#> 1 Transfer to another short-term hospital 12
#> 2 Discharged/transferred to court/law enforcement 12
#> 3 Alive, destination unknown 12
#> 4 Routine discharge to home/self-care 12
#> 5 Transfer to SNF, intermediate care, or another facility 12
#> 6 Home health care 12
#> 7 Left against medical advice 12
#> 8 Died in hospital 12