Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with intersectCohort() #242

Open
patripedregal opened this issue Jul 7, 2024 · 1 comment
Open

issue with intersectCohort() #242

patripedregal opened this issue Jul 7, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@patripedregal
Copy link

patripedregal commented Jul 7, 2024

When using intersectCohorts with a cohort table generated with conceptCohorts I get the following error:
image
image

@nmercadeb nmercadeb self-assigned this Jul 29, 2024
@nmercadeb
Copy link
Collaborator

Code to reproduce error (in intersectCohorts returnOnlyComb = FALSE --> keepOriginalCohorts = TRUE):

# packages ---
library(Capr)
library(here)
library(DBI)
library(CDMConnector)
library(dplyr)
library(tidyr)
library(CodelistGenerator)
library(CohortConstructor)

# db with vocab ----
server_dbi <- Sys.getenv("DB_SERVER_cdm_thin_fr_202308_dbi")
user       <- Sys.getenv("DB_USER")
password   <- Sys.getenv("DB_PASSWORD")
port       <- Sys.getenv("DB_PORT")
host       <- Sys.getenv("DB_HOST")

# connect
db <- DBI::dbConnect(RPostgres::Postgres(),
                     dbname = server_dbi,
                     port = port,
                     host = host,
                     user = user,
                     password = password)

cdm_database_schema <- "public"
vocabulary_database_schema <- cdm_database_schema
results_database_schema <- "results"
db_name<-"THIN_fr"
table_stem <- "issue_cc"

# create cdm reference ----
cdm <- cdmFromCon(
  con = db,
  cdm_schema = cdm_database_schema,
  write_schema = c("schema" = results_database_schema, "prefix" = table_stem),
  cdm_name = db_name,
  achilles_schema = results_database_schema 
)

## OCAM + OCA
drug_codes <- getDrugIngredientCodes(cdm, name = c("amoxicillin", "clarithromycin", "metronidazole"))

cdm$ocam <- conceptCohort(cdm = cdm,
                          conceptSet = drug_codes,
                          name = "ocam")

cdm$intersection_ocam <- cdm$ocam %>%
  CohortConstructor::intersectCohorts(
    gap = 0,
    # returnOnlyComb = FALSE,
    keepOriginalCohorts = TRUE,
    name = "intersection_ocam"
  )

! It needs access to THIN france

@edward-burn edward-burn added this to the cran v0.3 milestone Sep 2, 2024
@edward-burn edward-burn added the bug Something isn't working label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants