Skip to content

R interface to NLM RxNorm API to get drug names and class based on RxCUI

License

Notifications You must be signed in to change notification settings

nt-williams/rxnorm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rxnorm

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.

Access drug name and class using RxCUI from the National Library of Medicine RxNorm RESTful API.

Scope

rxnorm is an R package providing a basic interface to query the National Library of Medicine RxNorm RESTful API using RxCUI. The goal is to provide a simple way to translate RxCUI into drug categories with incremental levels of generality: specific drug names → brand names → drug classes.

Installation

You can install rxnorm from GitHub with:

devtools::install_github("nt-williams/rxnorm")

Example

library(rxnorm)

Query the API for the RxNorm name:

get_rx(1011485)
#> [1] "cetirizine hydrochloride 10 MG Disintegrating Oral Tablet [Zyrtec]"

Query the API for the brand name:

get_bn(1011485)
#> [1] "ZYRTEC"

Query the API for the strength of active ingredients:

get_rxcui_strength(861819)
#>      activeIngredientName numeratorValue numeratorUnit denominatorValue
#> 1   sitagliptin phosphate             50            MG                1
#> 2 metformin hydrochloride            500            MG                1
#>   denominatorUnit
#> 1            EACH
#> 2            EACH

Query the API for the WHO ATC drug class:

get_atc(1011485)
#> [1] "R06AE"

We can further parse ATC codes to varying levels of specificy:

get_atc(1011485, "first")
#> [1] "respiratory system"
get_atc(1011485, "second")
#> [1] "antihistamines for systemic use"
get_atc(1011485, "third")
#> [1] "antihistamines for systemic use"
get_atc(1011485, "fourth")
#> [1] "piperazine derivatives"

About

R interface to NLM RxNorm API to get drug names and class based on RxCUI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages