openevidence-hello-world
Create a minimal working OpenEvidence clinical query example. Use when starting a new OpenEvidence integration, testing your setup, or learning basic clinical query patterns. Trigger with phrases like "openevidence hello world", "openevidence example", "openevidence quick start", "first clinical query".
- License 许可
- MIT
- 最近更新
- 2026-03-20
- Stars
- ★ 4
- Forks
- 0
01 前言 Front Matter
- name
- openevidence-hello-world
- author
- Jeremy Longshore <jeremy@intentsolutions.io>
- license
- MIT
- version
- 1.0.0
- description
- Create a minimal working OpenEvidence clinical query example. Use when starting a new OpenEvidence integration, testing your setup, or learning basic clinical query patterns. Trigger with phrases like "openevidence hello world", "openevidence example", "openevidence quick start", "first clinical query".
- allowed-tools
- Read, Write, Edit
- compatible-with
- claude-code, codex, openclaw
03 SKILL.md 正文
OpenEvidence Hello World
Overview
Minimal working example demonstrating core OpenEvidence clinical query functionality.
Prerequisites
- Completed
openevidence-install-authsetup - Valid API credentials configured
- Development environment ready
Instructions
Step 1: Create Entry File
// src/openevidence-demo.ts
import { OpenEvidenceClient } from '@openevidence/sdk';
const client = new OpenEvidenceClient({
apiKey: process.env.OPENEVIDENCE_API_KEY,
orgId: process.env.OPENEVIDENCE_ORG_ID,
});
Step 2: Make Your First Clinical Query
async function firstClinicalQuery() {
// Simple clinical question
const response = await client.query({
question: "What are the first-line treatments for type 2 diabetes in adults?",
context: {
specialty: "internal-medicine",
urgency: "routine",
},
});
console.log('Answer:', response.answer);
console.log('Sources:', response.citations.map(c => c.source));
console.log('Confidence:', response.confidence);
}
firstClinicalQuery().catch(console.error);
Step 3: Run the Example
# With TypeScript
npx ts-node src/openevidence-demo.ts
# With Node.js (after compilation)
node dist/openevidence-demo.js
Output
- Working code file with OpenEvidence client initialization
- Successful API response with evidence-based answer
- Console output showing:
Answer: First-line treatment for type 2 diabetes in adults typically includes...
Sources: ["NEJM 2024", "ADA Standards of Care 2025", "JAMA Internal Medicine"] # 2024: 2025 year
Confidence: 0.95
Response Structure
interface ClinicalQueryResponse {
answer: string; // Evidence-based clinical answer
citations: Citation[]; // Peer-reviewed sources
confidence: number; // 0-1 confidence score
lastUpdated: string; // When evidence was last reviewed
disclaimer: string; // Clinical use disclaimer
deepConsultAvailable: boolean; // Whether DeepConsult can provide more detail
}
interface Citation {
source: string; // Journal/guideline name
title: string; // Article title
authors: string[]; // Author list
year: number; // Publication year
doi?: string; // DOI if available
url?: string; // Link to source
}
Error Handling
| Error | Cause | Solution |
|---|---|---|
| Import Error | SDK not installed | Verify with npm list @openevidence/sdk |
| Auth Error | Invalid credentials | Check environment variables are set |
| Timeout | Complex query or network issues | Increase timeout or retry |
| Rate Limit | Too many requests | Wait and retry with exponential backoff |
| Invalid Query | Question not clinical | Ensure query is medically relevant |
Examples
TypeScript Example with Error Handling
import { OpenEvidenceClient, OpenEvidenceError } from '@openevidence/sdk';
const client = new OpenEvidenceClient({
apiKey: process.env.OPENEVIDENCE_API_KEY,
orgId: process.env.OPENEVIDENCE_ORG_ID,
});
async function queryClinicalEvidence(question: string) {
try {
const response = await client.query({
question,
context: {
specialty: "family-medicine",
urgency: "routine",
},
options: {
maxCitations: 5,
includeGuidelines: true,
},
});
return {
answer: response.answer,
sources: response.citations,
confidence: response.confidence,
};
} catch (error) {
if (error instanceof OpenEvidenceError) {
console.error(`OpenEvidence Error [${error.code}]:`, error.message);
}
throw error;
}
}
// Example usage
queryClinicalEvidence(
"What is the recommended antibiotic for community-acquired pneumonia?"
).then(result => {
console.log('Clinical Answer:', result.answer);
console.log('Evidence Sources:', result.sources.length);
});
Python Example
from openevidence import OpenEvidenceClient, OpenEvidenceError
client = OpenEvidenceClient()
def query_clinical_evidence(question: str) -> dict:
try:
response = client.query(
question=question,
context={
"specialty": "emergency-medicine",
"urgency": "urgent"
}
)
return {
"answer": response.answer,
"sources": [c.source for c in response.citations],
"confidence": response.confidence
}
except OpenEvidenceError as e:
print(f"Error [{e.code}]: {e.message}")
raise
# Example usage
result = query_clinical_evidence(
"What are the contraindications for tPA in acute ischemic stroke?"
)
print(f"Answer: {result['answer']}")
Resources
Next Steps
Proceed to openevidence-local-dev-loop for development workflow setup.
04 同仓库更多 Skills
azure-apim-architecture
Analyzes and explains Azure API Management architecture decisions for enterprise API marketplace implementations using VNet Internal mode, Front Door, hybrid authentication, and multi-environment strategies. Use when discussing APIM component selection, network topology, cost optimization, or comparing alternatives like workspaces vs instances, VNet Internal vs External mode, or Front Door vs Application Gateway.
apiops-deployment
Guides deployment of Azure API Management infrastructure using Infrastructure as Code (Bicep/Terraform), CI/CD pipelines (GitHub Actions/Azure DevOps), and APIOps workflows. Use when deploying APIM, creating pipelines, or implementing dev→test→prod promotion strategies.
apim-policy-authoring
Creates production-ready Azure API Management policy XML for authentication (OAuth 2.0, JWT validation, subscription keys), rate limiting, CORS configuration, error handling, and API transformations. Use when implementing API security, access control, or request/response processing logic.
api-security-review
Reviews Azure API Management configurations for security vulnerabilities, OWASP API Security Top 10 compliance, VNet Internal mode validation, Private Link verification, and Azure Security Benchmark alignment. Use when performing security audits, pre-deployment validation, or compliance reviews.
jira-cli
Interact with Jira from the command line to create, list, view, edit, and transition issues, manage sprints and epics, and perform common Jira workflows. Use when the user asks about Jira tasks, tickets, issues, sprints, or needs to manage project work items.
calculator
Performs arbitrary-precision arithmetic calculations including addition, subtraction, multiplication, division, and exponents. Use when the user asks to calculate, compute, or evaluate math expressions, or when precise decimal arithmetic is needed to avoid floating-point errors.