APIs

RxClass API

findSimilarClassesByClass

Information returned
Classes with similar clinically-significant RxNorm ingredients
Service domain
https://rxnav.nlm.nih.gov
HTTP request
GET  /REST/rxclass/class/similar.xml?classId=value&relaSource=value&rela=value&scoreType=value&top=value&equivalenceThreshold=value&inclusionThreshold=value

Description

Find similar classes of drug members. The input drug class is defined by the class identifier (classId), the source of drug relations (relaSource) and the relationship (rela) of the drugs to the class.

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.

For combinations of rela and relaSrc that can uniquely identify a class, see getClassMembers. rela may be omitted only if it would be empty.

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

ParameterLocationUseDescriptionDefault
formatPathOptional

Notation for results

One of:
.xml
Get results in XML
.json
Get results in JSON
.xml
classIdQueryRequiredClass identifier
relaSourceQueryRequiredSource of relationships of classId to drugs

(See getSourcesOfDrugClassRelations for the menu.)

relaQueryRequiredRelationship of classId to its members

(See getRelas for the menu.)

scoreTypeQueryOptionalRanking of results
One of:
0
Parameter class Equals result classes
1
Parameter class Includes result classes
2
Parameter class Included-in result classes
0
topQueryOptionalCoarse control over number of results to return

(Range: 1 to 100.)

10
equivalenceThresholdQueryOptionalMinimum of equivalence scores to return

(Range: 0.0 to 1.0.)

0.0
inclusionThresholdQueryOptionalWhen 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 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 that are snug subsets of "SNOMED CT Carbohydrate-containing product" (id=350544001)

XML: https://rxnav.nlm.nih.gov/REST/rxclass/class/similar?classId=350544001&relaSource=SNOMEDCT&scoreType=1&rela=isa_structure&top=1

JSON: https://rxnav.nlm.nih.gov/REST/rxclass/class/similar.json?classId=350544001&relaSource=SNOMEDCT&scoreType=1&rela=isa_structure&top=1

An XML result is shown below.

<rxclassdata>
    <similarityMember>
        <ingredientRxcui>10046</ingredientRxcui>
        <ingredientRxcui>10159</ingredientRxcui>
        ...
        <rankClassConcept>
            <similarityEntityItem>
                <equivalenceScore>0.16366342</equivalenceScore>
                <inclusionScore>1.0</inclusionScore>
                <intersection>5</intersection>
                <cardinality1>28</cardinality1>
                <cardinality2>5</cardinality2>
            </similarityEntityItem>
            <drugClassConceptItem>
                <rela>has_ingredient</rela>
                <relaSource>MEDRT</relaSource>
                <rxclassMinConceptItem>
                    <classId>D002482</classId>
                    <className>Cellulose</className>
                    <classType>CHEM</classType>
                </rxclassMinConceptItem>
            </drugClassConceptItem>
        </rankClassConcept>
    </similarityMember>
</rxclassdata>

Example: Classes similar to ATC "protein kinase inhibitors" (id=L01E)

XML: https://rxnav.nlm.nih.gov/REST/rxclass/class/similar?classId=L01E&relaSource=ATC&scoreType=0&top=4

JSON: https://rxnav.nlm.nih.gov/REST/rxclass/class/similar.json?classId=L01E&relaSource=ATC&scoreType=0&top=4

An XML result is shown below.

<rxclassdata>
    <similarityMember>
        <ingredientRxcui>1098413</ingredientRxcui>
        <ingredientRxcui>1147220</ingredientRxcui>
        ...
        <rankClassConcept>
            <similarityEntityItem>
                <equivalenceScore>0.96798533</equivalenceScore>
                <inclusionScore>0.0</inclusionScore>
                <intersection>73</intersection>
                <cardinality1>74</cardinality1>
                <cardinality2>74</cardinality2>
            </similarityEntityItem>
            <drugClassConceptItem>
                <rela/>
                <relaSource>ATCPROD</relaSource>
                <rxclassMinConceptItem>
                    <classId>L01E</classId>
                    <className>PROTEIN KINASE INHIBITORS</className>
                    <classType>ATC1-4</classType>
                </rxclassMinConceptItem>
            </drugClassConceptItem>
        </rankClassConcept>
        <rankClassConcept>
            <similarityEntityItem>
                <equivalenceScore>0.7203966</equivalenceScore>
                <inclusionScore>-0.7462462</inclusionScore>
                <intersection>71</intersection>
                <cardinality1>74</cardinality1>
                <cardinality2>95</cardinality2>
            </similarityEntityItem>
            <drugClassConceptItem>
                <rela>has_moa</rela>
                <relaSource>MEDRT</relaSource>
                <rxclassMinConceptItem>
                    <classId>N0000175082</classId>
                    <className>Kinase Inhibitors</className>
                    <classType>MOA</classType>
                </rxclassMinConceptItem>
            </drugClassConceptItem>
        </rankClassConcept>
        <rankClassConcept>
            <similarityEntityItem>
                <equivalenceScore>0.6988873</equivalenceScore>
                <inclusionScore>-0.22422422</inclusionScore>
                <intersection>64</intersection>
                <cardinality1>74</cardinality1>
                <cardinality2>81</cardinality2>
            </similarityEntityItem>
            <drugClassConceptItem>
                <rela>isa_disposition</rela>
                <relaSource>SNOMEDCT</relaSource>
                <rxclassMinConceptItem>
                    <classId>427620008</classId>
                    <className>Phosphotransferase inhibitor-containing product</className>
                    <classType>DISPOS</classType>
                    <classUrl>http://snomed.info/id/427620008</classUrl>
                </rxclassMinConceptItem>
            </drugClassConceptItem>
        </rankClassConcept>
        <rankClassConcept>
            <similarityEntityItem>
                <equivalenceScore>0.6988873</equivalenceScore>
                <inclusionScore>-0.22422422</inclusionScore>
                <intersection>64</intersection>
                <cardinality1>74</cardinality1>
                <cardinality2>81</cardinality2>
            </similarityEntityItem>
            <drugClassConceptItem>
                <rela>isa_disposition</rela>
                <relaSource>SNOMEDCT</relaSource>
                <rxclassMinConceptItem>
                    <classId>427510007</classId>
                    <className>Protein kinase inhibitor-containing product</className>
                    <classType>DISPOS</classType>
                    <classUrl>http://snomed.info/id/427510007</classUrl>
                </rxclassMinConceptItem>
            </drugClassConceptItem>
        </rankClassConcept>
    </similarityMember>
</rxclassdata>

Example: Similar classes, with customized thresholds

XML: https://rxnav.nlm.nih.gov/REST/rxclass/class/similar?classId=L03AB&relaSource=ATC&scoreType=1&equivalenceThreshold=0.35&inclusionThreshold=0.35

JSON: https://rxnav.nlm.nih.gov/REST/rxclass/class/similar.json?classId=L03AB&relaSource=ATC&scoreType=1&equivalenceThreshold=0.35&inclusionThreshold=0.35

An XML result is shown below.

<rxclassdata>
    <similarityMember>
        <ingredientRxcui>120608</ingredientRxcui>
        <ingredientRxcui>1546168</ingredientRxcui>
        ...
        <rankClassConcept>
            <similarityEntityItem>
                <equivalenceScore>0.4281744</equivalenceScore>
                <inclusionScore>1.0</inclusionScore>
                <intersection>3</intersection>
                <cardinality1>6</cardinality1>
                <cardinality2>3</cardinality2>
            </similarityEntityItem>
            <drugClassConceptItem>
                <rela>has_chemical_structure</rela>
                <relaSource>FDASPL</relaSource>
                <rxclassMinConceptItem>
                    <classId>D016899</classId>
                    <className>Interferon-beta</className>
                    <classType>CHEM</classType>
                </rxclassMinConceptItem>
            </drugClassConceptItem>
        </rankClassConcept>
        <rankClassConcept>
            <similarityEntityItem>
                <equivalenceScore>0.4281744</equivalenceScore>
                <inclusionScore>1.0</inclusionScore>
                <intersection>3</intersection>
                <cardinality1>6</cardinality1>
                <cardinality2>3</cardinality2>
            </similarityEntityItem>
            <drugClassConceptItem>
                <rela>has_ingredient</rela>
                <relaSource>MEDRT</relaSource>
                <rxclassMinConceptItem>
                    <classId>D016899</classId>
                    <className>Interferon-beta</className>
                    <classType>CHEM</classType>
                </rxclassMinConceptItem>
            </drugClassConceptItem>
        </rankClassConcept>
        <rankClassConcept>
            <similarityEntityItem>
                <equivalenceScore>0.4281744</equivalenceScore>
                <inclusionScore>1.0</inclusionScore>
                <intersection>3</intersection>
                <cardinality1>6</cardinality1>
                <cardinality2>3</cardinality2>
            </similarityEntityItem>
            <drugClassConceptItem>
                <rela>has_epc</rela>
                <relaSource>FDASPL</relaSource>
                <rxclassMinConceptItem>
                    <classId>N0000191625</classId>
                    <className>Interferon beta</className>
                    <classType>EPC</classType>
                </rxclassMinConceptItem>
            </drugClassConceptItem>
        </rankClassConcept>
        <rankClassConcept>
            <similarityEntityItem>
                <equivalenceScore>0.4281744</equivalenceScore>
                <inclusionScore>1.0</inclusionScore>
                <intersection>3</intersection>
                <cardinality1>6</cardinality1>
                <cardinality2>3</cardinality2>
            </similarityEntityItem>
            <drugClassConceptItem>
                <rela>has_epc</rela>
                <relaSource>DAILYMED</relaSource>
                <rxclassMinConceptItem>
                    <classId>N0000191625</classId>
                    <className>Interferon beta</className>
                    <classType>EPC</classType>
                </rxclassMinConceptItem>
            </drugClassConceptItem>
        </rankClassConcept>
        <rankClassConcept>
            <similarityEntityItem>
                <equivalenceScore>0.4281744</equivalenceScore>
                <inclusionScore>1.0</inclusionScore>
                <intersection>3</intersection>
                <cardinality1>6</cardinality1>
                <cardinality2>3</cardinality2>
            </similarityEntityItem>
            <drugClassConceptItem>
                <rela>has_chemical_structure</rela>
                <relaSource>DAILYMED</relaSource>
                <rxclassMinConceptItem>
                    <classId>D016899</classId>
                    <className>Interferon-beta</className>
                    <classType>CHEM</classType>
                </rxclassMinConceptItem>
            </drugClassConceptItem>
        </rankClassConcept>
        <rankClassConcept>
            <similarityEntityItem>
                <equivalenceScore>0.36700666</equivalenceScore>
                <inclusionScore>0.375</inclusionScore>
                <intersection>3</intersection>
                <cardinality1>6</cardinality1>
                <cardinality2>4</cardinality2>
            </similarityEntityItem>
            <drugClassConceptItem>
                <rela>isa_structure</rela>
                <relaSource>SNOMEDCT</relaSource>
                <rxclassMinConceptItem>
                    <classId>768865007</classId>
                    <className>Interferon-containing product</className>
                    <classType>STRUCT</classType>
                    <classUrl>http://snomed.info/id/768865007</classUrl>
                </rxclassMinConceptItem>
            </drugClassConceptItem>
        </rankClassConcept>
        <rankClassConcept>
            <similarityEntityItem>
                <equivalenceScore>0.36700666</equivalenceScore>
                <inclusionScore>0.375</inclusionScore>
                <intersection>3</intersection>
                <cardinality1>6</cardinality1>
                <cardinality2>4</cardinality2>
            </similarityEntityItem>
            <drugClassConceptItem>
                <rela>isa_disposition</rela>
                <relaSource>SNOMEDCT</relaSource>
                <rxclassMinConceptItem>
                    <classId>768865007</classId>
                    <className>Interferon-containing product</className>
                    <classType>DISPOS</classType>
                    <classUrl>http://snomed.info/id/768865007</classUrl>
                </rxclassMinConceptItem>
            </drugClassConceptItem>
        </rankClassConcept>
        <rankClassConcept>
            <similarityEntityItem>
                <equivalenceScore>0.36700666</equivalenceScore>
                <inclusionScore>0.375</inclusionScore>
                <intersection>3</intersection>
                <cardinality1>6</cardinality1>
                <cardinality2>4</cardinality2>
            </similarityEntityItem>
            <drugClassConceptItem>
                <rela>has_epc</rela>
                <relaSource>FDASPL</relaSource>
                <rxclassMinConceptItem>
                    <classId>N0000175521</classId>
                    <className>Interferon alpha</className>
                    <classType>EPC</classType>
                </rxclassMinConceptItem>
            </drugClassConceptItem>
        </rankClassConcept>
        <rankClassConcept>
            <similarityEntityItem>
                <equivalenceScore>0.36700666</equivalenceScore>
                <inclusionScore>0.375</inclusionScore>
                <intersection>3</intersection>
                <cardinality1>6</cardinality1>
                <cardinality2>4</cardinality2>
            </similarityEntityItem>
            <drugClassConceptItem>
                <rela>has_chemical_structure</rela>
                <relaSource>FDASPL</relaSource>
                <rxclassMinConceptItem>
                    <classId>D016898</classId>
                    <className>Interferon-alpha</className>
                    <classType>CHEM</classType>
                </rxclassMinConceptItem>
            </drugClassConceptItem>
        </rankClassConcept>
    </similarityMember>
</rxclassdata>