| Title: | 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. |
| Authors: | Marta Alcalde-Herraiz [aut] (ORCID: <https://orcid.org/0009-0002-4405-1814>), Kim Lopez-Guell [aut] (ORCID: <https://orcid.org/0000-0002-8462-8668>), Elin Rowlands [aut] (ORCID: <https://orcid.org/0009-0005-5166-0417>), Cecilia Campanile [aut, cre] (ORCID: <https://orcid.org/0009-0007-6629-4661>), Edward Burn [aut] (ORCID: <https://orcid.org/0000-0002-9286-1128>), Martí Català [aut] (ORCID: <https://orcid.org/0000-0003-3308-9905>) |
| Maintainer: | Cecilia Campanile <[email protected]> |
| License: | Apache License (>= 2) |
| Version: | 1.0.1.900 |
| Built: | 2026-06-04 17:01:06 UTC |
| Source: | https://github.com/ohdsi/omopsketch |
This function provides a list of allowed inputs for the omopTableName
argument in summariseClinicalRecords().
clinicalTables()clinicalTables()
A character vector with table names.
library(OmopSketch) clinicalTables()library(OmopSketch) clinicalTables()
Summarise Database Characteristics for OMOP CDM
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, ... )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, ... )
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. |
A summarised_result object with the results.
## Not run: 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) ## End(Not run)## Not run: 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) ## End(Not run)
mockOmopSketch( numberIndividuals = 100, con = lifecycle::deprecated(), writeSchema = lifecycle::deprecated(), seed = lifecycle::deprecated() )mockOmopSketch( numberIndividuals = 100, con = lifecycle::deprecated(), writeSchema = lifecycle::deprecated(), seed = lifecycle::deprecated() )
numberIndividuals |
Number of individuals to create in the cdm reference object. |
con |
deprecated. |
writeSchema |
deprecated. |
seed |
deprecated. |
A mock cdm_reference object.
plotConceptSetCounts(result, facet = NULL, colour = NULL)plotConceptSetCounts(result, facet = NULL, colour = NULL)
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:
|
A plot visualisation.
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)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)
plotInObservation(result, facet = NULL, colour = NULL)plotInObservation(result, facet = NULL, colour = NULL)
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:
|
A plot visualisation.
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)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()
plotObservationPeriod( result, variableName = "Number subjects", plotType = "barplot", facet = NULL, colour = NULL, style = NULL, type = NULL )plotObservationPeriod( result, variableName = "Number subjects", plotType = "barplot", facet = NULL, colour = NULL, style = NULL, type = NULL )
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", "densityplot" or "cumulativeplot". |
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 |
type |
Character string indicating the output plot format. See
|
A plot visualisation.
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)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)
summarisePerson()
Visualise the output of summarisePerson()
plotPerson(result, variableName = NULL, style = NULL, type = NULL)plotPerson(result, variableName = NULL, style = NULL, type = NULL)
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
|
A plot visualisation.
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)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)
plotRecordCount(result, facet = NULL, colour = NULL)plotRecordCount(result, facet = NULL, colour = NULL)
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:
|
A plot visualisation.
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)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()
plotTrend( result, output = NULL, facet = "type", colour = NULL, style = NULL, type = NULL )plotTrend( result, output = NULL, facet = "type", colour = NULL, style = NULL, type = NULL )
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 |
type |
Character string indicating the output plot format. See
|
A plot visualisation.
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)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)
databaseCharacteristics() functionGenerate an interactive Shiny application that visualises the results
obtained from the databaseCharacteristics() function
shinyCharacteristics( result, directory, background = TRUE, title = "Database characterisation", logo = "ohdsi", theme = NULL )shinyCharacteristics( result, directory, background = TRUE, title = "Database characterisation", logo = "ohdsi", theme = NULL )
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. |
This function invisibly returns NULL and generates a static Shiny app in the specified directory.
## 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)## 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)
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.
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() )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() )
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 |
A summarised_result object with the results.
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)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)
Only concepts recorded during observation period are counted.
summariseConceptCounts( cdm, conceptId, countBy = c("record", "person"), concept = TRUE, interval = "overall", sex = FALSE, ageGroup = NULL, dateRange = NULL )summariseConceptCounts( cdm, conceptId, countBy = c("record", "person"), concept = TRUE, interval = "overall", sex = FALSE, ageGroup = NULL, dateRange = NULL )
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 |
A summarised_result object with the results.
Only concepts recorded during observation period are counted.
summariseConceptIdCounts( cdm, omopTableName, countBy = "record", interval = "overall", sex = FALSE, ageGroup = NULL, inObservation = FALSE, sample = NULL, dateRange = NULL, year = lifecycle::deprecated() )summariseConceptIdCounts( cdm, omopTableName, countBy = "record", interval = "overall", sex = FALSE, ageGroup = NULL, inObservation = FALSE, sample = NULL, dateRange = NULL, year = lifecycle::deprecated() )
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. |
A summarised_result object with the results.
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)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)
Only concepts recorded during observation period are counted.
summariseConceptSetCounts( cdm, conceptSet, countBy = c("record", "person"), concept = TRUE, interval = "overall", sex = FALSE, ageGroup = NULL, dateRange = NULL )summariseConceptSetCounts( cdm, conceptSet, countBy = c("record", "person"), concept = TRUE, interval = "overall", sex = FALSE, ageGroup = NULL, dateRange = NULL )
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 |
A summarised_result object with the results.
summariseInObservation( observationPeriod, interval = "overall", output = "record", ageGroup = NULL, sex = FALSE, dateRange = NULL )summariseInObservation( observationPeriod, interval = "overall", output = "record", ageGroup = NULL, sex = FALSE, dateRange = NULL )
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 |
A summarised_result object with the results.
Summarise missing data in omop tables
summariseMissingData( cdm, omopTableName, col = NULL, sex = FALSE, interval = "overall", ageGroup = NULL, sample = 1e+05, dateRange = NULL, year = lifecycle::deprecated() )summariseMissingData( cdm, omopTableName, col = NULL, sex = FALSE, interval = "overall", ageGroup = NULL, sample = 1e+05, dateRange = NULL, year = lifecycle::deprecated() )
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 |
A summarised_result object with the results.
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)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
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() )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() )
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. |
A summarised_result object with the results.
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)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
summariseOmopSnapshot(cdm)summariseOmopSnapshot(cdm)
cdm |
A |
A summarised_result object with the results.
library(OmopSketch) library(omock) cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb") result <- summariseOmopSnapshot(cdm = cdm) tableOmopSnapshot(result = result) cdmDisconnect(cdm = cdm)library(OmopSketch) library(omock) cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb") result <- summariseOmopSnapshot(cdm = cdm) tableOmopSnapshot(result = result) cdmDisconnect(cdm = cdm)
Summarise person table
summarisePerson(cdm)summarisePerson(cdm)
cdm |
A |
A summarised_result object with the results.
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)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)
Only records that fall within the observation period are considered.
summariseRecordCount( cdm, omopTableName, interval = "overall", ageGroup = NULL, sex = FALSE, sample = NULL, dateRange = NULL )summariseRecordCount( cdm, omopTableName, interval = "overall", ageGroup = NULL, sex = FALSE, sample = NULL, dateRange = NULL )
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 |
A summarised_result object with the results.
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)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)
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.
summariseTrend( cdm, event = NULL, episode = NULL, output = "record", interval = "overall", ageGroup = NULL, sex = FALSE, inObservation = FALSE, dateRange = NULL )summariseTrend( cdm, event = NULL, episode = NULL, output = "record", interval = "overall", ageGroup = NULL, sex = FALSE, inObservation = FALSE, dateRange = NULL )
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 |
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.
A summarised_result object with the results.
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", output = "person", 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)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", output = "person", 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
tableClinicalRecords( result, header = "cdm_name", hide = c(omopgenerics::settingsColumns(result), omopgenerics::additionalColumns(result)), groupColumn = c("omop_table", omopgenerics::strataColumns(result)), type = NULL, style = NULL )tableClinicalRecords( result, header = "cdm_name", hide = c(omopgenerics::settingsColumns(result), omopgenerics::additionalColumns(result)), groupColumn = c("omop_table", omopgenerics::strataColumns(result)), type = NULL, style = NULL )
result |
A summarised_result object (output of
|
header |
A vector specifying the elements to include in the header. The order of elements matters, with the first being the topmost header. |
hide |
Columns to drop from the output table. |
groupColumn |
Columns to use as group labels, to see options use visOmopResults::tableColumns(result). |
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 |
A formatted table visualisation.
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)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
tableConceptIdCounts(result, display = "overall", type = "reactable")tableConceptIdCounts(result, display = "overall", type = "reactable")
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". |
A formatted table visualisation.
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)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)
tableInObservation(result, type = "gt")tableInObservation(result, type = "gt")
result |
A summarised_result object (output of
|
type |
Type of formatting output table. See
|
A formatted table visualisation.
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)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
tableMissingData( result, header = "cdm_name", hide = c("variable_name", omopgenerics::settingsColumns(result)), groupColumn = c("omop_table", omopgenerics::strataColumns(result)), type = NULL, style = NULL )tableMissingData( result, header = "cdm_name", hide = c("variable_name", omopgenerics::settingsColumns(result)), groupColumn = c("omop_table", omopgenerics::strataColumns(result)), type = NULL, style = NULL )
result |
A summarised_result object (output of
|
header |
A vector specifying the elements to include in the header. The order of elements matters, with the first being the topmost header. |
hide |
Columns to drop from the output table. |
groupColumn |
Columns to use as group labels, to see options use visOmopResults::tableColumns(result). |
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 |
A formatted table visualisation.
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)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
tableObservationPeriod( result, header = "cdm_name", hide = omopgenerics::settingsColumns(result), groupColumn = omopgenerics::strataColumns(result), type = NULL, style = NULL )tableObservationPeriod( result, header = "cdm_name", hide = omopgenerics::settingsColumns(result), groupColumn = omopgenerics::strataColumns(result), type = NULL, style = NULL )
result |
A summarised_result object (output of
|
header |
A vector specifying the elements to include in the header. The order of elements matters, with the first being the topmost header. |
hide |
Columns to drop from the output table. |
groupColumn |
Columns to use as group labels, to see options use visOmopResults::tableColumns(result). |
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 |
A formatted table visualisation.
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)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
tableOmopSnapshot( result, header = "cdm_name", hide = "variable_level", groupColumn = "variable_name", type = NULL, style = NULL )tableOmopSnapshot( result, header = "cdm_name", hide = "variable_level", groupColumn = "variable_name", type = NULL, style = NULL )
result |
A summarised_result object (output of |
header |
A vector specifying the elements to include in the header. The order of elements matters, with the first being the topmost header. |
hide |
Columns to drop from the output table. |
groupColumn |
Columns to use as group labels, to see options use visOmopResults::tableColumns(result). |
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 |
A formatted table visualisation.
library(OmopSketch) library(omock) cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb") result <- summariseOmopSnapshot(cdm = cdm) tableOmopSnapshot(result = result) cdmDisconnect(cdm = cdm)library(OmopSketch) library(omock) cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb") result <- summariseOmopSnapshot(cdm = cdm) tableOmopSnapshot(result = result) cdmDisconnect(cdm = cdm)
summarisePerson() into a tableVisualise the results of summarisePerson() into a table
Visualise the output of summarisePerson()
tablePerson( result, header = "cdm_name", hide = omopgenerics::settingsColumns(result), groupColumn = character(), type = NULL, style = NULL ) tablePerson( result, header = "cdm_name", hide = omopgenerics::settingsColumns(result), groupColumn = character(), type = NULL, style = NULL )tablePerson( result, header = "cdm_name", hide = omopgenerics::settingsColumns(result), groupColumn = character(), type = NULL, style = NULL ) tablePerson( result, header = "cdm_name", hide = omopgenerics::settingsColumns(result), groupColumn = character(), type = NULL, style = NULL )
result |
A summarised_result object (output of |
header |
A vector specifying the elements to include in the header. The order of elements matters, with the first being the topmost header. |
hide |
Columns to drop from the output table. |
groupColumn |
Columns to use as group labels, to see options use visOmopResults::tableColumns(result). |
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 |
A formatted table visualisation.
A formatted table visualisation.
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)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)
tableRecordCount(result, type = "gt")tableRecordCount(result, type = "gt")
result |
A summarised_result object (output of |
type |
Type of formatting output table. See
|
A formatted table visualisation.
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)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)
summariseConceptIdCounts() outputThis function takes a summarised_result object and generates a formatted
table highlighting the most frequent concepts.
tableTopConceptCounts( result, top = 10, countBy = NULL, type = NULL, style = NULL )tableTopConceptCounts( result, top = 10, countBy = NULL, type = NULL, style = NULL )
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 |
A formatted table visualisation.
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)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
tableTrend( result, header = "cdm_name", hide = "variable_level", groupColumn = c("type", "omop_table"), type = NULL, style = NULL )tableTrend( result, header = "cdm_name", hide = "variable_level", groupColumn = c("type", "omop_table"), type = NULL, style = NULL )
result |
A summarised_result object (output of |
header |
A vector specifying the elements to include in the header. The order of elements matters, with the first being the topmost header. |
hide |
Columns to drop from the output table. |
groupColumn |
Columns to use as group labels, to see options use visOmopResults::tableColumns(result). |
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 |
A formatted table visualisation.
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)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)