calculate.dd: Calculcates the number of days each patient spent dead during...

calculate.ddR Documentation

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

Description

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

Usage

calculate.dd(
  index.op.dt,
  patient.dt,
  patient.id.col.name = "PRIM_HCU.IDencrypted",
  index.event.id.col.name = "index.event.id",
  daoh.period.end.col.name = "daoh.period.end",
  dod.col.name = "DOD"
)

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 dead column for each index event.

patient.dt

A data.table with patient details, minimally including date of death.

patient.id.col.name

Character name of the patient identifier column (Default: 'PRIM_HCU.IDencrypted')

index.event.id.col.name

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

daoh.period.end.col.name

Character name of the column that will be generated in index.op.dt to contain the end of each DAOH period (Default: 'daoh.period.end')

dod.col.name

Character name of the column that contains date of death in the patient.dt (Default: 'DOD')

daoh.limits

Numeric vector of length two with DAOH start and end relative to the index event.

Value

A data.table that is index.op.dt, but with a column named 'dih' (days in hospital). 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.