View source: R/DataLoadingSaving.R
getDbCaseData | R Documentation |
Load all data about the cases and nesting cohort from the database.
getDbCaseData( connectionDetails, cdmDatabaseSchema, tempEmulationSchema = getOption("sqlRenderTempEmulationSchema"), outcomeDatabaseSchema = cdmDatabaseSchema, outcomeTable = "condition_era", outcomeIds = c(), useNestingCohort = FALSE, nestingCohortDatabaseSchema = cdmDatabaseSchema, nestingCohortTable = "cohort", nestingCohortId = NULL, useObservationEndAsNestingEndDate = TRUE, getVisits = FALSE, getExposures = FALSE, exposureDatabaseSchema = cdmDatabaseSchema, exposureTable = "drug_era", exposureIds = c(), studyStartDate = "", studyEndDate = "", maxNestingCohortSize = 1e+07, maxCasesPerOutcome = 5e+05 )
connectionDetails |
An R object of type |
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'. |
tempEmulationSchema |
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 matching on visit date is requested later on. |
getExposures |
Should data on exposures be fetched? All exposure information
for the nesting cohort will be retrieved, which may be time-consuming.
Usually it is more efficient to fetch exposure data only for the cases
and controls, as can be done using the |
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'. |
maxNestingCohortSize |
If the nesting cohort is larger than
this number it will be sampled to this size. |
maxCasesPerOutcome |
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 caseData
, containing information on the cases, the nesting cohort,
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.