Skip to contents

This function fills out the SwissEthics annual safety report template with a much as possible. Minor (formatting) changes will still be required after generation of the report.

Usage

asr(
  data,
  target = "tmp.docx",
  trial_title = "TRIAL NAME",
  protocol_number = "default",
  basec_number = "default",
  snctp_number = "default",
  swissmedic_number = "default",
  ec_name = "default",
  tr_number = "default",
  product_name = "default",
  sponsor_contact = "default name, default number, default email",
  inst_name_address = "default name, default address",
  n_centers_t = "default",
  n_centers_p = "default",
  n_centers_c = "default",
  n_centers_o = "default",
  n_pat_t = 500,
  n_pat_e = 300,
  n_pat_c = 100,
  n_pat_p = 15,
  n_centers_t_ch = "default",
  n_centers_p_ch = "default",
  n_centers_c_ch = "default",
  n_centers_o_ch = "default",
  n_pat_t_ch = 500,
  n_pat_e_ch = 300,
  n_pat_c_ch = 100,
  n_pat_p_ch = 15,
  n_per_arm = c(grp1 = 150, grp2 = 150),
  report_date = format(Sys.Date(), format = "%d/%m/%Y"),
  period_from = as.Date("2020-11-02"),
  period_to = as.Date("2020-11-17"),
  template = system.file("extdata/clino_annual_safety_report_fm.docx", package =
    "SwissASR"),
  international = FALSE,
  trial_type = "imp",
  var_class = "class",
  var_sae_n = "sae_n",
  var_part_id = "record_id",
  var_age = "age",
  var_sex = "sex",
  var_country = "country",
  var_site = "site",
  var_sae = "sae",
  var_date_onset = "sae_date",
  var_trt = "trt",
  var_date_trt_start = "sae_trtstart",
  var_date_trt_stop = "sae_trtstop",
  var_outcome = "outcome",
  var_comment = "comment",
  var_relation = "related",
  var_expected = "expected",
  var_devdef = "devdef",
  var_devattr = "devattr",
  var_devint = "devint",
  var_safetymeasure = "safetymeasure",
  var_tx = NULL
)

Arguments

data

dataframe containing safety data

target

filename to save the report to

trial_title

name of the trial

protocol_number

trial code/protocol number

basec_number

BASEC number

snctp_number

SNCTP number

swissmedic_number

Swissmedic number

ec_name

EC name (Lead EC and/concerned EC)

tr_number

Number for Transplantation Clinical Trials (FOPH number)

product_name

product name or intervention

sponsor_contact

contact details of sponsor(-investigator)

inst_name_address

name and address of institute

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

target number of participants

n_pat_e

number of enrolled participants

n_pat_c

number of completed participants

n_pat_p

number of prematurely terminated participants

n_centers_t_ch

total number of participating centres in CH

n_centers_p_ch

planned number of participating centres in CH

n_centers_c_ch

number of closed centres in CH

n_centers_o_ch

number of open centres in CH

n_pat_t_ch

target number of participants in CH

n_pat_e_ch

number of enrolled participants in CH

n_pat_c_ch

number of completed participants in CH

n_pat_p_ch

number of prematurely terminated participants in CH

n_per_arm

number of enrolled participants per arm, list with group 1 and 2, define here the names of your groups as in the data

report_date

report date

period_from

start of reporting period

period_to

end of reporting period

template

path to template file

international

internation or national trial (logical)

trial_type

one of imp, medical device, other. Abbreviations OK.

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 occured

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 ended

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

var_devattr

variable containing whether the SAE is attributable to the device

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

Value

nothing in R, creates a docx file in the target location

Details

Use of the var_tx argument results in the indicated variable being included in the line listing.

Examples


data(asr_sae)
file <- tempfile("asr", fileext = ".docx")
asr(asr_sae, file)
#> Error in "run(\"osascript\", script_path)": ! System command 'osascript' failed

# # more usual use will require passing more information:
# asr(asr_sae, file,
#     # trial info
#     trial_title = "Example Trial Name",
#     protocol_number = "20221002130",
#     basec_number = "",
#     snctp_number = "202200458",
#     swissmedic_number = "....",
#     ec_name = "Kantonale Ethikskommision Bern",
#     tr_number = "",
#     product_name = "Drug name",
#     international = FALSE,
#     trial_type = "imp",
#     # Sponsor info
#     sponsor_contact = "Sponsor name, Sponsor phone number, Sponsor email",
#     inst_name_address = "Institute name, Institute address",
#     # site info
#     n_centers_t = 20,        # total number
#     n_centers_p = "default", # planned
#     n_centers_c = "default", # closed
#     n_centers_o = "default", # open
#     # participant info
#     n_pat_t = 1000,          # target
#     n_pat_e = 300,           # enrolled
#     n_pat_c = 0,             # complete
#     n_pat_p = 0,             # prematurely terminated
#     # report info
#     report_date = format(Sys.Date(), format = "%d/%m/%Y"),
#     period_from = as.Date("2020-11-02"),
#     period_to = as.Date("2020-11-17"),
#     # variable mapping
#     var_class = "class",
#     var_sae_n = "sae_n", #sae ID
#     var_part_id = "record_id", #participant ID
#     var_age = "age",
#     var_sex ="sex",
#     var_country = "country",
#     var_site = "site",
#     var_sae = "sae",
#     var_date_onset = "sae_date",
#     var_trt = "trt",
#     var_date_trt_start = "sae_trtstart",
#     var_date_trt_stop = "sae_trtstop",
#     var_outcome = "outcome",
#     var_comment = "comment",
#     var_relation = "related",
#     var_expected = "expected",
#     var_safetymeasure = "safetymeasure"
#     )