get_lab_results
Retrieve patient lab results (e.g., CBC, METABOLIC, LIPIDS) using patient ID and optional timeframe, integrated with Google Cloud Healthcare API for efficient clinical workflows.
Instructions
Get patient's lab results
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | e.g., CBC, METABOLIC, LIPIDS, ALL | |
| patientId | Yes | ||
| timeframe | No |
Implementation Reference
- The core handler function that implements the get_lab_results tool by querying FHIR Observation resources filtered by patient and optional date range, then formatting the response.async getPatientLabResults(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(`/Observation?${params}`); return this.formatResponse(`fhir://Patient/${args.patientId}/lab-results`, response.data); }
- Defines the input schema, description, and name for the get_lab_results tool used in tool listing.{ name: "get_lab_results", description: "Get patient's lab results", inputSchema: { type: "object", properties: { patientId: { type: "string" }, category: { type: "string", description: "e.g., CBC, METABOLIC, LIPIDS, ALL" }, timeframe: { type: "string" } }, required: ["patientId"] } },
- src/server/handlers/ToolHandler.ts:86-87 (registration)Registers the handler dispatch for get_lab_results tool calls, routing to FhirClient.getPatientLabResults.case "get_lab_results": return await this.fhirClient.getPatientLabResults(request.params.arguments);