From 6721c1191ef3cc8b8f644a1af9c1201356e02de5 Mon Sep 17 00:00:00 2001 From: Tim Barnett Date: Tue, 28 Nov 2023 11:33:00 +0000 Subject: [PATCH 1/5] Updated warning for expectation of dm naming for special_dm #172 --- R/process_cut.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/process_cut.R b/R/process_cut.R index c413fba..b987483 100644 --- a/R/process_cut.R +++ b/R/process_cut.R @@ -91,6 +91,9 @@ no_cut_v empty, in which case a default value of vector() will be used." msg = "special_dm must be either TRUE or FALSE" ) if (special_dm) { + assert_that("dm" %in% names(source_data), + msg = "dataset `dm` is missing but special_dm processing expects this" + ) assert_that( setequal(names(source_sdtm_data), c( patient_cut_v, date_cut_m[, 1], no_cut_v, From de2b7fd2f754f969368c67d29bea4bd9332660f4 Mon Sep 17 00:00:00 2001 From: Tim Barnett Date: Tue, 28 Nov 2023 11:57:45 +0000 Subject: [PATCH 2/5] Adjust style of message #172 --- R/process_cut.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/process_cut.R b/R/process_cut.R index b987483..64eb2cf 100644 --- a/R/process_cut.R +++ b/R/process_cut.R @@ -92,7 +92,7 @@ no_cut_v empty, in which case a default value of vector() will be used." ) if (special_dm) { assert_that("dm" %in% names(source_data), - msg = "dataset `dm` is missing but special_dm processing expects this" + msg = "dataset `dm` is missing but special_dm processing expects this" ) assert_that( setequal(names(source_sdtm_data), c( From 6e53a2b6a5d6cd56abb733f433ab445b43a6c1e4 Mon Sep 17 00:00:00 2001 From: Tim Barnett Date: Tue, 28 Nov 2023 12:56:46 +0000 Subject: [PATCH 3/5] Amend source data ref to source_sdtm_data #172 --- R/process_cut.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/process_cut.R b/R/process_cut.R index 64eb2cf..2fe5918 100644 --- a/R/process_cut.R +++ b/R/process_cut.R @@ -91,7 +91,7 @@ no_cut_v empty, in which case a default value of vector() will be used." msg = "special_dm must be either TRUE or FALSE" ) if (special_dm) { - assert_that("dm" %in% names(source_data), + assert_that("dm" %in% names(source_sdtm_data), msg = "dataset `dm` is missing but special_dm processing expects this" ) assert_that( From 09d9974d1ed449b3a5307151b5d7656002d535e1 Mon Sep 17 00:00:00 2001 From: Tim Barnett Date: Wed, 29 Nov 2023 10:13:14 +0000 Subject: [PATCH 4/5] Update pharmaverse links #172 --- .github/pull_request_template.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index eecd262..4016cd5 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,11 +1,11 @@ -Thank you for your Pull Request! [admiraldev](https://pharmaverse.github.io/admiraldev/devel/index.html) have developed this task checklist from the [Development Process Guide](https://pharmaverse.github.io/admiraldev/main/articles/development_process.html) to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the datacutr codebase remains robust and consistent. +Thank you for your Pull Request! [admiraldev](https://pharmaverse.github.io/admiraldev/index.html) have developed this task checklist from the [Development Process Guide](https://pharmaverse.github.io/admiraldev/articles/development_process.html) to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the datacutr codebase remains robust and consistent. Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the `devel` branch until you have checked off each task. - [ ] Place Closes # into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update) - [ ] Code is formatted according to the [tidyverse style guide](https://style.tidyverse.org/). Run `styler::style_file()` to style R and Rmd files -- [ ] Updated relevant unit tests or have written new unit tests - See [Unit Test Guide](https://pharmaverse.github.io/admiraldev/main/articles/unit_test_guidance.html#writing-unit-tests-in-admiral-) -- [ ] If you removed/replaced any function and/or function parameters, did you fully follow the [deprecation guidance](https://pharmaverse.github.io/admiraldev/main/articles/programming_strategy.html#deprecation-1)? +- [ ] Updated relevant unit tests or have written new unit tests - See [Unit Test Guide](https://pharmaverse.github.io/admiraldev/articles/unit_test_guidance.html#writing-unit-tests-in-admiral-) +- [ ] If you removed/replaced any function and/or function parameters, did you fully follow the [deprecation guidance](https://pharmaverse.github.io/admiraldev/articles/programming_strategy.html#deprecation)? - [ ] Update to all relevant roxygen headers and examples - [ ] Run `devtools::document()` so all `.Rd` files in the `man` folder and the `NAMESPACE` file in the project root are updated appropriately - [ ] Address any updates needed for vignettes and/or templates From 87d03d0c25e0444c2fd55ccecee23b90b777d25d Mon Sep 17 00:00:00 2001 From: Tim Barnett Date: Mon, 11 Dec 2023 14:13:04 +0000 Subject: [PATCH 5/5] Update NEWS.md for process_cut warning addition #172 --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 2a609d9..6fc23d7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,6 +7,7 @@ - Update to `date_cut()` and `special_dm_cut()` functions to allow for datacut date to be null. In this case, all records for this patient will be kept/left unchanged. +- Warning added to `process_cut` if expected dataset `dm` is missing ## Breaking Changes - N/A