| Title: | Characterise Tables of an OMOP Common Data Model Instance |
| Version: | 1.0.0 |
| Maintainer: | Cecilia Campanile <cecilia.campanile@ndorms.ox.ac.uk> |
| Description: | Summarises key information in data mapped to the Observational Medical Outcomes Partnership (OMOP) common data model. Assess suitability to perform specific epidemiological studies and explore the different domains to obtain feasibility counts and trends. |
| License: | Apache License (≥ 2) |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| Suggests: | CDMConnector (≥ 1.3.0), CodelistGenerator, CohortCharacteristics, DBI, duckdb, DT, flextable, gt, here, knitr, lubridate, odbc, OmopViewer (≥ 0.5.0), sortable, reactable, remotes, rmarkdown, RPostgres, shinyWidgets, testthat (≥ 3.0.0), withr, omock (≥ 0.4.0), covr, ggplot2, visOmopResults (≥ 1.4.0), devtools, usethis |
| Config/testthat/edition: | 3 |
| Config/testthat/parallel: | true |
| Imports: | cli, clock, CohortConstructor (≥ 0.3.1), dplyr, lifecycle, omopgenerics (≥ 1.3.1), PatientProfiles (≥ 1.4.3), purrr, rlang, stringr, tidyr |
| Depends: | R (≥ 4.1) |
| URL: | https://OHDSI.github.io/OmopSketch/ |
| BugReports: | https://github.com/OHDSI/OmopSketch/issues |
| VignetteBuilder: | knitr |
| NeedsCompilation: | no |
| Packaged: | 2025-11-19 11:21:05 UTC; orms1215 |
| Author: | Marta Alcalde-Herraiz
|
| Repository: | CRAN |
| Date/Publication: | 2025-11-19 12:10:08 UTC |
OmopSketch: Characterise Tables of an OMOP Common Data Model Instance
Description
Summarises key information in data mapped to the Observational Medical Outcomes Partnership (OMOP) common data model. Assess suitability to perform specific epidemiological studies and explore the different domains to obtain feasibility counts and trends.
Author(s)
Maintainer: Cecilia Campanile cecilia.campanile@ndorms.ox.ac.uk (ORCID)
Authors:
Marta Alcalde-Herraiz marta.alcaldeherraiz@ndorms.ox.ac.uk (ORCID)
Kim Lopez-Guell kim.lopez@spc.ox.ac.uk (ORCID)
Elin Rowlands elin.rowlands@ndorms.ox.ac.uk (ORCID)
Edward Burn edward.burn@ndorms.ox.ac.uk (ORCID)
Martí Català marti.catalasabate@ndorms.ox.ac.uk (ORCID)
See Also
Useful links:
Tables in the cdm_reference that contain clinical information
Description
This function provides a list of allowed inputs for the omopTableName
argument in summariseClinicalRecords().
Usage
clinicalTables()
Value
A character vector with table names.
Examples
library(OmopSketch)
clinicalTables()
Helper for consistent documentation
Description
Helper for consistent documentation
Arguments
cdm |
A |
omopTableName |
A character vector of the names of the tables to
summarise in the cdm object. Run |
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.
|
sex |
Logical; whether to stratify results by sex ( |
facet |
Columns to face by. Formula format can be provided. See possible
columns to face by with: |
colour |
Columns to colour by. See possible columns to colour by with:
|
interval |
Time interval to stratify by. It can either be "years", "quarters", "months" or "overall". |
sample |
Either an integer or a character string.
|
Summarise Database Characteristics for OMOP CDM
Description
Summarise 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 |
omopTableName |
A character vector of the names of the tables to
summarise in the cdm object. Run |
sample |
Either an integer or a character string.
|
sex |
Logical; whether to stratify results by sex ( |
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.
|
dateRange |
A vector of two dates defining the desired study period.
Only the |
interval |
Time interval to stratify by. It can either be "years", "quarters", "months" or "overall". |
conceptIdCounts |
Logical; whether to summarise concept ID counts
( |
... |
additional arguments passed to the OmopSketch functions that are used internally. |
Value
A summarised_result object with the results.
Examples
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)
Helper for consistent documentation of dateRange.
Description
Helper for consistent documentation of dateRange.
Arguments
dateRange |
A vector of two dates defining the desired study period.
Only the |
Creates a mock database to test OmopSketch package
Description
Usage
mockOmopSketch(
numberIndividuals = 100,
con = lifecycle::deprecated(),
writeSchema = lifecycle::deprecated(),
seed = lifecycle::deprecated()
)
Arguments
numberIndividuals |
Number of individuals to create in the cdm reference object. |
con |
deprecated. |
writeSchema |
deprecated. |
seed |
deprecated. |
Value
A mock cdm_reference object.
Helper for consistent documentation for plots.
Description
Helper for consistent documentation for plots.
Arguments
style |
Visual theme to apply. Character, or |
type |
Character string indicating the output plot format. See
|
Plot the concept counts of a summariseConceptSetCounts output
Description
Usage
plotConceptSetCounts(result, facet = NULL, colour = NULL)
Arguments
result |
A summarised_result object (output of
|
facet |
Columns to face by. Formula format can be provided. See possible
columns to face by with: |
colour |
Columns to colour by. See possible columns to colour by with:
|
Value
A plot visualisation.
Examples
library(dplyr)
library(OmopSketch)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseConceptSetCounts(
cdm = cdm,
conceptSet = list(
"asthma" = c(4051466, 317009),
"rhinitis" = c(4280726, 4048171, 40486433)
)
)
result |>
filter(variable_name == "Number subjects") |>
plotConceptSetCounts(
facet = "codelist_name",
colour = "standard_concept_name"
)
cdmDisconnect(cdm = cdm)
Create a ggplot2 plot from the output of summariseInObservation()
Description
Usage
plotInObservation(result, facet = NULL, colour = NULL)
Arguments
result |
A summarised_result object (output of
|
facet |
Columns to face by. Formula format can be provided. See possible
columns to face by with: |
colour |
Columns to colour by. See possible columns to colour by with:
|
Value
A plot visualisation.
Examples
library(dplyr)
library(OmopSketch)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseInObservation(
observationPeriod = cdm$observation_period,
output = c("person-days", "record"),
ageGroup = list("<=40" = c(0, 40), ">40" = c(41, Inf)),
sex = TRUE
)
result |>
filter(variable_name == "Person-days") |>
plotInObservation(facet = "sex", colour = "age_group")
cdmDisconnect(cdm = cdm)
Create a plot from the output of summariseObservationPeriod()
Description
Create a plot from the output of summariseObservationPeriod()
Usage
plotObservationPeriod(
result,
variableName = "Number subjects",
plotType = "barplot",
facet = NULL,
colour = NULL,
style = NULL
)
Arguments
result |
A summarised_result object (output of
|
variableName |
The variable to plot it can be: "Number subjects", "Records per person", "Duration in days" or "Days to next observation period". |
plotType |
The plot type, it can be: "barplot", "boxplot" or "densityplot". |
facet |
Columns to face by. Formula format can be provided. See possible
columns to face by with: |
colour |
Columns to colour by. See possible columns to colour by with:
|
style |
Visual theme to apply. Character, or |
Value
A plot visualisation.
Examples
library(OmopSketch)
library(dplyr, warn.conflicts = FALSE)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseObservationPeriod(cdm = cdm)
tableObservationPeriod(result = result)
plotObservationPeriod(
result = result,
variableName = "Duration in days",
plotType = "boxplot"
)
cdmDisconnect(cdm = cdm)
Visualise the output of summarisePerson()
Description
Visualise the output of summarisePerson()
Usage
plotPerson(result, variableName = NULL, style = NULL, type = NULL)
Arguments
result |
A summarised_result object (output of |
variableName |
The variable to plot, a choice between
|
style |
Visual theme to apply. Character, or |
type |
Character string indicating the output plot format. See
|
Value
A plot visualisation.
Examples
library(OmopSketch)
library(dplyr, warn.conflicts = FALSE)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summarisePerson(cdm = cdm)
tablePerson(result = result)
cdmDisconnect(cdm = cdm)
Create a ggplot of the records' count trend
Description
Usage
plotRecordCount(result, facet = NULL, colour = NULL)
Arguments
result |
A summarised_result object (output of
|
facet |
Columns to face by. Formula format can be provided. See possible
columns to face by with: |
colour |
Columns to colour by. See possible columns to colour by with:
|
Value
A plot visualisation.
Examples
library(omock)
library(OmopSketch)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
summarisedResult <- summariseRecordCount(
cdm = cdm,
omopTableName = "condition_occurrence",
ageGroup = list("<=20" = c(0, 20), ">20" = c(21, Inf)),
sex = TRUE
)
plotRecordCount(
result = summarisedResult,
colour = "age_group",
facet = sex ~ .
)
cdmDisconnect(cdm = cdm)
Create a ggplot2 plot from the output of summariseTrend()
Description
Create a ggplot2 plot from the output of summariseTrend()
Usage
plotTrend(result, output = NULL, facet = "type", colour = NULL, style = NULL)
Arguments
result |
A summarised_result object (output of |
output |
The output to plot. Accepted values are:
|
facet |
Columns to face by. Formula format can be provided. See possible
columns to face by with: |
colour |
Columns to colour by. See possible columns to colour by with:
|
style |
Visual theme to apply. Character, or |
Value
A plot visualisation.
Examples
library(dplyr)
library(OmopSketch)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseTrend(cdm,
episode = "observation_period",
output = c("person-days", "record"),
interval = "years",
ageGroup = list("<=40" = c(0, 40), ">40" = c(41, Inf)),
sex = TRUE
)
plotTrend(
result = result,
output = "record",
colour = "sex",
facet = "age_group"
)
cdmDisconnect(cdm = cdm)
Objects exported from other packages
Description
These objects are imported from other packages. Follow the links below to see their documentation.
- omopgenerics
bind,exportSummarisedResult,importSummarisedResult,settings,suppress
Generate an interactive Shiny application that visualises the results
obtained from the databaseCharacteristics() function
Description
Generate an interactive Shiny application that visualises the results
obtained from the databaseCharacteristics() function
Usage
shinyCharacteristics(
result,
directory,
background = TRUE,
title = "Database characterisation",
logo = "ohdsi",
theme = "scarlet"
)
Arguments
result |
A summarised_result object (output of
|
directory |
A character string specifying the directory where the application will be saved. |
background |
Background panel for the Shiny app.
|
title |
Title of the shiny. Default is "Characterisation". |
logo |
Name of a logo or path to a logo. If NULL no logo is included. Only svg format allowed for the moment. |
theme |
A character string specifying the theme for the Shiny application. It can be any of the OmopViewer supported themes. |
Value
This function invisibly returns NULL and generates a static Shiny app in the specified directory.
Examples
## Not run:
library(OmopSketch)
library(omock)
library(here)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
res <- databaseCharacteristics(cdm = cdm)
shinyCharacteristics(result = res, directory = here())
cdmDisconnect(cdm = cdm)
## End(Not run)
Helper for consistent documentation of table arguments.
Description
Helper for consistent documentation of table arguments.
Arguments
type |
Character string specifying the desired output table format. See
|
style |
Defines the visual formatting of the table. This argument can be provided in one of the following ways:
If |
Summarise an omop table from a cdm object
Description
You will obtain information related to the number of records, number of subjects, whether the records are in observation, number of present domains, number of present concepts, missing data and inconsistencies in start date and end date.
Usage
summariseClinicalRecords(
cdm,
omopTableName,
recordsPerPerson = c("mean", "sd", "median", "q25", "q75", "min", "max"),
conceptSummary = TRUE,
missingData = TRUE,
quality = TRUE,
sex = FALSE,
ageGroup = NULL,
dateRange = NULL,
inObservation = lifecycle::deprecated(),
standardConcept = lifecycle::deprecated(),
sourceVocabulary = lifecycle::deprecated(),
domainId = lifecycle::deprecated(),
typeConcept = lifecycle::deprecated()
)
Arguments
cdm |
A |
omopTableName |
A character vector of the names of the tables to
summarise in the cdm object. Run |
recordsPerPerson |
Generates summary statistics for the number of records per person. Set to NULL if no summary statistics are required. |
conceptSummary |
Logical. If
|
missingData |
Logical. If |
quality |
Logical. If
|
sex |
Logical; whether to stratify results by sex ( |
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.
|
dateRange |
A vector of two dates defining the desired study period.
Only the |
inObservation |
Deprecated. Use |
standardConcept |
Deprecated. Use |
sourceVocabulary |
Deprecated. Use |
domainId |
Deprecated. Use |
typeConcept |
Deprecated. Use |
Value
A summarised_result object with the results.
Examples
library(OmopSketch)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseClinicalRecords(
cdm = cdm,
omopTableName = "condition_occurrence",
recordsPerPerson = c("mean", "sd"),
quality = TRUE,
conceptSummary = TRUE,
missingData = TRUE
)
tableClinicalRecords(result = result)
cdmDisconnect(cdm = cdm)
Summarise concept counts in patient-level data
Description
Only concepts recorded during observation period are counted.
Usage
summariseConceptCounts(
cdm,
conceptId,
countBy = c("record", "person"),
concept = TRUE,
interval = "overall",
sex = FALSE,
ageGroup = NULL,
dateRange = NULL
)
Arguments
cdm |
A |
conceptId |
List of concept IDs to summarise. |
countBy |
Either "record" for record-level counts or "person" for person-level counts |
concept |
TRUE or FALSE. If TRUE code use will be summarised by concept. |
interval |
Time interval to stratify by. It can either be "years", "quarters", "months" or "overall". |
sex |
Logical; whether to stratify results by sex ( |
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.
|
dateRange |
A vector of two dates defining the desired study period.
Only the |
Details
Value
A summarised_result object with the results.
Summarise concept use in patient-level data
Description
Only concepts recorded during observation period are counted.
Usage
summariseConceptIdCounts(
cdm,
omopTableName,
countBy = "record",
interval = "overall",
sex = FALSE,
ageGroup = NULL,
inObservation = FALSE,
sample = NULL,
dateRange = NULL,
year = lifecycle::deprecated()
)
Arguments
cdm |
A |
omopTableName |
A character vector of the names of the tables to
summarise in the cdm object. Run |
countBy |
Either "record" for record-level counts or "person" for person-level counts. |
interval |
Time interval to stratify by. It can either be "years", "quarters", "months" or "overall". |
sex |
Logical; whether to stratify results by sex ( |
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.
|
inObservation |
Logical. If |
sample |
Either an integer or a character string.
|
dateRange |
A vector of two dates defining the desired study period.
Only the |
year |
deprecated. |
Value
A summarised_result object with the results.
Examples
library(OmopSketch)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseConceptIdCounts(
cdm = cdm,
omopTableName = "condition_occurrence",
countBy = c("record", "person"),
sex = TRUE
)
tableConceptIdCounts(result = result)
cdmDisconnect(cdm = cdm)
Summarise concept counts in patient-level data
Description
Only concepts recorded during observation period are counted.
Usage
summariseConceptSetCounts(
cdm,
conceptSet,
countBy = c("record", "person"),
concept = TRUE,
interval = "overall",
sex = FALSE,
ageGroup = NULL,
dateRange = NULL
)
Arguments
cdm |
A |
conceptSet |
List of concept IDs to summarise. |
countBy |
Either "record" for record-level counts or "person" for person-level counts |
concept |
TRUE or FALSE. If TRUE code use will be summarised by concept. |
interval |
Time interval to stratify by. It can either be "years", "quarters", "months" or "overall". |
sex |
Logical; whether to stratify results by sex ( |
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.
|
dateRange |
A vector of two dates defining the desired study period.
Only the |
Details
Value
A summarised_result object with the results.
Summarise the number of people in observation during a specific interval of time
Description
Usage
summariseInObservation(
observationPeriod,
interval = "overall",
output = "record",
ageGroup = NULL,
sex = FALSE,
dateRange = NULL
)
Arguments
observationPeriod |
An observation_period omop table. It must be part of a cdm_reference object. |
interval |
Time interval to stratify by. It can either be "years", "quarters", "months" or "overall". |
output |
Output format. It can be either the number of records ("record") that are in observation in the specific interval of time, the number of person-days ("person-days"), the number of subjects ("person"), the number of females ("sex") or the median age of population in observation ("age"). |
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.
|
sex |
Logical; whether to stratify results by sex ( |
dateRange |
A vector of two dates defining the desired study period.
Only the |
Value
A summarised_result object with the results.
Summarise missing data in omop tables
Description
Summarise missing data in omop tables
Usage
summariseMissingData(
cdm,
omopTableName,
col = NULL,
sex = FALSE,
interval = "overall",
ageGroup = NULL,
sample = 1e+05,
dateRange = NULL,
year = lifecycle::deprecated()
)
Arguments
cdm |
A |
omopTableName |
A character vector of the names of the tables to
summarise in the cdm object. Run |
col |
A character vector of column names to check for missing values.
If |
sex |
Logical; whether to stratify results by sex ( |
interval |
Time interval to stratify by. It can either be "years", "quarters", "months" or "overall". |
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.
|
sample |
Either an integer or a character string.
|
dateRange |
A vector of two dates defining the desired study period.
Only the |
year |
deprecated |
Value
A summarised_result object with the results.
Examples
library(OmopSketch)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseMissingData(
cdm = cdm,
omopTableName = c("condition_occurrence", "visit_occurrence"),
sample = 10000
)
tableMissingData(result = result)
cdmDisconnect(cdm = cdm)
Summarise the observation period table getting some overall statistics in a summarised_result object
Description
Summarise the observation period table getting some overall statistics in a summarised_result object
Usage
summariseObservationPeriod(
cdm,
estimates = c("mean", "sd", "min", "q05", "q25", "median", "q75", "q95", "max",
"density"),
missingData = TRUE,
quality = TRUE,
byOrdinal = TRUE,
ageGroup = NULL,
sex = FALSE,
dateRange = NULL,
observationPeriod = lifecycle::deprecated()
)
Arguments
cdm |
A |
estimates |
Estimates to summarise the variables of interest (
|
missingData |
Logical. If |
quality |
Logical. If
|
byOrdinal |
Boolean variable. Whether to stratify by the ordinal observation period (e.g., 1st, 2nd, etc.) (TRUE) or simply analyze overall data (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.
|
sex |
Logical; whether to stratify results by sex ( |
dateRange |
A vector of two dates defining the desired study period.
Only the |
observationPeriod |
deprecated. |
Value
A summarised_result object with the results.
Examples
library(OmopSketch)
library(dplyr, warn.conflicts = FALSE)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseObservationPeriod(cdm = cdm)
tableObservationPeriod(result = result)
plotObservationPeriod(
result = result,
variableName = "Duration in days",
plotType = "boxplot"
)
cdmDisconnect(cdm = cdm)
Summarise a cdm_reference object creating a snapshot with the metadata of the cdm_reference object
Description
Summarise a cdm_reference object creating a snapshot with the metadata of the cdm_reference object
Usage
summariseOmopSnapshot(cdm)
Arguments
cdm |
A |
Value
A summarised_result object with the results.
Examples
library(OmopSketch)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseOmopSnapshot(cdm = cdm)
tableOmopSnapshot(result = result)
cdmDisconnect(cdm = cdm)
Summarise person table
Description
Summarise person table
Usage
summarisePerson(cdm)
Arguments
cdm |
A |
Value
A summarised_result object with the results.
Examples
library(OmopSketch)
library(dplyr, warn.conflicts = FALSE)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summarisePerson(cdm = cdm)
tablePerson(result = result)
cdmDisconnect(cdm = cdm)
Summarise record counts of an omop_table using a specific time interval
Description
Only records that fall within the observation period are considered.
Usage
summariseRecordCount(
cdm,
omopTableName,
interval = "overall",
ageGroup = NULL,
sex = FALSE,
sample = NULL,
dateRange = NULL
)
Arguments
cdm |
A |
omopTableName |
A character vector of the names of the tables to
summarise in the cdm object. Run |
interval |
Time interval to stratify by. It can either be "years", "quarters", "months" or "overall". |
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.
|
sex |
Logical; whether to stratify results by sex ( |
sample |
Either an integer or a character string.
|
dateRange |
A vector of two dates defining the desired study period.
Only the |
Details
Value
A summarised_result object with the results.
Examples
library(OmopSketch)
library(dplyr, warn.conflicts = FALSE)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseRecordCount(
cdm = cdm,
omopTableName = c("condition_occurrence", "drug_exposure"),
interval = "years",
ageGroup = list("<=20" = c(0, 20), ">20" = c(21, Inf)),
sex = TRUE
)
tableRecordCount(result = result)
cdmDisconnect(cdm = cdm)
Summarise temporal trends in OMOP tables
Description
This function summarises temporal trends from OMOP CDM tables, considering only data within the observation period. It supports both event and episode tables and can report trends such as number of records, number of subjects, person-days, median age, and number of females.
Usage
summariseTrend(
cdm,
event = NULL,
episode = NULL,
output = "record",
interval = "overall",
ageGroup = NULL,
sex = FALSE,
inObservation = FALSE,
dateRange = NULL
)
Arguments
cdm |
A |
event |
A character vector of OMOP table names to treat as event tables (uses only start date). |
episode |
A character vector of OMOP table names to treat as episode tables (uses start and end date). |
output |
A character vector indicating what to summarise.
Options include |
interval |
Time interval to stratify by. It can either be "years", "quarters", "months" or "overall". |
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.
|
sex |
Logical; whether to stratify results by sex ( |
inObservation |
Logical. If |
dateRange |
A vector of two dates defining the desired study period.
If |
Details
-
Event tables: Records are included if their start date falls within the study period. Each record contributes to the time interval containing the start date.
-
Episode tables: Records are included if their start or end date overlaps with the study period. Records are trimmed to the date range, and contribute to all overlapping time intervals between start and end dates.
Value
A summarised_result object with the results.
Examples
library(OmopSketch)
library(omock)
library(dplyr)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseTrend(
cdm = cdm,
event = c("condition_occurrence", "drug_exposure"),
episode = "observation_period",
interval = "years",
ageGroup = list("<=20" = c(0, 20), ">20" = c(21, Inf)),
sex = TRUE,
dateRange = as.Date(c("1950-01-01", "2010-12-31"))
)
plotTrend(result = result, facet = sex ~ omop_table, colour = c("age_group"))
cdmDisconnect(cdm = cdm)
Create a visual table from a summariseClinicalRecord() output
Description
Create a visual table from a summariseClinicalRecord() output
Usage
tableClinicalRecords(result, type = NULL, style = NULL)
Arguments
result |
A summarised_result object (output of
|
type |
Character string specifying the desired output table format. See
|
style |
Defines the visual formatting of the table. This argument can be provided in one of the following ways:
If |
Value
A formatted table visualisation.
Examples
library(OmopSketch)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
summarisedResult <- summariseClinicalRecords(
cdm = cdm,
omopTableName = c("condition_occurrence", "drug_exposure"),
recordsPerPerson = c("mean", "sd"),
inObservation = TRUE,
standardConcept = TRUE,
sourceVocabulary = TRUE,
domainId = TRUE,
typeConcept = TRUE
)
summarisedResult |>
suppress(minCellCount = 5) |>
tableClinicalRecords()
cdmDisconnect(cdm = cdm)
Create a visual table from a summariseConceptIdCounts() result
Description
Create a visual table from a summariseConceptIdCounts() result
Usage
tableConceptIdCounts(result, display = "overall", type = "reactable")
Arguments
result |
A summarised_result object (output of
|
display |
A character string indicating which subset of the data to display. Options are:
|
type |
Type of formatting output table, either "reactable" or "datatable". |
Value
A formatted table visualisation.
Examples
library(OmopSketch)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseConceptIdCounts(cdm = cdm, omopTableName = "condition_occurrence")
tableConceptIdCounts(result = result, display = "standard")
cdmDisconnect(cdm = cdm)
Create a visual table from a summariseInObservation() result
Description
Usage
tableInObservation(result, type = "gt")
Arguments
result |
A summarised_result object (output of
|
type |
Type of formatting output table. See
|
Value
A formatted table visualisation.
Examples
library(OmopSketch)
library(dplyr, warn.conflicts = FALSE)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseInObservation(
observationPeriod = cdm$observation_period,
interval = "years",
output = c("person-days", "record"),
ageGroup = list("<=60" = c(0, 60), ">60" = c(61, Inf)),
sex = TRUE
)
result |>
tableInObservation()
cdmDisconnect(cdm = cdm)
Create a visual table from a summariseMissingData() result
Description
Create a visual table from a summariseMissingData() result
Usage
tableMissingData(result, type = NULL, style = NULL)
Arguments
result |
A summarised_result object (output of
|
type |
Character string specifying the desired output table format. See
|
style |
Defines the visual formatting of the table. This argument can be provided in one of the following ways:
If |
Value
A formatted table visualisation.
Examples
library(OmopSketch)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseMissingData(
cdm = cdm,
omopTableName = c("condition_occurrence", "visit_occurrence")
)
tableMissingData(result = result)
cdmDisconnect(cdm = cdm)
Create a visual table from a summariseObservationPeriod() result
Description
Create a visual table from a summariseObservationPeriod() result
Usage
tableObservationPeriod(result, type = NULL, style = NULL)
Arguments
result |
A summarised_result object (output of
|
type |
Character string specifying the desired output table format. See
|
style |
Defines the visual formatting of the table. This argument can be provided in one of the following ways:
If |
Value
A formatted table visualisation.
Examples
library(OmopSketch)
library(dplyr, warn.conflicts = FALSE)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseObservationPeriod(cdm = cdm)
tableObservationPeriod(result = result)
plotObservationPeriod(
result = result,
variableName = "Duration in days",
plotType = "boxplot"
)
cdmDisconnect(cdm = cdm)
Create a visual table from a summarise_omop_snapshot result
Description
Create a visual table from a summarise_omop_snapshot result
Usage
tableOmopSnapshot(result, type = NULL, style = NULL)
Arguments
result |
A summarised_result object (output of |
type |
Character string specifying the desired output table format. See
|
style |
Defines the visual formatting of the table. This argument can be provided in one of the following ways:
If |
Value
A formatted table visualisation.
Examples
library(OmopSketch)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseOmopSnapshot(cdm = cdm)
tableOmopSnapshot(result = result)
cdmDisconnect(cdm = cdm)
Visualise the results of summarisePerson() into a table
Description
Visualise the results of summarisePerson() into a table
Visualise the output of summarisePerson()
Usage
tablePerson(result, type = NULL, style = NULL)
tablePerson(result, type = NULL, style = NULL)
Arguments
result |
A summarised_result object (output of |
type |
Character string specifying the desired output table format. See
|
style |
Defines the visual formatting of the table. This argument can be provided in one of the following ways:
If |
Value
A formatted table visualisation.
A formatted table visualisation.
Examples
library(OmopSketch)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summarisePerson(cdm = cdm)
tablePerson(result = result)
library(OmopSketch)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summarisePerson(cdm = cdm)
tablePerson(result = result)
cdmDisconnect(cdm = cdm)
Create a visual table from a summariseRecordCount() result
Description
Usage
tableRecordCount(result, type = "gt")
Arguments
result |
A summarised_result object (output of |
type |
Type of formatting output table. See
|
Value
A formatted table visualisation.
Examples
library(OmopSketch)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
summarisedResult <- summariseRecordCount(
cdm = cdm,
omopTableName = c("condition_occurrence", "drug_exposure"),
interval = "years",
ageGroup = list("<=20" = c(0, 20), ">20" = c(21, Inf)),
sex = TRUE
)
tableRecordCount(result = summarisedResult)
cdmDisconnect(cdm = cdm)
Create a visual table of the most common concepts from
summariseConceptIdCounts() output
Description
This function takes a summarised_result object and generates a formatted
table highlighting the most frequent concepts.
Usage
tableTopConceptCounts(
result,
top = 10,
countBy = NULL,
type = NULL,
style = NULL
)
Arguments
result |
A summarised_result object (output of
|
top |
Integer. The number of top concepts to display. Defaults to |
countBy |
Either 'person' or 'record'. If NULL whatever is in the data is used. |
type |
Character string specifying the desired output table format. See
|
style |
Defines the visual formatting of the table. This argument can be provided in one of the following ways:
If |
Value
A formatted table visualisation.
Examples
library(OmopSketch)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseConceptIdCounts(cdm = cdm, omopTableName = "condition_occurrence")
tableTopConceptCounts(result = result, top = 5)
cdmDisconnect(cdm = cdm)
Create a visual table from a summariseTrend() result
Description
Create a visual table from a summariseTrend() result
Usage
tableTrend(result, type = NULL, style = NULL)
Arguments
result |
A summarised_result object (output of |
type |
Type of formatting output table between |
style |
Defines the visual formatting of the table. This argument can be provided in one of the following ways:
If |
Value
A formatted table visualisation.
Examples
library(OmopSketch)
library(dplyr, warn.conflicts = FALSE)
library(omock)
cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")
result <- summariseTrend(
cdm = cdm,
episode = "observation_period",
event = c("drug_exposure", "condition_occurrence"),
interval = "years",
ageGroup = list("<=20" = c(0, 20), ">20" = c(21, Inf)),
sex = TRUE
)
tableTrend(result = result)
cdmDisconnect(cdm = cdm)