
Summarise Database Characteristics for OMOP CDM
Source:R/databaseCharacteristics.R
databaseCharacteristics.RdSummarise Database Characteristics for OMOP CDM
Usage
databaseCharacteristics(
cdm,
omopTableName = c("visit_occurrence", "visit_detail", "condition_occurrence",
"drug_exposure", "procedure_occurrence", "device_exposure", "measurement",
"observation", "death"),
sample = NULL,
sex = FALSE,
ageGroup = NULL,
dateRange = NULL,
interval = "overall",
conceptIdCounts = FALSE,
...
)Arguments
- cdm
A
cdm_referenceobject. Use CDMConnector to create a reference to a database or omock to create a reference to synthetic data.- omopTableName
A character vector of the names of the tables to summarise in the cdm object. Run
clinicalTables()to check the available options.- sample
Either an integer or a character string.
If an integer (n > 0), the function will first sample
ndistinctperson_ids from thepersontable and then subset the input tables to those subjects.If a character string, it must be the name of a cohort in the
cdm; in this case, the input tables are subset to subjects (subject_id) belonging to that cohort.Use
NULLto disable subsetting (default value).
- sex
Logical; whether to stratify results by sex (
TRUE) or not (FALSE).- ageGroup
A list of age groups to stratify the results by. Each element represents a specific age range. You can give them specific names, e.g.
ageGroup = list(children = c(0, 17), adult = c(18, Inf)).- dateRange
A vector of two dates defining the desired study period. Only the
start_datecolumn of the OMOP table is checked to ensure it falls within this range. IfdateRangeisNULL, no restriction is applied.- interval
Time interval to stratify by. It can either be "years", "quarters", "months" or "overall".
- conceptIdCounts
Logical; whether to summarise concept ID counts (
TRUE) or not (FALSE).- ...
additional arguments passed to the OmopSketch functions that are used internally.
Examples
if (FALSE) { # \dontrun{
library(OmopSketch)
library(omock)
library(dplyr)
library(here)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- databaseCharacteristics(
cdm = cdm,
sample = 100,
omopTableName = c("drug_exposure", "condition_occurrence"),
sex = TRUE,
ageGroup = list(c(0, 50), c(51, 100)),
interval = "years",
conceptIdCounts = FALSE
)
result |>
glimpse()
shinyCharacteristics(result = result, directory = here())
cdmDisconnect(cdm = cdm)
} # }