cb_apply_query {cloudos}R Documentation

Apply a query to a cohort

Description

Updates a cohort by applying a new query.

Usage

cb_apply_query(cohort, query, keep_query = TRUE)

Arguments

cohort

A cohort object. (Required) See constructor function cb_create_cohort or cb_load_cohort

query

A phenotype query defined using the phenotype function and logic operators (see example below)

keep_query

If True, combines the newly supplied query with the pre-existing query. Otherwise, pre-existing query is overwritten. (Default: TRUE)

Value

The updated cohort object.

Examples

## Not run: 
A <- phenotype(id = 13, from = "2016-01-21", to = "2017-02-13")
B <- phenotype(id = 4, value = "Cancer")

A_not_B <- A & !B

my_cohort <- cb_load_cohort(cohort_id = "612f37a57673ed0ddeaf1333", cb_version = "v2")

my_cohort <- cb_apply_query(my_cohort, query = A_not_B, keep_query = F)

## End(Not run)


[Package cloudos version 0.4.0 Index]