get_patient_conditions
Retrieve a patient's medical conditions or diagnoses using their ID, with options to filter by onset date and status, leveraging the MCP Server for Google Cloud Healthcare API.
Instructions
Get medical conditions/diagnoses for a patient
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| onsetDate | No | YYYY-MM-DD | |
| patientId | Yes | ||
| status | No |
Implementation Reference
- src/server/constants/tools.ts:37-52 (schema)Defines the tool schema, description, and input validation schema for 'get_patient_conditions'.{ name: "get_patient_conditions", description: "Get medical conditions/diagnoses for a patient", inputSchema: { type: "object", properties: { patientId: { type: "string" }, status: { type: "string", enum: ["active", "inactive", "resolved"] }, onsetDate: { type: "string", description: "YYYY-MM-DD" } }, required: ["patientId"] } },
- src/server/handlers/ToolHandler.ts:37-39 (registration)The listTools handler that returns all TOOL_DEFINITIONS including get_patient_conditions schema.private handleList = async () => ({ tools: TOOL_DEFINITIONS });
- src/server/handlers/ToolHandler.ts:70-71 (handler)Switch case in callTool handler that routes get_patient_conditions calls to FhirClient.case "get_patient_conditions": return await this.fhirClient.getPatientConditions(request.params.arguments);
- Core implementation of get_patient_conditions: constructs FHIR search params and queries /Condition endpoint for the patient's conditions.async getPatientConditions(args: any) { const params = new URLSearchParams(); params.append('patient', `${args.patientId}`); if (args.status) params.append('clinical-status', args.status); if (args.onsetDate) params.append('onset-date', args.onsetDate); const response = await this.client.get(`/Condition?${params}`); return this.formatResponse(`fhir://Patient/${args.patientId}/conditions`, response.data); }
- src/server/AgentCareServer.ts:35-36 (registration)Registers the ToolHandler (which handles tool list and calls) to the MCP server.private setupHandlers() { this.toolHandler.register(this.mcpServer);