RxTerms RESTful Web API User's Guideupdated: 1/11/2012 |
The RxTerms RESTful API is a web service for accessing the current RxTerms data set.
Useful links:The RxTerms RESTful web API is a simple web service implemented using HTTP and can be thought of as a collection of resources, specified as URIs. Some characteristics of the RxTerms RESTful web API:
curl http://rxnav.nlm.nih.gov/REST/RxTerms/version (returns) <?xml version="1.0" encoding="UTF-8" standalone="yes"?><rxtermsdata><rxtermsVersion>RxTerms201011</rxtermsVersion></rxtermsdata>Notice that the data returned from the RxTerms RESTful web API is in XML format. The curl command takes a URL as part of its command sequence. The string http://rxnav.nlm.nih.gov/REST/RxTerms/version is a RxTerms RESTful web API resource. The Resources section details the RxTerms RESTful web API resources available to clients.
Clients to the RxTerms RESTful web API provide resource names in the form of URIs to receive data about the resources. Currently, the RxTerms API RESTful web services return the data in XML form as the default. The API can also return the data in JSON or plain text format. Here is the curl command, modified from above, to return the RxTerms version in JSON format:
curl -H "Accept:application/json" http://rxnav.nlm.nih.gov/REST/RxTerms/version (returns) {"rxtermsVersion":"RxTerms201106"}
Here is the curl command to return the RxNorm version in plain text format:
curl -H "Accept:text/plain" http://rxnav.nlm.nih.gov/REST/RxTerms/version (returns) RxTerms201106
RESTful web service resource | SOAP-based web service function |
/ | none |
/allconcepts | getAllConcepts |
/rxcui/{rxcui}/allinfo | getAllRxTermInfo |
/rxcui/{rxcui}/name | getRxTermDisplayName |
/version | getRxTermsVersion |
Example
http://rxnav.nlm.nih.gov/REST/RxTerms/ (returns) <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <rxtermsdata> <resourceList> <resource>http://rxnav.nlm.nih.gov/REST/RxTerms/version</resource> <resource>http://rxnav.nlm.nih.gov/REST/RxTerms/allconcepts</resource> <resource>http://rxnav.nlm.nih.gov/REST/RxTerms/rxcui/{rxcui}/allinfo</resource> <resource>http://rxnav.nlm.nih.gov/REST/RxTerms/rxcui/{rxcui}/name</resource> </resourceList> </rxtermsdata>
Example
http://rxnav.nlm.nih.gov/REST/RxTerms/allconcepts (returns) <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <rxtermsdata> <minConceptGroup> <minConcept> <fullName>0.09 ML pegaptanib 3.33 MG/ML Prefilled Syringe</fullName> <termType>SCD</termType> <rxcui>1011625</rxcui> </minConcept> <minConcept> <fullName>0.09 ML pegaptanib 3.33 MG/ML Prefilled Syringe [Macugen]</fullName> <termType>SBD</termType> <rxcui>1011626</rxcui> </minConcept> (many more ...) </minConceptGroup> </rxtermsdata>
Example
http://rxnav.nlm.nih.gov/REST/RxTerms/rxcui/198440/allinfo (returns) <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <rxtermsdata> <rxtermsProperties> <brandName/> <displayName>Acetaminophen (Oral-pill)</displayName> <synonym>APAP</synonym> <fullName>Acetaminophen 500 MG Oral Tablet</fullName> <fullGenericName>Acetaminophen 500 MG Oral Tablet</fullGenericName> <strength>500 mg</strength> <rxtermsDoseForm>Tabs</rxtermsDoseForm> <route>Oral-pill</route> <termType>SCD</termType> <rxcui>198440</rxcui> <genericRxcui>0</genericRxcui> <rxnormDoseForm>Oral Tablet</rxnormDoseForm> <suppress/> </rxtermsProperties> </rxtermsdata>
Example
http://rxnav.nlm.nih.gov/REST/RxTerms/rxcui/198440/name (returns) <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <rxtermsdata> <displayGroup> <rxcui>198440</rxcui> <displayName>Acetaminophen (Oral-pill)</displayName> </displayGroup> </rxtermsdata>
Example
http://rxnav.nlm.nih.gov/REST/RxTerms/version (returns) <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <rxtermsdata> <rxtermsVersion>RxTerms201011</rxtermsVersion> </rxtermsdata>
Comments? Feedback? Questions?
Contact: Contact us
U.S. National Library of Medicine,
8600 Rockville Pike, Bethesda, MD 20894
National Institutes of Health, Department of Health & Human Services Copyright, Privacy, Accessibility |