clean_hosp_network: Clean Patient Location History/Hospital Network Data

View source: R/clean_hosp_network.R

clean_hosp_networkR Documentation

Clean Patient Location History/Hospital Network Data

Description

To use other hospital network functions in this package, your data must have columns for: patient's first unit and patient's next unit or patient's first room and patient's next room. There might be multiple rows per patient, but each row should always have a beginning and ending room and/or unit for each encounter. This function might be able to help get your data in that format.

Usage

clean_hosp_network(
  data,
  uniqueID,
  startDate,
  endDate,
  unitName = NULL,
  roomNum = NULL
)

Arguments

data

A data.frame containing patient location history data

uniqueID

An unquoted column name for the unique identifier for each encounter or patient

startDate

Unquoted column name for the column containing the start date for an encounter

endDate

Unquoted column name for the column containing the end date for an encounter

unitName

Optional, unquoted column name for the column containing the unit name data

roomNum

Optional, unquoted column name for the column containing the room number data

Value

A data.frame containing the cleaned patient location history data

Examples

hn_data <- hosp_network_data # read in example data provided in package
cleaned_hn_data <- clean_hosp_network(data = hn_data, uniqueID = UniqueEncountID, startDate = BeginDate, endDate = EndDate, unitName = UnitName, roomNum = RoomNumber) # clean the data using specific columns in the dataset

cleaned2 <- clean_hosp_network(data = hn_data, uniqueID = UniqueEncountID, startDate = BeginDate, endDate = EndDate, roomNum = RoomNumber) # clean the data again, but omit the unit name data

cleaned3 <- clean_hosp_network(data = hn_data, uniqueID = UniqueEncountID, startDate = BeginDate, endDate = EndDate, unitName = UnitName) # clean the data again, but omit the room number data

npeters1322/hospEpi documentation built on April 30, 2022, 6:12 p.m.