check_vocab_id: Check if a Concept Class Object Belongs to a Vocabulary

Description Usage See Also Examples

View source: R/x_check.R

Description

Check if a Concept Class Object Belongs to a Vocabulary

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
check_vocab_id(
  conn,
  conn_fun = "connectAthena()",
  concept_obj,
  vocab_schema = "omop_vocabulary",
  vocabulary_id,
  concept_class_id,
  cache_only = FALSE,
  skip_cache = FALSE,
  override_cache = FALSE,
  render_sql = FALSE,
  verbose = FALSE,
  sleepTime = 1
)

See Also

cli_alert

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
library(chariot)
library(tidyverse)

# Checking concept id
check_concept_id(concept_id = 2160178)

# Doesn't matter if it is a real concept id or not. It only checks if it is a valid
# integer
check_concept_id(concept_id = 216017800)

# Examples of concept ids that would be invalid
check_concept_id(concept_id = "216017800A")


# Check that a concept belongs to the expected vocabulary.
# If the Concept Id does not exist in the Concept table, an alert is returned
check_vocab_id(concept_obj = 2160178,
               vocabulary_id = "HemOnc")

check_vocab_id(concept_obj = 2160178,
               vocabulary_id = "ATC")

# If the Concept Id exists in the Concept table and the vocabulary_id is wrong
check_vocab_id(concept_obj = 1308216,
               vocabulary_id = "ATC")

# If the Concept Id exists in the Concept table and the vocabulary_id is correct
check_vocab_id(concept_obj = 1308216,
               vocabulary_id = "RxNorm")

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