Population Medication Analysis¶
Runs a population-level medication analysis for a specified drug class. It fetches the class info, collects member drugs (RxCUIs), and optionally enriches each drug with RxNorm properties and RxTerms. Returns a compiled population summary plus per-drug details as JSON.

Usage¶
Use this node when you need to analyze all medications within a drug class (e.g., MeSH/ATC/VA) at a population level. Typical workflow: provide the class identifier, choose the classification system, set whether to include per-drug details and RxTerms, optionally cap the number of drugs, then connect the outputs to downstream analytics, visualization, or reporting nodes.
Inputs¶
| Field | Required | Type | Description | Example |
|---|---|---|---|---|
| class_identifier | True | STRING | The identifier of the target drug class to analyze (e.g., a MeSH/ATC/VA class ID). | D007398 |
| class_type | True | CHOICE | Classification system for the provided class identifier. | MeSH |
| include_drug_details | True | BOOLEAN | If true, fetches RxNorm concept properties and names for each drug. | True |
| include_rxterms | True | BOOLEAN | If true, fetches RxTerms information for each drug. | True |
| max_drugs | True | INT | Maximum number of drugs (RxCUIs) to analyze from the class members. | 50 |
Outputs¶
| Field | Type | Description | Example |
|---|---|---|---|
| population_analysis | STRING | JSON string summarizing the analysis: class metadata, total drugs analyzed, summary stats, and a list of RxCUIs. | {"analysis_type":"Population-Level Medication Analysis","class_identifier":"D007398","population_summary":{"total_drugs":42}} |
| drug_details | STRING | JSON string of per-drug details keyed by RxCUI, including RxNorm properties and optional RxTerms, plus a summary section. | {"total_drugs":42,"summary":{"with_rxnorm_details":40,"with_rxterms":39,"errors":0},"drugs":{"161":{"rxcui":"161","rxnorm_name":{}}}} |
| status | STRING | Human-readable status message describing the result of the analysis. | Successfully analyzed 42 drugs in class D007398 (MeSH) |
Important Notes¶
- The node depends on external RxClass/RxNorm services via the underlying API; availability and response quality affect results.
- max_drugs limits how many RxCUIs are processed to manage performance and API load.
- When include_drug_details or include_rxterms are enabled, the node performs additional API calls per drug and may take longer.
- If the class identifier has no member drugs, outputs will be empty JSON objects and the status will report no RxCUIs found.
- Returned JSON strings are formatted and intended to be consumed by downstream nodes or saved for analysis.
Troubleshooting¶
- Error: Failed to get class information — Verify the class_identifier and class_type are valid and that the external service is reachable.
- Error: Failed to get drug members — The class may not have member drugs or the service may be unavailable; try again or use a different class.
- Status indicates no RxCUIs found — The provided class may be empty or unsupported; confirm the identifier and classification system.
- Drug details summary shows errors > 0 — Some per-drug enrichment calls failed; consider reducing max_drugs or disabling include_rxterms/include_drug_details to isolate issues.
- Slow performance — Lower max_drugs or disable optional details to reduce API calls, and retry later if rate-limited.