check_drug_interactions
Check for potential drug interactions between medications for a specific patient using athenahealth's clinical data.
Instructions
Check for drug interactions for a patient
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| patient_id | Yes | Patient ID | |
| medications | Yes | List of medication names or RxNorm codes |
Implementation Reference
- src/handlers/tool-handlers.ts:86-100 (handler)MCP tool handler that processes the check_drug_interactions tool call. Extracts parameters, calls the client service, logs data access, and returns the interactions as JSON text 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 schema definition including name, description, and input validation schema for check_drug_interactions.{ 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)Registration of the check_drug_interactions tool in the MCP server request handler switch statement, dispatching to the tool handler.case 'check_drug_interactions': return await this.toolHandlers.handleCheckDrugInteractions(args);
- Core helper function that performs the actual API call to athenahealth's druginteractions endpoint, constructing form data from medications list and returning ClinicalAlert[].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; }