Skip to content

Commit

Permalink
Merge pull request #191 from pharmaverse/172_dm_warning
Browse files Browse the repository at this point in the history
Closes #172 - Add warning for expectation of input dm
  • Loading branch information
alanaharris22 authored Dec 11, 2023
2 parents 6de4ef3 + 87d03d0 commit ab85217
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -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 #<insert_issue_number> 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
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions R/process_cut.R
Original file line number Diff line number Diff line change
Expand Up @@ -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_sdtm_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,
Expand Down

0 comments on commit ab85217

Please sign in to comment.