the cedar ledge

Exploring Drug Concepts by Name

Date: July 28 2021

Summary: How to explore drugs in an OHDSI table by name

Keywords: #ohdsi #sql #drug #name #r #archive

Bibliography

EHDEN Academy

Table of Contents

    1. Setting Up Environment
      1. Installation Requirements
      2. Making Connection to Eunomia
      3. Querying Drugs by Name
  1. How To Cite
  2. References:
  3. Discussion:

Setting Up Environment

Installation Requirements

We install the OHDSI dummy database, Eunomia, to write our queries:

install.packages(c("SqlRender", "DatabaseConnector", "remotes"))
remotes::install_github("ohdsi/Eunomia", ref = "v1.0.0")

We will also install the package knitr for viewing and working with resulting tables easily:

install.packages("knitr")

Making Connection to Eunomia

Here we load the DatabaseConnector library to connect to Eunomia:

library('DatabaseConnector')
library('knitr')

And set a connection to Eunomia

connectionDetails <-Eunomia::getEunomiaConnectionDetails()
connection <- connect(connectionDetails)

Querying Drugs by Name

First we need to write our SQL query as follows:

sql <-	"
	SELECT * FROM @cdm.concept WHERE lower(concept_name) = 'warfarin'
	"

And then we can run our SQL query and return the results as follows:

result <- renderTranslateQuerySql(connection, sql,cdm ="main")
knitr::kable(result)

How To Cite

Zelko, Jacob. Exploring Drug Concepts by Name. https://jacobzelko.com/07282021211226-drug-concepts. July 28 2021.

References:

Discussion:

CC BY-SA 4.0 Jacob Zelko. Last modified: May 19, 2024. Website built with Franklin.jl and the Julia programming language.