check_drug_interactions
Check for potential drug interactions between prescribed medications to ensure patient safety and prevent adverse effects.
Instructions
Check for drug interactions for a patient
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| medications | Yes | List of medication names or RxNorm codes | |
| patient_id | Yes | Patient ID |
Input Schema (JSON Schema)
{
"properties": {
"medications": {
"description": "List of medication names or RxNorm codes",
"items": {
"type": "string"
},
"type": "array"
},
"patient_id": {
"description": "Patient ID",
"type": "string"
}
},
"required": [
"patient_id",
"medications"
],
"type": "object"
}
Implementation Reference
- src/handlers/tool-handlers.ts:86-100 (handler)MCP tool handler that extracts arguments, calls AthenaHealthClient.checkDrugInteractions, logs data access, and formats the response as MCP content.async handleCheckDrugInteractions(args: any) { const { patient_id, medications } = args; const interactions = await this.client.checkDrugInteractions(patient_id, medications); logDataAccess('DRUG_INTERACTIONS', patient_id, 'CHECK'); return { content: [ { type: 'text' as const, text: JSON.stringify(interactions, null, 2), }, ], }; }
- src/definitions/tools.ts:20-35 (schema)Tool definition including name, description, and input schema for validating arguments.{ name: 'check_drug_interactions', description: 'Check for drug interactions for a patient', inputSchema: { type: 'object', properties: { patient_id: { type: 'string', description: 'Patient ID' }, medications: { type: 'array', items: { type: 'string' }, description: 'List of medication names or RxNorm codes' }, }, required: ['patient_id', 'medications'], }, },
- src/mcp-server.ts:179-180 (registration)Switch case in MCP server that routes 'check_drug_interactions' tool calls to the appropriate handler.case 'check_drug_interactions': return await this.toolHandlers.handleCheckDrugInteractions(args);
- Core implementation that makes the POST request to Athenahealth API endpoint for drug interactions, formatting medications as form data.async checkDrugInteractions(patientId: string, medications: string[]): Promise<ClinicalAlert[]> { const formData = new URLSearchParams(); medications.forEach((med, index) => { formData.append(`medications[${index}]`, med); }); const response = await this.makeRequest<AthenaHealthResponse<ClinicalAlert[]>>( `${this.config.practice_id}/patients/${patientId}/druginteractions`, { method: 'POST', data: formData.toString(), headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, } ); return response.data; }