Inspiration
The integration of Artificial Intelligence into healthcare is often bottlenecked by siloed, unstructured data and complex proprietary EHR systems. We were incredibly inspired by the work we have done on open-source wso2/fhir-mcp-server implementation: https://foundry.hl7.org/products/4825d8a9-7451-4276-9294-eb0ce8facf6e. We looked into the Prompt Opinion Platform and we thought of building compatible FHIR server for the platform to use for the AI agent use cases.
What it does
FHIR MCP Server provides a standardized way to connect AI models with structured healthcare data using the Model Context Protocol (MCP) and Fast Healthcare Interoperability Resources (FHIR).
How we built it
We utilized the core open-source WSO2 FHIR MCP Server as our foundation and made it compatible to work with PromptOpinion Platform . Built in Python, this standard server already handled the heavy lifting of MCP-compatible transport and foundational SMART-on-FHIR OAuth 2.0 authentication.
Challenges we ran into
Authentication Context Handling: Integrating the SMART-on-FHIR EHR Launch flow within headless Prompt Opinion agents.
Context Window Overload: FHIR JSON bundles are notoriously verbose, packed with system metadata. Feeding a raw FHIR response from a simple search query easily overwhelmed the token limits of the LLMs.
Accomplishments that we're proud of
We were able to write extension model that can plug the FHIR MCP Server into the Prompt Opinion Platform for handling the EHR launch context and work with Prompt Opinion Agents.
We were able to transform the FHIR resources into optimized, condensed structures that fit seamlessly into Prompt Opinion's context window.
What we learned
Raw FHIR and LLMs Don't Mix Well: We learned quickly that feeding raw, unparsed FHIR JSON bundles directly into an AI's context window is a recipe for token exhaustion and hallucination
Navigating Healthcare Authentication in AI: Implementing SMART-on-FHIR's EHR Launch and context handling from MCP server was a challenging but invaluable learning experience
What's next for FHIR MCP Server compatible with PromptOpinion Platform
Streaming Responses for Longitudinal Records: Querying a patient with a decades-long medical history can result in massive data bundles.
Multi-Tenant Agent Scaling: Upgrading the architecture to handle concurrent requests from various Prompt Opinion agents operating across different healthcare organizations
Log in or sign up for Devpost to join the conversation.