RxClass API
findClassByName
- Information returned
- Drug classes with a specified class name
- Service domain
- https://rxnav.nlm.nih.gov
- HTTP request
- GETÂ /REST/rxclass/class/byName.xml?className=value&classTypes=values
Description
Retrieve class information for a class indicated by className. The specified name may be a synonym for the class. If classTypes is specified, only classes of those types are returned.
Parameters
Parameter | Location | Use | Description | Default |
---|---|---|---|---|
format | Path | Optional | Notation for results One of:
| .xml |
className | Query | Required | Name of the class | |
classTypes | Query | Optional | Class type(s) (Space-separated list. See getClassTypes 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
- 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 named "radiopharmaceuticals"
XML: https://rxnav.nlm.nih.gov/REST/rxclass/class/byName?className=radiopharmaceuticals
JSON: https://rxnav.nlm.nih.gov/REST/rxclass/class/byName.json?className=radiopharmaceuticals
An XML result is shown below.
<rxclassdata> <rxclassMinConceptList> <rxclassMinConcept> <classId>D019275</classId> <className>Radiopharmaceuticals</className> <classType>CHEM</classType> </rxclassMinConcept> <rxclassMinConcept> <classId>349358000</classId> <className>Radiopharmaceuticals</className> <classType>THERAP</classType> <classUrl>http://snomed.info/id/349358000</classUrl> </rxclassMinConcept> </rxclassMinConceptList> </rxclassdata>