Skip to content

Commit

Permalink
Merge pull request #286 from OHDSI/issue_284
Browse files Browse the repository at this point in the history
updated functions from CDMConnector
  • Loading branch information
cecicampanile authored Jan 14, 2025
2 parents e6e7d18 + 1c262e2 commit 87827ec
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion R/mockOmopSketch.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ mockOmopSketch <- function(con = NULL,


# WHEN WE SUPORT LOCAL CDMs WE WILL HAVE TO ACCOUNT FOR THAT HERE
cdm <- CDMConnector::copy_cdm_to(con = con, cdm = cdm, schema = writeSchema)
cdm <- CDMConnector::copyCdmTo(con = con, cdm = cdm, schema = writeSchema)

return(cdm)
}
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ library(duckdb)
library(CDMConnector)
library(dplyr, warn.conflicts = FALSE)
library(OmopSketch)
con <- dbConnect(duckdb(), eunomia_dir())
con <- dbConnect(duckdb(), eunomiaDir())
cdm <- cdmFromCon(con = con, cdmSchema = "main", writeSchema = "main")
cdm
```
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ library(duckdb)
library(CDMConnector)
library(dplyr, warn.conflicts = FALSE)
library(OmopSketch)
con <- dbConnect(duckdb(), eunomia_dir())
con <- dbConnect(duckdb(), eunomiaDir())
cdm <- cdmFromCon(con = con, cdmSchema = "main", writeSchema = "main")
#> Note: method with signature 'DBIConnection#Id' chosen for function 'dbExistsTable',
#> target signature 'duckdb_connection#Id'.
#> "duckdb_connection#ANY" would also be valid
#> ! cdm name not specified and could not be inferred from the cdm source table
cdm
#>
#> ── # OMOP CDM reference (duckdb) of Synthea synthetic health database ──────────
#> ── # OMOP CDM reference (duckdb) of An OMOP CDM database ───────────────────────
#> • omop tables: person, observation_period, visit_occurrence, visit_detail,
#> condition_occurrence, drug_exposure, procedure_occurrence, device_exposure,
#> measurement, observation, death, note, note_nlp, specimen, fact_relationship,
Expand Down
Binary file modified man/figures/README-unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-5-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-6-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-7-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ schema <- function(type = Sys.getenv("DB_TO_TEST", "duckdb")) {
cdmEunomia <- function() {
con <- connection()
schema <- schema()
conDuck <- DBI::dbConnect(duckdb::duckdb(), CDMConnector::eunomia_dir())
conDuck <- DBI::dbConnect(duckdb::duckdb(), CDMConnector::eunomiaDir())
cdmDuck <- CDMConnector::cdmFromCon(
con = conDuck, cdmSchema = "main", writeSchema = "main"
)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-summariseRecordCount.R
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ test_that("dateRnge argument works", {

PatientProfiles::mockDisconnect(cdm = cdm)

db <- DBI::dbConnect(duckdb::duckdb(), dbdir = CDMConnector::eunomia_dir())
db <- DBI::dbConnect(duckdb::duckdb(), dbdir = CDMConnector::eunomiaDir())
cdm <- CDMConnector::cdmFromCon(con = db, cdmSchema = "main",writeSchema = "main")


Expand Down
2 changes: 1 addition & 1 deletion vignettes/B-summarise_concept_set_counts.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ library(OmopSketch)
library(CodelistGenerator)
# Connect to Eunomia database
con <- DBI::dbConnect(duckdb::duckdb(), CDMConnector::eunomia_dir())
con <- DBI::dbConnect(duckdb::duckdb(), CDMConnector::eunomiaDir())
cdm <- CDMConnector::cdmFromCon(
con = con, cdmSchema = "main", writeSchema = "main"
)
Expand Down

0 comments on commit 87827ec

Please sign in to comment.