findBaselineHospitalStay: Finds the length of a hospital stay at the baseline block

View source: R/helperFunctions.R

findBaselineHospitalStayR Documentation

Finds the length of a hospital stay at the baseline block

Description

Finds the length of hospital stays around baseline

Usage

findBaselineHospitalStay(
  serialDf,
  baselineDates = baselineInfo,
  blDayDiff = blDayDiff,
  idColumn = "PATIENT",
  startDateColumn = "VISIT_START",
  endDateColumn = "VISIT_END",
  blDateColumn = "VISIT",
  countNights = TRUE
)

Arguments

idColumn

name of ID column: default is PATIENT

startDateColumn

name of date column: default is VISIT_START. This column has to be of class Date

endDateColumn

name of date column: default is VISIT_END. This column has to be of class Date

countNights

whether to count nights or days in hopsital (if night, than an outpatient stay has length 0, otherwise 1)

df

the data frame to check

dayDiff

time around baseline (default: 90 days, will look three months before and after baseline)

Value

data frame with baseline measure or NA if no measurement was close to baseline


smm52/timeBlocks documentation built on Nov. 27, 2022, 3:54 a.m.