mockDrugUtilisation {DrugUtilisation} | R Documentation |
It creates a mock database for testing drugutilisation package
mockDrugUtilisation(
connectionDetails = list(con = DBI::dbConnect(duckdb::duckdb(), ":memory:"),
writeSchema = "main"),
numberIndividuals = 10,
seed = 1,
concept = NULL,
concept_ancestor = NULL,
drug_strength = NULL,
person = NULL,
observation_period = NULL,
drug_exposure = NULL,
condition_occurrence = NULL,
observation = NULL,
concept_relationship = NULL,
extraTables = list(),
...
)
connectionDetails |
Details of the connection |
numberIndividuals |
Number of individuals in the mock cdm |
seed |
Seed for the random numbers |
concept |
A concept tibble, if NULL a mock one is created |
concept_ancestor |
A concept_ancestor tibble, if NULL a mock one is created |
drug_strength |
A drug_strength tibble, if NULL a mock one is created |
person |
A person tibble, if NULL a mock one is created |
observation_period |
A observation_period tibble, if NULL a mock one is created |
drug_exposure |
A drug_exposure tibble, if NULL a mock one is created |
condition_occurrence |
A condition_occurrence tibble, if NULL a mock one is created |
observation |
A observation tibble, if NULL a mock one is created |
concept_relationship |
A concept_relationship tibble, if NULL a mock one is created. |
extraTables |
Extra tibbles to be instantiated that are not cohorts or cdm tables |
... |
Cohorts can be added to the cdm reference, cohort1 and cohort2 will be created if not provided |
A cdm reference with the mock tables
library(DrugUtilisation)
cdm <- mockDrugUtilisation()
cdm