knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  message = "hide"
)
library(chariot)
library(tidyverse)
conn <- chariot::connectAthena()

The target ATC Class first should be identified and a concept class object is derived. The Concept Id 21601386 for ANTINEOPLASTIC AND IMMUNOMODULATING AGENTS is used in this example.

atc_class_concept <- get_concept(21601386,
                          vocab_schema = "omop_vocabulary",
                          conn = conn)

A concept class object contains slots for each field in the original Concept table with data type constraints. Concepts are handled as S4 classes in this package to allow the end-user to have access to all the concept attributes at any given point during their analysis. The concept class object of the example is as follows:

atc_class_concept

The atc_class_concept is used as an argument for the preview_atc_classification function first to understand the number of levels that fall below this concept in the hierarchy, as well as the number of descendants at each of these levels to apply filters to create a manageable plot.

preview_atc_classification(concept_class_obj = atc_class_concept,
                     conn = conn)

I will now plot levels 1 to 5.

temp_html <- tempfile(fileext = ".html")
plot_atc_classification(conn = conn,
                          concept_class_obj = atc_class_concept,
                          range = 1:5,
                          file = temp_html)
htmltools::includeHTML(path = temp_html)
unlink(temp_html)
dcAthena(conn = conn)


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