mockCohortCharacteristics {CohortCharacteristics} | R Documentation |
It creates a mock database for testing PatientProfiles package
Description
It creates a mock database for testing PatientProfiles package
Usage
mockCohortCharacteristics(
connectionDetails = list(con = DBI::dbConnect(duckdb::duckdb(), ":memory:"),
write_schema = "main", mock_prefix = NULL),
drug_exposure = NULL,
drug_strength = NULL,
observation_period = NULL,
condition_occurrence = NULL,
visit_occurrence = NULL,
concept_ancestor = NULL,
person = NULL,
death = NULL,
cohort1 = NULL,
cohort2 = NULL,
drug_concept_id_size = 5,
ancestor_concept_id_size = 5,
condition_concept_id_size = 5,
visit_concept_id_size = 5,
visit_occurrence_id_size = 5,
ingredient_concept_id_size = 1,
drug_exposure_size = 10,
patient_size = 1,
min_drug_exposure_start_date = "2000-01-01",
max_drug_exposure_start_date = "2020-01-01",
earliest_date_of_birth = NULL,
latest_date_of_birth = NULL,
earliest_observation_start_date = NULL,
latest_observation_start_date = NULL,
min_days_to_observation_end = NULL,
max_days_to_observation_end = NULL,
earliest_condition_start_date = NULL,
latest_condition_start_date = NULL,
min_days_to_condition_end = NULL,
max_days_to_condition_end = NULL,
earliest_visit_start_date = NULL,
latest_visit_start_date = NULL,
min_days_to_visit_end = NULL,
max_days_to_visit_end = NULL,
seed = 1,
...
)
Arguments
connectionDetails |
Connection an details to create the cdm mock object. |
drug_exposure |
default null user can define its own table. |
drug_strength |
default null user can define its own table. |
observation_period |
default null user can define its own table. |
condition_occurrence |
default null user can define its own table. |
visit_occurrence |
default null user can define its own visit_occurrence table. |
concept_ancestor |
the concept ancestor table. |
person |
default null user can define its own table. |
death |
default null user can define its own table |
cohort1 |
cohort table for test to run in getindication. |
cohort2 |
cohort table for test to run in getindication. |
drug_concept_id_size |
number of unique drug concept id. |
ancestor_concept_id_size |
the size of concept ancestor table. |
condition_concept_id_size |
number of unique row in the condition concept table. |
visit_concept_id_size |
number of unique visit concept id. |
visit_occurrence_id_size |
number of unique visit occurrence id. |
ingredient_concept_id_size |
number of unique drug ingredient concept id. |
drug_exposure_size |
number of unique drug exposure. |
patient_size |
number of unique patient. |
min_drug_exposure_start_date |
user define minimum drug exposure start date. |
max_drug_exposure_start_date |
user define maximum drug exposure start date. |
earliest_date_of_birth |
the earliest date of birth of patient in person table format "dd-mm-yyyy". |
latest_date_of_birth |
the latest date of birth for patient in person table format "dd-mm-yyyy". |
earliest_observation_start_date |
the earliest observation start date for patient format "dd-mm-yyyy". |
latest_observation_start_date |
the latest observation start date for patient format "dd-mm-yyyy". |
min_days_to_observation_end |
the minimum number of days of the observational integer. |
max_days_to_observation_end |
the maximum number of days of the observation period integer. |
earliest_condition_start_date |
the earliest condition start date for patient format "dd-mm-yyyy". |
latest_condition_start_date |
the latest condition start date for patient format "dd-mm-yyyy". |
min_days_to_condition_end |
the minimum number of days of the condition integer. |
max_days_to_condition_end |
the maximum number of days of the condition integer. |
earliest_visit_start_date |
the earliest visit start date for patient format "dd-mm-yyyy". |
latest_visit_start_date |
the latest visit start date for patient format "dd-mm-yyyy". |
min_days_to_visit_end |
the minimum number of days of the visit integer. |
max_days_to_visit_end |
the maximum number of days of the visit integer. |
seed |
seed. |
... |
user self defined tibble table to put in cdm, it can input as many as the user want. |
Value
cdm of the mock database following user's specifications.
Examples
library(CohortCharacteristics)
cdm <- mockCohortCharacteristics()
cdm
CDMConnector::cdmDisconnect(cdm = cdm)