getdPatientCohort: This function builds a patient cohort (and controls) based on...

Description Usage Arguments Details Value Examples

Description

This function will build a patient cohort with its respective controls using an inclusion concept_id list as well as an exclussion concept_id list. The user specifies the number of both cases and controls for his cohort.

Usage

1
2
getdPatientCohort(connection, dbms, includeConceptlist, excludeConceptlist,
  schema, cohortSize, controlSize, searchDomain)

Arguments

connection

The connection to the database server.

dbms

The target DBMS for SQL to be rendered in.

includeConceptlist

The list of concept_id's used to build the cohort.

excludeConceptlist

The list of concept_id's used as exclusion criteria for the cohort.

schema

The database schema being used.

cohortSize

The number of desired patients to appear in the cohort.

controlSize

The number of desired patients to be in the control group.

Details

This function takes the lists of include and exclude concept_ids and finds all patients that satisfy this characteristics from the Observation and Condition_occurrence tables in CDM V5.

Value

A list of dataframes containing both cases and control patient_id's.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 

casesANDcontrolspatient_ids_df<- getdPatientCohort(conn, dbms,
         as.character(keywordList_FF$V3), as.character(ignoreList_FF$V3),
         cdmSchema,nCases,nControls)
if (nCases > nrow(casesANDcontrolspatient_ids_df[[1]])) {
     message("Not enough patients to get the number of cases specified")
     stop
} else {
   if (nCases > nrow(casesANDcontrolspatient_ids_df[[2]])) {
       message("Not enough patients to get the number of controls specified")
       stop
   }
}


## End(Not run)

OHDSI/Aphrodite documentation built on Sept. 18, 2020, 10:26 p.m.