Skip to content

Commit

Permalink
feat: #2595 deprecate_inform now in date_source
Browse files Browse the repository at this point in the history
  • Loading branch information
bms63 committed Dec 23, 2024
1 parent f66b567 commit 15ea407
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
11 changes: 11 additions & 0 deletions R/derive_var_extreme_date.R
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,17 @@ date_source <- function(dataset_name,
filter = NULL,
date,
set_values_to = NULL) {

deprecate_inform(
when = "1.2.0",
what = "date_source()",
with = "derive_vars_extreme_event()",
details = c(
x = "This message will turn into a warning with release of 1.3.0",
i = "https://pharmaverse.github.io/admiral/reference/derive_vars_extreme_event.html"
)
)

out <- list(
dataset_name = assert_character_scalar(dataset_name),
filter = assert_filter_cond(enexpr(filter), optional = TRUE),
Expand Down
8 changes: 6 additions & 2 deletions tests/testthat/_snaps/derive_var_extreme_date.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
i Please use `derive_vars_extreme_event()` instead.
x This message will turn into a warning with release of 1.3.0
i https://pharmaverse.github.io/admiral/reference/derive_vars_extreme_event.html
`derive_var_extreme_dtm()` was deprecated in admiral 1.2.0.
i Please use `derive_vars_extreme_event()` instead.
x This message will turn into a warning with release of 1.3.0
i https://pharmaverse.github.io/admiral/reference/derive_vars_extreme_event.html
Output
# A tibble: 3 x 6
STUDYID USUBJID TRTEDTM DTHDTC DTHDT LSTALVDT
Expand All @@ -16,7 +20,7 @@
2 STUDY01 2 NA 2020-06 2020-06-01 NA
3 STUDY01 3 2020-04-12 13:15:00 <NA> NA 2020-04-12

# derive_var_extreme_dtm Test 4: Message sent to users
# derive_var_extreme_dtm Test 5: Message sent to users

Code
derive_var_extreme_dtm(adsl, new_var = LSTALVDTM, source_datasets = list(ae = ae,
Expand All @@ -35,7 +39,7 @@
3 STUDY01 3 2020-04-12 13:15:00 <NA> NA ADSL NA TRTEDTM
# i 1 more variable: LSTALVDTM <dttm>

# derive_var_extreme_dtm Test 6: error if source dataset is not available
# derive_var_extreme_dtm Test 8: error if source dataset is not available

Code
derive_var_extreme_dtm(adsl, new_var = LSTALVDTM, source_datasets = list(ea = ae),
Expand Down

0 comments on commit 15ea407

Please sign in to comment.