Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion R/getConceptsWithCodeCounts.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ getConceptsWithCodeCounts <- function(
sql <- SqlRender::translate(sql, targetDialect = connection@dbms)
concepts <- DatabaseConnector::dbGetQuery(connection, sql) |>
tibble::as_tibble() |>
dplyr::mutate(standard_concept = dplyr::if_else(is.na(standard_concept), FALSE, TRUE))
dplyr::mutate(standard_concept = dplyr::if_else(is.na(standard_concept), FALSE, TRUE)) |>
dplyr::mutate(concept_id = as.double(concept_id))

return(concepts)
}
Expand Down
4 changes: 2 additions & 2 deletions inst/testdata/config/atlasDev_databasesConfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ BQ5k:
bigint: integer64
tempEmulationSchema: atlas-development-270609.sandbox
cdm:
cdmDatabaseSchema: atlas-development-270609.etl_sam_r12_5k_omop
vocabularyDatabaseSchema: atlas-development-270609.etl_sam_r12_5k_omop
cdmDatabaseSchema: atlas-development-270609.finngen_omop_r13_v3_test
vocabularyDatabaseSchema: atlas-development-270609.finngen_omop_r13_v3_test
resultsDatabaseSchema: atlas-development-270609.sandbox
cohortTable:
cohortDatabaseSchema: atlas-development-270609.sandbox
Expand Down
Binary file modified inst/testdata/data/FinnGenR13_countsOnly.sqlite
Binary file not shown.
3 changes: 2 additions & 1 deletion inst/testdata/data/createTestingData.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ source("tests/testthat/setup.R")
conceptIds <- c(
317009, # Snomed: Asthma
45596282, # ICD10: Asthma
21601855 # ATC level 4: C10AA (Statins)
21601855, # ATC level 4: C10AA (Statins)
2010001615 # test endpoint
)

CDMdbHandler <- HadesExtras_createCDMdbHandlerFromList(test_cohortTableHandlerConfig, loadConnectionChecksLevel = "basicChecks")
Expand Down
5 changes: 4 additions & 1 deletion tests/testmanual/manualtest-timeplotview.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ conceptId <- 782748

conceptId <- 21602735

conceptId <- 2010001615 # test endpoint


results <- getCodeCounts(
CDMdbHandler,
conceptId = conceptId
conceptId = conceptId,
codeCountsTable = "code_counts"
)


Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-createCodeCountsTable.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test_that("createStratifiedCodeCountsTable works with duplicated counts", {
createStratifiedCodeCountsTable(CDMdbHandler, domains = domain, stratifiedCodeCountsTable = stratifiedCodeCountsTable)
)

stratifiedCodeCounts <- CDMdbHandler$connectionHandler$tbl(paste0(resultsDatabaseSchema, ".", stratifiedCodeCountsTable))
stratifiedCodeCounts <- CDMdbHandler$connectionHandler$tbl(I(paste0(resultsDatabaseSchema, ".", stratifiedCodeCountsTable)))

# check that the table was created
stratifiedCodeCounts |>
Expand Down Expand Up @@ -99,7 +99,7 @@ test_that("createCodeCountsTables works", {
# - Check if the table was created
resultsDatabaseSchema <- CDMdbHandler$resultsDatabaseSchema
cdmDatabaseSchema <- CDMdbHandler$cdmDatabaseSchema
code_counts <- CDMdbHandler$connectionHandler$tbl(paste0(resultsDatabaseSchema, ".", codeCountsTable))
code_counts <- CDMdbHandler$connectionHandler$tbl(I(paste0(resultsDatabaseSchema, ".", codeCountsTable)))

# check that the table was created with correct columns
code_counts |>
Expand Down