Drug Class Analysis¶
Runs a full workflow to classify a drug and optionally retrieve its mechanism of action. It normalizes a provided drug name or NDC to an RxCUI, fetches drug classes from RxClass, and formats summary information including classification counts and inferred therapeutic categories.

Usage¶
Use this node when you need to determine the therapeutic classes associated with a drug and optionally include mechanism-of-action data. Typical flow: provide a drug name (or NDC), choose the identifier type, optionally limit to a specific classification system, and decide whether to include mechanism data. Connect its outputs to downstream nodes for reporting, filtering, or population analyses.
Inputs¶
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
| drug_identifier | True | STRING | The drug identifier to analyze. Accepts a drug name (e.g., generic or brand) or an NDC, depending on identifier_type. | atorvastatin |
| identifier_type | True | ["drug_name", "ndc"] | Specifies how to interpret drug_identifier. Choose "drug_name" to resolve by name, or "ndc" to resolve by National Drug Code. | drug_name |
| classification_system | True | SELECT | Which classification relationship sources to include when fetching classes. Use "ALL" to include all supported systems, or select a specific source such as ATC, MEDRT, VA, etc. | ALL |
| include_mechanism | True | BOOLEAN | If true, retrieves and returns mechanism of action data for the resolved RxCUI. | true |
Outputs¶
| Field | Type | Description | Example |
|---|---|---|---|
| drug_classifications | STRING | A JSON string with the resolved RxCUI, a list of class entries (id, name, type, URL), and a summary with total classes, classification systems, and inferred therapeutic categories. | {"drug_identifier": "atorvastatin", "rxcui": "83367", "classifications": [{"class_id": "D001241", "class_name": "HMG-CoA Reductase Inhibitors", "class_type": "ATC", "class_url": "https://rxnav.nlm.nih.gov/REST/rxclass/class/D001241"}], "summary": {"total_classes": 1, "classification_systems": ["ATC"], "therapeutic_categories": ["HMG-CoA Reductase Inhibitors"]}} |
| mechanism_data | STRING | A JSON string containing mechanism of action information keyed to the RxCUI, plus a note about possible external data sources. | {"rxcui": "83367", "mechanism_analysis": {"moa": [{"source": "MEDRT", "name": "HMG-CoA reductase inhibitor"}]}, "note": "Mechanism of action data may require integration with additional databases like DrugBank or MeSH"} |
| status | STRING | Human-readable status message indicating success or an error condition. | Successfully analyzed drug classes for atorvastatin (RXCUI: 83367) |
Important Notes¶
- Identifier resolution: The node first resolves the provided drug_identifier to an RxCUI. If resolution fails, both outputs will be empty JSON objects and status will contain an error.
- Classification scope: Set classification_system to "ALL" to include all supported sources or select a specific source (e.g., ATC, MEDRT, VA) for narrower results.
- Mechanism data: When include_mechanism is true, mechanism_data is fetched and returned as-is with minimal formatting and may rely on external sources; availability can vary by RxCUI.
- Output format: All outputs are JSON strings; downstream nodes expecting structured data should parse these strings.
- Therapeutic categories: The summary infers therapeutic_categories by scanning class names for terms like "inhibitor", "agonist", or "antagonist"; this is heuristic and not exhaustive.
- Case sensitivity note: If selecting all classification systems, prefer "ALL" as exposed by the input selector.
Troubleshooting¶
- Empty outputs with error status: The RxCUI could not be resolved. Verify the drug name spelling or NDC format and ensure identifier_type matches the input.
- No classes returned: The selected classification_system may not have entries for the drug. Try "ALL" or a different source (e.g., ATC, MEDRT).
- Mechanism data is empty: Not all drugs have mechanism data available from the backing sources. Set include_mechanism to true, and if still empty, consider augmenting with external datasets.
- JSON parsing errors downstream: Both main outputs are JSON strings. Ensure you parse the strings before accessing fields.
- Unexpected classification systems in summary: Multiple sources may be returned when using "ALL"; filter results downstream if you need a single system.