getDbCaseCrossoverData: Load case-crossover data from the database

Description Usage Arguments Value

View source: R/DataLoadingSaving.R

Description

Load all data about the cases from the database.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
getDbCaseCrossoverData(
  connectionDetails,
  cdmDatabaseSchema,
  oracleTempSchema = cdmDatabaseSchema,
  outcomeDatabaseSchema = cdmDatabaseSchema,
  outcomeTable = "condition_era",
  outcomeIds = c(),
  useNestingCohort = FALSE,
  nestingCohortDatabaseSchema = cdmDatabaseSchema,
  nestingCohortTable = "cohort",
  nestingCohortId = NULL,
  useObservationEndAsNestingEndDate = TRUE,
  getVisits = FALSE,
  exposureDatabaseSchema = cdmDatabaseSchema,
  exposureTable = "drug_era",
  exposureIds = c(),
  studyStartDate = "",
  studyEndDate = "",
  getTimeControlData = FALSE,
  maxNestingCohortSize = 1e+07,
  maxCasesPerOutcome = 5e+05
)

Arguments

connectionDetails

An R object of type ConnectionDetails created using the function createConnectionDetails in the DatabaseConnector package.

cdmDatabaseSchema

The name of the database schema that contains the OMOP CDM instance. Requires read permissions to this database. On SQL Server, this should specify both the database and the schema, so for example 'cdm_instance.dbo'.

oracleTempSchema

A schema where temp tables can be created in Oracle.

outcomeDatabaseSchema

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.

outcomeTable

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.

outcomeIds

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.

useNestingCohort

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.

nestingCohortDatabaseSchema

The name of the database schema that is the location where the nesting cohort is defined.

nestingCohortTable

Name of the table holding the nesting cohort. This table should have the same structure as the cohort table.

nestingCohortId

A cohort definition ID identifying the records in the nestingCohortTable to use as nesting cohort.

useObservationEndAsNestingEndDate

When using a nesting cohort, should the observation period end date be used instead of the cohort end date?

getVisits

Get data on visits? This is needed when performing a time- case-control study and matching on visit date is requested later on.

exposureDatabaseSchema

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.

exposureTable

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.

exposureIds

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.

studyStartDate

A calendar date specifying the minimum date where data is used. Date format is 'yyyymmdd'.

studyEndDate

A calendar date specifying the maximum date where data is used. Date format is 'yyyymmdd'.

getTimeControlData

Should data for time controls be fetched? (needed for case-time-control analyses).

maxNestingCohortSize

If the nesting cohort is larger than this number it will be sampled to this size. maxCohortSize = 0 indicates no maximum size. (needed for case-time-control analyses).

maxCasesPerOutcome

If there are more than this number of cases for a single outcome cases will be sampled to this size. maxCasesPerOutcome = 0 indicates no maximum size.

Value

Returns an object of type CaseCrossoverData, containing information on the cases, the nesting cohort, exposures, and optionally visits. Information about multiple outcomes can be captured at once for efficiency reasons. The generic summary() function has been implemented for this object.


OHDSI/CaseCrossover documentation built on Nov. 21, 2020, 7:03 a.m.