API for RxTerms

RxTerms is a drug interface terminology derived from RxNorm (the U.S. terminology standard for clinical drugs) which can be easily used for prescription writing or medication history recording (e.g., in e-prescribing systems or PHRs).

This API provides access to the RxTerms DISPLAY_NAME (drug name/route pairs) field, and provides the associated list of strengths and forms as a pre-built list for each drug.

API Demo

The following demo shows how this API might be used with an autocompleter we've developed. When you pick a drug, the strength field will get populated with the list of strengths for that drug (from the STRENGTHS_AND_FORMS field).

For further experimentation with the autocompleter and this API, try the autocompleter demo page.

API Documentation

API Base URL: https://clinicaltables.nlm.nih.gov/api/rxterms/v3/search (+ query string parameters)

This data set may also be accessed through the FHIR ValueSet $expand operation.

In addition to the base URL, you will need to specify other parameters. See the query string parameters section below for details.

Query String Parameters and Default Values

At a minimum, when using the above base URL, you will need to specify the "terms" parameter containing a word or partial word to match.

Parameter NameDefault ValueDescription
terms(Required.) The search string (e.g., just a part of a word) for which to find matches in the list. More than one partial word can be present in "terms", in which case there is an implicit AND between them.
maxList Optional, with a default of 7. Specifies the number of results requested, up to the upper limit of 500. If present but the value is empty, 500 will be used.
qAn optional, additional query string used to further constrain the results returned by the "terms" field. Unlike the terms field, "q" is not automatically wildcarded, but can include wildcards and can specify field names. See the Elasticsearch query string page for documentation of supported syntax.
dfDISPLAY_NAMEA comma-separated list of display fields (from the fields section below) which are intended for the user to see when looking at the results.
sfDISPLAY_NAME, DISPLAY_NAME_SYNONYMA comma-separated list of fields to be searched.
cfDISPLAY_NAMEA field to regard as the "code" for the returned item data. (In this case, there isn't a code that corresponds to DISPLAY_NAME, so the name string is used.)
efA comma-separated list of additional fields to be returned for each retrieved list item. (See the Output format section for how the data for fields is returned.) If you wish the keys in the returned data hash to be something other than the field names, you can specify an alias for the field name by separating it from its field name with a colon, e.g., "ef=field_name1:alias1,field2,field_name3:alias3,etc. Note that not every field specified in the ef parameter needs to have an alias.

RxTerms Field Descriptions

FieldField Description
DISPLAY_NAMEThe drug name and route combination, taken from the DISPLAY_NAME field of the RxTerms data file.
STRENGTHS_AND_FORMSA list of strength and form combination strings (e.g., "2mg Tab") for the drug.
RXCUISThese are codes for the DISPLAY_NAME + strength-form combination. The codes are taken from the RXCUI field of RxTerms.
DISPLAY_NAME_SYNONYMThe synonyms from the DISPLAY_NAME_SYNONYM field in the RxTerms data file. This is an array of synonyms in case there is more than one per DISPLAY_NAME. However, this list does not provide an association between synonyms and strength values, as the RxTerms data file does.

Output format

Output for an API query is an array of the following elements:

  1. The total number of results on the server (which can be more than the number returned). For APIs in which there are millions of records, this number might be a lower bound due to early termination if there are more than a hundred thousand results.
  2. An array of codes for the returned items. (This is the field specified with the cf query parameter above.)
  3. A hash of the "extra" data requested via the "ef" query parameter above. The keys on the hash are the fields (or their requested aliases) named in the "ef" parameter, and the value for a field is an array of that field's values in the same order as the returned codes.
  4. An array, with one element for each returned code, where each element is an array of the display strings specified with the "df" query parameter.
  5. An array, with one element for each returned code, where each element is the "code system" for the returned code. Note that only code-system aware APIs will return this array.

Sample API Queries

QueryResultDescription
https://clinicaltables.nlm.nih.gov/api/rxterms/v3/search?terms=arava&ef=STRENGTHS_AND_FORMS[1,["ARAVA (Oral Pill)"],{"STRENGTHS_AND_FORMS":[[" 10 mg Tab"," 20 mg Tab","100 mg Tab"]]}, [["ARAVA (Oral Pill)"]]]Returns all the drugs (in this case just one) matching "arava", along with its strength list. As noticed above, the the code and display name fields are the same for this data, which is why you see the name twice.
https://clinicaltables.nlm.nih.gov/api/rxterms/v3/search?terms=artic&ef=STRENGTHS_AND_FORMS,RXCUIS [2,["ARTICADENT (Injectable)","Articaine/EPINEPHrine (Injectable)"],{"STRENGTHS_AND_FORMS":[["40-0.005 mg/ml Cartridge 1.7 ml","40-0.01 mg/ml Cartridge 1.7 ml"],["40-0.005 mg/ml Cartridge 1.7 ml","40-0.005 mg/ml Cartridge 1.8 ml","40-0.01 mg/ml Cartridge 1.7 ml","40-0.01 mg/ml Cartridge 1.8 ml"]],"RXCUIS":[["1011646","1011648"],["1595029","1658966","1595035","1661483"]]}, [["ARTICADENT (Injectable)"],["Articaine/EPINEPHrine (Injectable)"]]] Returns the two results matching "artic". The strength list for each drug is also returned, in the same order as the drug name list, and the RXCUI codes for each drug name/strength combination is also returned, in the same order as the strength lists.