VitalFlow: The AI-Agentic Hospital Command Center

💡 Inspiration

In modern healthcare, data is abundant but disconnected. Hospital administrators view critical dashboards in one system (like Tableau) but have to switch to completely different systems (like Salesforce) to coordinate staff or managing beds.

We call this the "Swivel-Chair" problem. In a critical situation—like an ER capacity surge—every second spent switching tabs or making phone calls costs lives. We wanted to build a solution that didn't just show the problem but empowered the user to solve it instantly. We were inspired by the vision of a "Closed-Loop" system where Analytics and Operations merge into a single, intelligent workflow.

🏥 What it does

VitalFlow is an end-to-end Hospital Command Center that bridges the gap between visualization and action.

  1. Real-Time Monitoring (Tableau): It provides a "Digital Twin" of the hospital floor, visualizing occupancy, wait times, and critical bottlenecks in real-time.
  2. Intelligent Intervention (The Extension): When a user clicks on a critical ward (e.g., "Emergency Room"), the embedded VitalFlow Extension activates. It acts as an AI Agent, analyzing the root cause and recommending a specific course of action (e.g., "Divert Ambulance to St. Mary's").
  3. Seamless Execution (Salesforce): With a single click, the user authorizes the action. This fires a signal to the Salesforce backend, which instantly:
  4. Creates a high-priority record.
  5. Notifies assigned staff.
  6. Updates the Live Command Center (LWC) for the floor manager to acknowledge.

🛠️ How we built it

We architected a decoupled, event-driven stack to ensure scalability and security.

  • Frontend (Visualization): We built a custom Tableau Dashboard Extension using HTML5, JavaScript, and the Tableau Extensions API (.trex). This allows the code to "read" the dashboard context (e.g., which Ward was clicked).
  • Middleware (Connectivity): We used a local Python (Flask) server to handle the secure handshake between the Tableau Cloud environment and the local development environment, managing complex CORS policies.
  • Backend (Salesforce "Agentic OS"):
  • Platform Events: Instead of simple database writes, we implemented an Event-Driven Architecture. The extension publishes Hospital_Signal__e events. This ensures the system is non-blocking and can handle thousands of signals per minute.
  • Apex Triggers: We wrote custom Apex logic to consume these events, apply business rules (e.g., auto-calculating severity), and generate Hospital_Alert__c records.
  • Native UI: We built a custom Lightning Web Component (LWC), hospitalMonitor, to replace standard list views with a visual, interactive card-based interface for floor managers.

🚧 Challenges we ran into

  • The "Localhost" Security Block: One of our biggest hurdles was getting the secure Tableau Cloud (https) to talk to our local Python server (http). Browsers aggressively block "Mixed Content." We had to configure specific "Safe Lists" in Tableau and implement robust CORS headers in Python to permit the data handshake.
  • Architectural Bottlenecks: Initially, we used standard REST API calls to create records. We realized this was too slow ("synchronous") for a high-volume hospital environment. We had to refactor the entire backend to use Salesforce Platform Events, transforming it into an asynchronous "Fire-and-Forget" system that is much more resilient.
  • Schema Mismatches: Connecting a custom LWC to the database often resulted in "Restricted Picklist" errors when trying to update statuses. debugging these required a deep dive into Salesforce Object Manager and Field Dependencies.

🏆 Accomplishments that we're proud of

  • The "Golden Loop": The moment we clicked a button in a Tableau Dashboard and saw a custom Lightning Card pop up in Salesforce instantly—without refreshing the page—was magical. It proved the integration was seamless.
  • Enterprise Architecture: We didn't just build a hackathon prototype; we built it "The Right Way." Using LWC and Platform Events means this architecture is actually scalable to real-world enterprise needs.
  • Agentic Workflow: We successfully moved beyond just "reporting data" to "initiating action," effectively creating a Level 3 Agentic Workflow.

🧠 What we learned

  • Salesforce Ecosystem: We gained deep hands-on experience with Lightning Web Components (LWC) and the @wire service for reactive data binding.
  • Event-Driven Design: We learned why enterprises prefer Pub/Sub models over direct API calls for scalability.
  • Tableau Extensions API: We learned how to manipulate dashboard parameters programmatically, turning a static chart into an interactive application.

🚀 What's next for VitalFlow

  • True AI Integration: Currently, the recommendations are rule-based. The next step is connecting the AgentLogic Apex class to Salesforce Einstein GPT or an LLM to generate dynamic, context-aware resolution plans based on historical data.
  • Predictive Analytics: We plan to use the historical data logs to predict surges 4 hours before they happen, moving from "Reactive" alerts to "Proactive" resource allocation.
  • Mobile Deployment: Wrapping the LWC in the Salesforce Mobile App to allow doctors to acknowledge alerts from their phones.

Built With

Share this project:

Updates

Submission history