plot_admissions_discharges_day_of_week: Average daily hospital arrivals and discharges

View source: R/plot_admissions_discharges_day_of_week.R

plot_admissions_discharges_day_of_weekR Documentation

Average daily hospital arrivals and discharges

Description

plot_admissions_discharges_day_of_week returns average daily hospital arrivals and discharges by days of the week either as a plot (default) or a dataframe.

Usage

plot_admissions_discharges_day_of_week(
  data,
  startDate,
  endDate,
  returnPlot = TRUE,
  hospitalName = "Hospital name"
)

Arguments

data

Hospital episode data with at least the following fields:

  • Admissions - date of admission;

  • Discharges - date of discharge;

  • IDcol - patient pseudo ID;

  • PatientType - the admission type, distinguishing emergency from other admissions

  • EpisodeNumber - episode ID;

  • WardCode - ward where the episode took place.

startDate

Date of earliest discharge to be included in the analysis.

endDate

Date of latest admission to be included in the analysis.

returnPlot

If TRUE returns a plot, otherwise returns a dataframe.

hospitalName

Name of the hospital.

Value

A plot (default) or a dataframe showing average admissions and discharges on each day of the week.

Examples

## Not run: 
plot_admissions_discharges_day_of_week(
  data = example_data,
  startDate = "2015-01-01 00:00:00",
  endDate = "2015-02-01 00:00:00",
  returnPlot = TRUE
)

## End(Not run)


HorridTom/hospitalflow documentation built on June 14, 2022, noon