Population Medication Analysis¶
Runs a population-level medication analysis for a given drug class identifier. It fetches class information, retrieves member drugs (RxCUIs), optionally gathers detailed RxNorm and RxTerms data per drug, and compiles a summary JSON describing the class and analyzed drugs.

Usage¶
Use this node to analyze all medications belonging to a specific drug class (e.g., MeSH/ATC/VA class). Typical workflow: provide a valid class identifier, choose the class system, set whether to include detailed per-drug info and RxTerms, and set a cap on the number of drugs to analyze. The node returns two JSON strings: a population-level analysis summary and per-drug details, along with a status message.
Inputs¶
| Field | Required | Type | Description | Example | 
|---|---|---|---|---|
| class_identifier | True | STRING | The drug class identifier used by RxClass (e.g., MeSH descriptor ID, ATC code, or VA class ID). | D007398 | 
| class_type | True | STRING | Classification system for the provided identifier. | MeSH | 
| include_drug_details | True | BOOLEAN | If true, fetches RxNorm name and concept properties for each RxCUI. | true | 
| include_rxterms | True | BOOLEAN | If true, fetches RxTerms information for each RxCUI. | true | 
| max_drugs | True | INT | Maximum number of drugs (RxCUIs) to analyze from the class members. Range: 1–200. | 50 | 
Outputs¶
| Field | Type | Description | Example | 
|---|---|---|---|
| population_analysis | STRING | JSON string with population-level analysis summary, including class info, counts, and high-level metadata. | {"analysis_type":"Population-Level Medication Analysis","class_identifier":"D007398","class_type":"MeSH","population_summary":{"total_drugs":42,"class_name":"...","class_id":"...","analysis_timestamp":"2025-01-01T12:00:00"},"drug_list":["12345","67890"],"drug_details_summary":{"with_rxnorm_details":40,"with_rxterms":39,"errors":2},"analysis_ready":true} | 
| drug_details | STRING | JSON string with per-drug details keyed by RxCUI, including RxNorm name, concept properties, and RxTerms when requested. | {"total_drugs":42,"summary":{"with_rxnorm_details":40,"with_rxterms":39,"errors":2},"drugs":{"12345":{"rxcui":"12345","rxnorm_name":{"name":"..."},"properties":{"...":"..."},"rxterms":{"...":"..."}},"67890":{"rxcui":"67890","error":"..."}}} | 
| status | STRING | Human-readable status message describing the outcome of the analysis or an error message if something failed. | Successfully analyzed 42 drugs in class D007398 (MeSH) | 
Important Notes¶
- This node relies on external RxNorm/RxClass and RxTerms APIs; network issues or API downtime will affect results.
- class_identifier must be valid for the chosen class_type (e.g., MeSH D-code, ATC code, or VA class).
- Outputs are JSON strings; parse them before downstream structured processing.
- max_drugs caps the number of RxCUIs analyzed to manage runtime and API usage (1–200).
- When include_drug_details or include_rxterms is false, corresponding sections in drug_details will be minimal or absent.
- If the class has no drug members or RxCUIs cannot be extracted, the node returns empty JSON strings and a status explaining the issue.
Troubleshooting¶
- No RxCUIs found: Verify class_identifier and class_type are correct and correspond to a drug class with members.
- Empty or {} outputs: Check the status output for error details; often caused by invalid identifiers or API errors.
- Rate limiting or timeouts: Reduce max_drugs, or try again later. The node throttles requests slightly, but external limits may still apply.
- Incomplete per-drug details: Set include_drug_details and/or include_rxterms to true. If already true, the external API may have missing data for some RxCUIs.
- Unexpected class metadata: Ensure the identifier truly maps to the intended drug class; class_info is taken directly from the RxClass response.