Skip to main content
Glama
akiani

Epic Patient API MCP Server

by akiani
allergies.py1.26 kB
"""Handle allergy queries.""" import json from ..data import PatientDataLoader def handle_list_allergies(patient_id: str, loader: PatientDataLoader) -> str: """List patient allergies (summary with IDs and dates only).""" if not loader.patient_exists(patient_id): return json.dumps({"error": f"Patient {patient_id} not found"}) allergies = loader.get_allergies(patient_id) summary = [ { "id": allergy.id, "allergen": allergy.allergen, "severity": allergy.severity, "recorded_date": str(allergy.recorded_date) } for allergy in allergies ] return json.dumps(summary, indent=2) def handle_get_allergy_details(patient_id: str, allergy_id: str, loader: PatientDataLoader) -> str: """Get detailed information for a specific allergy.""" if not loader.patient_exists(patient_id): return json.dumps({"error": f"Patient {patient_id} not found"}) allergies = loader.get_allergies(patient_id) for allergy in allergies: if allergy.id == allergy_id: return json.dumps(allergy.model_dump(mode='json'), indent=2, default=str) return json.dumps({"error": f"Allergy {allergy_id} not found for patient {patient_id}"})

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