Load all data needed to perform an SCCS analysis from the database.
getDbSccsData( connectionDetails, cdmDatabaseSchema, oracleTempSchema = cdmDatabaseSchema, outcomeDatabaseSchema = cdmDatabaseSchema, outcomeTable = "condition_era", outcomeIds, exposureDatabaseSchema = cdmDatabaseSchema, exposureTable = "drug_era", exposureIds = c(), useCustomCovariates = FALSE, customCovariateDatabaseSchema = cdmDatabaseSchema, customCovariateTable = "cohort", customCovariateIds = c(), useNestingCohort = FALSE, nestingCohortDatabaseSchema = cdmDatabaseSchema, nestingCohortTable = "cohort", nestingCohortId = NULL, deleteCovariatesSmallCount = 100, studyStartDate = "", studyEndDate = "", cdmVersion = "5", maxCasesPerOutcome = 0 )
An R object of type
The name of the database schema that contains the OMOP CDM instance. Requires read permissions to this database. On SQL Server, this should specifiy both the database and the schema, so for example 'cdm_instance.dbo'.
A schema where temp tables can be created in Oracle.
The name of the database schema that is the location where the data used to define the outcome cohorts is available. If outcomeTable = CONDITION_ERA, outcomeDatabaseSchema is not used. Requires read permissions to this database.
The tablename that contains the outcome cohorts. If outcomeTable is not CONDITION_OCCURRENCE or CONDITION_ERA, then expectation is outcomeTable has format of COHORT table: COHORT_DEFINITION_ID, SUBJECT_ID, COHORT_START_DATE, COHORT_END_DATE.
A list of ids used to define outcomes. If outcomeTable = CONDITION_OCCURRENCE, the list is a set of ancestor CONCEPT_IDs, and all occurrences of all descendant concepts will be selected. If outcomeTable <> CONDITION_OCCURRENCE, the list contains records found in COHORT_DEFINITION_ID field.
The name of the database schema that is the location where the exposure data used to define the exposure cohorts is available. If exposureTable = DRUG_ERA, exposureDatabaseSchema is not used but assumed to be cdmSchema. Requires read permissions to this database.
The tablename that contains the exposure cohorts. If exposureTable <> DRUG_ERA, then expectation is exposureTable has format of COHORT table: cohort_concept_id, SUBJECT_ID, COHORT_START_DATE, COHORT_END_DATE.
A list of identifiers to define the exposures of interest. If exposureTable = DRUG_ERA, exposureIds should be CONCEPT_ID. If exposureTable <> DRUG_ERA, exposureIds is used to select the cohort_concept_id in the cohort-like table. If no exposureIds are provided, all drugs or cohorts in the exposureTable are included as exposures.
Create covariates from a custom table?
The name of the database schema that is the location where the custom covariate data is available.
Name of the table holding the custom covariates. This table should have the same structure as the cohort table.
A list of cohort definition IDS identifying the records in the customCovariateTable to use for building custom covariates.
Should the study be nested in a cohort (e.g. people with a specific indication)? If not, the study will be nested in the general population.
The name of the database schema that is the location where the nesting cohort is defined.
Name of the table holding the nesting cohort. This table should have the same structure as the cohort table.
A cohort definition ID identifying the records in the nestingCohortTable to use as nesting cohort.
The minimum count for a covariate to appear in the data to be kept.
A calendar date specifying the minimum date where data is used. Date format is 'yyyymmdd'.
A calendar date specifying the maximum date where data is used. Date format is 'yyyymmdd'.
Define the OMOP CDM version used: currently support "4" and "5".
If there are more than this number of cases for a single
outcome cases will be sampled to this size.
Returns an object of type
sccsData, containing information on the cases, their outcomes,
exposures, and potentially other covariates. Information about multiple outcomes can be captured at
once for efficiency reasons. This object is a list with the following components:
An ffdf object listing the persons that have the outcome(s), their age, and observation time.
An ffdf object listing the exposures, outcomes and other covariates.
An ffdf object describing the covariates that have been extracted.
A list of objects with information on how the sccsData object was constructed.
summary() function has been implemented for this object.
This function downloads several types of information:
Information on the occurrences of the outcome(s) of interest. Note that information for multiple outcomes can be fetched in one go, and later the specific outcome can be specified for which we want to build a model.
Information on the observation time and age for the people with the outcomes.
Information on exposures of interest which we want to include in the model.
Five different database schemas can be specified, for five different types of information: The
cdmDatabaseSchema is used to extract patient age and observation period. The
outcomeDatabaseSchema is used to extract information about the outcomes, the
exposureDatabaseSchema is used to retrieve information on exposures, and the
customCovariateDatabaseSchema is optionally used to find additional, user-defined
covariates. All four locations could point to the same database schema.
nestingCohortDatabaseSchema is optionally used to define a cohort in which the analysis is nested,
for example a cohort of diabetics patients.
All five locations could point to the same database schema.