get_appointments
Retrieve patient appointments by specifying a patient ID and date range to streamline scheduling and healthcare workflows using Google Cloud Healthcare API.
Instructions
Get patient's Appointments
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dateFrom | No | YYYY-MM-DD | |
| dateTo | No | YYYY-MM-DD | |
| patientId | Yes |
Implementation Reference
- The core handler function that executes the get_appointments tool by querying the FHIR Appointment resource with patient ID and optional date filters.async getPatientAppointments(args: any) { const params = new URLSearchParams(); params.append('patient', `${args.patientId}`); if (args.dateFrom) params.append('date', `ge${args.dateFrom}`); if (args.dateTo) params.append('date', `le${args.dateTo}`); const response = await this.client.get(`/Appointment?${params}`); return this.formatResponse(`fhir://Patient/${args.patientId}/appointments`, response.data); }
- src/server/handlers/ToolHandler.ts:90-91 (handler)The switch case in the main tool handler that routes get_appointments calls to the FhirClient implementation.case "get_appointments": return await this.fhirClient.getPatientAppointments(request.params.arguments);
- The tool definition including name, description, and input schema used for registration and validation.{ name: "get_appointments", description: "Get patient's Appointments", inputSchema: { type: "object", properties: { patientId: { type: "string" }, dateFrom: { type: "string", description: "YYYY-MM-DD" }, dateTo: { type: "string", description: "YYYY-MM-DD" } }, required: ["patientId"] } },
- src/server/handlers/ToolHandler.ts:37-38 (registration)The list tools handler that returns the TOOL_DEFINITIONS array containing the get_appointments tool definition.private handleList = async () => ({ tools: TOOL_DEFINITIONS