APIs

RxClass API

getClassByRxNormDrugId

Information returned
Classes containing a specified drug RXCUI
Service domain
https://rxnav.nlm.nih.gov
HTTP request
GET  /REST/rxclass/class/byRxcui.xml?rxcui=value&relaSource=value&relas=values

Description

Get the classes that directly contain a given RxNorm concept (rxcui parameter) or any product or ingredient related to it (see default paths). The result can be filtered by drug-class sources (relaSource parameter) and relations (relas parameter).

The result does not include superclasses that only indirectly contain the concept or a related product or ingredient.

See the RxClass Overview for more details on the sources of drug-class relations and the relationship values.

Parameters

ParameterLocationUseDescriptionDefault
formatPathOptional

Notation for results

One of:
.xml
Get results in XML
.json
Get results in JSON
.xml
rxcuiQueryRequiredRxNorm identifier (RxCUI)
relaSourceQueryOptionalSource of drug-class relationships

(See getSourcesOfDrugClassRelations for the menu.)

ALL
relasQueryOptionalRelationship(s) the drug may have to the class

(Space-separated list. See getRelas for the menu.)

ALL

All query parameters are case-insensitive.

Note that HTTP requires that query parameters be "URL encoded". For instance, a "space-separated list" will, in practice, usually appear to use either a plus sign (+) or %20 as the separator. For full information on URL encoding, please refer to IETF RFC 3986, "Uniform Resource Identifier".

Output structure

Results are available as either XML or JSON.

  • The XML result has the root element rxclassdata. It is described in the XML Schema for the RxClass 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 rxclassdata. 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:

rxclassdata
Root element in XML, or anonymous object in JSON
rxclassDrugInfoList
rxclassDrugInfo (array)
minConcept
Drug that is a class member
rxcui
RxNorm identifier
name
Drug name
tty
Drug term type
rxclassMinConceptItem
Drug class
classId
Class identifier (an ID in the namespace of the class source)
className
Class name
classType
Class type (ATC1-4, CHEM, DISPOS, EPC, VA, etc.)
classUrl
Link to the class source
rela
Member relationship that defines the class
relaSource
Drug-member relationship source

Example: Classes that MED-RT associates by may_treat with morphine (RxCUI 7052)

XML: https://rxnav.nlm.nih.gov/REST/rxclass/class/byRxcui?rxcui=7052&relaSource=MEDRT&relas=may_treat

JSON: https://rxnav.nlm.nih.gov/REST/rxclass/class/byRxcui.json?rxcui=7052&relaSource=MEDRT&relas=may_treat

An XML result is shown below.

<rxclassdata>
    <rxclassDrugInfoList>
        <rxclassDrugInfo>
            <minConcept>
                <rxcui>235751</rxcui>
                <name>morphine hydrochloride</name>
                <tty>PIN</tty>
            </minConcept>
            <rxclassMinConceptItem>
                <classId>D004417</classId>
                <className>Dyspnea</className>
                <classType>DISEASE</classType>
            </rxclassMinConceptItem>
            <rela>may_treat</rela>
            <relaSource>MEDRT</relaSource>
        </rxclassDrugInfo>
        <rxclassDrugInfo>
            <minConcept>
                <rxcui>235751</rxcui>
                <name>morphine hydrochloride</name>
                <tty>PIN</tty>
            </minConcept>
            <rxclassMinConceptItem>
                <classId>D010148</classId>
                <className>Pain, Intractable</className>
                <classType>DISEASE</classType>
            </rxclassMinConceptItem>
            <rela>may_treat</rela>
            <relaSource>MEDRT</relaSource>
        </rxclassDrugInfo>
        ...
        <rxclassDrugInfo>
            <minConcept>
                <rxcui>7052</rxcui>
                <name>morphine</name>
                <tty>IN</tty>
            </minConcept>
            <rxclassMinConceptItem>
                <classId>D004417</classId>
                <className>Dyspnea</className>
                <classType>DISEASE</classType>
            </rxclassMinConceptItem>
            <rela>may_treat</rela>
            <relaSource>MEDRT</relaSource>
        </rxclassDrugInfo>
        <rxclassDrugInfo>
            <minConcept>
                <rxcui>7052</rxcui>
                <name>morphine</name>
                <tty>IN</tty>
            </minConcept>
            <rxclassMinConceptItem>
                <classId>D010148</classId>
                <className>Pain, Intractable</className>
                <classType>DISEASE</classType>
            </rxclassMinConceptItem>
            <rela>may_treat</rela>
            <relaSource>MEDRT</relaSource>
        </rxclassDrugInfo>
    </rxclassDrugInfoList>
</rxclassdata>