getApproximateMatch

Information returned
Concept and atom IDs approximately matching a query
Service domain
https://rxnav.nlm.nih.gov
HTTP request
GET  /REST/approximateTerm.xml?term=value&maxEntries=value&option=value

Description

Searches for strings in the data set that most closely match the term pararmeter.

This function is useful for strings where an exact or normalized string match (findRxcuiByString) does not find the desired results. For example, consider the following queries:

Search TermNote
ACCUPRIL 20 MG TAB TABLET(contains extra word)
HYDROCHLOROT 50 MG TABLET(unknown abbreviation)
Rantidine 15 ML Syrup Oral(misspelled word)

Results can optionally be limited to Active concepts with the option parameter.

Results include the score, rank, RxCUI and RxAUI of the closest strings. The strings themselves (RXNCONSO STR field) are not returned due to the proprietary nature of some of the strings. They can be retrieved by calling the RxNorm API function getProprietaryInformation using the RxCUI and RxAUI.

Results are returned in order by the quality of the lexical match, best results first (rank=1). The maxEntries parameter gives some control over the number of results, but more or fewer may be returned to avoid splitting a rank.

For more information about the approximate-matching algorithm, see Approximate Matching in the RxNorm API.

Upcoming Changes On or After July 5, 2021:
Upcoming Changes On or After August 2, 2021:

Scope

Selectable (see parameters):

  • Active: concepts in the current RxNorm data set that have an atom with SAB=RXNORM and SUPPRESS=N

  • Current: concepts in the current RxNorm data set that have an atom with SUPPRESS=N

Parameters

ParameterLocationUseDescriptionDefault
formatPathOptional

Notation for results

One of:
.xml
Get results in XML
.json
Get results in JSON
.xml
termQueryRequiredString, of which to find approximate matches
maxEntriesQueryOptionalCoarse control of number of results

(Range: 1 to 100.)

20
optionQueryOptionalScope of search
One of:
0
Find atoms in Current concepts
1
Find atoms in Active concepts
0

All query parameters are case-insensitive.

Output structure

Results are available as either XML or JSON.

  • The XML result has the root element rxnormdata. It is described in the XML Schema for the RxNorm API; the relevant element structure is summarized below. Elements that would be empty might be left out.

  • The JSON result is an object {...}, analogous to the content of the XML rxnormdata. Fields that might occur multiple times in the XML are expressed as an array. Fields that would be empty might be null or left out. Numbers are expressed as strings.

Both XML and JSON results follow the same outline:

rxnormdata
Root element in XML, or anonymous object in JSON
approximateGroup
inputTerm
Term sought
maxEntries
Requested number of results
option
Requested option
comment
Message from the search engine
candidate (array)
rxcui
RxNorm identifier
rxaui
RxNorm RXAUI (string identifier) that matches
score
Match score (higher is better)
rank
1 for all best matches, 2 for all second-best matches, etc.

Example: Terms like "zocor 10 mg"

XML: https://rxnav.nlm.nih.gov/REST/approximateTerm?term=zocor%2010%20mg&maxEntries=4

JSON: https://rxnav.nlm.nih.gov/REST/approximateTerm.json?term=zocor%2010%20mg&maxEntries=4

An XML result is shown below.

<rxnormdata>
    <approximateGroup>
        <inputTerm>zocor 10 mg</inputTerm>
        <maxEntries>4</maxEntries>
        <comment/>
        <candidate>
            <rxcui>104490</rxcui>
            <rxaui>2651386</rxaui>
            <score>75</score>
            <rank>1</rank>
        </candidate>
        <candidate>
            <rxcui>563653</rxcui>
            <rxaui>12297106</rxaui>
            <score>75</score>
            <rank>1</rank>
        </candidate>
    </approximateGroup>
</rxnormdata>