Skip to contents

Get occurrences of of a concept set from ATLAS for a given cohort

Usage

pull_concept_set(
  cohort,
  concept_set_id,
  start_date,
  end_date,
  concept_set_name = NULL,
  min_n = NULL,
  n = FALSE,
  keep_all = FALSE,
  con = getOption("con.default.value"),
  atlas_url = getOption("atlas_url.default.value"),
  write_schema = getOption("write_schema.default.value"),
  ...
)

Arguments

cohort

tbl; reference to a table created in a user schema with a column called "person_id", and columns for start_date and end_date

concept_set_id

num; the number associated with the concept_set_id in ATLAS

start_date

the name of the start_date column in the cohort table (unquoted)

end_date

the name of the end_date column in the cohort table (unquoted)

concept_set_name

chr; Name to describe the concept set, used to create an indicator variable

min_n

dbl; the minimum number of occurrences per person to consider the indicator true

n

dbl; count the number of occurrences per person (will not include zeros)

keep_all

lgl; keep columns with information about the concept (e.g., concept name, id, etc.)

con

the connection object to ohdsilab

atlas_url

chr; the base url for ATLAS (not ohdsilab)

write_schema

chr; schema for the user

Value

a dataframe

Examples

if (FALSE) { # \dontrun{
tobacco <- pull_concepts(cohort, concept_set_id = 1157, start_date = covariate_start_date,
 end_date = cohort_start_date, name = "tobacco"
 )} # }