Skip to content

Commit

Permalink
Update create_episode_file
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennit07 committed Sep 26, 2023
1 parent bc5a423 commit 3064388
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions R/create_episode_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#'
#' @return a [tibble][tibble::tibble-package] containing the episode file
#' @export
#' @family episode_file
create_episode_file <- function(
processed_data_list,
year,
Expand Down Expand Up @@ -158,6 +159,7 @@ create_episode_file <- function(
#' @param vars_to_keep a character vector of the variables to keep, all others
#' will be stored.
#'
#' @family episode_file
#' @return `data` with only the `vars_to_keep` kept
store_ep_file_vars <- function(data, year, vars_to_keep) {
tempfile_path <- get_file_path(
Expand Down Expand Up @@ -195,6 +197,7 @@ store_ep_file_vars <- function(data, year, vars_to_keep) {
#' @inheritParams create_episode_file
#' @inheritParams store_ep_file_vars
#'
#' @family episode_file
#' @return The full SLF data.
load_ep_file_vars <- function(data, year) {
tempfile_path <- get_file_path(
Expand Down Expand Up @@ -222,6 +225,7 @@ load_ep_file_vars <- function(data, year) {
#'
#' @inheritParams store_ep_file_vars
#'
#' @family episode_file
#' @return A data frame with CIJ markers filled in for those missing.
fill_missing_cij_markers <- function(data) {
fixable_data <- data %>%
Expand Down Expand Up @@ -276,6 +280,7 @@ fill_missing_cij_markers <- function(data) {
#'
#' @inheritParams store_ep_file_vars
#'
#' @family episode_file
#' @return The data with CIJ variables corrected.
correct_cij_vars <- function(data) {
check_variables_exist(
Expand Down Expand Up @@ -317,6 +322,7 @@ correct_cij_vars <- function(data) {
#'
#' @inheritParams store_ep_file_vars
#'
#' @family episode_file
#' @return The data with cost including dna.
create_cost_inc_dna <- function(data) {
check_variables_exist(data, c("cost_total_net", "attendance_status"))
Expand All @@ -341,6 +347,7 @@ create_cost_inc_dna <- function(data) {
#' @inheritParams store_ep_file_vars
#' @inheritParams create_demographic_cohorts
#'
#' @family episode_file
#' @return The data unchanged (the cohorts are written to disk)
create_cohort_lookups <- function(data, year, update = latest_update()) {
# Use future so the cohorts can be created simultaneously (in parallel)
Expand Down Expand Up @@ -377,6 +384,7 @@ create_cohort_lookups <- function(data, year, update = latest_update()) {
#' @inheritParams get_demographic_cohorts_path
#' @param demographic_cohort,service_use_cohort The cohort data
#'
#' @family episode_file
#' @return The data including the Demographic and Service Use lookups.
join_cohort_lookups <- function(
data,
Expand Down

0 comments on commit 3064388

Please sign in to comment.