RxNav

NDF-RT API

updated: 7/19/2012

Lister Hill Center

The NDF-RT API is a web service for accessing the current National Drug File - Reference Terminology (NDF-RT) data set from your program via SOAP/WSDL.

Quick Links:

Building a Java Application to use the NDF-RT API

The NDF-RT API provides developers with functions for retrieving NDF-RT data from the most current NDF-RT data set. Building applications to use the NDF-RT API require initial setup of the development environment and developing code. Each of these is described in detail in this chapter.

Java Development Environment Setup

Setup of a Java developer's environment involves the following steps. All steps must be completed before application code can be compiled and built to execute requests with the NDF-RT API.
  1. Obtain a Simple Object Access Protocol (SOAP) 1.2 compatible engine for web service message routing.
  2. Download the WSDL for the NDF-RT API web service.
  3. Generate the client side stubs using Axis's WSDL2Java utility for the WSDL (for applications written in Java).

1. Obtaining a SOAP 1.2 Engine

Developers will require a Simple Object Access Protocol (SOAP) 1.2 compatible engine to route the web service messages to/from the NDF-RT API. The client programs shown in this guide have been tested with Apache Axis Version 1.4 Follow the link to their website and download and install the version onto your development machine. The location of this download will be referred to as <AXIS_DIR> in this guide.

2. Downloading the NDF-RT WSDL

The NDF-RT WSDL may be downloaded from the RxNav web site. Right-click on the NDF-RT API WSDL and save the WSDL file to your development machine. The path to this file will be hereafter referred to as <NDFRT_WSDL_LOCATION>.

3. Generating Client Stubs for Java

Apache Axis is delivered with a utility to generate Java classes from a WSDL. Using WSDL2Java generates client stubs that enable communication with a defined web service.
  prompt> java -classpath  <CLASSPATH> org.apache.axis.wsdl.WSDL2Java \
      <NDFRT_WSDL_LOCATION>
The call to the utility places generated Java class files in the directory where the utility is run. The <CLASSPATH> must include the following jar files generally found in the lib directory of the Axis installation:
axis.jar
wsdl4j-1.5.1.jar
commons-logging-1.0.4.jar
commons-discovery-0.2.jar
jaxrpc.jar
saaj.jar
activation.jar
mail.jar
Other SOAP engines use different utilities to generate the client stubs. Refer to your specific SOAP engine documentation for instructions on building the client stubs using the downloaded WSDL.

Coding Java Applications to use the NDF-RT API

The basic paradigm for obtaining NDF-RT data from the NDF-RT API web service is as follows:
  1. Establish a connection to the NDF-RT API web service.
  2. Obtain the data from the NDF-RT API web service.

Java Code: Establishing a Connection to the NDF-RT API Web Service

The NDF-RT API web service is an Axis web service running at the NLM on the RxNav production machine. The web service endpoint URI is http://mor.nlm.nih.gov/axis/services/NdfrtAPI The classes generated during WSDL2Java execution must be imported into your application. For Java applications, include these import statements:
import java.net.URL;
import BeanService.*;
import gov.nih.nlm.mor.axis.services.NdfrtAPI.*;

The following code snippet shows how to establish a connection to the NDF-RT API web service.
String ndfrtHost = "http://mor.nlm.nih.gov";
String ndfrtURI = ndfrtHost + "/axis/services/NdfrtAPI";

// Locate the NDF-RT API web service
URL ndfrtURL = new URL(ndfrtURI);
NdfrtAPIService ndfrtService = new NdfrtAPIServiceLocator();
NdfrtAPI ndfrt = ndfrtService.getNdfrtAPI(ndfrtURL);

Java Code: Obtaining NDF-RT Data

The NDF-RT API web service provides access to current NDF-RT data through its calls defined in the WSDL. The code snippet below gets the NDF-RT data set version. Each operation made available in the NDF-RT API web service is described in detail in the NDF-RT API reference section.
// Get the version
String version = ndfrt.getNDFRTversion();
// print results
System.out.println("NDF-RT Data Set version = " + version);

Compiling the Java Application

When compiling the application using the NDF-RT API, the CLASSPATH must include the directory into which the compiled stubs were put and the following jar files which are generally found in the lib directory of the Axis installation:
axis.jar
wsdl4j-1.5.1.jar
commons-logging-1.0.4.jar
commons-discovery-0.2.jar
jaxrpc.jar
saaj.jar
activation.jar
mail.jar



NDF-RT API Reference

This section contains the design details of the NDF-RT API. Each function contains a description, the inputs to the function, the outputs from the function and examples. Available functions:

Function Description
findConceptsByID Get the NDF-RT concept for a specified identifier
findConceptsByName Get the concepts for a specified name and kind
findDrugInteractions Get the drug concepts that interact with a given drug
findInteractionsFromListnew Get the interactions from a list of drugs
getAllConceptsByKind new Get concept information for specified kinds.
getAllInfo Get concept information
getAssociationList Get the association names
getChildConcepts Get the child concepts for a specified concept
getConceptProperties Get the concept property value for a specified concept and property name
getConceptsByProperty Get the concepts that contain a specified property name and value
getIdTypeList Get the identifier type names
getKindList Get the kind names in the NDF-RT data set
getNDFRTversion Get the version of the NDF-RT data set
getParentConcepts Get the parent concepts of a specified concept
getPropertyList Get the property names in the NDF-RT data set
getRelatedConceptsByAssociation Get the associations for a specified concept
getRelatedConceptsByReverseRole Get the concepts related to the specified object concept by role
getRelatedConceptsByRole Get the concepts related to the specified concept by role
getRoleList Get the role names in the NDF-RT data set
getVAClassMembers Get the members of a VA class
getVAClassOfConcept Get the VA class for a specified concept
interactions Check if there is an interaction between two drugs.


A sample API client written in perl is also available.

findConceptsByID( idType, idString )

Get the NDF-RT concept for a specified identifier.

Input:

idType - the type of identifier. See getIdTypeList for valid values.

idString - the value of the identifier.

Output:

An array NDF-RT minimal concept structures containing the following fields:

Example

findConceptsByID( "RXCUI", "36567" )

returns:
{
  { NUI="N0000005842", NAME="Simvastatin", KIND="INGREDIENT_KIND" },
  { NUI="N0000148200", NAME="SIMVASTATIN", KIND="DRUG_KIND" }
}

findConceptsByName( conceptName, kindName )

Get the concepts for a specified name and kind

Input:

conceptName - the name of the concept

kindName - (optional) the kind value. If not specified, all kinds are returned. See getKindList for valid values.

Output:

An array of minimal concept structures. Each concept structure contains:

Example

findConceptsByName( "aspirin", "DRUG_KIND")

returns
{
   {NUI="N0000145918", NAME="ASPIRIN", KIND="DRUG_KIND"}
}

findDrugInteractions( nui , scope )

Get the drug concepts that interact with a given drug

Input:

nui - the NDF-RT identifier of the drug

scope - (optional, default: 3) The range of concepts related to the specified drug that are to be checked for interactions. Possible values are:

Output:

An array of interaction type structures for the interacting drugs. Each interaction type structure contains:

Examples

In the following example, the interactions of the drug morphine are requested. No inference is allowed. Only those interactions asserted in NDF-RT are searched.
findDrugInteractions( "N0000145914" , 1)

returns

{
   {  COMMENT="MORPHINE is resolved to MORPHINE and MORPHINE has 6 interaction(s)",
      {NUI="N0000145914", NAME="MORPHINE", KIND="DRUG_KIND"},
      {
         {{NUI="N0000147939", NAME="NALTREXONE", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000171790", NAME="RASAGILINE", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000147737", NAME="BUPRENORPHINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000146932", NAME="RIFAMPIN", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000147743", NAME="BUTORPHANOL", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000147937", NAME="NALBUPHINE", KIND="DRUG_KIND"}, SEVERITY="Significant"}
      }
   }
}

In the example below, the interactions are requested for morphine sulfate, using first a scope value of 1. There are no interactions returned, because no interactions are asserted in NDF-RT for this drug form.
In the second part of the example, the scope value is set to 2, indicating that interactions for the non-salt form (here, morphine), can be used in lieu of that for the salt form (here, morphine sulfate), since no interactions were found for the salt form. The interactions for morphine are returned.
findDrugInteractions( "N0000145858" , 1)

returns

{}



findDrugInteractions( "N0000145858" , 2)

returns

{
   {  COMMENT="MORPHINE SULFATE is resolved to MORPHINE and MORPHINE has 6 interaction(s)",
      {NUI="N0000145914", NAME="MORPHINE", KIND="DRUG_KIND"},
      {
         {{NUI="N0000147939", NAME="NALTREXONE", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000171790", NAME="RASAGILINE", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000147737", NAME="BUPRENORPHINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000146932", NAME="RIFAMPIN", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000147743", NAME="BUTORPHANOL", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000147937", NAME="NALBUPHINE", KIND="DRUG_KIND"}, SEVERITY="Significant"}
      }
   }
}
In the next example, the interactions with naratriptan are requested with scope set to 2 (explore the non-salt form of specific salts as necessary). No interactions are found.
In the second part of the example, the scope is set to 3, which allows for exploring the specific salts of a non-salt form for interactions. Interactions are found with naratriptan hydrochloride, a salt form of naratriptan.
findDrugInteractions( "N0000022106" , 2)

returns

{}



findDrugInteractions( "N0000022106" , 3)

returns

{
   {  COMMENT="NARATRIPTAN is resolved to NARATRIPTAN HYDROCHLORIDE and NARATRIPTAN HYDROCHLORIDE has 19 interaction(s)",
      {NUI="N0000148545", NAME="NARATRIPTAN HYDROCHLORIDE", KIND="DRUG_KIND"},
      {
         {{NUI="N0000022990", NAME="SIBUTRAMINE HYDROCHLORIDE", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000146837", NAME="ERGOTAMINE TARTRATE", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000147201", NAME="ERGOT", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000147971", NAME="PHENELZINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148335", NAME="PAROXETINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000147852", NAME="FLUOXETINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148386", NAME="FLUVOXAMINE MALEATE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148387", NAME="NEFAZODONE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148400", NAME="TRAMADOL HYDROCHLORIDE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148038", NAME="TRANYLCYPROMINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148257", NAME="SERTRALINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148583", NAME="CITALOPRAM", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148775", NAME="ESCITALOPRAM OXALATE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148860", NAME="DULOXETINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148355", NAME="VENLAFAXINE HYDROCHLORIDE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148514", NAME="SUMATRIPTAN", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000176142", NAME="DESVENLAFAXINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000179820", NAME="TAPENTADOL", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000182438", NAME="VILAZODONE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
      }
   }
}
In the next example, the multiple ingredient drug acetaminophen/tramadol has interactions for both ingredients.
findDrugInteractions( "N0000022251" , 3)

returns

{
   {  COMMENT="ACETAMINOPHEN/TRAMADOL is resolved to TRAMADOL HYDROCHLORIDE and TRAMADOL HYDROCHLORIDE has 43 interaction(s)",
      {NUI="N0000148400", NAME="TRAMADOL HYDROCHLORIDE", KIND="DRUG_KIND"},
      {
         {{NUI="N0000023009", NAME="HYPERICUM PERFORATUM (ST. JOHN'S WORT)", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000147971", NAME="PHENELZINE", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000148014", NAME="SELEGILINE", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000147939", NAME="NALTREXONE", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000148043", NAME="TRIFLUPROMAZINE", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000147991", NAME="PROCARBAZINE", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000146143", NAME="ISOCARBOXAZID", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000148038", NAME="TRANYLCYPROMINE", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000148664", NAME="LINEZOLID", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000148042", NAME="TRIFLUOPERAZINE", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000171790", NAME="RASAGILINE", KIND="DRUG_KIND"}, SEVERITY="Critical"},
         {{NUI="N0000146226", NAME="CARBAMAZEPINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148257", NAME="SERTRALINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148355", NAME="VENLAFAXINE HYDROCHLORIDE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000147852", NAME="FLUOXETINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148387", NAME="NEFAZODONE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000147779", NAME="CLOMIPRAMINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000147828", NAME="DOXEPIN", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000147800", NAME="DESIPRAMINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000147946", NAME="NORTRIPTYLINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000147895", NAME="MAPROTILINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148545", NAME="NARATRIPTAN HYDROCHLORIDE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148576", NAME="RIZATRIPTAN", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148775", NAME="ESCITALOPRAM OXALATE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148709", NAME="ALMOTRIPTAN", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000147702", NAME="AMITRIPTYLINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148335", NAME="PAROXETINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148386", NAME="FLUVOXAMINE MALEATE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000147875", NAME="IMIPRAMINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148047", NAME="TRIMIPRAMINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000146270", NAME="AMOXAPINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148003", NAME="PROTRIPTYLINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148583", NAME="CITALOPRAM", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148550", NAME="ZOLMITRIPTAN", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148791", NAME="ELETRIPTAN", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148860", NAME="DULOXETINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000147701", NAME="AMIODARONE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148514", NAME="SUMATRIPTAN", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000147791", NAME="CYCLOBENZAPRINE", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148357", NAME="LEVOMETHADYL", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000148734", NAME="FROVATRIPTAN", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000171783", NAME="MILNACIPRAN", KIND="DRUG_KIND"}, SEVERITY="Significant"},
         {{NUI="N0000176142", NAME="DESVENLAFAXINE", KIND="DRUG_KIND"}, SEVERITY="Significant"}
      }
   },
   {  COMMENT="ACETAMINOPHEN/TRAMADOL is resolved to ACETAMINOPHEN and ACETAMINOPHEN has 2 interaction(s)",
      {NUI="N0000145898", NAME="ACETAMINOPHEN", KIND="DRUG_KIND"},
      {
         {{NUI="N0000147089", NAME="SULFINPYRAZONE", KIND="DRUG_KIND"},SEVERITY="Significant"},
         {{NUI="N0000145890", NAME="ISONIAZID", KIND=DRUG_KIND"},SEVERITY="Significant"}
      }
   }
}

findInteractionsFromList( nuiValues , scope )

Get the interactions from a list of drugs.

Input:

nuiValues - array of NDF-RT identifiers. There is a limit of 50 identifiers. Specifying more than 50 values will result in no output.

scope - (optional, default: 3) The range of concepts related to the specified drug that are to be checked for interactions. Possible values are:

Output:

An interactions structure containing the following fields:

Example

In the following example, the ingredients morphine (NUI="N0000007070") and rasagiline (NUI="N0000179514") are checked. The returned data indicates that there is an interaction between the two drugs.
findInteractionsFromList( {"N0000007070", "N0000179514"}, 2 )

returns
{
   {NUI="N0000007070", NAME="morphine", KIND="INGREDIENT_KIND"},
   {NUI="N0000179514", NAME="rasagiline", KIND="INGREDIENT_KIND"},
   INTERACTIONCOUNT=1,
   {
      {NUI="N0000176852", NAME="MORPHINE/RASAGILINE", KIND="DRUG_INTERACTION_KIND"},
      {NUI="N0000145914", NAME="MORPHINE", KIND="DRUG_KIND"},
      {NUI="N0000171790", NAME="RASAGILINE", KIND="DRUG_KIND"},
      SEVERITY="Critical",
   }
   COMMENT=""
}

getAllConceptsByKind( kinds )

Get concept information for the specified kinds.

Input:

kinds - an array of Kinds. See getKindList example for valid values.

Output:

An array of minimal concept structures. Each concept structure contains:

Example

getAllConceptsByKind({"DOSE_FORM_KIND"})

returns:
{
  {nui="N0000010000", name="12 Hour Extended Release Suspension", kind="DOSE_FORM_KIND"},
  {nui="N0000135674", name="12 Hour Extended Release Capsule", kind="DOSE_FORM_KIND"},
  {nui="N0000135675", name="12 Hour Extended Release Tablet", kind="DOSE_FORM_KIND"},
  {nui="N0000135676", name="16 Hour Transdermal Patch", kind="DOSE_FORM_KIND"},
  {nui="N0000135677", name="24 Hour Extended Release Capsule", kind="DOSE_FORM_KIND"},

  (many more ...)

}

getAllInfo( nui )

Get concept information

Input:

nui - the NDF-RT identifier

Output:

A concept structure containing the following fields:

Example

getAllInfo( "N0000146307" )

returns
{
   children=
   {
      { NUI="N0000151099", NAME="SULINDAC 150MG TAB", KIND="DRUG_KIND" },
      { NUI="N0000151100", NAME="SULINDAC 200MG TAB", KIND="DRUG_KIND" },
      { NUI="N0000151101", NAME="SULINDAC 200MG TAB,EC", KIND="DRUG_KIND" }
   },
   parents=
   {
      { NUI="N0000010601", NAME="S [Preparations]", KIND="DRUG_KIND" }
   },
   NUI="N0000146307", NAME="SULINDAC", KIND="DRUG_KIND",
   associations= {},
   roles=
   {
      { NAME="CI_with",   OBJECT={NUI="N0000000999", NAME="Drug Hypersensitivity", KIND="DISEASE_KIND"}},
      { NAME="CI_with",   OBJECT={NUI="N0000010195", NAME="Pregnancy", KIND="DISEASE_KIND"}},
      { NAME="may_treat", OBJECT={NUI="N0000003204", NAME="Arthritis, Gouty", KIND="DISEASE_KIND"}},
      { NAME="may_treat", OBJECT={NUI="N0000000482", NAME="Arthritis, Rheumatoid", KIND="DISEASE_KIND"}},
      { NAME="may_treat", OBJECT={NUI="N0000001687", NAME="Inflammation", KIND="DISEASE_KIND"}},
      { NAME="may_treat", OBJECT={NUI="N0000002244", NAME="Osteoarthritis", KIND="DISEASE_KIND"}},
      { NAME="may_treat", OBJECT={NUI="N0000002632", NAME="Rheumatic Diseases", KIND="DISEASE_KIND"}},
      { NAME="has_PE",    OBJECT={NUI="N0000008836", NAME="Decreased Prostaglandin Production", KIND="PHYSIOLOGIC_EFFECT_KIND"}},
      { NAME="has_Ingredient", OBJECT={NUI="N0000007042", NAME="sulindac", KIND="INGREDIENT_KIND"}},
      { NAME="has_MoA",   OBJECT={NUI="N0000000160", NAME="Cyclooxygenase Inhibitors", KIND="MECHANISM_OF_ACTION_KIND"}}
   },
   properties=
   {
      { NAME="Display_Name", VALUE="SULINDAC"},
      { NAME="NUI",          VALUE="N0000146307"},   
      { NAME="VANDF_Record", VALUE="50.416^552^50.416552"},   
      { NAME="VANDF_Record", VALUE="50.6^296^50.6296"},   
      { NAME="kind",         VALUE="DRUG_KIND"},   
      { NAME="RxNorm_Name",  VALUE="Sulindac"},   
      { NAME="RxNorm_CUI",   VALUE="10237"},   
      { NAME="Level",        VALUE="Ingredient"},   
      { NAME="FDA_UNII",     VALUE="184SNS8VUH"},   
      { NAME="code",         VALUE="C20526"},   
      { NAME="Status",       VALUE="Active"},   
      { NAME="VUID",         VALUE="4017957"},   
      { NAME="UMLS_CUI",     VALUE="C0038792"}   
   }
}

getAssociationList( )

Get the association names

Input:

None

Output:

An array of valid association names.

Example

getAssociationList()

returns

{ "Heading_Mapped_To", "Ingredient_1", "Ingredient_2", "Product_Component", "Product_Component-2" }

getChildConcepts( nui, transitive )

Get the child concepts for a specified concept

Input:

nui - the NDF-RT identifier

transitive - (optional, default: false) if false, then only direct child concepts are returned. If true, all descendant concepts are returned.

Output:

An array of minimal concept structures. Each concept structure contains:

Example

getChildConcepts( "N0000146307", false )

returns

{
   { NUI="N0000151099", NAME="SULINDAC 150MG TAB",    KIND="DRUG_KIND" },
   { NUI="N0000151100", NAME="SULINDAC 200MG TAB",    KIND="DRUG_KIND" },
   { NUI="N0000151101", NAME="SULINDAC 200MG TAB,EC", KIND="DRUG_KIND" }
}

getConceptProperties( nui, propName )

Get the concept property value for a specified concept and property name

Input:

nui - the NDF-RT identifier

propName - (optional) the property name. If not specified, all properties are returned. See getPropertyList for valid values.

Output:

An array of property structures. Each property structure contains the following fields:

Example

getConceptProperties( "N0000022046", "VUID" )

returns

{
   {NAME="VUID" VALUE="4024041"}
}

getConceptsByProperty( propertyName, propertyValue )

Get the concepts that contain a specified property name and value

Input:

propertyName - name of the property. See getPropertyList example for valid values.

propertyValue - the property value

Output:

An array of minimal concept structures. Each minimal concept structure contains:

Example

getConceptsByProperty("UMLS_CUI", "C0000970")

returns

{
   { NUI="N0000145898", NAME="ACETAMINOPHEN", KIND="DRUG_KIND" },
   { NUI="N0000007359", NAME="Acetaminophen", KIND="INGREDIENT_KIND" }
}

getIdTypeList()

Get the identifier type names

Input:

None

Output:

An array of identifier types

Example

getIdTypeList()

returns

{ "CODE", "MeSH_CUI", "MeSH_DUI", "NUI", "RxCUI", "UMLSCUI", "UNII", "VUID" }

getKindList()

Get the kind names in the NDF-RT data set

Input:

None

Output:

An array of kind names

Example

getKindList()

returns

{
  "DISEASE_KIND", "DOSE_FORM_KIND", "DRUG_INTERACTION_KIND", "DRUG_KIND", "INGREDIENT_KIND",
  "MECHANISM_OF_ACTION_KIND", "PHARMACOKINETICS_KIND", "PHYSIOLOGIC_EFFECT_KIND",
  "THERAPEUTIC_CATEGORY_KIND"
}

getNDFRTversion()

Get the version of the NDF-RT data set

Input:

None

Output:

The version of the NDF-RT data set

Example

getNDFRTversion()

returns

2010.11.01

getParentConcepts( nui, transitive )

Get the parent concepts of a specified concept

Input:

nui - the NDF-RT identifier

transitive - (optional, default: false) if false, then only direct parent concepts are returned. If true, return all ancestor concepts.

Output:

An array of minimal concept structures. Each concept structure contains:

Example

getParentConcepts( "N0000145914", "true" )

returns

{
   {NUI="N0000010582", NAME="Drug Products by Generic Ingredient Combinations", KIND="DRUG_KIND"},
   {NUI="N0000010595", NAME="M [Preparations]", KIND="DRUG_KIND"},
   {NUI="N0000010582", NAME="Pharmaceutical Preparations", KIND="DRUG_KIND"}
}

getPropertyList()

Get the property names in the NDF-RT data set

Input:

None

Output:

An array of property names

Example

getPropertyList()

returns

{
  "CS_Federal_Schedule", "Class_Code", "Class_Description", "Display_Name", "FDA_UNII",
  "Level", "MeSH_CUI", "MeSH_DUI", "MeSH_Definition", "MeSH_Name", "NUI",
  "Print_Name", "RxNorm_CUI", "RxNorm_Name", "SNOMED_CID", "Severity", "Status",
  "Strength", "Synonym", "UMLS_CUI", "Units", "VANDF_Record", "VA_National_Formulary_Name",
  "VUID", "code", "kind"
}

getRelatedConceptsByAssociation( nui, assocName )

Get the associations for a specified concept

Input:

nui - the NDF-RT concept identifier

assocName - (optional) the association name. If not specified, then all associations are returned for the concept. See getAssociationList for valid values.

Output:

An array of association structures. Each association structure contains:

Example

getRelatedConceptsByAssociation( "N0000150128", "PRODUCT_COMPONENT" )

returns

{
   {NAME="Product_Component", OBJECTNUI="N0000146102"},
   {NAME="Product_Component", OBJECTNUI="N0000146103"}
}

getRelatedConceptsByReverseRole( nui, roleName, transitive )

Get the concepts related to the specified object concept by role. The concept specified in the call is the object of the role. This differs from the concept specified in getRelatedConceptsByRole where the concept specified is the subject of the role.

Input:

nui - the NDF-RT identifier of the object concept

roleName - the role. See getRoleList for valid values.

transitive - (optional, default: false) if false, the results will have a direct link through the role to the object concept. If true, then the results can be indirectly linked through the role via a descendant of the object concept.

Output:

An array of minimal concept structures. Each minimal concept structure contains:

Example

In the example below, the drugs which "may_treat" arthritis (NUI="N0000000478") are returned. In the first case, the transitive flag is false, returning only the drugs which have a direct link to arthritis.
In the second case, the transitive flag is true, allowing links to the descendants of arthritis, such as osteoarthritis.
getRelatedConceptsByReverseRole( "N0000000478", "may_treat", "false")

returns

{
   {NUI="N0000022978", NAME="CHONDROITIN SODIUM", KIND="DRUG_KIND"},
   {NUI="N0000148758", NAME="DEVILS CLAW", KIND="DRUG_KIND"},
   {NUI="N0000148143", NAME="LINOLENIC ACID", KIND="DRUG_KIND"},
   {NUI="N0000020848", NAME="MECLOFENAMATE", KIND="DRUG_KIND"},
   {NUI="N0000147121", NAME="SALSALATE", KIND="DRUG_KIND"}
}

getRelatedConceptsByReverseRole( "N0000000478", "may_treat", "true")

returns

{
   {NUI="N0000147846", NAME="FENOPROFEN", KIND="DRUG_KIND"},
   {NUI="N0000147806", NAME="DICLOFENAC", KIND="DRUG_KIND"},
   {NUI="N0000148161", NAME="NABUMETONE", KIND="DRUG_KIND"},
   {NUI="N0000148313", NAME="OXAPROZIN", KIND="DRUG_KIND"},
   {NUI="N0000146358", NAME="AURANOFIN", KIND="DRUG_KIND"},
   {NUI="N0000148649", NAME="MELOXICAM", KIND="DRUG_KIND"},
   {NUI="N0000145827", NAME="PENICILLIN G BENZATHINE", KIND="DRUG_KIND"},
   {NUI="N0000146197", NAME="IBUPROFEN", KIND="DRUG_KIND"},
   {NUI="N0000146225", NAME="PROBENECID", KIND="DRUG_KIND"},
   {NUI="N0000146290", NAME="PENICILLAMINE", KIND="DRUG_KIND"},
   {NUI="N0000148789", NAME="ADALIMUMAB", KIND="DRUG_KIND"},
   {NUI="N0000148773", NAME="FISH OIL", KIND="DRUG_KIND"},
   {NUI="N0000020848", NAME="MECLOFENAMATE", KIND="DRUG_KIND"},
   {NUI="N0000147399", NAME="FLURBIPROFEN", KIND="DRUG_KIND"},
   {NUI="N0000147659", NAME="ETODOLAC", KIND="DRUG_KIND"},
   {NUI="N0000148586", NAME="LEFLUNOMIDE", KIND="DRUG_KIND"},
   {NUI="N0000148588", NAME="THALIDOMIDE", KIND="DRUG_KIND"},
   {NUI="N0000147121", NAME="SALSALATE", KIND="DRUG_KIND"},
   {NUI="N0000145994", NAME="CAPTOPRIL", KIND="DRUG_KIND"},
   {NUI="N0000147069", NAME="AZATHIOPRINE", KIND="DRUG_KIND"},
   {NUI="N0000147064", NAME="CYCLOSPORINE", KIND="DRUG_KIND"},
   {NUI="N0000022978", NAME="CHONDROITIN SODIUM", KIND="DRUG_KIND"},
   {NUI="N0000148778", NAME="GLUCOSAMINE", KIND="DRUG_KIND"},
   {NUI="N0000145918", NAME="ASPIRIN", KIND="DRUG_KIND"},
   {NUI="N0000148590", NAME="ETANERCEPT", KIND="DRUG_KIND"},
   {NUI="N0000146760", NAME="CHOLINE SALICYLATE", KIND="DRUG_KIND"},
   {NUI="N0000022608", NAME="GOLD", KIND="DRUG_KIND"},
   {NUI="N0000147767", NAME="CHLOROQUINE", KIND="DRUG_KIND"},
   {NUI="N0000022347", NAME="CHONDROITIN", KIND="DRUG_KIND"},
   {NUI="N0000146939", NAME="PIROXICAM", KIND="DRUG_KIND"},
   {NUI="N0000146243", NAME="INDOMETHACIN", KIND="DRUG_KIND"},
   {NUI="N0000148596", NAME="CELECOXIB", KIND="DRUG_KIND"},
   {NUI="N0000148143", NAME="LINOLENIC ACID", KIND="DRUG_KIND"},
   {NUI="N0000146247", NAME="ALLOPURINOL", KIND="DRUG_KIND"},
   {NUI="N0000147107", NAME="AUROTHIOGLUCOSE", KIND="DRUG_KIND"},
   {NUI="N0000146249", NAME="SULFASALAZINE", KIND="DRUG_KIND"},
   {NUI="N0000029322", NAME="ANTIGOUT AGENTS", KIND="DRUG_KIND"},
   {NUI="N0000148037", NAME="TOLMETIN", KIND="DRUG_KIND"},
   {NUI="N0000148721", NAME="VALDECOXIB", KIND="DRUG_KIND"},
   {NUI="N0000145804", NAME="COLCHICINE", KIND="DRUG_KIND"},
   {NUI="N0000147916", NAME="METHOTREXATE", KIND="DRUG_KIND"},
   {NUI="N0000146300", NAME="DIFLUNISAL", KIND="DRUG_KIND"},
   {NUI="N0000147089", NAME="SULFINPYRAZONE", KIND="DRUG_KIND"},
   {NUI="N0000147835", NAME="ENALAPRIL", KIND="DRUG_KIND"},
   {NUI="N0000148718", NAME="ANAKINRA", KIND="DRUG_KIND"},
   {NUI="N0000147149", NAME="NAPROXEN", KIND="DRUG_KIND"},
   {NUI="N0000148758", NAME="DEVILS CLAW", KIND="DRUG_KIND"},
   {NUI="N0000148611", NAME="ROFECOXIB", KIND="DRUG_KIND"},
   {NUI="N0000146405", NAME="KETOPROFEN", KIND="DRUG_KIND"},
   {NUI="N0000022992", NAME="HYLAN G-F 20", KIND="DRUG_KIND"},
   {NUI="N0000146307", NAME="SULINDAC", KIND="DRUG_KIND"},
   {NUI="N0000147871", NAME="HYDROXYCHLOROQUINE", KIND="DRUG_KIND"}
}

getRelatedConceptsByRole( nui, roleName, transitive )

Get the concepts related to the specified concept by role

Input:

nui - the NDF-RT identifier

roleName - the role. See getRoleList for valid values.

transitive - (optional, default: false) if false, then only the concepts directly associated through the role are returned. If true, the concepts directly associated with the role and the descendants of these concepts are returned.

Output:

An array of minimal concept structures. Each minimal concept structure contains:

Example

getRelatedConceptsByRole( "N0000145914", "may_treat", "false")

returns

{
   {NUI="N0000001030", NAME="Dyspnea", KIND="DISEASE_KIND"},
   {NUI="N0000002278", NAME="Pain",    KIND="DISEASE_KIND"},
   {NUI="N0000002279", NAME="Pain, Intractable", KIND="DISEASE_KIND"}
}

getRoleList()

Get the role names in the NDF-RT data set

Input:

None

Output:

An array containing the roles

Example

getRoleList()

returns

{
  "CI_ChemClass", "CI_MoA", "CI_PE", "CI_with effect_may_be_inhibited_by", "has_Chemical_Structure",
  "has_Ingredient", "has_MoA", "has_PE", "has_PK", "has_TC", "has_active_metabolites", "induces",
  "may_diagnose", "may_prevent", "may_treat", "may_treat_or_prevent", "metabolized_by",
  "site_of_metabolism"
}

getVAClassMembers( nui )

Get the members of a VA class

Input:

nui - the NDF-RT identifier of the VA class

Output:

An array of minimal concept structures containing the following fields:

Example

The following example retrieves the members of the VA class "Antimalarials" (NUI=N0000029367).
getVAClassMembers( "N0000029367" )

returns

{
  { NUI="N0000156166", NAME="AMODIAQUINE HCL 100MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000178473", NAME="ARTEMETHER 20MG/LUMEFANTRINE 120MG TAB,PKT,24", KIND="DRUG_KIND" },
  { NUI="N0000162660", NAME="ATOVAQUONE 250MG/PROGUANIL HCL 100MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000162661", NAME="ATOVAQUONE 62.5MG/PROGUANIL HCL 25MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000152249", NAME="CHLOROQUINE HCL 250MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000152246", NAME="CHLOROQUINE HCL 50MG/ML INJ", KIND="DRUG_KIND" },
  { NUI="N0000152248", NAME="CHLOROQUINE PO4 250MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000152250", NAME="CHLOROQUINE PO4 500MG/PRIMAQUINE PO4 79MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000152247", NAME="CHLOROQUINE PO4 500MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000161065", NAME="HALOFANTRINE HCL 250MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000152386", NAME="HYDROXYCHLOROQUINE SO4 200MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000157039", NAME="MEFLOQUINE HCL 250MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000152398", NAME="PRIMAQUINE PO4 26.3MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000154509", NAME="PYRIMETHAMINE 25MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000150407", NAME="PYRIMETHAMINE 25MG/SULFADOXINE 500MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000152251", NAME="QUINACRINE HCL 100MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000153693", NAME="QUININE SO4 130MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000153696", NAME="QUININE SO4 162.5MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000153694", NAME="QUININE SO4 200MG CAP", KIND="DRUG_KIND" },
  { NUI="N0000153690", NAME="QUININE SO4 260MG TAB", KIND="DRUG_KIND" },
  { NUI="N0000153691", NAME="QUININE SO4 300MG CAP", KIND="DRUG_KIND" },
  { NUI="N0000178117", NAME="QUININE SO4 324MG CAP", KIND="DRUG_KIND" },
  { NUI="N0000153692", NAME="QUININE SO4 325MG CAP", KIND="DRUG_KIND" }
}

getVAClassOfConcept( nui )

Get the VA class for a specified concept

Input:

nui - the NDF-RT identifier

Output:

A minimal concept structure containing the following fields:

Example

getVAClassOfConcept( "N0000160834" )

returns

{ NUI="N0000029122", NAME="ANTILIPEMIC AGENTS", KIND="DRUG_KIND" }

interactions( nui1, nui2, scope)

Check if two drugs interact with each other.

Input:

nui1 - the NDF-RT identifier of the first drug

nui2 - the NDF-RT identifier of the second drug

scope - (optional, default: 3) The range of concepts related to the specified drug that are to be checked for interactions. Possible values are:

Output:

An interactions structure containing the following fields:

Example

In the following example, the ingredients morphine (NUI="N0000007070") and rasagiline (NUI="N0000179514") are checked. The returned data indicates that there is an interaction between the two drugs.
interactions( "N0000007070", "N0000179514", 2 )

returns
{
   {NUI="N0000007070", NAME="morphine", KIND="INGREDIENT_KIND"},
   {NUI="N0000179514", NAME="rasagiline", KIND="INGREDIENT_KIND"},
   INTERACTIONCOUNT=1,
   {
      {NUI="N0000176852", NAME="MORPHINE/RASAGILINE", KIND="DRUG_INTERACTION_KIND"},
      {NUI="N0000145914", NAME="MORPHINE", KIND="DRUG_KIND"},
      {NUI="N0000171790", NAME="RASAGILINE", KIND="DRUG_KIND"},
      SEVERITY="Critical",
   }
   COMMENT=""
}

NDF-RT Web API Client

An interactive web client which calls the NDF-RT API functions is publicly available. To access the client, bring up a web browser and enter the following URL: http://mor.nlm.nih.gov/perl/ndfrt_api_demo.pl

This will bring up the application shown below:

NDF-RT API Client


The web application can call any of the API functions available from the Method: drop down list. Parameters for the functions are entered in the Arg1, Arg2 and Arg3 positions on the screen. In the example below, the function findDrugInteractions is selected and N0000145914 is entered for Arg1 (the NUI) and 1 is entered for arg2 (scope) . The answer is shown in the colored box below the form.

NDF-RT API Client - findDrugInteractions


Comments? Feedback? Questions?
Contact: Contact us


U.S. National Library of Medicine, 8600 Rockville Pike, Bethesda, MD 20894
National Institutes of Health, Department of Health & Human Services
Copyright, Privacy, Accessibility