diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index 6145988..818ef47 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -1,3 +1,3 @@ -Version: 0.4.6 -Date: 2023-08-16 13:20:11 UTC -SHA: 5bbdbdb4d813b2d122933029be67b91a5a9ef811 +Version: 1.0.1 +Date: 2023-11-06 07:37:15 UTC +SHA: dc2612c5ca69955ea95e295703e67377b608870a diff --git a/DESCRIPTION b/DESCRIPTION index 670f87f..1e8efb4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: DrugExposureDiagnostics Title: Diagnostics for OMOP Common Data Model Drug Records -Version: 1.0.0 +Version: 1.0.1 Authors@R: c( person("Ger", "Inberg", email = "g.inberg@erasmusmc.nl", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-8993-8748")), diff --git a/NEWS.md b/NEWS.md index c418b5a..7113a13 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # DrugExposureDiagnostics (development version) +# DrugExposureDiagnostics 1.0.1 +* Fix unit test + # DrugExposureDiagnostics 1.0.0 * Obscure patient counts in concept/diagnostics summary * Update documentation regarding default checks diff --git a/R/getDrugRecords.R b/R/getDrugRecords.R index 17b4ec1..4ab64dc 100644 --- a/R/getDrugRecords.R +++ b/R/getDrugRecords.R @@ -36,6 +36,7 @@ getDrugRecords <- function(cdm, verbose = FALSE) { errorMessage <- checkmate::makeAssertCollection() checkDbType(cdm = cdm, messageStore = errorMessage) + checkmate::assertNumeric(ingredient, add = errorMessage) checkTableExists( cdm = cdm, tableName = includedConceptsTable, messageStore = errorMessage diff --git a/tests/testthat/test-GetDrugRecords.R b/tests/testthat/test-GetDrugRecords.R index 22d9022..0c622f8 100644 --- a/tests/testthat/test-GetDrugRecords.R +++ b/tests/testthat/test-GetDrugRecords.R @@ -46,7 +46,7 @@ getTestData <- function(ingredientId) { } test_that("getDrugRecords", { - ingredientId <- "1125315" + ingredientId <- 1125315 cdm <- getTestData(ingredientId) result <- getDrugRecords(cdm = cdm, ingredient = ingredientId, includedConceptsTable = "ingredient_concepts") %>% dplyr::collect() @@ -63,7 +63,7 @@ test_that("getDrugRecords", { "ingredient")) # non exising ingredient should deliver no results - result <- getDrugRecords(cdm = cdm, ingredient = "123456", includedConceptsTable = "ingredient_concepts") %>% + result <- getDrugRecords(cdm = cdm, ingredient = 123456, includedConceptsTable = "ingredient_concepts") %>% dplyr::collect() expect_equal(nrow(result), 0) })