Skip to content

Commit bbbe860

Browse files
committed
comment out unnecessary tests
1 parent df02197 commit bbbe860

2 files changed

Lines changed: 75 additions & 76 deletions

File tree

DESCRIPTION

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ BugReports: https://github.com/OHDSI/Capr/issues/
1818
Encoding: UTF-8
1919
RoxygenNote: 7.3.1
2020
Depends:
21-
R (>= 3.5.0),
22-
CirceR (>= 1.3.1)
21+
R (>= 3.5.0)
2322
Imports:
2423
magrittr (>= 1.5.0),
2524
jsonlite,
@@ -40,12 +39,12 @@ Imports:
4039
DBI,
4140
DatabaseConnector,
4241
SqlRender,
43-
generics
42+
generics,
43+
CirceR
4444
Suggests:
4545
testthat (>= 3.0.0),
4646
knitr,
47-
rmarkdown,
48-
Eunomia
47+
rmarkdown
4948
VignetteBuilder: knitr
5049
Config/testthat/edition: 3
5150
Collate:

tests/testthat/test-cohort.R

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ test_that("cohort entry works", {
3333

3434
})
3535

36-
test_that("getConceptSetDetails works on Eunomia", {
37-
skip_if_not_installed("Eunomia")
38-
gibleed <- cs(descendants(192671), name = "test")
39-
connectionDetails <- Eunomia::getEunomiaConnectionDetails()
40-
suppressMessages({
41-
con <- DatabaseConnector::connect(connectionDetails)
42-
})
43-
suppressWarnings({ # DatabaseConnector will throw a warning when passing already translated SQL code to dbGetQuery
44-
gibleed <- getConceptSetDetails(gibleed, con, vocabularyDatabaseSchema = "main")
45-
})
46-
expect_equal(gibleed@Expression[[1]]@Concept@concept_name, "Gastrointestinal hemorrhage")
47-
DatabaseConnector::disconnect(con)
48-
})
36+
# test_that("getConceptSetDetails works on Eunomia", {
37+
# skip_if_not_installed("Eunomia")
38+
# gibleed <- cs(descendants(192671), name = "test")
39+
# connectionDetails <- Eunomia::getEunomiaConnectionDetails()
40+
# suppressMessages({
41+
# con <- DatabaseConnector::connect(connectionDetails)
42+
# })
43+
# suppressWarnings({ # DatabaseConnector will throw a warning when passing already translated SQL code to dbGetQuery
44+
# gibleed <- getConceptSetDetails(gibleed, con, vocabularyDatabaseSchema = "main")
45+
# })
46+
# expect_equal(gibleed@Expression[[1]]@Concept@concept_name, "Gastrointestinal hemorrhage")
47+
# DatabaseConnector::disconnect(con)
48+
# })
4949

5050

5151
test_that("full cohort works", {
@@ -138,64 +138,64 @@ test_that("full cohort works without group", {
138138
})
139139

140140

141-
test_that("Capr cohort generates on synpuf", {
142-
skip_if_not_installed("CirceR")
143-
skip_if_not_installed("Eunomia")
144-
# need simple cohort for synpuf
145-
cd <- cohort(
146-
entry = entry(
147-
# observationWindow = continuousObservation(1, 0) # TODO this line causes an error.
148-
drugExposure(cs(descendants(1118084), name = "celecoxib"), male()),
149-
observationWindow = continuousObservation(365, 0)
150-
)
151-
)
152-
153-
cohortList <- toCirce(cd)
154-
expect_type(cohortList, "list")
155-
156-
cohortJson <- jsonlite::toJSON(cohortList, pretty = T, auto_unbox = TRUE) %>%
157-
as.character()
158-
159-
expect_type(cohortJson, "character")
160-
expect_true(nchar(cohortJson) > 1)
161-
162-
sql <- CirceR::cohortExpressionFromJson(cohortJson) %>%
163-
CirceR::buildCohortQuery(options = CirceR::createGenerateOptions(generateStats = TRUE))
164-
165-
expect_type(sql, "character")
166-
expect_true(nchar(sql) > 1)
167-
168-
cohortsToCreate <- tibble::tibble(
169-
cohortId = 999,
170-
cohortName = "CaprTest",
171-
sql = sql
172-
)
173-
174-
connectionDetails <- Eunomia::getEunomiaConnectionDetails()
175-
cohortTableNames <- CohortGenerator::getCohortTableNames("cohort")
176-
177-
invisible(capture_output(suppressMessages({
178-
CohortGenerator::createCohortTables(connectionDetails,
179-
cohortDatabaseSchema = "main",
180-
cohortTableNames = cohortTableNames)
181-
182-
183-
CohortGenerator::generateCohortSet(connectionDetails = connectionDetails,
184-
cdmDatabaseSchema = "main" ,
185-
cohortTableNames = cohortTableNames,
186-
cohortDefinitionSet = cohortsToCreate,
187-
incremental = FALSE)
188-
189-
df <- CohortGenerator::getCohortCounts(connectionDetails = connectionDetails,
190-
cohortDatabaseSchema = "main",
191-
cohortTable = "cohort",
192-
cohortIds = c(999),
193-
cohortDefinitionSet = cohortsToCreate)
194-
})))
195-
196-
expect_true(df$cohortEntries > 1)
197-
198-
})
141+
# test_that("Capr cohort generates on synpuf", {
142+
# skip_if_not_installed("CirceR")
143+
# skip_if_not_installed("Eunomia")
144+
# # need simple cohort for synpuf
145+
# cd <- cohort(
146+
# entry = entry(
147+
# # observationWindow = continuousObservation(1, 0) # TODO this line causes an error.
148+
# drugExposure(cs(descendants(1118084), name = "celecoxib"), male()),
149+
# observationWindow = continuousObservation(365, 0)
150+
# )
151+
# )
152+
#
153+
# cohortList <- toCirce(cd)
154+
# expect_type(cohortList, "list")
155+
#
156+
# cohortJson <- jsonlite::toJSON(cohortList, pretty = T, auto_unbox = TRUE) %>%
157+
# as.character()
158+
#
159+
# expect_type(cohortJson, "character")
160+
# expect_true(nchar(cohortJson) > 1)
161+
#
162+
# sql <- CirceR::cohortExpressionFromJson(cohortJson) %>%
163+
# CirceR::buildCohortQuery(options = CirceR::createGenerateOptions(generateStats = TRUE))
164+
#
165+
# expect_type(sql, "character")
166+
# expect_true(nchar(sql) > 1)
167+
#
168+
# cohortsToCreate <- tibble::tibble(
169+
# cohortId = 999,
170+
# cohortName = "CaprTest",
171+
# sql = sql
172+
# )
173+
#
174+
# connectionDetails <- Eunomia::getEunomiaConnectionDetails()
175+
# cohortTableNames <- CohortGenerator::getCohortTableNames("cohort")
176+
#
177+
# invisible(capture_output(suppressMessages({
178+
# CohortGenerator::createCohortTables(connectionDetails,
179+
# cohortDatabaseSchema = "main",
180+
# cohortTableNames = cohortTableNames)
181+
#
182+
#
183+
# CohortGenerator::generateCohortSet(connectionDetails = connectionDetails,
184+
# cdmDatabaseSchema = "main" ,
185+
# cohortTableNames = cohortTableNames,
186+
# cohortDefinitionSet = cohortsToCreate,
187+
# incremental = FALSE)
188+
#
189+
# df <- CohortGenerator::getCohortCounts(connectionDetails = connectionDetails,
190+
# cohortDatabaseSchema = "main",
191+
# cohortTable = "cohort",
192+
# cohortIds = c(999),
193+
# cohortDefinitionSet = cohortsToCreate)
194+
# })))
195+
#
196+
# expect_true(df$cohortEntries > 1)
197+
#
198+
# })
199199

200200
test_that("compile generic works", {
201201
ch <- cohort(conditionOccurrence(cs(1,2, name = "test")))

0 commit comments

Comments
 (0)