Skip to content

Commit

Permalink
Version 0.5.2 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mbranca committed Jul 5, 2024
1 parent 2f520f3 commit 9225f06
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: SwissASR
Title: Automated Completion of the SwissEthics Annual Safety Report
Version: 0.5.1
Version: 0.5.2
Authors@R:
c(person(given = "Alan G.",
family = "Haynes",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SwissASR 0.5.2

* Correction of template inputs, dates formatting and additional note for SAEs tables.

# SwissASR 0.5.1

* Corrected the version of the word template, 2.1 instead of 1.1.
Expand Down
14 changes: 12 additions & 2 deletions R/asr.R
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ asr <- function(data,
# ## trt ----
# check_fac_char(data$trt)
# data$trt <- as.character(data$trt)
#
#

dfs <- asr_dataprep(data,
period_from = period_from,
period_to = period_to
Expand Down Expand Up @@ -382,8 +383,11 @@ asr <- function(data,
# body_add_par(x, pos = "after")
# }

# format the dates for the text
period_from_f <- format(period_from, format = "%d/%m/%Y")
period_to_f <- format(period_to, format = "%d/%m/%Y")

period <- glue("{period_from} to {period_to}")
period <- glue("{period_from_f} to {period_to_f}")
## New code to insert the fields instead of bookmarks
doc <- doc %>%
set_doc_properties(trial_title = get("trial_title"),
Expand Down Expand Up @@ -450,6 +454,12 @@ asr <- function(data,
cursor_bookmark("partsafety_tab") %>%
body_add_flextable(ft)

if(all(!is.na(n_per_arm))){
grp <- names(n_per_arm)
doc <- doc %>%
officer::set_doc_properties(text_groups =
paste0("Note: If the results are displayed by groups, N is the total and in parenthesis there are the events for ",grp[1]," and ", grp[2]," groups, respectively.") )
}


## line listing ----
Expand Down
4 changes: 2 additions & 2 deletions R/asr_skeleton.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ asr_skeleton <- function(){
args <- lapply(1:length(args), function(x){
arg <- names(args)[x]
helptext <- args_helpers[[arg]]
paste(arg, "=", deparse(args[[x]]), helptext)
paste(arg, "=", deparse(args[[x]]), ", ", helptext)
}) |>
paste(collapse = ", \n ")
paste(collapse = " \n ")

context <- rstudioapi:::getSourceEditorContext()
id <- context$id
Expand Down
Binary file modified inst/extdata/clino_annual_safety_report_fm.docx
Binary file not shown.

0 comments on commit 9225f06

Please sign in to comment.