Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ data-raw/pp.R @toni-1991
data-raw/query_databases.R @bundfussr

# admiralonco
data-raw/rs_onco.R @bundfussr
data-raw/rs_onco*.R @bundfussr
data-raw/tr_onco.R @bundfussr
data-raw/tu_onco.R @bundfussr

Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Suggests:
usethis,
yaml
Config/roxygen2/markdown: TRUE
Config/roxygen2/version: 8.1.0
Config/roxygen2/version: 8.1.1
Encoding: UTF-8
Language: en-US
LazyData: true
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# pharmaversesdtm (development version)

## New Features

- Oncology response data for PCWG4 criteria (`rs_onco_pcwg4`) was added. (#261)

## Various

<details>
Expand Down
40 changes: 40 additions & 0 deletions R/rs_onco_pcwg4.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This file is automatically generated by data-raw/create_sdtms_data.R.
# For updating it please edit inst/extdata/sdtms-specs.json and rerun create_sdtms_data.R.
# Manual edits are not recommended, as changes may be overwritten.
#' Disease Response (PCWG4) for Oncology
#'
#' A SDTM RS dataset for oncology studies using PCWG4 criteria intended for examples of ADaM dataset creation
#'
#' @name rs_onco_pcwg4
#' @title Disease Response (PCWG4) for Oncology
#' @keywords dataset oncology
#' @description A SDTM RS dataset for oncology studies using PCWG4 criteria intended for examples of ADaM dataset creation
#' @docType data
#' @format A data frame with 14 columns:
#' \describe{
#' \item{STUDYID}{Study Identifier}
#' \item{DOMAIN}{Domain Abbreviation}
#' \item{USUBJID}{Unique Subject Identifier}
#' \item{RSSEQ}{Sequence Number}
#' \item{RSTESTCD}{Response Assessment Short Name}
#' \item{RSTEST}{Response Assessment Name}
#' \item{RSCAT}{Category for Response Assessment}
#' \item{RSORRES}{Response Assessment Original Result}
#' \item{RSSTRESC}{Response Assessment Result in Std Format}
#' \item{RSEVAL}{Evaluator}
#' \item{VISITNUM}{Visit Number}
#' \item{VISIT}{Visit Name}
#' \item{RSDTC}{Date/Time of Response Assessment}
#' \item{RSDY}{Study Day of Response Assessment}
#' }
#'
#' @source Generated dataset
#' @author Stefan Bundfuss
#' @details Contains a set of 3 unique Test Short Names and Test Names: \tabular{ll}{
#' \strong{RSTESTCD} \tab \strong{RSTEST} \cr
#' BONERESP \tab Bone Response \cr
#' OVRLRESP \tab Overall Response \cr
#' SFTSRESP \tab Soft Tissue Response
#' }

"rs_onco_pcwg4"
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ This metadata drives the automated documentation process, and the file is read b
- Update `inst/extdata/sdtms-specs.json` with the new dataset metadata, including:
- Assigning the dataset label, description, author, source, purpose, or structure.
- Assigning or updating the dataset therapeutic area (used for reference-page grouping).
- Install the package locally, e.g., by calling `pak::local_install(upgrade =
FALSE)`. This ensures that the `create_sdtms_data.R` script in the next step
finds the new dataset as it reads the data from the installed version.
- Run `data-raw/create_sdtms_data.R` in order to update `NAMESPACE` and update the `.Rd` files in `man/`.
- Add your GitHub handle to `.github/CODEOWNERS`.
- Update `NEWS.md`.
Expand Down
100 changes: 100 additions & 0 deletions data-raw/rs_onco_pcwg4.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Datasets: rs_onco_pcwg4
# Description: RS Oncology dataset using PCWG4 criteria

# Load libraries -----
library(dplyr)
library(tidyr)
library(admiral)

# Create rs_onco_pcwg4 ----
pcwg4_raw <- tibble::tribble(
~USUBJID, ~VISIT, ~SoftTissue, ~Bone, ~Overall, ~PSMA_PET,
"01-701-1015", "WEEK 8", "SD", "NON-PD", "SD", "NON-CR/NON-PD",
"01-701-1015", "WEEK 16", "PR", "NON-PD", "PR", "NON-CR/NON-PD",
"01-701-1015", "WEEK 24", "PR", "NON-PD", "PR", "NON-CR/NON-PD",
"01-701-1028", "WEEK 8", "PR", "NON-PD", "PR", "NON-CR/NON-PD",
"01-701-1028", "WEEK 16", "PR", "NON-PD", "PR", "CR",
"01-701-1028", "WEEK 24", "PD", "NON-PD", "PD", "PDu",
"01-701-1034", "WEEK 8", "SD", "NON-PD", "SD", "NON-CR/NON-PD",
"01-701-1034", "WEEK 16", "SD", "NON-PD", "SD", "NON-CR/NON-PD",
"01-701-1034", "WEEK 24", "SD", "NON-PD", "SD", "NON-CR/NON-PD",
"01-701-1097", "WEEK 8", "SD", "NON-PD", "SD", "PD",
"01-701-1097", "WEEK 16", "PR", "PD", "PD", "PD",
"01-701-1097", "WEEK 24", "PR", "PD", "PD", "PD",
"01-701-1115", "WEEK 8", "NED", "PDu", "PDu", "NON-CR/NON-PD",
"01-701-1118", "WEEK 8", "CR", "NED", "CR", "NON-CR/NON-PD",
"01-701-1118", "WEEK 16", "CR", "NED", "CR", "PD",
"01-701-1118", "WEEK 24", "CR", "NED", "CR", "PD",
"01-701-1130", "WEEK 8", "PR", "NON-PD", "PR", "NE",
"01-701-1130", "WEEK 16", "PR", "NON-PD", "PR", "NON-CR/NON-PD",
"01-701-1130", "WEEK 24", "PD", "NON-PD", "PD", "CR",
"01-701-1133", "WEEK 8", "NE", "NE", "NE", "NON-CR/NON-PD",
"01-701-1133", "WEEK 16", "SD", "NON-PD", "SD", "NE",
"01-701-1133", "WEEK 24", "SD", "NON-PD", "SD", "PDu",
"01-701-1148", "WEEK 8", "PR", "NE", "PR", "CR",
"01-701-1148", "WEEK 16", "PR", "NE", "PR", "NON-CR/NON-PD",
"01-701-1148", "WEEK 24", "PR", "NE", "PR", "PD",
"01-701-1153", "WEEK 8", "SD", "NED", "SD", "NON-CR/NON-PD",
"01-701-1153", "WEEK 16", "SD", "NED", "SD", "NON-CR/NON-PD",
"01-701-1153", "WEEK 24", "SD", "NED", "SD", "CR",
"01-701-1275", "WEEK 8", "SD", "PD", "PD", "PD",
"01-701-1275", "WEEK 16", "SD", "PD", "PD", "PD"
)

rs_onco_pcwg4_pre <- pcwg4_raw %>%
pivot_longer(
cols = c("SoftTissue", "Bone", "Overall", "PSMA_PET"),
names_to = "assessment",
values_to = "RSORRES",
values_drop_na = TRUE
)

testnames <- tibble::tribble(
~assessment, ~RSTESTCD, ~RSTEST, ~RSCAT,
"SoftTissue", "SFTSRESP", "Soft Tissue Response", "RECIST 1.1",
"Bone", "BONERESP", "Bone Response", "PCWG SCHER PROSTATE CANCER 2016",
"Overall", "OVRLRESP", "Overall Response", "PCWG SCHER PROSTATE CANCER 2016",
"PSMA_PET", "OVRLRESP", "Overall Response", "PSMA-PET"
)

# date of the corresponding visit from LB
lb <- pharmaversesdtm::lb
timingvars <- rs_onco_pcwg4_pre %>%
distinct(USUBJID) %>%
left_join(lb, by = "USUBJID") %>%
filter(VISITNUM %in% c(8, 10, 12)) %>%
distinct(USUBJID, VISITNUM, VISIT, LBDTC, LBDY) %>%
mutate(
RSDTC = sapply(strsplit(LBDTC, "T", fixed = TRUE), `[`, 1),
RSDY = LBDY
) %>%
select(USUBJID, VISITNUM, VISIT, RSDTC, RSDY)

rs_onco_pcwg4 <- rs_onco_pcwg4_pre %>%
left_join(testnames, by = "assessment") %>%
left_join(timingvars, by = c("USUBJID", "VISIT")) %>%
mutate(
STUDYID = "CDISCPILOT01",
DOMAIN = "RS",
RSEVAL = "INVESTIGATOR",
RSSTRESC = RSORRES
) %>%
derive_var_obs_number(
by_vars = exprs(USUBJID),
order = exprs(VISITNUM, RSEVAL),
new_var = RSSEQ
) %>%
select(
STUDYID, DOMAIN, USUBJID, RSSEQ, RSTESTCD, RSTEST, RSCAT, RSORRES, RSSTRESC,
RSEVAL, VISITNUM, VISIT, RSDTC, RSDY
)

# assign labels
rs_onco <- pharmaversesdtm::rs_onco
for (col in colnames(rs_onco_pcwg4)) {
attr(rs_onco_pcwg4[[col]], "label") <- attr(rs_onco[[col]], "label")
}

attr(rs_onco_pcwg4, "label") <- "Disease Response (PCWG4)"

usethis::use_data(rs_onco_pcwg4, overwrite = TRUE)
Binary file added data/rs_onco_pcwg4.rda
Binary file not shown.
Loading
Loading