diff --git a/data-raw/rs_onco_recist.R b/data-raw/rs_onco_recist.R index 144dc2d..1dc81ce 100644 --- a/data-raw/rs_onco_recist.R +++ b/data-raw/rs_onco_recist.R @@ -10,7 +10,7 @@ tu <- tu_onco_recist tr <- derive_vars_merged( tr_onco_recist, dataset_add = tu, - by_vars = exprs(USUBJID, TREVAL = TUEVAL, TREVALID = TUEVALID, TRLINKID = TULINKID), + by_vars = exprs(USUBJID, TREVAL = TUEVAL, TREVALID = TUEVALID, TRLNKID = TULNKID), new_vars = exprs(TRLOC = TULOC) ) @@ -38,8 +38,8 @@ sums <- tr %>% summarise( TRSTRESN = sum(TRSTRESN), CRFL = all(CRFL), - IDS = paste(sort(TRLINKID), collapse = ", "), - NTFL = all(substr(TRLINKID, 1, 1) == "N") + IDS = paste(sort(TRLNKID), collapse = ", "), + NTFL = all(substr(TRLNKID, 1, 1) == "N") ) %>% mutate(TRTESTCD = "SUMDIAM") %>% ungroup() diff --git a/data-raw/tr_onco_recist.R b/data-raw/tr_onco_recist.R index c49bd34..2718fa5 100644 --- a/data-raw/tr_onco_recist.R +++ b/data-raw/tr_onco_recist.R @@ -6,7 +6,7 @@ library(admiral) # create tumor results to be used for RS tr <- tribble( - ~SUBJNR, ~TRLINKID, ~TRTESTCD, ~TRORRES, ~VISITNUM, + ~SUBJNR, ~TRLNKID, ~TRTESTCD, ~TRORRES, ~VISITNUM, # BOR = CR, CBOR = SD "1", "T01", "LDIAM", "21", 1, "1", "T02", "LPERP", "32", 1, @@ -120,7 +120,7 @@ tr <- tribble( suppress_warning( tr_compl <- tr %>% mutate( - diff_percent = (as.numeric(SUBJNR) + as.numeric(substr(TRLINKID, 3, 3)) + VISITNUM) %% 11, + diff_percent = (as.numeric(SUBJNR) + as.numeric(substr(TRLNKID, 3, 3)) + VISITNUM) %% 11, TRORRES = case_match( TRTESTCD, "LDIAM" ~ as.character(as.numeric(TRORRES) * (1 - diff_percent / 100)), @@ -144,7 +144,7 @@ tr <- bind_rows(tr, tr_compl) suppress_warning( tr_radio1 <- tr %>% mutate( - diff_percent = (as.numeric(SUBJNR) + as.numeric(substr(TRLINKID, 3, 3)) + VISITNUM) %% 7 - 3, + diff_percent = (as.numeric(SUBJNR) + as.numeric(substr(TRLNKID, 3, 3)) + VISITNUM) %% 7 - 3, TRORRES = if_else( TRTESTCD %in% c("LDIAM", "LPERP"), as.character(as.numeric(TRORRES) * (1 + diff_percent / 100)), @@ -159,7 +159,7 @@ suppress_warning( suppress_warning( tr_radio2 <- tr %>% mutate( - diff_percent = (as.numeric(SUBJNR) + as.numeric(substr(TRLINKID, 3, 3)) + VISITNUM + 3) %% 7 - 3, + diff_percent = (as.numeric(SUBJNR) + as.numeric(substr(TRLNKID, 3, 3)) + VISITNUM + 3) %% 7 - 3, TRORRES = if_else( TRTESTCD %in% c("LDIAM", "LPERP"), as.character(as.numeric(TRORRES) * (1 + diff_percent / 100)), @@ -174,11 +174,11 @@ tr <- bind_rows(tr, tr_radio1, tr_radio2) %>% select(-diff_percent) %>% mutate( TRGRPID = if_else( - substr(TRLINKID, 1, 1) == "T", + substr(TRLNKID, 1, 1) == "T", "TARGET", "NON-TARGET" ), - .before = TRLINKID + .before = TRLNKID ) %>% mutate( TREVAL = if_else(is.na(TREVALID), "INVESTIGATOR", "INDEPENDENT ASSESSOR"), @@ -273,7 +273,7 @@ tr <- derive_var_obs_number( tr_screen <- tr %>% filter(VISITNUM == 1 & basicfl == "Y") %>% - select(STUDYID, USUBJID, SUBJNR, TRLINKID, TRTESTCD, VISIT, VISITNUM, TREVAL, TREVALID, TRACPTFL) + select(STUDYID, USUBJID, SUBJNR, TRLNKID, TRTESTCD, VISIT, VISITNUM, TREVAL, TREVALID, TRACPTFL) saveRDS(tr_screen, file = "data-raw/tu_help_data.rds") tr_onco_recist <- select(tr, -SUBJNR, -basicfl, -RFSTDT) diff --git a/data-raw/tu_onco_recist.R b/data-raw/tu_onco_recist.R index e4faf8a..e935bf3 100644 --- a/data-raw/tu_onco_recist.R +++ b/data-raw/tu_onco_recist.R @@ -21,7 +21,7 @@ tu <- tr_screen %>% TULOC = if_else( TRTESTCD == "LPERP", "LYMPH NODE", - locations[as.numeric(SUBJNR) + as.numeric(substr(TRLINKID, str_length(TRLINKID), str_length(TRLINKID)))] + locations[as.numeric(SUBJNR) + as.numeric(substr(TRLNKID, str_length(TRLNKID), str_length(TRLNKID)))] ), TUTESTCD = "TUMIDENT", TUTEST = "Tumore Identification" @@ -33,10 +33,10 @@ tu_onco_recist <- tu %>% .before = STUDYID ) %>% mutate( - TUORRES = if_else(substr(TRLINKID, 1, 1) == "T", "TARGET", "NON-TARGET"), + TUORRES = if_else(substr(TRLNKID, 1, 1) == "T", "TARGET", "NON-TARGET"), TUSTRESC = TUORRES, TUMETHOD = "CT SCAN", - TULINKID = TRLINKID, + TULNKID = TRLNKID, TUEVAL = TREVAL, TUEVALID = TREVALID, TUACPTFL = TRACPTFL diff --git a/data/tr_onco_recist.rda b/data/tr_onco_recist.rda index 044f522..e949b68 100644 Binary files a/data/tr_onco_recist.rda and b/data/tr_onco_recist.rda differ diff --git a/data/tu_onco_recist.rda b/data/tu_onco_recist.rda index 4116424..93dada4 100644 Binary files a/data/tu_onco_recist.rda and b/data/tu_onco_recist.rda differ diff --git a/man/tr_onco_recist.Rd b/man/tr_onco_recist.Rd index d94618a..02ed140 100644 --- a/man/tr_onco_recist.Rd +++ b/man/tr_onco_recist.Rd @@ -5,7 +5,7 @@ \alias{tr_onco_recist} \title{Tumor Results Dataset (RECIST 1.1)} \format{ -An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 444 rows and 18 columns. +An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 444 rows and 19 columns. } \usage{ tr_onco_recist