APIs

RxNorm API

getRelaPaths

Information returned
Relationship paths leading from one term-type to another
Service domain
https://rxnav.nlm.nih.gov
HTTP request
GET  /REST/relapaths.xml?start=startingTTYs&finish=endingTTYs

Description

getRelaPaths returns the definition of RxNav's related-concepts graph. For example, an SCD's related PINs are found by following RxNorm's relationship from SCD to SCDC, then a second relationship, from SCDC to PIN. The two hops are represented as the "path" SCD, SCDC, PIN.

The paths can be filtered by the starting or terminal term type.

Scope

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

Parameters

ParameterLocationUseDescriptionDefault
formatPathOptional

Notation for results

One of:
.xml
Get results in XML
.json
Get results in JSON
.xml
startQueryOptionalStarting TTY

(See getTermTypes for the menu.)

finishQueryOptionalEnding TTY

(See getTermTypes for the menu.)

All query parameters are case-insensitive.

Note that HTTP requires that query parameters be "URL encoded". 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 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
relationPathList
Relationship paths that define RxNav's related concepts
relationPath (array)
A path from one TTY to another
tty (array)
The stops that make up the path, in order: the starting TTY, first hop, second hop, ..., ending TTY

Example: All paths

XML: https://rxnav.nlm.nih.gov/REST/relapaths

JSON: https://rxnav.nlm.nih.gov/REST/relapaths.json

An XML result is shown below.

<rxnormdata>
    <relationPathList>
        <relationPath>
            <tty>BN</tty>
            <tty>IN</tty>
        </relationPath>
        <relationPath>
            <tty>BN</tty>
            <tty>PIN</tty>
        </relationPath>
        <relationPath>
            <tty>BN</tty>
            <tty>SBD</tty>
        </relationPath>
        ...
    </relationPathList>
</rxnormdata>

Example: Paths from BPCK to related concepts

XML: https://rxnav.nlm.nih.gov/REST/relapaths?start=BPCK

JSON: https://rxnav.nlm.nih.gov/REST/relapaths.json?start=BPCK

An XML result is shown below.

<rxnormdata>
    <relationPathList>
        <relationPath>
            <tty>BPCK</tty>
            <tty>DF</tty>
        </relationPath>
        <relationPath>
            <tty>BPCK</tty>
            <tty>GPCK</tty>
        </relationPath>
        <relationPath>
            <tty>BPCK</tty>
            <tty>GPCK</tty>
            <tty>SCD</tty>
        </relationPath>
        ...
    </relationPathList>
</rxnormdata>

Example: Path from BPCK to IN

XML: https://rxnav.nlm.nih.gov/REST/relapaths?start=BPCK&finish=IN

JSON: https://rxnav.nlm.nih.gov/REST/relapaths.json?start=BPCK&finish=IN

An XML result is shown below.

<rxnormdata>
    <relationPathList>
        <relationPath>
            <tty>BPCK</tty>
            <tty>GPCK</tty>
            <tty>SCD</tty>
            <tty>SCDC</tty>
            <tty>IN</tty>
        </relationPath>
    </relationPathList>
</rxnormdata>