Overview
ClinicalTrials.gov has a free REST API with data on 500k+ trials. This can augment drug safety checks with real trial-level evidence — e.g., checking if a drug combination was studied in a trial and what the outcomes were.
API
GET https://clinicaltrials.gov/api/v2/studies?query.term=warfarin+aspirin&fields=protocolSection&pageSize=5
No API key required. Returns JSON.
What to build
medguard/knowledge/clinicaltrials.py — ClinicalTrialsClient
search_trials(drug_a, drug_b) → list of relevant trial summaries
- Cache results with
diskcache (same pattern as RxNormClient)
- Hook into
DrugSafetyChecker as an optional third source alongside OpenFDA and static table
- Add
use_clinical_trials: bool = False to DrugSafetyConfig
Value
Catches drug interactions that appear in trials but not yet in FDA labeling. Especially useful for newer drug combinations.
Files to modify
medguard/knowledge/clinicaltrials.py — new file
medguard/guardrails/drug_safety.py — integrate as optional source
medguard/config.py — add flag to DrugSafetyConfig
tests/test_drug_safety.py — add mocked tests
Acceptance criteria
Overview
ClinicalTrials.gov has a free REST API with data on 500k+ trials. This can augment drug safety checks with real trial-level evidence — e.g., checking if a drug combination was studied in a trial and what the outcomes were.
API
No API key required. Returns JSON.
What to build
medguard/knowledge/clinicaltrials.py—ClinicalTrialsClientsearch_trials(drug_a, drug_b)→ list of relevant trial summariesdiskcache(same pattern asRxNormClient)DrugSafetyCheckeras an optional third source alongside OpenFDA and static tableuse_clinical_trials: bool = FalsetoDrugSafetyConfigValue
Catches drug interactions that appear in trials but not yet in FDA labeling. Especially useful for newer drug combinations.
Files to modify
medguard/knowledge/clinicaltrials.py— new filemedguard/guardrails/drug_safety.py— integrate as optional sourcemedguard/config.py— add flag toDrugSafetyConfigtests/test_drug_safety.py— add mocked testsAcceptance criteria
ClinicalTrialsClient.search_trials("warfarin", "aspirin")returns resultsDrugSafetyResultrespxmocks (no real network in unit tests)