Skip to contents

Produce a set of tests which can be used by most of the extracts. This will produce counts of various demographics using create_demog_test_flags() counts of episodes for every hbtreatcode using create_hb_test_flags(), a total cost for each hbtreatcode using create_hb_cost_test_flags(). It will also produce various summary statistics for bedday, cost and episode date variables.

Usage

produce_source_extract_tests(
  data,
  sum_mean_vars = c("beddays", "cost", "yearstay"),
  max_min_vars = c("record_keydate1", "record_keydate2", "cost_total_net", "yearstay"),
  add_hscp_count = TRUE
)

Arguments

data

new or old data for testing summary flags (data is from get_source_extract_path())

sum_mean_vars

variables used when selecting 'all' measures from calculate_measures()

max_min_vars

variables used when selecting 'min-max' from calculate_measures()

add_hscp_count

Default set to TRUE. For use where hscp variable is not available, specify FALSE.

Value

a dataframe with a count of each flag from calculate_measures()