instantiateCohortFromConceptSetExpression: Given a concept set expression, instantiate a cohort.

View source: R/InstantiateCohortFromConceptSetExpression.R

instantiateCohortFromConceptSetExpressionR Documentation

Given a concept set expression, instantiate a cohort.

Description

Given a concept set expression, instantiate a cohort. The cohort is generated by checking for the occurrence of any of the resolved conceptId's in the conceptSetExpression in any domain tables. The domain tables are condition_occurrence, drug_exposure, procedure_occurrence, visit_occurrence, observation.

Usage

instantiateCohortFromConceptSetExpression(
  connectionDetails = NULL,
  connection = NULL,
  cdmDatabaseSchema,
  vocabularyDatabaseSchema = cdmDatabaseSchema,
  cohortDatabaseSchema = cohortDatabaseSchema,
  cohortId,
  cohortTable = "cohort",
  restrictToObservationPeriod = TRUE,
  tempEmulationSchema = getOption("sqlRenderTempEmulationSchema"),
  conceptSetExpression
)

Arguments

connectionDetails

An object of type connectionDetails as created using the createConnectionDetails function in the DatabaseConnector package. Can be left NULL if connection is provided.

connection

An object of type connection as created using the connect function in the DatabaseConnector package. Can be left NULL if connectionDetails is provided, in which case a new connection will be opened at the start of the function, and closed when the function finishes.

cdmDatabaseSchema

Schema name where your patient-level data in OMOP CDM format resides. Note that for SQL Server, this should include both the database and schema name, for example 'cdm_data.dbo'.

vocabularyDatabaseSchema

The schema name of containing the vocabulary tables.

cohortId

An integer value to identify the cohort.

cohortTable

the name of the cohort table

restrictToObservationPeriod

(Default = TRUE) Do you want to restrict to Observation period? i.e Cohort dates are restricted to observation period.

tempEmulationSchema

Some database platforms like Oracle and Impala do not truly support temp tables. To emulate temp tables, provide a schema with write privileges where temp tables can be created.

conceptSetExpression

An R object (list) representation of a concept set expression


OHDSI/ConceptSetDiagnostics documentation built on Feb. 26, 2023, 1:31 a.m.