RxClass API
findClassesById
- Information returned
- Drug classes with a specified class identifier
- Service domain
- https://rxnav.nlm.nih.gov
- HTTP request
- GETÂ /REST/rxclass/class/byId.xml?classId=value
Description
Retrieve class information for classes identified by classId.
Class ID examples:
classId Example | ID Type | Class Types |
---|---|---|
B01AA | ATC ID | ATC1-4 |
D000998 | MeSH ID | CHEM, DISEASE |
M0545196 | MeSH Concept UI | CHEM, DISEASE |
N0000000133 | NUI | EPC, MOA, PE, PK |
MS140 | VA Class ID | VA |
324643005 | SNOMED CT ID | DISPOS, STRUCT |
Schedule3 | Drug Schedule | SCHEDULE |
NOTE: If the ID is a MeSH Concept UI, the response reflects the corresponding MeSH ID.
Parameters
Parameter | Location | Use | Description | Default |
---|---|---|---|---|
format | Path | Optional | Notation for results One of:
| .xml |
classId | Query | Required | Class identifier |
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 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
- rxclassMinConceptList
- Drug classes
- rxclassMinConcept (array)
- 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
See also
Example: Class identified by ATC B01AA
XML: https://rxnav.nlm.nih.gov/REST/rxclass/class/byId?classId=B01AA
JSON: https://rxnav.nlm.nih.gov/REST/rxclass/class/byId.json?classId=B01AA
An XML result is shown below.
<rxclassdata> <rxclassMinConceptList> <rxclassMinConcept> <classId>B01AA</classId> <className>Vitamin K antagonists</className> <classType>ATC1-4</classType> </rxclassMinConcept> </rxclassMinConceptList> </rxclassdata>
Example: Multiple classes identified by SNOMED CT identifier 323508007
XML: https://rxnav.nlm.nih.gov/REST/rxclass/class/byId?classId=323508007
JSON: https://rxnav.nlm.nih.gov/REST/rxclass/class/byId.json?classId=323508007
An XML result is shown below.
<rxclassdata> <rxclassMinConceptList> <rxclassMinConcept> <classId>323508007</classId> <className>Broad spectrum penicillin antibacterial agent</className> <classType>DISPOS</classType> <classUrl>http://snomed.info/id/323508007</classUrl> </rxclassMinConcept> <rxclassMinConcept> <classId>323508007</classId> <className>Broad spectrum penicillin antibacterial agent</className> <classType>STRUCT</classType> <classUrl>http://snomed.info/id/323508007</classUrl> </rxclassMinConcept> <rxclassMinConcept> <classId>323508007</classId> <className>Broad spectrum penicillin antibacterial agent</className> <classType>THERAP</classType> <classUrl>http://snomed.info/id/323508007</classUrl> </rxclassMinConcept> </rxclassMinConceptList> </rxclassdata>