Skip to content

Commit

Permalink
add extra help
Browse files Browse the repository at this point in the history
  • Loading branch information
aghaynes committed May 15, 2024
1 parent 1c358e3 commit 0932882
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 2 deletions.
52 changes: 51 additions & 1 deletion R/asr_skeleton.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,58 @@ asr_skeleton <- function(){

args$data <- "sae_data"

args_helpers <- list(
data = "# dataframe containing SAEs",
target = "# word file as output\n\n # TRIAL INFORMATION",
trial_title = "",
protocol_number = "",
basec_number = "",
snctp_number = "",
swissmedic_number = "",
ec_name = "# ethics committee",
product_name = "# product/intervention name\n\n # SPONSOR INFORMATION",
sponsor_contact = "",
inst_name_address = "\n\n # TRIAL PROGRESS",
n_centers_t = "# total number of participating centres",
n_centers_p = "# planned number of participating centres",
n_centers_c = "# number of closed centres",
n_centers_o = "# number of open centres",
n_pat_t = "# total target number of participants ",
n_pat_e = "# actual number of participants enrolled",
n_pat_c = "# number of participants completed",
n_pat_p = "# number of participants prematurely terminated\n\n # REPORT INFORMATION",
report_date = "# normally Sys.Date()",
period_from = "# date of previous report",
period_to = "# probably Sys.Date()-1",
template = "# Word file to use as the template",
international = "# TRUE if the trial is international",
trial_type = "# type of trial\n\n # VARIABLES IN data",
var_class = "# variable containing SAE class. Options allowed are 'SAE', 'SADR', 'SUSAR'",
var_sae_n = "# variable containing SAE ID",
var_part_id = "# variable containing participant ID",
var_age = "# variable containing participant age",
var_sex = "# variable containing participant sex",
var_country = "# variable containing participants country",
var_site = "# variable containing participants site",
var_sae = "# variable containing SAE type (description)",
var_date_onset = "# variable containing the date the SAE occurred",
var_trt = "# variable containing the treatment used to alleviate the SAE",
var_date_trt_start = "# variable containing the date that the treatment started",
var_date_trt_stop = "# variable containing the date that the treatment stopped",
var_outcome = "# variable containing the outcome of the SAE",
var_comment = "# variable containing any comment",
var_relation = "# variable containing the relationship to randomized intervention",
var_expected = "# variable saying whether the SAE was expected",
var_devdef = "# variable containing whether the SAE is a device deficiency (MD trials only)",
var_devattr = "# variable containing whether the SAE is attributable to the device (MD trials only)",
var_devint = "# variable containing whether the SAE is attributable to an intervention in the trial",
var_safetymeasure = "# variable containing whether the SAE required safety related measures",
var_tx = "# variable indicating the intervention group. If provided, this variable will be included in the line listing")

args <- lapply(1:length(args), function(x){
paste(names(args)[x], "=", deparse(args[[x]]))
arg <- names(args)[x]
helptext <- args_helpers[[arg]]
paste(arg, "=", deparse(args[[x]]), helptext)
}) |>
paste(collapse = ", \n ")

Expand Down
2 changes: 1 addition & 1 deletion inst/rstudio/addins.dcf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Name: Add asr template
Name: Add asr call template
Description: Adds a template function call for the asr function to the current file.
Binding: asr_skeleton
Interactive: false

0 comments on commit 0932882

Please sign in to comment.