@@ -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
5151test_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
200200test_that(" compile generic works" , {
201201 ch <- cohort(conditionOccurrence(cs(1 ,2 , name = " test" )))
0 commit comments