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


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:


Making Connection to Eunomia

Here we load the DatabaseConnector library to connect to Eunomia:


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")

How To Cite

Zelko, Jacob. Exploring Drug Concepts by Name. July 28 2021.



CC BY-SA 4.0 Jacob Zelko. Last modified: November 24, 2023. Website built with Franklin.jl and the Julia programming language.