Skip to content

Commit

Permalink
Refine cli messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennit07 committed Oct 9, 2024
1 parent c1a3865 commit 8974ac5
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 55 deletions.
2 changes: 1 addition & 1 deletion R/add_activity_after_death_flag.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ add_activity_after_death_flag <- function(
dplyr::select(-death_date_boxi) %>%
dplyr::distinct()

cli::cli_alert_info("Add activity after death flag function started at {Sys.time()}")
cli::cli_alert_info("Add activity after death flag function finished at {Sys.time()}")

return(final_data)
}
Expand Down
2 changes: 1 addition & 1 deletion R/add_hri_variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ flag_non_scottish_residents <- function(
) %>%
dplyr::select(-"dummy_postcode", -"eng_prac")

cli::cli_alert_info("Add HRI variables function started at {Sys.time()}")
cli::cli_alert_info("Add HRI variables function finished at {Sys.time()}")

return(return_data)
}
Expand Down
2 changes: 1 addition & 1 deletion R/add_keep_population_flag.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ add_keep_population_flag <- function(individual_file, year) {
)
}

cli::cli_alert_info("Add keep population function started at {Sys.time()}")
cli::cli_alert_info("Add keep population function finished at {Sys.time()}")

return(individual_file)
}
Expand Down
2 changes: 1 addition & 1 deletion R/add_nsu_cohort.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ add_nsu_cohort <- function(
) %>%
dplyr::select(-dplyr::contains("_nsu"), -"has_chi")

cli::cli_alert_info("Add NSU cohort function started at {Sys.time()}")
cli::cli_alert_info("Add NSU cohort function finished at {Sys.time()}")

return(return_df)
}
2 changes: 1 addition & 1 deletion R/add_ppa_flag.R
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ add_ppa_flag <- function(data) {
.data$cij_ppa
))

cli::cli_alert_info("Add PPA flag function started at {Sys.time()}")
cli::cli_alert_info("Add PPA flag function finished at {Sys.time()}")

return(ppa_cij_data)
}
4 changes: 2 additions & 2 deletions R/aggregate_by_chi.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ aggregate_by_chi <- function(episode_file, year, exclude_sc_var = FALSE) {
)
individual_file <- individual_file[, year := year]

cli::cli_alert_info("Aggregate by CHI function started at {Sys.time()}")
cli::cli_alert_info("Aggregate by CHI function finished at {Sys.time()}")

# convert back to tibble
return(dplyr::as_tibble(individual_file))
Expand Down Expand Up @@ -272,7 +272,7 @@ aggregate_ch_episodes <- function(episode_file) {
# Convert back to tibble if needed
episode_file <- tibble::as_tibble(episode_file)

cli::cli_alert_info("Aggregate ch episodes function started at {Sys.time()}")
cli::cli_alert_info("Aggregate ch episodes function finished at {Sys.time()}")

return(episode_file)
}
2 changes: 1 addition & 1 deletion R/correct_demographics.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ correct_demographics <- function(data, year) {
data_chi
)

cli::cli_alert_info("Correct demographics function started at {Sys.time()}")
cli::cli_alert_info("Correct demographics function finished at {Sys.time()}")

return(data)
}
2 changes: 1 addition & 1 deletion R/cost_uplift.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ apply_cost_uplift <- function(data) {
# remove the last uplift column
dplyr::select(-"uplift")

cli::cli_alert_info("Apply cost uplift function started at {Sys.time()}")
cli::cli_alert_info("Apply cost uplift function finished at {Sys.time()}")

return(data)
}
Expand Down
16 changes: 8 additions & 8 deletions R/create_episode_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ store_ep_file_vars <- function(data, year, vars_to_keep) {
path = tempfile_path
)

cli::cli_alert_info("Store episode file variables function started at {Sys.time()}")
cli::cli_alert_info("Store episode file variables function finished at {Sys.time()}")

return(
dplyr::select(
Expand Down Expand Up @@ -324,7 +324,7 @@ load_ep_file_vars <- function(data, year) {

fs::file_delete(tempfile_path)

cli::cli_alert_info("Load episode file variable function started at {Sys.time()}")
cli::cli_alert_info("Load episode file variable function finished at {Sys.time()}")

return(full_data)
}
Expand Down Expand Up @@ -380,7 +380,7 @@ fill_missing_cij_markers <- function(data) {

return_data <- dplyr::bind_rows(non_fixable_data, fixed_data)

cli::cli_alert_info("Fill missing cij markers function started at {Sys.time()}")
cli::cli_alert_info("Fill missing cij markers function finished at {Sys.time()}")

return(return_data)
}
Expand Down Expand Up @@ -425,7 +425,7 @@ correct_cij_vars <- function(data) {
)
)

cli::cli_alert_info("Correct cij variables function started at {Sys.time()}")
cli::cli_alert_info("Correct cij variables function finished at {Sys.time()}")

return(data)
}
Expand All @@ -452,7 +452,7 @@ create_cost_inc_dna <- function(data) {
)
)

cli::cli_alert_info("Create cost inc dna function started at {Sys.time()}")
cli::cli_alert_info("Create cost inc dna function finished at {Sys.time()}")

return(data)
}
Expand All @@ -478,7 +478,7 @@ create_cohort_lookups <- function(data, year, update = latest_update()) {
write_to_disk = TRUE
)

cli::cli_alert_info("Create cohort lookups function started at {Sys.time()}")
cli::cli_alert_info("Create cohort lookups function finished at {Sys.time()}")

return(data)
}
Expand Down Expand Up @@ -514,7 +514,7 @@ join_cohort_lookups <- function(
by = "chi"
)

cli::cli_alert_info("Join cohort lookups function started at {Sys.time()}")
cli::cli_alert_info("Join cohort lookups function finished at {Sys.time()}")

return(join_cohort_lookups)
}
Expand Down Expand Up @@ -554,7 +554,7 @@ join_sc_client <- function(data,
)
}

cli::cli_alert_info("Join social care client function started at {Sys.time()}")
cli::cli_alert_info("Join social care client function finished at {Sys.time()}")

return(data_file)
}
Loading

0 comments on commit 8974ac5

Please sign in to comment.