RxClass API
findSimilarClassesByDrugList
- Information returned
- Classes with clinically-significant RxNorm ingredients similar to a specified list
- Service domain
- https://rxnav.nlm.nih.gov
- HTTP request
- GETÂ /REST/rxclass/class/similarByRxcuis.xml?rxcuis=values&relaSource=value&rela=value&scoreType=value&top=value&equivalenceThreshold=value&inclusionThreshold=value
Description
Find classes with drug members similar to the list specified by the rxcuis.
The scoreType parameter selects the kind of similarity to find:
- Equivalance
- The class indicated by parameters has the same membership as the result class. Classes scoring lower than equivalenceThreshold are not returned.
- Includes
- The class indicated by parameters includes the result class. That is, the resulting drug classes have a large number of members which are included in the input drug class. This would be any resulting drug classes which have an inclusion score greater than 0. A minimum inclusion score can be set with the inclusionThreshold parameter.
- Included-in
- The class indicated by parameters is included in the ideal result class. That is, the class indicated by parameters has a large number of members contained in the returned drug classes. This would be any resulting drug classes which have an inclusion score less than 0. Minimum inclusion quality can be set with the inclusionThreshold parameter.
The results may be limited to classes of a specified source (relaSource parameter) and relationship (rela parameter). See getClassMembers for a table of useful source and relationship combinations.
Class similarity compares clinically-significant RxNorm ingredients, which may be different from the drugs reported by getClassMembers. See Similarity Scoring for details on how the similar classes are determined.
The classes' similarity scores are returned in response elements equivalenceScore and inclusionScore. A summary of the basis of computation is returned in intersection, cardinality1, and cardinality2. More detail about the basis of computation of the scores is available from getSimilarityInformation.
Parameters
Parameter | Location | Use | Description | Default |
---|---|---|---|---|
format | Path | Optional | Notation for results One of:
| .xml |
rxcuis | Query | Required | RxNorm drug identifier(s) (Space-separated list. At most 500 items.) | |
relaSource | Query | Optional | Source of drug relations to search (See getSourcesOfDrugClassRelations for the menu.) | ALL |
rela | Query | Optional | Relationship of the drug class to its members (See getRelas for the menu.) | ALL |
scoreType | Query | Optional | Ranking of results One of:
| 0 |
top | Query | Optional | Coarse control over number of results to return (Range: 1 to 100.) | 10 |
equivalenceThreshold | Query | Optional | Minimum of equivalence scores to return (Range: 0.0 to 1.0.) | 0.0 |
inclusionThreshold | Query | Optional | When ranking by inclusion score: Minimum of (absolute value of) inclusion scores to return (Range: 0.0 to 1.0.) | 1.0 |
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
- similarityMember
- ingredientRxcui (array)
- RxNorm identifier of an ingredient
- rankClassConcept (array)
- Drug class and its similarity stats
- similarityEntityItem
- Similarity stats
- equivalenceScore
- Degree of overlap of two classes
- inclusionScore
- Degree to which one compared class includes the other
- intersection
- Number of drugs common to both classes
- cardinality1
- Number of drugs in class 1
- cardinality2
- Number of drugs in class 2
- drugClassConceptItem
- Compared class
- rela
- Member relationship that defines the class
- relaSource
- Drug-member relationship source
- rxclassMinConceptItem
- 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
Example: Classes with membership most similar to: morphine (id=7052), opium (RxCUI 7676), oxycodone (RxCUI 7804) and dihydrocodeine (RxCUI 23088)
XML: https://rxnav.nlm.nih.gov/REST/rxclass/class/similarByRxcuis?rxcuis=7052+7676+7804+23088&top=3
JSON: https://rxnav.nlm.nih.gov/REST/rxclass/class/similarByRxcuis.json?rxcuis=7052+7676+7804+23088&top=3
An XML result is shown below.
<rxclassdata> <similarityMember> <ingredientRxcui>23088</ingredientRxcui> <ingredientRxcui>7052</ingredientRxcui> <ingredientRxcui>7676</ingredientRxcui> <ingredientRxcui>7804</ingredientRxcui> <rankClassConcept> <similarityEntityItem> <equivalenceScore>0.5962848</equivalenceScore> <inclusionScore>-1.0</inclusionScore> <intersection>4</intersection> <cardinality1>4</cardinality1> <cardinality2>6</cardinality2> </similarityEntityItem> <drugClassConceptItem> <rela/> <relaSource>ATC</relaSource> <rxclassMinConceptItem> <classId>N02AA</classId> <className>Natural opium alkaloids</className> <classType>ATC1-4</classType> </rxclassMinConceptItem> </drugClassConceptItem> </rankClassConcept> <rankClassConcept> <similarityEntityItem> <equivalenceScore>0.3211308</equivalenceScore> <inclusionScore>-0.45</inclusionScore> <intersection>3</intersection> <cardinality1>4</cardinality1> <cardinality2>7</cardinality2> </similarityEntityItem> <drugClassConceptItem> <rela>has_ingredient</rela> <relaSource>MEDRT</relaSource> <rxclassMinConceptItem> <classId>D009022</classId> <className>Morphine Derivatives</className> <classType>CHEM</classType> </rxclassMinConceptItem> </drugClassConceptItem> </rankClassConcept> ... </similarityMember> </rxclassdata>