get_patient_medications
Retrieve medication orders for a specific patient, filtered by status, using the MCP Server for Google Cloud Healthcare API. Supports active, completed, stopped, or on-hold medication statuses.
Instructions
Get medication orders for a patient
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| patientId | Yes | ||
| status | No |
Implementation Reference
- The main handler function that executes the tool logic by querying the FHIR server for MedicationRequest resources filtered by patient ID and optional status.async getPatientMedications(args: any) { const params = new URLSearchParams(); params.append('patient', `${args.patientId}`); if (args.status) params.append('status', args.status); const response = await this.client.get(`/MedicationRequest?${params}`); return this.formatResponse(`fhir://Patient/${args.patientId}/medications`, response.data); }
- src/server/constants/tools.ts:53-67 (schema)Defines the tool's input schema, description, and registration in the TOOL_DEFINITIONS array used for listing tools.{ name: "get_patient_medications", description: "Get medication orders for a patient", inputSchema: { type: "object", properties: { patientId: { type: "string" }, status: { type: "string", enum: ["active", "completed", "stopped", "on-hold"] } }, required: ["patientId"] } },
- src/server/handlers/ToolHandler.ts:72-73 (registration)Registers the tool handler by dispatching calls to the FhirClient.getPatientMedications method in the main tool call switch statement.case "get_patient_medications": return await this.fhirClient.getPatientMedications(request.params.arguments);