From e9fe2ada8d61aebdc19ea0983fa0cd189ec9b35b Mon Sep 17 00:00:00 2001 From: Federico Baratin Date: Thu, 8 Aug 2024 17:58:35 +0200 Subject: [PATCH 01/18] Updates with INVESTOGATOR records logic. --- inst/templates/ad_adface.R | 54 +++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/inst/templates/ad_adface.R b/inst/templates/ad_adface.R index 844cbef0..50cea792 100644 --- a/inst/templates/ad_adface.R +++ b/inst/templates/ad_adface.R @@ -120,22 +120,46 @@ adface <- derive_vars_joined( ATPTREF = FATPTREF, ATPT = FATPT, ATPTN = FATPTNUM - ) %>% - # Step 8 - Creating severity records from Diameter for Redness, Swelling,etc - # Note: Basically, this function will derive and create the severity records from the - # diameter record for the particular events that user wants. If you want to derive the Severity - # from diameter, even though you have the severity in SDTM level, this function will re-derive the - # severity and remove the derived SDTM severity records. - derive_diam_to_sev_records( - diam_code = "DIAMETER", - faobj_values = c("REDNESS", "SWELLING"), - testcd_sev = "SEV", - test_sev = "Severity/Intensity", - none = 0, - mild = 2, - mod = 5, - sev = 10 ) + + +# Version 0.3.0: as per CBER requirement, Investigator assessment has been added into FACE, +# which is identified by "INVESTIGATOR" value, in FAEVAL. +# If you need to derive maximum severity from mm reported by subject, please discard Investigator +# records from the below function. Otherwise, remove intermediates datasets. + +inv_mm <- adface %>% + filter(FAOBJ %in% c("REDNESS", "SWELLING") & FAEVAL == "INVESTIGATOR") + +subj_mm <- adface %>% + filter(!(FAOBJ %in% c("REDNESS", "SWELLING") & FAEVAL == "INVESTIGATOR")) + + +adface <- derive_diam_to_sev_records( + dataset = subj_mm, + diam_code = "DIAMETER", + faobj_values = c("REDNESS", "SWELLING"), + testcd_sev = "SEV", + test_sev = "Severity/Intensity", + none = 0, + mild = 2, + mod = 5, + sev = 10 + ) %>% + bind_rows(inv_mm) %>% + arrange(STUDYID,USUBJID,FASEQ) %>% + # Please, consider which assessment is needed for your analysis. If you want to prioritize + # Instigator assessment, please proceed as follows. Otherwise, change FAEVAL order. + derive_var_extreme_flag( + by = exprs(STUDYID, USUBJID, FATPTREF, FAOBJ, FATESTCD, FATPTNUM), + order = exprs(STUDYID, USUBJID, FATPTREF, FAOBJ, FATESTCD, FATPTNUM, FAEVAL), + new_var = ANL01FL, + mode = "first", + true_value = "Y", + false_value = NA_character_ + ) + + # Step 9 - Deriving Maximum Severity for Local and Systemic events adface <- adface %>% derive_extreme_records( From 1a938aa93d9d6623c6a80710aa66a8cafc67d968 Mon Sep 17 00:00:00 2001 From: Federico Baratin Date: Thu, 8 Aug 2024 18:10:51 +0200 Subject: [PATCH 02/18] Updated with CBER requirements for INV assessment. --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index d25a87e2..0ca74563 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # admiralvaccine 0.3.0 +## ADFACE update after CBER requirements for eDiary data + +- Updated ADFACE template as per new SDTM mapping of Investigator assessment for eDiary data, as recommended by CBER. The collection of the Investigator assessment can happen when data reported by the participants was deemed incorrect or the participant did not complete the eDiary. In case of these two scenarios, the Investigator assessment is collected within the eDiary platform as a separate record from the original data reported by the participant (if this is allowed by eCOA system) or in the study eCRF. This leads to a change in Solicited Adverse Event SDTM structure (FACE and VS). Additional records coming from Investigator assessment are added, which can be indentified through an evaluator variable (FAEVAL/VSEVAL). An update in ADFACE has been provided in order to reflect this changes in SDTM. (#243) + ## Breaking Changes - Removed `dataset_supp` and `dataset_suppex` arguments from `derive_vars_merged_vaccine()` as we are not combining the parental with supplementary inside the function, but can be optionally combined in the ADCE, ADFACE and ADIS templates using `combine_supp()` function from {metatools}. (#246) From 302fbf62b51097c503add8c81524c32b0cb37874 Mon Sep 17 00:00:00 2001 From: Arjun Rubalingam Date: Wed, 21 Aug 2024 19:22:17 +0530 Subject: [PATCH 03/18] Update ad_adface.R --- inst/templates/ad_adface.R | 58 +++++++++++++++----------------------- 1 file changed, 23 insertions(+), 35 deletions(-) diff --git a/inst/templates/ad_adface.R b/inst/templates/ad_adface.R index 50cea792..d99e70c9 100644 --- a/inst/templates/ad_adface.R +++ b/inst/templates/ad_adface.R @@ -120,23 +120,25 @@ adface <- derive_vars_joined( ATPTREF = FATPTREF, ATPT = FATPT, ATPTN = FATPTNUM - ) + ) %>% +# Please, consider which assessment is needed for your analysis. If you want to prioritize +# Instigator assessment, please proceed as follows. Otherwise, change FAEVAL order. + derive_var_extreme_flag( + by = exprs(STUDYID, USUBJID, FATPTREF, FAOBJ, FATESTCD, FATPTNUM), + order = exprs(STUDYID, USUBJID, FATPTREF, FAOBJ, FATESTCD, FATPTNUM, FAEVAL), + new_var = ANL01FL, + mode = "first", + true_value = "Y", + false_value = NA_character_ +) # Version 0.3.0: as per CBER requirement, Investigator assessment has been added into FACE, # which is identified by "INVESTIGATOR" value, in FAEVAL. -# If you need to derive maximum severity from mm reported by subject, please discard Investigator -# records from the below function. Otherwise, remove intermediates datasets. -inv_mm <- adface %>% - filter(FAOBJ %in% c("REDNESS", "SWELLING") & FAEVAL == "INVESTIGATOR") - -subj_mm <- adface %>% - filter(!(FAOBJ %in% c("REDNESS", "SWELLING") & FAEVAL == "INVESTIGATOR")) - - -adface <- derive_diam_to_sev_records( - dataset = subj_mm, +#step 8 - Derive the severity records from the Diameter records for the redness and swelling. +adface <- adface %>% derive_diam_to_sev_records( + filter_add = ANL01FL == 'Y', diam_code = "DIAMETER", faobj_values = c("REDNESS", "SWELLING"), testcd_sev = "SEV", @@ -145,26 +147,12 @@ adface <- derive_diam_to_sev_records( mild = 2, mod = 5, sev = 10 - ) %>% - bind_rows(inv_mm) %>% - arrange(STUDYID,USUBJID,FASEQ) %>% - # Please, consider which assessment is needed for your analysis. If you want to prioritize - # Instigator assessment, please proceed as follows. Otherwise, change FAEVAL order. - derive_var_extreme_flag( - by = exprs(STUDYID, USUBJID, FATPTREF, FAOBJ, FATESTCD, FATPTNUM), - order = exprs(STUDYID, USUBJID, FATPTREF, FAOBJ, FATESTCD, FATPTNUM, FAEVAL), - new_var = ANL01FL, - mode = "first", - true_value = "Y", - false_value = NA_character_ - ) - + ) # Step 9 - Deriving Maximum Severity for Local and Systemic events -adface <- adface %>% - derive_extreme_records( + adface <- adface %>% derive_extreme_records( dataset_add = adface, - filter = FATESTCD == "SEV", + filter = FATESTCD == "SEV" & ANL01FL == "Y", by_vars = exprs(USUBJID, FAOBJ, ATPTREF), order = exprs(AVAL), check_type = "none", @@ -173,12 +161,11 @@ adface <- adface %>% FATEST = "Maximum Severity", FATESTCD = "MAXSEV" ) - ) + ) %>% # Step 10 - Deriving Maximum Diameter for Administrative Site Reactions -adface <- adface %>% derive_extreme_records( dataset_add = adface, - filter = FAOBJ %in% c("REDNESS", "SWELLING") & FATESTCD == "DIAMETER", + filter = FAOBJ %in% c("REDNESS", "SWELLING") & FATESTCD == "DIAMETER" & ANL01FL == "Y", by_vars = exprs(USUBJID, FAOBJ, FALNKGRP), order = exprs(AVAL), check_type = "none", @@ -191,7 +178,7 @@ adface <- adface %>% # Step 11 - Deriving Maximum Temperature derive_extreme_records( dataset_add = adface, - filter = FAOBJ == "FEVER", + filter = FAOBJ == "FEVER" & ANL01FL == "Y", by_vars = exprs(USUBJID, FAOBJ, ATPTREF), order = exprs(VSSTRESN), check_type = "none", @@ -246,8 +233,8 @@ adface <- derive_vars_params( ) %>% # Step 13 - Maximum flag ANL01FL and ANL02FL derive_vars_max_flag( - flag1 = "ANL01FL", - flag2 = "ANL02FL" + flag1 = "ANL02FL", + flag2 = "ANL03FL" ) %>% # Step 14 - Creating flag variables for occurred events derive_vars_event_flag( @@ -303,3 +290,4 @@ if (!file.exists(dir)) { dir.create(dir, recursive = TRUE, showWarnings = FALSE) } save(admiralvaccine_adface, file = file.path(dir, "adface.rda"), compress = "bzip2") + From 97acb2cdc5b3fb644585a44195ed146e5d1025e2 Mon Sep 17 00:00:00 2001 From: Arjun Rubalingam Date: Wed, 21 Aug 2024 19:22:24 +0530 Subject: [PATCH 04/18] Update derive_diam_to_sev_records.Rd --- man/derive_diam_to_sev_records.Rd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/man/derive_diam_to_sev_records.Rd b/man/derive_diam_to_sev_records.Rd index 6890bf3a..6bc00127 100644 --- a/man/derive_diam_to_sev_records.Rd +++ b/man/derive_diam_to_sev_records.Rd @@ -6,6 +6,7 @@ \usage{ derive_diam_to_sev_records( dataset, + filter_add = NULL, diam_code = "DIAMETER", faobj_values = c("REDNESS", "SWELLING"), testcd_sev = "SEV", @@ -22,6 +23,8 @@ derive_diam_to_sev_records( The variables \code{USUBJID},\code{FAOBJ},\code{AVAL}, \code{AVALC}, \code{FATESTCD} and \code{FATEST} are expected for Input data set.} +\item{filter_add}{filter for the \code{dataset}.} + \item{diam_code}{Diameter record filter \emph{Permitted Value}: A character vector or scalar. From 7fe12b90856d98dd9a121ac65935c557dd32d05f Mon Sep 17 00:00:00 2001 From: Arjun Rubalingam Date: Wed, 21 Aug 2024 19:22:29 +0530 Subject: [PATCH 05/18] Update derive_diam_to_sev_records.R --- R/derive_diam_to_sev_records.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/derive_diam_to_sev_records.R b/R/derive_diam_to_sev_records.R index c5a3ca3e..a776ebca 100644 --- a/R/derive_diam_to_sev_records.R +++ b/R/derive_diam_to_sev_records.R @@ -7,7 +7,7 @@ #' #' The variables `USUBJID`,`FAOBJ`,`AVAL`, `AVALC`, `FATESTCD` and `FATEST` are expected #' for Input data set. -#' +#' @param filter_add filter for the `dataset`. #' @param diam_code Diameter record filter #' #' *Permitted Value*: A character vector or scalar. @@ -121,6 +121,7 @@ #' @family der_rec #' derive_diam_to_sev_records <- function(dataset, + filter_add = NULL, diam_code = "DIAMETER", faobj_values = c("REDNESS", "SWELLING"), testcd_sev = "SEV", @@ -140,6 +141,8 @@ derive_diam_to_sev_records <- function(dataset, optional = FALSE ) + filter_add <- assert_filter_cond(enexpr(filter_add), optional = TRUE) + # Checking & Removing the records which has severity records for the FAOBJ diam <- dataset %>% filter(FAOBJ %in% faobj_values) @@ -152,6 +155,7 @@ derive_diam_to_sev_records <- function(dataset, ds <- function(diam_code) { if (c(diam_code) %in% diam$FATESTCD) { sev <- fil_rec %>% + filter_if(filter_add) %>% filter(FAOBJ %in% faobj_values & FATESTCD %in% diam_code) %>% mutate( FATESTCD = testcd_sev, From c61d35969d2111dbe2e440a72f5f87d11c17e13c Mon Sep 17 00:00:00 2001 From: Arjun Rubalingam Date: Wed, 21 Aug 2024 19:22:34 +0530 Subject: [PATCH 06/18] Update test-derive_diam_to_sev_records.R --- .../test-derive_diam_to_sev_records.R | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/testthat/test-derive_diam_to_sev_records.R b/tests/testthat/test-derive_diam_to_sev_records.R index 1dfec63b..838712cc 100644 --- a/tests/testthat/test-derive_diam_to_sev_records.R +++ b/tests/testthat/test-derive_diam_to_sev_records.R @@ -180,15 +180,16 @@ test_that("derive_diam_to_sev_records Test 3: Check if the arguments `none`, test_that("derive_diam_to_sev_records Test 4: Check if the input dataset has severity records and remove those records correctly", { input <- tibble::tribble( - ~USUBJID, ~FAOBJ, ~AVAL, ~AVALC, ~ATPTREF, ~FATEST, ~FATESTCD, - "XYZ1001", "REDNESS", 1.5, "1.5", "VACCINATION 1", "Diameter", "DIAMETER", - "XYZ1001", "REDNESS", 11, "11", "VACCINATION 1", "Diameter", "DIAMETER", - "XYZ1001", "SWELLING", 6.5, "7.5", "VACCINATION 1", "Diameter", "DIAMETER", - "XYZ1001", "SWELLING", 4.5, "3.5", "VACCINATION 1", "Diameter", "DIAMETER", - "XYZ1001", "REDNESS", 1.5, "NONE", "VACCINATION 1", "Severity", "SEV", - "XYZ1001", "REDNESS", 11, "SEVERE", "VACCINATION 1", "Severity", "SEV", - "XYZ1001", "SWELLING", 6.5, "MODERATE", "VACCINATION 1", "Severity", "SEV", - "XYZ1001", "SWELLING", 4.5, "MILD", "VACCINATION 1", "Severity", "SEV" + ~USUBJID, ~FAOBJ, ~AVAL, ~AVALC, ~ATPTREF, ~FATEST, ~FATESTCD, ~FAEVAL, ~ANL01FL, + "XYZ1001", "REDNESS", 1.5, "1.5", "VACCINATION 1", "Diameter", "DIAMETER", "SUBJECT", "Y", + "XYZ1001", "REDNESS", 11, "11", "VACCINATION 1", "Diameter", "DIAMETER", "SUBJECT", "Y", + "XYZ1001", "SWELLING", 6.5, "7.5", "VACCINATION 1", "Diameter", "DIAMETER", "SUBJECT", "Y", + "XYZ1001", "SWELLING", 4.5, "3.5", "VACCINATION 1", "Diameter", "DIAMETER", "SUBJECT", "Y", + "XYZ1001", "REDNESS", 1.5, "NONE", "VACCINATION 1", "Severity", "SEV", "SUBJECT", "N", + "XYZ1001", "REDNESS", 1.5, "NONE", "VACCINATION 1", "Severity", "SEV", "INVESTIGATOR", "Y", + "XYZ1001", "REDNESS", 11, "SEVERE", "VACCINATION 1", "Severity", "SEV", "SUBJECT", "Y", + "XYZ1001", "SWELLING", 6.5, "MODERATE", "VACCINATION 1", "Severity", "SEV", "SUBJECT", "Y", + "XYZ1001", "SWELLING", 4.5, "MILD", "VACCINATION 1", "Severity", "SEV", "SUBJECT", "Y", ) format_avalc <- function(x) { @@ -201,7 +202,7 @@ test_that("derive_diam_to_sev_records Test 4: Check if the input dataset has } input <- input %>% - filter(FATESTCD != "SEV" & FAOBJ %in% c("REDNESS", "SWELLING")) + filter(ANL01FL == "Y" & FATESTCD != "SEV" & FAOBJ %in% c("REDNESS", "SWELLING")) expected1 <- input %>% mutate( @@ -224,6 +225,7 @@ test_that("derive_diam_to_sev_records Test 4: Check if the input dataset has actual_output <- derive_diam_to_sev_records( dataset = input, + filter_add = ANL01FL == "Y", diam_code = "DIAMETER", faobj_values = c("REDNESS", "SWELLING"), testcd_sev = "SEV", From eca13aadbcbc87a0db3fff8114ed99bb90e7085f Mon Sep 17 00:00:00 2001 From: Arjun Rubalingam Date: Wed, 21 Aug 2024 19:23:05 +0530 Subject: [PATCH 07/18] Update adface.Rmd --- vignettes/adface.Rmd | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/vignettes/adface.Rmd b/vignettes/adface.Rmd index b6ac9345..ec843797 100644 --- a/vignettes/adface.Rmd +++ b/vignettes/adface.Rmd @@ -295,6 +295,30 @@ dataset_vignette( display_vars = exprs(USUBJID, FAOBJ, AVAL, AVALC, ATPTREF, ATPTN) ) ``` +# Creating ANL01FL which would flag the records that will be considered for analysis and if there +is investigator and subject record for a same day, it would flag the Investigator record over the +subject record. +Note: Please, consider which assessment is needed for your analysis. If you want to prioritize +Instigator assessment, please proceed as follows. Otherwise, change FAEVAL order. + +```{r eval = TRUE} +adface <- adface %>% derive_var_extreme_flag( + by = exprs(STUDYID, USUBJID, FATPTREF, FAOBJ, FATESTCD, FATPTNUM), + order = exprs(STUDYID, USUBJID, FATPTREF, FAOBJ, FATESTCD, FATPTNUM, FAEVAL), + new_var = ANL01FL, + mode = "first", + true_value = "Y", + false_value = NA_character_ +) +``` + +```{r, echo=FALSE} +dataset_vignette( + adface, + display_vars = exprs(USUBJID, FAOBJ, ATPTREF, FATESTCD, FATEST, AVAL, ANL01FL), + filter = ANL01FL == "Y" +) +``` ## Derive Severity Records for Administration Site Events {#sev} @@ -305,6 +329,7 @@ The severity records created will be useful for calculating the maximum severity ```{r eval=TRUE} adface <- derive_diam_to_sev_records( dataset = adface, + filter_add = ANL01FL == "Y", diam_code = "DIAMETER", faobj_values = c("REDNESS", "SWELLING"), testcd_sev = "SEV", @@ -336,7 +361,7 @@ In this step, we will derive maximum records for severity, diameter, temperature adface <- derive_extreme_records( dataset = adface, dataset_add = adface, - filter_add = FATESTCD == "SEV", + filter_add = FATESTCD == "SEV" & ANL01FL == "Y", by_vars = exprs(USUBJID, FAOBJ, ATPTREF), order = exprs(AVAL), check_type = "none", @@ -350,7 +375,7 @@ adface <- derive_extreme_records( adface <- derive_extreme_records( dataset = adface, dataset_add = adface, - filter_add = FAOBJ %in% c("REDNESS", "SWELLING") & FATESTCD == "DIAMETER", + filter_add = FAOBJ %in% c("REDNESS", "SWELLING") & FATESTCD == "DIAMETER" & ANL01FL == "Y", by_vars = exprs(USUBJID, FAOBJ, FALNKGRP), order = exprs(AVAL), check_type = "none", @@ -364,7 +389,7 @@ adface <- derive_extreme_records( adface <- derive_extreme_records( dataset = adface, dataset_add = adface, - filter_add = FAOBJ == "FEVER", + filter_add = FAOBJ == "FEVER" & ANL01FL == "Y", by_vars = exprs(USUBJID, FAOBJ, ATPTREF), order = exprs(VSSTRESN), check_type = "none", @@ -476,8 +501,8 @@ The function `derive_vars_max_flag()` is used to derive flag variable for the ma ```{r eval=TRUE} adface <- derive_vars_max_flag( dataset = adface, - flag1 = "ANL01FL", - flag2 = "ANL02FL" + flag1 = "ANL02FL", + flag2 = "ANL03FL" ) ``` From 49e9c910968be6347ab2994a996fe2020cab7b73 Mon Sep 17 00:00:00 2001 From: Arjun Rubalingam Date: Fri, 23 Aug 2024 10:54:46 +0530 Subject: [PATCH 08/18] Update ad_adface.R --- inst/templates/ad_adface.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inst/templates/ad_adface.R b/inst/templates/ad_adface.R index d99e70c9..48203f48 100644 --- a/inst/templates/ad_adface.R +++ b/inst/templates/ad_adface.R @@ -138,7 +138,7 @@ adface <- derive_vars_joined( #step 8 - Derive the severity records from the Diameter records for the redness and swelling. adface <- adface %>% derive_diam_to_sev_records( - filter_add = ANL01FL == 'Y', + filter_add = ANL01FL == "Y", diam_code = "DIAMETER", faobj_values = c("REDNESS", "SWELLING"), testcd_sev = "SEV", @@ -290,4 +290,3 @@ if (!file.exists(dir)) { dir.create(dir, recursive = TRUE, showWarnings = FALSE) } save(admiralvaccine_adface, file = file.path(dir, "adface.rda"), compress = "bzip2") - From 710a919e159e9df27411787f82c67679089c81a0 Mon Sep 17 00:00:00 2001 From: Arjun Rubalingam Date: Fri, 23 Aug 2024 10:54:53 +0530 Subject: [PATCH 09/18] Update WORDLIST --- inst/WORDLIST | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inst/WORDLIST b/inst/WORDLIST index bbcf553b..d4254865 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -67,3 +67,9 @@ reactogenicity ungrouped xportr xpt +eCRF +eCOA +eDiary +FAEVAL +VSEVAL +ANL From 32f83a91e32a1c688103b7c3a6ca5b19f1ea25be Mon Sep 17 00:00:00 2001 From: Arjun Rubalingam Date: Fri, 23 Aug 2024 10:54:57 +0530 Subject: [PATCH 10/18] Update NEWS.md --- NEWS.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 0ca74563..36636d33 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,14 +2,18 @@ ## ADFACE update after CBER requirements for eDiary data -- Updated ADFACE template as per new SDTM mapping of Investigator assessment for eDiary data, as recommended by CBER. The collection of the Investigator assessment can happen when data reported by the participants was deemed incorrect or the participant did not complete the eDiary. In case of these two scenarios, the Investigator assessment is collected within the eDiary platform as a separate record from the original data reported by the participant (if this is allowed by eCOA system) or in the study eCRF. This leads to a change in Solicited Adverse Event SDTM structure (FACE and VS). Additional records coming from Investigator assessment are added, which can be indentified through an evaluator variable (FAEVAL/VSEVAL). An update in ADFACE has been provided in order to reflect this changes in SDTM. (#243) +- Updated ADFACE template as per new SDTM mapping of Investigator assessment for eDiary data, as recommended by CBER. The collection of the Investigator assessment can happen when data reported by the participants was deemed incorrect or the participant did not complete the eDiary. In case of these two scenarios, the Investigator assessment is collected within the eDiary platform as a separate record from the original data reported by the participant (if this is allowed by eCOA system) or in the study eCRF. This leads to a change in Solicited Adverse Event SDTM structure (FACE and VS). Additional records coming from Investigator assessment are added, which can be identified through an evaluator variable (FAEVAL/VSEVAL). An update in ADFACE has been provided in order to reflect this changes in SDTM. (#243) ## Breaking Changes - Removed `dataset_supp` and `dataset_suppex` arguments from `derive_vars_merged_vaccine()` as we are not combining the parental with supplementary inside the function, but can be optionally combined in the ADCE, ADFACE and ADIS templates using `combine_supp()` function from {metatools}. (#246) +- Included an argument `filter_add` in `derive_diam_to_sev_records()` to pass the subset condition to consider the particular diameter record for convert them to severity records. + ## Updates to Templates +- Included a step to derive ANL01FL to flag the records which would be considered for analysis purpose. + - Supplementary domains are now optionally combined with parental domain within the template. (#246) # admiralvaccine 0.2.0 From 6b6f7270043703ad2008b6a3ba68ad601f757edc Mon Sep 17 00:00:00 2001 From: Arjun Rubalingam Date: Fri, 23 Aug 2024 10:55:04 +0530 Subject: [PATCH 11/18] Update derive_diam_to_sev_records.R --- R/derive_diam_to_sev_records.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/R/derive_diam_to_sev_records.R b/R/derive_diam_to_sev_records.R index a776ebca..eac4bc72 100644 --- a/R/derive_diam_to_sev_records.R +++ b/R/derive_diam_to_sev_records.R @@ -154,8 +154,11 @@ derive_diam_to_sev_records <- function(dataset, # Replacing FATESTCD and FATEST for Diameter with Severity ds <- function(diam_code) { if (c(diam_code) %in% diam$FATESTCD) { + if(!is.null(filter_add)){ + fil_rec <- fil_rec %>% + filter(!!filter_add) + } sev <- fil_rec %>% - filter_if(filter_add) %>% filter(FAOBJ %in% faobj_values & FATESTCD %in% diam_code) %>% mutate( FATESTCD = testcd_sev, From d91cb9c3ff06510f7c1509d2d651e4abfe6947b3 Mon Sep 17 00:00:00 2001 From: Arjun Rubalingam Date: Fri, 23 Aug 2024 10:55:09 +0530 Subject: [PATCH 12/18] Update adface.Rmd --- vignettes/adface.Rmd | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/vignettes/adface.Rmd b/vignettes/adface.Rmd index ec843797..2ada7948 100644 --- a/vignettes/adface.Rmd +++ b/vignettes/adface.Rmd @@ -57,7 +57,8 @@ the environment. Some of the data frames needed are `VS`,`EX` and `FACE`. ```{r message=FALSE} library(admiral) -library(admiralvaccine) +# library(admiralvaccine) +devtools::load_all() library(admiraldev) library(pharmaversesdtm) library(dplyr, warn.conflicts = FALSE) @@ -258,7 +259,8 @@ dataset_vignette( ## Derive Direct Mapping Variables {#mapping} -In this step,we will create the user defined function to assign `AVAL` values from `AVALC` which will be used in further steps. +In this step,we will create the user defined function to assign `AVAL` values from `AVALC` which +will be used in further steps. The user defined functions would look like the following: @@ -295,11 +297,10 @@ dataset_vignette( display_vars = exprs(USUBJID, FAOBJ, AVAL, AVALC, ATPTREF, ATPTN) ) ``` -# Creating ANL01FL which would flag the records that will be considered for analysis and if there -is investigator and subject record for a same day, it would flag the Investigator record over the -subject record. -Note: Please, consider which assessment is needed for your analysis. If you want to prioritize -Instigator assessment, please proceed as follows. Otherwise, change FAEVAL order. +## Derive AN01FL +Creating ANL01FL which would flag the records that will be considered for analysis and if there is any Investigator and Subject record for the same day, it would flag the Investigator record over the subject record. + +Note: Please, consider which assessment is needed for your analysis. If you want to prioritize Investigator assessment, please proceed as follows. Otherwise, change FAEVAL order. ```{r eval = TRUE} adface <- adface %>% derive_var_extreme_flag( @@ -513,7 +514,7 @@ dataset_vignette( ) ``` -This call would return the input dataset with columns `ANL01FL`, `ANL02FL` added by default. +This call would return the input dataset with columns `ANL02FL`, `ANL03FL` added by default. This function allows the user to change the name of the new variables created. ## Derive Event Occurrence Flag {#eventflag} From d09265d68d87f647e01cb088863844bea5662070 Mon Sep 17 00:00:00 2001 From: Arjun Rubalingam Date: Fri, 23 Aug 2024 11:42:25 +0530 Subject: [PATCH 13/18] Update derive_diam_to_sev_records.R --- R/derive_diam_to_sev_records.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/derive_diam_to_sev_records.R b/R/derive_diam_to_sev_records.R index eac4bc72..acf893c6 100644 --- a/R/derive_diam_to_sev_records.R +++ b/R/derive_diam_to_sev_records.R @@ -154,7 +154,7 @@ derive_diam_to_sev_records <- function(dataset, # Replacing FATESTCD and FATEST for Diameter with Severity ds <- function(diam_code) { if (c(diam_code) %in% diam$FATESTCD) { - if(!is.null(filter_add)){ + if (!is.null(filter_add)) { fil_rec <- fil_rec %>% filter(!!filter_add) } From 284ed0770cafba2df81dbcb55d30d3e2732a37e2 Mon Sep 17 00:00:00 2001 From: Arjun Rubalingam Date: Fri, 23 Aug 2024 11:42:30 +0530 Subject: [PATCH 14/18] Update adface.Rmd --- vignettes/adface.Rmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vignettes/adface.Rmd b/vignettes/adface.Rmd index 2ada7948..9b77bb40 100644 --- a/vignettes/adface.Rmd +++ b/vignettes/adface.Rmd @@ -362,7 +362,7 @@ In this step, we will derive maximum records for severity, diameter, temperature adface <- derive_extreme_records( dataset = adface, dataset_add = adface, - filter_add = FATESTCD == "SEV" & ANL01FL == "Y", + filter_add = FATESTCD == "SEV" & ANL01FL == "Y", by_vars = exprs(USUBJID, FAOBJ, ATPTREF), order = exprs(AVAL), check_type = "none", @@ -376,7 +376,7 @@ adface <- derive_extreme_records( adface <- derive_extreme_records( dataset = adface, dataset_add = adface, - filter_add = FAOBJ %in% c("REDNESS", "SWELLING") & FATESTCD == "DIAMETER" & ANL01FL == "Y", + filter_add = FAOBJ %in% c("REDNESS", "SWELLING") & FATESTCD == "DIAMETER" & ANL01FL == "Y", by_vars = exprs(USUBJID, FAOBJ, FALNKGRP), order = exprs(AVAL), check_type = "none", @@ -390,7 +390,7 @@ adface <- derive_extreme_records( adface <- derive_extreme_records( dataset = adface, dataset_add = adface, - filter_add = FAOBJ == "FEVER" & ANL01FL == "Y", + filter_add = FAOBJ == "FEVER" & ANL01FL == "Y", by_vars = exprs(USUBJID, FAOBJ, ATPTREF), order = exprs(VSSTRESN), check_type = "none", From fd993624f1a88fa457fcb9f6c4e99fd2058849a7 Mon Sep 17 00:00:00 2001 From: Arjun Rubalingam Date: Fri, 23 Aug 2024 12:21:33 +0530 Subject: [PATCH 15/18] Update adface.Rmd --- vignettes/adface.Rmd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vignettes/adface.Rmd b/vignettes/adface.Rmd index 9b77bb40..cfe8352a 100644 --- a/vignettes/adface.Rmd +++ b/vignettes/adface.Rmd @@ -57,8 +57,7 @@ the environment. Some of the data frames needed are `VS`,`EX` and `FACE`. ```{r message=FALSE} library(admiral) -# library(admiralvaccine) -devtools::load_all() +library(admiralvaccine) library(admiraldev) library(pharmaversesdtm) library(dplyr, warn.conflicts = FALSE) From 28196e46fbc510fd46236f9bd3f3244e3263b9f2 Mon Sep 17 00:00:00 2001 From: Arjun Rubalingam Date: Fri, 23 Aug 2024 14:00:19 +0530 Subject: [PATCH 16/18] Update ad_adface.R --- inst/templates/ad_adface.R | 51 +++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/inst/templates/ad_adface.R b/inst/templates/ad_adface.R index 48203f48..c513976c 100644 --- a/inst/templates/ad_adface.R +++ b/inst/templates/ad_adface.R @@ -121,23 +121,22 @@ adface <- derive_vars_joined( ATPT = FATPT, ATPTN = FATPTNUM ) %>% - -# Please, consider which assessment is needed for your analysis. If you want to prioritize -# Instigator assessment, please proceed as follows. Otherwise, change FAEVAL order. + # Please, consider which assessment is needed for your analysis. If you want to prioritize + # Instigator assessment, please proceed as follows. Otherwise, change FAEVAL order. derive_var_extreme_flag( - by = exprs(STUDYID, USUBJID, FATPTREF, FAOBJ, FATESTCD, FATPTNUM), - order = exprs(STUDYID, USUBJID, FATPTREF, FAOBJ, FATESTCD, FATPTNUM, FAEVAL), - new_var = ANL01FL, - mode = "first", - true_value = "Y", - false_value = NA_character_ -) + by = exprs(STUDYID, USUBJID, FATPTREF, FAOBJ, FATESTCD, FATPTNUM), + order = exprs(STUDYID, USUBJID, FATPTREF, FAOBJ, FATESTCD, FATPTNUM, FAEVAL), + new_var = ANL01FL, + mode = "first", + true_value = "Y", + false_value = NA_character_ + ) # Version 0.3.0: as per CBER requirement, Investigator assessment has been added into FACE, # which is identified by "INVESTIGATOR" value, in FAEVAL. -#step 8 - Derive the severity records from the Diameter records for the redness and swelling. -adface <- adface %>% derive_diam_to_sev_records( +# step 8 - Derive the severity records from the Diameter records for the redness and swelling. +adface <- adface %>% derive_diam_to_sev_records( filter_add = ANL01FL == "Y", diam_code = "DIAMETER", faobj_values = c("REDNESS", "SWELLING"), @@ -147,22 +146,22 @@ adface <- adface %>% derive_diam_to_sev_records( mild = 2, mod = 5, sev = 10 - ) +) # Step 9 - Deriving Maximum Severity for Local and Systemic events - adface <- adface %>% derive_extreme_records( - dataset_add = adface, - filter = FATESTCD == "SEV" & ANL01FL == "Y", - by_vars = exprs(USUBJID, FAOBJ, ATPTREF), - order = exprs(AVAL), - check_type = "none", - mode = "last", - set_values_to = exprs( - FATEST = "Maximum Severity", - FATESTCD = "MAXSEV" - ) - ) %>% -# Step 10 - Deriving Maximum Diameter for Administrative Site Reactions +adface <- adface %>% derive_extreme_records( + dataset_add = adface, + filter = FATESTCD == "SEV" & ANL01FL == "Y", + by_vars = exprs(USUBJID, FAOBJ, ATPTREF), + order = exprs(AVAL), + check_type = "none", + mode = "last", + set_values_to = exprs( + FATEST = "Maximum Severity", + FATESTCD = "MAXSEV" + ) +) %>% + # Step 10 - Deriving Maximum Diameter for Administrative Site Reactions derive_extreme_records( dataset_add = adface, filter = FAOBJ %in% c("REDNESS", "SWELLING") & FATESTCD == "DIAMETER" & ANL01FL == "Y", From fbac63b8d530c47b2d5014df73064a8201a715c6 Mon Sep 17 00:00:00 2001 From: ahasoplakus Date: Mon, 26 Aug 2024 17:39:02 +0000 Subject: [PATCH 17/18] Update News.md --- NEWS.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 36636d33..83a3b750 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,20 +1,30 @@ # admiralvaccine 0.3.0 -## ADFACE update after CBER requirements for eDiary data +## Updates related to CBER requirements for eDiary data -- Updated ADFACE template as per new SDTM mapping of Investigator assessment for eDiary data, as recommended by CBER. The collection of the Investigator assessment can happen when data reported by the participants was deemed incorrect or the participant did not complete the eDiary. In case of these two scenarios, the Investigator assessment is collected within the eDiary platform as a separate record from the original data reported by the participant (if this is allowed by eCOA system) or in the study eCRF. This leads to a change in Solicited Adverse Event SDTM structure (FACE and VS). Additional records coming from Investigator assessment are added, which can be identified through an evaluator variable (FAEVAL/VSEVAL). An update in ADFACE has been provided in order to reflect this changes in SDTM. (#243) +- Updated ADFACE template and vignette as per new SDTM mapping of Investigator assessment for eDiary data, as recommended by CBER. The collection of the Investigator assessment can happen when data reported by the participants was deemed incorrect or the participant did not complete the eDiary. In these two scenarios, the Investigator assessment is collected within the eDiary platform as a separate record from the original data reported by the participant (if this is allowed by eCOA system) or in the study eCRF. This leads to a change in Solicited Adverse Event SDTM structure (FACE and VS). Additional records coming from Investigator assessment are added, which can be identified through an evaluator variable (FAEVAL/VSEVAL). An update in ADFACE has been provided in order to reflect these changes in SDTM. (#243) ## Breaking Changes -- Removed `dataset_supp` and `dataset_suppex` arguments from `derive_vars_merged_vaccine()` as we are not combining the parental with supplementary inside the function, but can be optionally combined in the ADCE, ADFACE and ADIS templates using `combine_supp()` function from {metatools}. (#246) +- Removed `dataset_supp` and `dataset_suppex` arguments from `derive_vars_merged_vaccine()` as we are not combining parental with supplementary domains inside the function, but can be optionally combined in the ADCE, ADFACE and ADIS templates using `combine_supp()` function from {metatools}. (#246) - Included an argument `filter_add` in `derive_diam_to_sev_records()` to pass the subset condition to consider the particular diameter record for convert them to severity records. ## Updates to Templates -- Included a step to derive ANL01FL to flag the records which would be considered for analysis purpose. +- Included a step to derive ANL01FL in ADFACE template, to flag the records which would be considered for analysis purpose. -- Supplementary domains are now optionally combined with parental domain within the template. (#246) +- Supplementary domains are now optionally combined with parental domains in ADFACE and ADIS templates. (#246) + +## Updates to Documentation + +- Included a step to derive ANL01FL in ADFACE vignette, to flag the records which would be considered for analysis purpose. + +- Supplementary domains are now optionally combined with parental domains n ADFACE and ADIS vignettes. (#246) + +## Various + +- {metatools} and {styler} were added to 'Suggests'. (#246, #239) # admiralvaccine 0.2.0 From 4066d0d06f5f6b33456bca60ca1d6daadbe43fa3 Mon Sep 17 00:00:00 2001 From: ahasoplakus Date: Mon, 26 Aug 2024 17:47:44 +0000 Subject: [PATCH 18/18] update wordlist --- inst/WORDLIST | 1 + 1 file changed, 1 insertion(+) diff --git a/inst/WORDLIST b/inst/WORDLIST index d4254865..245b5198 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -73,3 +73,4 @@ eDiary FAEVAL VSEVAL ANL +styler