RxNorm API
getAllHistoricalNDCs
- Information returned
- National Drug Codes (NDC) ever associated with a concept
- Service domain
- https://rxnav.nlm.nih.gov
- HTTP request
- GETÂ /REST/rxcui/rxcui/allhistoricalndcs.xml?history=0or1or2
Description
Get the National Drug Codes (NDCs) for the RxNorm concept identified by rxcui. The history parameter selects NDCs currently associated with the concept (i.e., NDCs present in the current version of RxNorm), NDCs ever associated with the concept, or NDCs ever associated with the concept or any obsolete concept remapped into it.
The result status element categorizes NDC associations as "direct" or "indirect". NDCs associated by RxNorm with rxcui are categorized as "direct". If history option 2 was requested, NDCs that RxNorm associated with another concept, which subsequently was remapped to rxcui, are also included and are categorized as "indirect".
For each NDC association, the result indicates by startDate and endDate the first and last releases of RxNorm that indicated the association. NDC associations that are still in effect have an endDate of the current RxNorm release.
Scope
Current and Historical: concepts in current and previous RxNorm data sets
Parameters
Parameter | Location | Use | Description | Default |
---|---|---|---|---|
rxcui | Path | Required | RxNorm identifier of a drug product (term type SBD, SCD, BPCK, or GPCK) | |
format | Path | Optional | Notation for results One of:
| .xml |
history | Query | Optional | Depth of history to retrieve One of:
| 2 |
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
- historicalNdcConcept
- historicalNdcTime (array)
- One NDC's association to the RxNorm concept
- status
- "direct" = NDC is associated with the subject RxCUI. "indirect" = NDC was inherited through remapping
- rxcui
- RxCUI of concept to which the NDCs are or were directly associated
- ndcTime (array)
- NDC and period of association
- ndc (array of 1)
- National Drug Code (NDC) in CMS 11-digit format
- startDate
- the first RxNorm release where the NDC was active for this concept. Format is YYYYMM
- endDate
- the last RxNorm release where the NDC was active for this concept. Format is YYYYMM
Example: NDCs for Zithromax 500 MG Injection (RxCUI=1668240 or inherited through remapping)
XML: https://rxnav.nlm.nih.gov/REST/rxcui/1668240/allhistoricalndcs
JSON: https://rxnav.nlm.nih.gov/REST/rxcui/1668240/allhistoricalndcs.json
These NDCs includes NDCs associated with RxCUI=351772, which was remapped to the specified concept.
An XML result is shown below.
<rxnormdata> <historicalNdcConcept> <historicalNdcTime> <status>direct</status> <rxcui>1668240</rxcui> <ndcTime> <ndc>00069040001</ndc> <startDate>201511</startDate> <endDate>202408</endDate> </ndcTime> <ndcTime> <ndc>00069040010</ndc> <startDate>201511</startDate> <endDate>202408</endDate> </ndcTime> <ndcTime> <ndc>00069315014</ndc> <startDate>201511</startDate> <endDate>202104</endDate> </ndcTime> <ndcTime> <ndc>00069315083</ndc> <startDate>201511</startDate> <endDate>202408</endDate> </ndcTime> <ndcTime> <ndc>00069315084</ndc> <startDate>201511</startDate> <endDate>202408</endDate> </ndcTime> <ndcTime> <ndc>54868452700</ndc> <startDate>201511</startDate> <endDate>201907</endDate> </ndcTime> </historicalNdcTime> <historicalNdcTime> <status>indirect</status> <rxcui>351772</rxcui> <ndcTime> <ndc>00069040001</ndc> <startDate>201401</startDate> <endDate>201510</endDate> </ndcTime> <ndcTime> <ndc>00069040010</ndc> <startDate>201401</startDate> <endDate>201510</endDate> </ndcTime> <ndcTime> <ndc>00069315014</ndc> <startDate>200706</startDate> <endDate>201510</endDate> </ndcTime> <ndcTime> <ndc>00069315083</ndc> <startDate>200706</startDate> <endDate>201510</endDate> </ndcTime> <ndcTime> <ndc>00069315084</ndc> <startDate>201304</startDate> <endDate>201510</endDate> </ndcTime> <ndcTime> <ndc>54569468100</ndc> <startDate>200706</startDate> <endDate>201101</endDate> </ndcTime> <ndcTime> <ndc>54868452700</ndc> <startDate>200810</startDate> <endDate>201510</endDate> </ndcTime> <ndcTime> <ndc>55154271505</ndc> <startDate>200706</startDate> <endDate>201206</endDate> </ndcTime> <ndcTime> <ndc>61947315000</ndc> <startDate>200708</startDate> <endDate>201206</endDate> </ndcTime> <ndcTime> <ndc>61947315001</ndc> <startDate>200706</startDate> <endDate>201206</endDate> </ndcTime> <ndcTime> <ndc>61947315003</ndc> <startDate>200706</startDate> <endDate>201206</endDate> </ndcTime> </historicalNdcTime> </historicalNdcConcept> </rxnormdata>