Primary workflow for OpenEvidence clinical evidence integration. Covers the core use case: searching clinical literature with evidence-level filters, retrieving structured citations with journal and year metadata, checking drug interactions against patient context, and looking up specialty guidelines from major bodies (ACC/AHA, ESC, NICE). Responses include confidence scores and evidence grading to support clinical decision making. All queries support specialty filtering to narrow results to relevant domains.
const result = await client.query({
question: 'What is the recommended treatment for acute migraine in adults?',
context: 'emergency_department',
evidence_level: 'high',
specialty: 'neurology',
max_citations: 10,
});
console.log('Answer:', result.answer);
console.log(`Confidence: ${result.confidence} | Evidence grade: ${result.grade}`);
result.citations.forEach(c =>
console.log(` [${c.journal}] ${c.title} (${c.year}) — Level ${c.evidence_level}`)
);
const recent = await client.search({
keywords: 'GLP-1 receptor agonist cardiovascular outcomes',
specialty: 'cardiology',
year_min: 2024,
evidence_level: 'meta-analysis',
limit: 20,
});
console.log(`Found ${recent.total} results`);
recent.results.forEach(r => console.log(` ${r.title} (${r.journal}, ${r.year})`));
const interactions = await client.interactions.check({
medications: ['metformin', 'lisinopril', 'atorvastatin'],
patient_context: { age: 65, conditions: ['diabetes', 'hypertension'] },
});
interactions.forEach(i =>
console.log(`${i.drug1} + ${i.drug2}: ${i.severity} — ${i.description}`)
);
if (interactions.some(i => i.severity === 'major')) {
console.warn('WARNING: Major interaction detected — review before prescribing');
}
const guidelines = await client.guidelines.search({
condition: 'hypertension',
source: ['ACC/AHA', 'ESC', 'NICE'],
year_min: 2023,
});
guidelines.forEach(g =>
console.log(`${g.source}: ${g.title} (${g.year}) — ${g.recommendation_class}`)
);
| Issue | Cause | Fix |
|---|---|---|
401 Unauthorized |
Invalid API key | Verify key in Authorization: Bearer header |
404 Not Found |
Unknown specialty code | Use standard specialty slugs from /specialties |
422 Validation |
Conflicting filter params | Remove mutually exclusive filters |
429 Rate Limited |
Exceeds 30 queries/min | Back off per Retry-After header |
| Empty citations array | Question too narrow | Broaden search terms or lower evidence level |
A successful run returns evidence-backed answers with citations, drug interaction severity assessments, and guideline recommendations. Each response includes a confidence score and evidence grade for clinical decision support.
Continue with openevidence-core-workflow-b for patient case analysis and reporting.