| Title: | Build Tables in the OMOP Common Data Model |
|---|---|
| Description: | Provides functionality to construct standardised tables from health care data formatted according to the Observational Medical Outcomes Partnership (OMOP) Common Data Model. The package includes tools to build key tables such as observation period and drug era, among others. |
| Authors: | Martí Català [aut, cre] (ORCID: <https://orcid.org/0000-0003-3308-9905>), Elin Rowlands [ctb] (ORCID: <https://orcid.org/0009-0005-5166-0417>), Cecilia Campanile [ctb] (ORCID: <https://orcid.org/0009-0007-6629-4661>) |
| Maintainer: | Martí Català <[email protected]> |
| License: | Apache License (>= 2) |
| Version: | 0.3.0 |
| Built: | 2026-06-05 06:15:25 UTC |
| Source: | https://github.com/ohdsi/omopconstructor |
Create achilles tables
buildAchillesTables(cdm, achillesId = NULL)buildAchillesTables(cdm, achillesId = NULL)
cdm |
A cdm_reference object |
achillesId |
A vector of achilles ids. You can also use "minimal", "default" or "all" to point to a subset of analyses. Or also "person", "observation period", ... to run the analyses refering to a certain category. |
The cdm_reference object with the achilles tables populated.
drug_era tableBuild the drug_era table
buildDrugEra(cdm, collapseDays = 30L)buildDrugEra(cdm, collapseDays = 30L)
cdm |
A |
collapseDays |
Number of days that two exposures can be separated to be collapsed in a single era. |
The lazy drug_era table.
library(omock) library(OmopConstructor) library(dplyr, warn.conflicts = TRUE) cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb") cdm$drug_era <- buildDrugEra(cdm = cdm) cdm$drug_era |> glimpse()library(omock) library(OmopConstructor) library(dplyr, warn.conflicts = TRUE) cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb") cdm$drug_era <- buildDrugEra(cdm = cdm) cdm$drug_era |> glimpse()
observation_period table from data recorded in the cdm_reference
Build observation_period table from data recorded in the cdm_reference
buildObservationPeriod( cdm, collapseDays = Inf, persistenceDays = Inf, dateRange = as.Date(c("1900-01-01", NA)), censorAge = 120L, recordsFrom = c("drug_exposure", "visit_occurrence"), periodTypeConceptId = 32817L )buildObservationPeriod( cdm, collapseDays = Inf, persistenceDays = Inf, dateRange = as.Date(c("1900-01-01", NA)), censorAge = 120L, recordsFrom = c("drug_exposure", "visit_occurrence"), periodTypeConceptId = 32817L )
cdm |
A |
collapseDays |
Distance between records to be collapsed. |
persistenceDays |
Number of days added at the end of an observation period as persistence window. |
dateRange |
Range of dates to be considered. By default '1900-01-01' is
used as start date, whereas for censor date the first available of
|
censorAge |
Age to censor individuals if they reach a certain age. The last day in observation of the individual will be the day prior to their birthday. |
recordsFrom |
Tables to retrieve observation records from. |
periodTypeConceptId |
Choose the observation_period_type_concept_id that best represents how the period was determined. Accepted Concepts. |
The cdm_reference object with a new observation_period.
cdm_table into episodes.Collapse records of a cdm_table into episodes.
collapseRecords( x, startDate, endDate, by, gap = 0L, toSummarise = character(), name = NULL )collapseRecords( x, startDate, endDate, by, gap = 0L, toSummarise = character(), name = NULL )
x |
A |
startDate |
Column in |
endDate |
Column in |
by |
Columns in |
gap |
Integer; distance allowed between two consecutive records to be collapsed. |
toSummarise |
Columns in x that we want to be keep, the different columns will be added up. |
name |
Name of the new |
The x cdm_table with the records collapsed.