diff --git a/NAMESPACE b/NAMESPACE index d0323b8c4..753576404 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -156,6 +156,7 @@ export(read_sc_all_alarms_telecare) export(read_sc_all_care_home) export(read_sc_all_home_care) export(read_sc_all_sds) +export(run_episode_file) export(setup_keyring) export(start_fy) export(start_fy_quarter) diff --git a/man/correct_cij_vars.Rd b/man/correct_cij_vars.Rd index 558514dc6..bf28f9b2f 100644 --- a/man/correct_cij_vars.Rd +++ b/man/correct_cij_vars.Rd @@ -1,17 +1,23 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/create_episode_file.R +% Please edit documentation in R/create_episode_file.R, R/run_episode_file.R \name{correct_cij_vars} \alias{correct_cij_vars} \title{Correct the CIJ variables} \usage{ +correct_cij_vars(data) + correct_cij_vars(data) } \arguments{ \item{data}{The in-progress episode file data.} } \value{ +The data with CIJ variables corrected. + The data with CIJ variables corrected. } \description{ +Correct the CIJ variables + Correct the CIJ variables } diff --git a/man/create_cohort_lookups.Rd b/man/create_cohort_lookups.Rd index 109869074..04b497359 100644 --- a/man/create_cohort_lookups.Rd +++ b/man/create_cohort_lookups.Rd @@ -1,9 +1,11 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/create_episode_file.R +% Please edit documentation in R/create_episode_file.R, R/run_episode_file.R \name{create_cohort_lookups} \alias{create_cohort_lookups} \title{Create the cohort lookups} \usage{ +create_cohort_lookups(data, year, update = latest_update()) + create_cohort_lookups(data, year, update = latest_update()) } \arguments{ @@ -14,8 +16,12 @@ create_cohort_lookups(data, year, update = latest_update()) \item{update}{The update to use.} } \value{ +The data unchanged (the cohorts are written to disk) + The data unchanged (the cohorts are written to disk) } \description{ +Create the cohort lookups + Create the cohort lookups } diff --git a/man/create_cost_inc_dna.Rd b/man/create_cost_inc_dna.Rd index 47c38b176..3dfb55d97 100644 --- a/man/create_cost_inc_dna.Rd +++ b/man/create_cost_inc_dna.Rd @@ -1,17 +1,23 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/create_episode_file.R +% Please edit documentation in R/create_episode_file.R, R/run_episode_file.R \name{create_cost_inc_dna} \alias{create_cost_inc_dna} \title{Create cost total net inc DNA} \usage{ +create_cost_inc_dna(data) + create_cost_inc_dna(data) } \arguments{ \item{data}{The in-progress episode file data.} } \value{ +The data with cost including dna. + The data with cost including dna. } \description{ +Create cost total net inc DNA + Create cost total net inc DNA } diff --git a/man/create_episode_file.Rd b/man/create_episode_file.Rd index 99f885127..e1bda32b9 100644 --- a/man/create_episode_file.Rd +++ b/man/create_episode_file.Rd @@ -7,13 +7,6 @@ create_episode_file( processed_data_list, year, - dd_data = read_file(get_source_extract_path(year, "DD")), - nsu_cohort = read_file(get_nsu_path(year)), - ltc_data = read_file(get_ltcs_path(year)), - slf_pc_lookup = read_file(get_slf_postcode_path()), - slf_gpprac_lookup = read_file(get_slf_gpprac_path(), col_select = c("gpprac", - "cluster", "hbpraccode")), - slf_deaths_lookup = read_file(get_slf_deaths_lookup_path(year)), write_to_disk = TRUE, anon_chi_out = TRUE ) @@ -23,18 +16,6 @@ create_episode_file( \item{year}{The year to process, in FY format.} -\item{dd_data}{The processed DD extract} - -\item{nsu_cohort}{The NSU data for the year} - -\item{ltc_data}{The LTC data for the year} - -\item{slf_pc_lookup}{The SLF Postcode lookup} - -\item{slf_gpprac_lookup}{The SLF GP Practice lookup} - -\item{slf_deaths_lookup}{The SLF deaths lookup.} - \item{write_to_disk}{(optional) Should the data be written to disk default is \code{TRUE} i.e. write the data to disk.} diff --git a/man/fill_missing_cij_markers.Rd b/man/fill_missing_cij_markers.Rd index 4795eed7a..ff5b7cf44 100644 --- a/man/fill_missing_cij_markers.Rd +++ b/man/fill_missing_cij_markers.Rd @@ -1,17 +1,23 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/create_episode_file.R +% Please edit documentation in R/create_episode_file.R, R/run_episode_file.R \name{fill_missing_cij_markers} \alias{fill_missing_cij_markers} \title{Fill any missing CIJ markers for records that should have them} \usage{ +fill_missing_cij_markers(data) + fill_missing_cij_markers(data) } \arguments{ \item{data}{The in-progress episode file data.} } \value{ +A data frame with CIJ markers filled in for those missing. + A data frame with CIJ markers filled in for those missing. } \description{ +Fill any missing CIJ markers for records that should have them + Fill any missing CIJ markers for records that should have them } diff --git a/man/join_cohort_lookups.Rd b/man/join_cohort_lookups.Rd index 3ef549cc3..ada4b60e0 100644 --- a/man/join_cohort_lookups.Rd +++ b/man/join_cohort_lookups.Rd @@ -1,9 +1,19 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/create_episode_file.R +% Please edit documentation in R/create_episode_file.R, R/run_episode_file.R \name{join_cohort_lookups} \alias{join_cohort_lookups} \title{Join cohort lookups} \usage{ +join_cohort_lookups( + data, + year, + update = latest_update(), + demographic_cohort = read_file(get_demographic_cohorts_path(year, update), col_select = + c("chi", "demographic_cohort")), + service_use_cohort = read_file(get_service_use_cohorts_path(year, update), col_select = + c("chi", "service_use_cohort")) +) + join_cohort_lookups( data, year, @@ -17,15 +27,19 @@ join_cohort_lookups( \arguments{ \item{data}{The in-progress episode file data.} -\item{year}{The year to process, in FY format.} +\item{year}{financial year in '1718' format} \item{update}{The update to use} \item{demographic_cohort, service_use_cohort}{The cohort data} } \value{ +The data including the Demographic and Service Use lookups. + The data including the Demographic and Service Use lookups. } \description{ +Join cohort lookups + Join cohort lookups } diff --git a/man/load_ep_file_vars.Rd b/man/load_ep_file_vars.Rd index 509b0e00c..8726fa3ad 100644 --- a/man/load_ep_file_vars.Rd +++ b/man/load_ep_file_vars.Rd @@ -1,9 +1,11 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/create_episode_file.R +% Please edit documentation in R/create_episode_file.R, R/run_episode_file.R \name{load_ep_file_vars} \alias{load_ep_file_vars} \title{Load the unneeded episode file variables} \usage{ +load_ep_file_vars(data, year) + load_ep_file_vars(data, year) } \arguments{ @@ -12,8 +14,12 @@ load_ep_file_vars(data, year) \item{year}{The year to process, in FY format.} } \value{ +The full SLF data. + The full SLF data. } \description{ +Load the unneeded episode file variables + Load the unneeded episode file variables } diff --git a/man/run_episode_file.Rd b/man/run_episode_file.Rd new file mode 100644 index 000000000..424d24afa --- /dev/null +++ b/man/run_episode_file.Rd @@ -0,0 +1,49 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/run_episode_file.R +\name{run_episode_file} +\alias{run_episode_file} +\title{Produce the Source Episode file} +\usage{ +run_episode_file( + processed_data_list, + year, + dd_data = read_file(get_source_extract_path(year, "DD")), + nsu_cohort = read_file(get_nsu_path(year)), + ltc_data = read_file(get_ltcs_path(year)), + slf_pc_lookup = read_file(get_slf_postcode_path()), + slf_gpprac_lookup = read_file(get_slf_gpprac_path(), col_select = c("gpprac", + "cluster", "hbpraccode")), + slf_deaths_lookup = read_file(get_slf_deaths_lookup_path(year)), + write_to_disk = TRUE, + anon_chi_out = TRUE +) +} +\arguments{ +\item{processed_data_list}{containing data from processed extracts.} + +\item{year}{The year to process, in FY format.} + +\item{dd_data}{The processed DD extract} + +\item{nsu_cohort}{The NSU data for the year} + +\item{ltc_data}{The LTC data for the year} + +\item{slf_pc_lookup}{The SLF Postcode lookup} + +\item{slf_gpprac_lookup}{The SLF GP Practice lookup} + +\item{slf_deaths_lookup}{The SLF deaths lookup.} + +\item{write_to_disk}{(optional) Should the data be written to disk default is +\code{TRUE} i.e. write the data to disk.} + +\item{anon_chi_out}{(Default:TRUE) Should \code{anon_chi} be used in the output +(instead of chi)} +} +\value{ +a \link[tibble:tibble-package]{tibble} containing the episode file +} +\description{ +Produce the Source Episode file +} diff --git a/man/store_ep_file_vars.Rd b/man/store_ep_file_vars.Rd index 880266d58..e4f73ac89 100644 --- a/man/store_ep_file_vars.Rd +++ b/man/store_ep_file_vars.Rd @@ -1,9 +1,11 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/create_episode_file.R +% Please edit documentation in R/create_episode_file.R, R/run_episode_file.R \name{store_ep_file_vars} \alias{store_ep_file_vars} \title{Store the unneeded episode file variables} \usage{ +store_ep_file_vars(data, year, vars_to_keep) + store_ep_file_vars(data, year, vars_to_keep) } \arguments{ @@ -15,8 +17,12 @@ store_ep_file_vars(data, year, vars_to_keep) will be stored.} } \value{ +\code{data} with only the \code{vars_to_keep} kept + \code{data} with only the \code{vars_to_keep} kept } \description{ +Store the unneeded episode file variables + Store the unneeded episode file variables }