prune.events.to.period: Match index events to admissions that fall within the...

View source: R/calculate.R

prune.events.to.periodR Documentation

Match index events to admissions that fall within the corresponding DAOH period.

Description

Match index events to admissions that fall within the corresponding DAOH period.

Usage

prune.events.to.period(
  index.op.dt,
  event.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"
)

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.

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

Value

A data.table with patient identifier, index event identifier, and all admission found within the DAOH period of that index event.


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