Skip to contents

Summarise Database Characteristics for OMOP CDM

Usage

databaseCharacteristics(
  cdm,
  omopTableName = c("person", "observation_period", "visit_occurrence",
    "condition_occurrence", "drug_exposure", "procedure_occurrence", "device_exposure",
    "measurement", "observation", "death"),
  sex = FALSE,
  ageGroup = NULL,
  dateRange = NULL,
  interval = "overall",
  conceptIdCounts = FALSE,
  ...
)

Arguments

cdm

A cdm_reference object representing the Common Data Model (CDM) reference.

omopTableName

A character vector specifying the OMOP tables from the CDM to include in the analysis. If "person" is present, it will only be used for missing value summarisation.

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.

dateRange

A vector of two dates defining the desired study period. Only the start_date column of the OMOP table is checked to ensure it falls within this range. If dateRange is NULL, 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.

Value

A summarised_result object containing the results of the characterisation.

Examples

# \donttest{

cdm <- mockOmopSketch(numberIndividuals = 100)

result <- databaseCharacteristics(cdm = cdm,
omopTableNam = c("drug_exposure", "condition_occurrence"),
sex = TRUE, ageGroup = list(c(0,50), c(51,100)), interval = "years", conceptIdCounts = FALSE)
#> The characterisation will focus on the following OMOP tables: drug_exposure and
#> condition_occurrence
#> → Getting cdm snapshot
#> Warning: Vocabulary version in cdm_source (NA) doesn't match the one in the vocabulary
#> table (v5.0 18-JAN-19)
#> → Getting population characteristics
#>  Building new trimmed cohort
#> Adding demographics information
#> Creating initial cohort
#> Trim sex
#>  Cohort trimmed
#>  Building new trimmed cohort
#> Adding demographics information
#> Creating initial cohort
#> Trim sex
#> Trim age
#>  Cohort trimmed
#>  adding demographics columns
#>  summarising data
#>  summarising cohort general_population
#>  summarising cohort age_group_0_50
#>  summarising cohort age_group_51_100
#>  summariseCharacteristics finished!
#> → Summarising missing data
#> → Summarising table quality
#> → Summarising clinical records
#>  Adding variables of interest to drug_exposure.
#>  Summarising records per person in drug_exposure.
#>  Summarising drug_exposure: `in_observation`, `standard_concept`,
#>   `source_vocabulary`, `domain_id`, and `type_concept`.
#>  Adding variables of interest to condition_occurrence.
#>  Summarising records per person in condition_occurrence.
#>  Summarising condition_occurrence: `in_observation`, `standard_concept`,
#>   `source_vocabulary`, `domain_id`, and `type_concept`.
#> → Summarising observation period
#> → Summarising trends: records, subjects, person-days, age and sex
#> → The number of person-days is not computed for event tables
#> ☺ Database characterisation finished. Code ran in 1 min and 3 sec
#>  1 table created: "og_008_1755858381".

PatientProfiles::mockDisconnect(cdm)
# }