beds_available_between: beds_available_between

View source: R/between.R

beds_available_betweenR Documentation

beds_available_between

Description

Filters a dataframe of Bed Inventory data where the InventoryStartDate and InventoryEndDate overlap the date range specified. Useful for excluding providers from Utilization reporting who do not have active bed/unit inventory and bed/unit inventory data not active during the specified date range.

Usage

beds_available_between(., start = NULL, end = NULL, lgl = FALSE)

Arguments

start

Default = ReportStart, character/date of the start of the date range. Characters in format mdY, Ymd, dmY acceptable. Will be automatically retrieved from parent environments if not specified. If start is named other than ReportStart, it must be specified.

end

Default = ReportEnd, character/date of the end of the date range. Characters in format mdY, Ymd, dmY acceptable. Will be automatically retrieved from parent environments if not specified. If end is named other than ReportEnd, it must be specified.

lgl

Default = FALSE, logical, flag to force logical vector output.

Details

Context-sensitive: Automatically detects if nested inside of filter call, if so returns logical instead of data.frame. Enrollment-related functions require Enrollment data elements such as Entry Date, Exit Date, Move In Date, and Project Type (of the Enrollment's Project). Project Descriptor-related functions require Project data elements such as Operating Start/End dates and Bed Inventory Start/End dates.

Value

data.frame/logical after filtering/applying conditional to the appropriate columns

See Also

Other _between: between_df(), entered_between(), exited_between(), operating_between(), served_between(), stayed_between()

Examples

## Not run: 
library(dplyr)
ReportStart <- Sys.Date() - lubridate::weeks(4)
ReportEnd <- Sys.Date()
identical(
served_between(qpr_leavers),
qpr_leavers %>% filter(served_between(., lgl = TRUE))
)

## End(Not run)


COHHIO/HMIS documentation built on Sept. 8, 2024, 7:47 a.m.