search_code: Search for a Code in the Concept Table

Description Usage Arguments Value Examples

View source: R/x_search.R

Description

Search for a Code in the Concept Table

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
search_code(
  code_pattern,
  ignore.case = FALSE,
  perl = FALSE,
  fixed = FALSE,
  useBytes = FALSE,
  vocab_schema = "omop_vocabulary",
  limit = NULL,
  conn,
  conn_fun = "connectAthena()",
  cache_only = FALSE,
  skip_cache = FALSE,
  override_cache = FALSE,
  verbose = TRUE,
  render_sql = TRUE,
  sleepTime = 1
)

Arguments

code_pattern

Regex pattern of code

conn

Connection object. If provided, diverts queries to the connection instead of the local Athena instance without caching features.

cache_only

Loads from the cache and does not query the database. A NULL object is returned if a resultset was not cached.

skip_cache

Skip the caching altogether and directly query the database.

override_cache

If TRUE, the cache will not be loaded and will be overwritten by a new query. For override_cache to take effect, skip_cache should be FALSE.

verbose

If TRUE, prints loading and querying operations messages to the console. Default: FALSE

render_sql

If TRUE, the SQL will be printed back in the console prior to execution. Default: FALSE

sleepTime

Argument for 'Sys.sleep()' in between queries to allow for halting function execution, especially in cases where other chariot functions are executing multiple queries in succession and require cancellation.

Value

resultset as a dataframe with all column types as character and trimmed white space

Examples

1
2
3
if(interactive()){
 search_code(code_pattern = "^C40")
 }

patelm9/chariot documentation built on Feb. 19, 2022, 11:29 a.m.