-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patients seen refinement and excel summaries
- Loading branch information
1 parent
14e4c73
commit c2639a2
Showing
4 changed files
with
278 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
07_publication/script/functions/compile_pat_seen_adj_excel_summary.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
##########################################. | ||
### Compile appointments excel summary ### | ||
##########################################. | ||
|
||
# Author: Bex Madden | ||
# Date: 2024-07-23 | ||
|
||
|
||
compile_pat_seen_adj_summary <- function(){ | ||
|
||
# get file names | ||
#filnames <- list.files(ref_dir) | ||
|
||
# load parquet files | ||
p1 <- read_parquet(paste0(pat_seen_dir, "adj_wait_grp_all.parquet")) | ||
p2 <- read_parquet(paste0(pat_seen_dir, "adj_wait_grp_all_sex.parquet")) | ||
p3 <- read_parquet(paste0(pat_seen_dir, "adj_wait_grp_all_age.parquet")) | ||
p4 <- read_parquet(paste0(pat_seen_dir, "adj_wait_grp_all_simd.parquet")) | ||
|
||
p5 <- read_parquet(paste0(pat_seen_dir, "adj_wait_grp_mth.parquet")) | ||
p6 <- read_parquet(paste0(pat_seen_dir, "adj_wait_grp_mth_sex.parquet")) | ||
p7 <- read_parquet(paste0(pat_seen_dir, "adj_wait_grp_mth_age.parquet")) | ||
p8 <- read_parquet(paste0(pat_seen_dir, "adj_wait_grp_mth_simd.parquet")) | ||
|
||
p9 <- read_parquet(paste0(pat_seen_dir, "adj_wait_grp_qt.parquet")) | ||
p10 <- read_parquet(paste0(pat_seen_dir, "adj_wait_grp_qt_sex.parquet")) | ||
p11 <- read_parquet(paste0(pat_seen_dir, "adj_wait_grp_qt_age.parquet")) | ||
p12 <- read_parquet(paste0(pat_seen_dir, "adj_wait_grp_qt_simd.parquet")) | ||
|
||
# name tabs | ||
list_tabs <- list( | ||
all_hb = p1, | ||
all_sex = p2, | ||
all_age = p3, | ||
all_simd = p4, | ||
|
||
month_hb = p5, | ||
month_sex = p6, | ||
month_age = p7, | ||
month_simd = p8, | ||
|
||
quart_hb = p9, | ||
quart_sex = p10, | ||
quart_age = p11, | ||
quart_simd = p12) | ||
|
||
# save output as excel doc | ||
filepath = paste0(shorewise_pub_measure_summaries_dir, "/patients_seen_adjusted_summary.xlsx") | ||
export(list_tabs, file = filepath) | ||
|
||
# format report | ||
wb <- loadWorkbook(filepath) | ||
|
||
for(i in 1:length(list_tabs)){ | ||
setColWidths(wb, sheet = i, cols = 1:9, widths = "auto") | ||
} | ||
|
||
saveWorkbook(wb, filepath, overwrite =TRUE) | ||
|
||
} | ||
|
||
|
||
|
64 changes: 64 additions & 0 deletions
64
07_publication/script/functions/compile_pat_seen_unadj_excel_summary.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
##########################################. | ||
### Compile appointments excel summary ### | ||
##########################################. | ||
|
||
# Author: Bex Madden | ||
# Date: 2024-07-23 | ||
|
||
|
||
compile_pat_seen_unadj_summary <- function(){ | ||
|
||
# get file names | ||
#filnames <- list.files(ref_dir) | ||
|
||
# load parquet files | ||
p1 <- read_parquet(paste0(pat_seen_dir, "unadj_wait_grp_all.parquet")) | ||
p2 <- read_parquet(paste0(pat_seen_dir, "unadj_wait_grp_all_sex.parquet")) | ||
p3 <- read_parquet(paste0(pat_seen_dir, "unadj_wait_grp_all_age.parquet")) | ||
p4 <- read_parquet(paste0(pat_seen_dir, "unadj_wait_grp_all_simd.parquet")) | ||
|
||
p5 <- read_parquet(paste0(pat_seen_dir, "unadj_wait_grp_mth.parquet")) | ||
p6 <- read_parquet(paste0(pat_seen_dir, "unadj_wait_grp_mth_sex.parquet")) | ||
p7 <- read_parquet(paste0(pat_seen_dir, "unadj_wait_grp_mth_age.parquet")) | ||
p8 <- read_parquet(paste0(pat_seen_dir, "unadj_wait_grp_mth_simd.parquet")) | ||
|
||
p9 <- read_parquet(paste0(pat_seen_dir, "unadj_wait_grp_qt.parquet")) | ||
p10 <- read_parquet(paste0(pat_seen_dir, "unadj_wait_grp_qt_sex.parquet")) | ||
p11 <- read_parquet(paste0(pat_seen_dir, "unadj_wait_grp_qt_age.parquet")) | ||
p12 <- read_parquet(paste0(pat_seen_dir, "unadj_wait_grp_qt_simd.parquet")) | ||
|
||
# name tabs | ||
list_tabs <- list( | ||
all_hb = p1, | ||
all_sex = p2, | ||
all_age = p3, | ||
all_simd = p4, | ||
|
||
month_hb = p5, | ||
month_sex = p6, | ||
month_age = p7, | ||
month_simd = p8, | ||
|
||
quart_hb = p9, | ||
quart_sex = p10, | ||
quart_age = p11, | ||
quart_simd = p12) | ||
|
||
# save output as excel doc | ||
filepath = paste0(shorewise_pub_measure_summaries_dir, "/patients_seen_unadjusted_summary.xlsx") | ||
export(list_tabs, file = filepath) | ||
|
||
# format report | ||
wb <- loadWorkbook(filepath) | ||
|
||
for(i in 1:length(list_tabs)){ | ||
setColWidths(wb, sheet = i, cols = 1:9, widths = "auto") | ||
} | ||
|
||
saveWorkbook(wb, filepath, overwrite =TRUE) | ||
|
||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters