calculate.dih: Calculcates the number of days each patient spent in hospital...

calculate.dihR Documentation

Calculcates the number of days each patient spent in hospital during the DAOH period of each index event.

Description

Calculcates the number of days each patient spent in hospital during the DAOH period of each index event.

Usage

calculate.dih(
  index.op.dt,
  daoh.event.dt,
  index.event.id.col.name = "index.event.id",
  cropped.admission.start.col.name = "cropped.admission.start",
  cropped.admission.end.col.name = "cropped.admission.end"
)

Arguments

index.op.dt

A data.table that minimally has a patient identifier, a unique index event identifier for each event, and a date on which it occurred. Will be modified by reference to have a days in hospital column for each index event.

daoh.event.dt

A data.table with index event identifier, and all admissions found within the DAOH period of that index event, cropped so that they are not outside the DAOH limits, or overlapping patient death, generated by consolidate.events.

index.event.id.col.name

Character name of the index event identifier column (Default: 'index.event.id')

cropped.admission.start.col.name

Character name of the column with admission start dates that do not go outside the DAOH period (Default: 'cropped.admission.start')

cropped.admission.end.col.name

Character name of the column with admission end dates that do not go outside the DAOH period (Default: 'cropped.admission.end')

Value

A data.table that is index.op.dt, but with a column named 'dd' (days dead). The input index.op.dt will be modified by reference, so it's not strictly necessary to use the output.


mattmoo/daohtools documentation built on Feb. 5, 2023, 5:38 a.m.