calculate.daoh: Calculates the number of days each patient spent alive and...

calculate.daohR Documentation

Calculates the number of days each patient spent alive and out of hospital during the DAOH period of each index event. Applies calculate.dih and calculate.dd, then sums.

Description

Calculates the number of days each patient spent alive and out of hospital during the DAOH period of each index event. Applies calculate.dih and calculate.dd, then sums.

Usage

calculate.daoh(
  index.op.dt,
  patient.dt,
  daoh.event.dt,
  patient.id.col.name = "PRIM_HCU.IDencrypted",
  index.event.id.col.name = "index.event.id",
  cropped.admission.start.col.name = "cropped.admission.start",
  cropped.admission.end.col.name = "cropped.admission.end",
  daoh.period.start.col.name = "daoh.period.start",
  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 in hospital column for each index event.

patient.dt

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

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.

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')

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')

daoh.period.start.col.name

Character name of the column in index.op.dt with the start of each DAOH period (Default: 'daoh.period.start')

daoh.period.end.col.name

Character name of the column in index.op.dt with 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')

Value

A data.table that is index.op.dt, but with columns for days dead, days in hospital, and days alive and out of hospital (dd, dih, daoh). 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.