diff --git a/R/callback-cncpt.R b/R/callback-cncpt.R index cd919e0f..c4692c30 100644 --- a/R/callback-cncpt.R +++ b/R/callback-cncpt.R @@ -4,37 +4,11 @@ collect_dots <- function(concepts, interval, ..., merge_dat = FALSE) { dots <- list(...) - if (length(concepts) == 1L) { - - assert_that(identical(length(dots), 1L)) - - res <- dots[[1L]] - - if (is_ts_tbl(res)) { - ival <- coalesce(interval, interval(res)) - assert_that(has_interval(res, ival)) - } else { - assert_that(is_df(res)) - } - - return(res) - } - - if (length(dots) == 1L) { - dots <- dots[[1L]] - } - - if (is.null(names(dots))) { - names(dots) <- concepts - } - if (not_null(names(concepts))) { concepts <- chr_ply(concepts, grep, names(dots), value = TRUE, use_names = TRUE) } - assert_that(setequal(names(dots), concepts)) - res <- dots[concepts] assert_that(all_map(has_col, res, concepts)) @@ -45,7 +19,9 @@ collect_dots <- function(concepts, interval, ..., merge_dat = FALSE) { ival <- check_interval(res, interval) - if (merge_dat) { + if (length(res) == 1) { + res <- res[[1]] + } else if (merge_dat) { res <- reduce(merge, res, all = TRUE) } else { attr(res, "ival_checked") <- ival diff --git a/R/concept-load.R b/R/concept-load.R index 6774a5dd..1df90c5c 100644 --- a/R/concept-load.R +++ b/R/concept-load.R @@ -547,7 +547,7 @@ load_concepts.rec_cncpt <- function(x, aggregate = NULL, patient_ids = NULL, ext <- list(patient_ids = patient_ids, id_type = id_type, interval = coalesce(x[["interval"]], interval), - progress = progress) + ..., progress = progress) sub <- x[["items"]] agg <- x[["aggregate"]] @@ -606,8 +606,6 @@ load_concepts.item <- function(x, patient_ids = NULL, id_type = "icustay", load_concepts.itm <- function(x, patient_ids = NULL, id_type = "icustay", interval = hours(1L), ...) { - warn_dots(..., ok_args = "keep_components") - res <- do_itm_load(x, id_type, interval = interval) res <- merge_patid(res, patient_ids) res <- do_callback(x, res) diff --git a/inst/extdata/config/concept-dict.R b/inst/extdata/config/concept-dict.R index 0b79cb25..dee3d465 100644 --- a/inst/extdata/config/concept-dict.R +++ b/inst/extdata/config/concept-dict.R @@ -2769,7 +2769,6 @@ cfg <- list( omopid = 132797L, category = "outcome", callback = "sep3", - keep_components = c(FALSE, TRUE), class = "rec_cncpt" ), bnd = list( diff --git a/inst/extdata/config/concept-dict.json b/inst/extdata/config/concept-dict.json index 10fd7f3c..d80e1880 100644 --- a/inst/extdata/config/concept-dict.json +++ b/inst/extdata/config/concept-dict.json @@ -5254,7 +5254,6 @@ "omopid": 132797, "category": "outcome", "callback": "sep3", - "keep_components": [false, true], "class": "rec_cncpt" }, "sex": { diff --git a/tests/testthat/test-callback.R b/tests/testthat/test-callback.R index 0d151157..51fd5db2 100644 --- a/tests/testthat/test-callback.R +++ b/tests/testthat/test-callback.R @@ -272,5 +272,5 @@ test_that("susp_inf", { 57, 61, 70)), susp_inf = rep(TRUE, 6L), interval = hours(1L) ) - expect_identical(susp_inf(abx, samp), expected) + expect_identical(susp_inf(abx = abx, samp = samp), expected) }) diff --git a/tests/testthat/test-scores.R b/tests/testthat/test-scores.R index 169c43c4..6d1d316f 100644 --- a/tests/testthat/test-scores.R +++ b/tests/testthat/test-scores.R @@ -42,7 +42,7 @@ test_that("suspicion of infection", { expect_equal(interval(si_ei), hours(1L)) }) -sep3 <- sep3(so_mi, si_mi) +sep3 <- sep3(sofa = so_mi, susp_inf = si_mi) test_that("sepsis 3", {