OpenParable
Skip to content
← Back to skills

27_ATC_DDD

Research

Query the WHO ATC/DDD Classification System. Use whenever the user asks about ATC codes, drug classification hierarchy, Defined Daily Doses (DDD), or wants to look up drugs by ATC class or find the ATC code for a drug name.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/BioTender-max/awesome-bio-agent-skills/blob/HEAD/skills/drugclaw/atc/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/27-atc-ddd, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

ATC/DDD Query Skill

Look up ATC classification and DDD data for drugs. Auto-detects entity type:

Input PatternDetected AsQuery Path
N02BA A10BA02 C09XX01ATC codelocal DDD lookup + RxNav member drugs
aspirin metformindrug nameRxNav ATC classification + local DDD match

ATC code regex: ^[A-Z]\d{2}([A-Z]{1,2}\d{0,2})?$

API

FunctionInputReturns
load_local(path)Excel pathlist[dict] — cached ATC/DDD records
search(entity)single stringdict with entity, entity_type, local_hits, api_hits
search_batch(entities)list of stringsdict[str, dict] — keyed by entity
summarize(result)search result dictcompact LLM-readable text
to_json(result)search result dictJSON string

All functions accept use_api=True|False to toggle RxNav queries (default: on).

Usage

See if __name__ == "__main__" block in 27_ATC_DDD.py for runnable examples:

from importlib import import_module
atc = import_module("27_ATC_DDD")

# Drug name → ATC classes
r = atc.search("aspirin")
print(atc.summarize(r))

# ATC code → member drugs + DDD
r = atc.search("N02BA")
print(atc.summarize(r))

# Batch
results = atc.search_batch(["metformin", "A10BA02", "C09XX01"])

# JSON for pipeline
print(atc.to_json(atc.search("sparsentan")))

Data

  • Local file: ATC_DDD_new and alterations 2026_final.xlsx
  • Columns: atc_code, atc_level_name, new_ddd, unit, adm_route, note
  • Path: DATA_DIR / XLSX_PATH in 27_ATC_DDD.py
  • Remote API: RxNav RxClass (rxnav.nlm.nih.gov/REST/rxclass/)
  • Citation: WHOCC — WHO Collaborating Centre for Drug Statistics Methodology, ATC/DDD Index 2026. https://atcddd.fhi.no/atc_ddd_index/