Skip to main content
Glama
Kartha-AI

MCP Server for Google Cloud Healthcare API

by Kartha-AI

get_patient_encounters

Retrieve patient healthcare encounters by specifying a patient ID, date range, and status. Facilitates efficient access to visit data for clinical and administrative workflows.

Instructions

Get healthcare encounters/visits for a patient

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateFromNoYYYY-MM-DD
dateToNoYYYY-MM-DD
patientIdYes
statusNo

Implementation Reference

  • The main handler function that executes the tool logic: queries FHIR Encounter resources filtered by patient ID, optional status, and date range, then formats and returns the response.
    async getPatientEncounters(args: any) {
      const params = new URLSearchParams();
      params.append('patient', `${args.patientId}`);
      if (args.status) params.append('status', args.status);
      if (args.dateFrom) params.append('date', `ge${args.dateFrom}`);
      if (args.dateTo) params.append('date', `le${args.dateTo}`);
    
      const response = await this.client.get(`/Encounter?${params}`);
      return this.formatResponse(`fhir://Patient/${args.patientId}/encounters`, response.data);
    }
  • Registration/dispatch point in ToolHandler.handleCall switch statement that routes the tool call to the FhirClient implementation.
    case "get_patient_encounters":
      return await this.fhirClient.getPatientEncounters(request.params.arguments);
  • Tool schema definition used for input validation and tool listing/registration via TOOL_DEFINITIONS.
    {
      name: "get_patient_encounters",
      description: "Get healthcare encounters/visits for a patient",
      inputSchema: {
        type: "object",
        properties: {
          patientId: { type: "string" },
          status: {
            type: "string",
            enum: ["planned", "arrived", "in-progress", "finished", "cancelled"]
          },
          dateFrom: { type: "string", description: "YYYY-MM-DD" },
          dateTo: { type: "string", description: "YYYY-MM-DD" }
        },
        required: ["patientId"]
      }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Kartha-AI/google-cloud-healthcare-api-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server