Skip to main content
Glama
akiani

Epic Patient API MCP Server

by akiani
test_search.py1.76 kB
"""Tests for Gemini-powered search tool.""" import json import os import pytest from dotenv import load_dotenv from src.epic_mcp.data import PatientDataLoader from src.epic_mcp.tools import handle_search load_dotenv() @pytest.fixture def loader(): """Create a PatientDataLoader instance.""" return PatientDataLoader() class TestSearchTool: """Test Gemini-powered search functionality.""" def test_search_error_handling(self, loader): """Test search error handling for non-existent patient.""" result = handle_search("patient_999", "test query", loader) data = json.loads(result) assert "error" in data @pytest.mark.skipif(not os.getenv("GEMINI_API_KEY"), reason="GEMINI_API_KEY not set") def test_search_natural_language(self, loader): """Test natural language search returns relevant results.""" result = handle_search( "patient_001", "What medications is the patient taking for diabetes?", loader ) data = json.loads(result) assert "response" in data assert "Metformin" in data["response"] @pytest.mark.skipif(not os.getenv("GEMINI_API_KEY"), reason="GEMINI_API_KEY not set") def test_search_across_data_types(self, loader): """Test search can synthesize info from multiple data types.""" result = handle_search( "patient_001", "Summarize the patient's most recent lab results and vital signs", loader ) data = json.loads(result) response_lower = data["response"].lower() # Should mention data from both labs and vitals assert any(term in response_lower for term in ["glucose", "blood pressure", "cholesterol"])

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/akiani/mock-epic-mcp'

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