knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
Query, analyze, and explore a Postgres instance of the OMOP Vocabularies for a multitude of use cases, including standardizing data to the OMOP Vocabularies, automatically annotating data pulled from the OMOP CDM with the concept attributes, and calculating cumulative drug dosage from data found in the Drug Exposures table.
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("meerapatelmd/chariot")
This package was inititally written with the objective of exploring the vocabularies for concept mapping. To avoid the challenge of using solely the Concept Id in the R environment when exploring a certain concept, an S4 Concept
class is introduced, where Concept
objects store all the concept attributes found in the Concept Table as slots. This is a basic example which shows you how to solve a common problem:
conn <- pg13::local_connect()
library(chariot) aspirin <- get_concept(concept_id = 1112807, vocab_schema = "omop_vocabulary", conn = conn) class(aspirin)
aspirin
Concept
class objects keep the user informed of all the attributes of a concept during a session using the chariot
package. For example, I can look up the RxNorm Ingredients belonging to the ATC 5th Concept Class lisinopril
using the Concept Id 21601787
alone.
resultset <- lookup_atc_class_ingredients(conn = conn, vocab_schema = "omop_vocabulary", atc_concept_obj = 21601787)
resultset
However, upon viewing the output, the only knowledge known based on the arguments is the 21601787
concept id. When using the Concept
class, this information is not lost.
lisinopril_class_concept <- get_concept(conn = conn, concept_id = 21601787, vocab_schema = "omop_vocabulary") resultset <- lookup_atc_class_ingredients(conn = conn, vocab_schema = "omop_vocabulary", atc_concept_obj = lisinopril_class_concept)
resultset
The resultset can be referenced back to the lisinopril_class_concept
object that has retained all the concept attributes:
lisinopril_class_concept
pg13::dc(conn = conn)
Please note that the chariot project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.