consolidate.events: Runs the functions necessary to merge events so that they do...

consolidate.eventsR Documentation

Runs the functions necessary to merge events so that they do not overlap each other or patient death, and do not go outside the DAOH period. These events will be suitable for calculating DAOH.

Description

Runs the functions necessary to merge events so that they do not overlap each other or patient death, and do not go outside the DAOH period. These events will be suitable for calculating DAOH.

Usage

consolidate.events(
  index.op.dt,
  event.dt,
  patient.dt,
  daoh.limits,
  patient.id.col.name = "PRIM_HCU.IDencrypted",
  index.event.id.col.name = "index.event.id",
  index.event.date.col.name = "OP_ACDTE",
  admission.start.col.name = "EVSTDATE",
  admission.end.col.name = "EVENDATE",
  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 DAOH start and end date.

event.dt

A data.table of all other admission events that occurred, minimally with a patient identifier and event start and end dates.

patient.dt

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

daoh.limits

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

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

index.event.date.col.name

Character name of the index event date column (Default: 'OP_ACDTE')

admission.start.col.name

Character name of the column containing admission start dates (Default: 'EVSTDATE')

admission.end.col.name

Character name of the column containing admission end dates (Default: 'EVENDATE')

daoh.period.start.col.name

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

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

Value

A data.table with patient identifier, 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.


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