admin

Please wait...

auto_awesome AI Features & Integration

Cliniva is now an AI-First template, featuring deep integration with Google Gemini and OpenAI. These features are designed to modernize hospital operations through predictive analytics and intelligent automation.

1. AI Infrastructure (AiService)

The core of the AI features is the centralized AiService. It handles secure API communication, model selection, and configuration persistence.

  • Provider Support: Native support for Google Gemini (Flash/Pro) and OpenAI (GPT-4/3.5).
  • Security: API keys are handled securely via local configuration and dynamic header injection.
  • Settings UI: A user-friendly settings page allows administrators to switch models and providers on the fly.

2. Smart Dashboard Insights

Located on the main dashboard, this widget provides real-time predictive analysis of hospital data.

  • Dynamic Analysis: Predicts patient volume trends and bed occupancy.
  • Premium UI: Features glassmorphism effects, shimmer loading states, and fixed-height scrolling for layout stability.

3. Predictive Risk Badges

We've enhanced the standard data tables with AI "Risk Indicators."

  • Appointments Table: Automatically flags "High Risk" appointments based on visit types and patient history.
  • Inventory Table: Predicts stock-out risks and suggests reorder plans.
  • Reasoning Tooltips: Hover over any badge to see the AI's specific "Logic" or reason for the prediction.

4. Global AI Assistant

A floating, persistent AI helper available on every single page.

  • Chat Interface: A modern, slide-up chat window with typing animations.
  • Contextual Help: Ready to answer questions about clinical procedures or dashboard stats.
  • Dark Mode: Fully themed to match the template's dark and light modes.

5. Clinical AI Scribe

A specialized tool for doctors located within the Clinical Notes section.

  • Note Structuring: Transforms raw, messy observations into professional EMR-ready notes.
  • Automatic Categorization: Organizes data into Symptoms, Diagnosis, and Treatment Plan sections.
Developer Tip: You can extend these features by using the postPrompt() method in the AiService. Just inject the service into any component and start building!

security Production Readiness & Security

While the current implementation allows for rapid development and testing, moving to a production healthcare environment requires specific architectural changes to ensure security and compliance.

1. API Key Security (The Proxy Pattern)

In the demo version, API keys are stored in localStorage. In production, you MUST NOT do this. Exposing API keys in the frontend allows anyone to steal your quota and costs.

  • Recommended Approach: Create a backend proxy (e.g., using Node.js, .NET, or Java).
  • Workflow: The Angular AiService should send requests to your own server. Your server then attaches the API key and forwards the request to Gemini or OpenAI.
2. Data Flow Architecture
[Angular Frontend][Your Secure Backend (Proxy)][AI Provider API]
3. Privacy & HIPAA Compliance

When using AI in a medical context, ensure you are not sending Personally Identifiable Information (PII) to public AI models unless you have a Business Associate Agreement (BAA) with the provider (e.g., Google Cloud Vertex AI or Azure OpenAI).

  • Always anonymize patient names and IDs before sending data to the AiService.
  • Use the "system prompt" to instruct the AI not to store or log any sensitive data.
4. Transitioning to Production

To move to production, simply update the baseUrl in your AiService to point to your secure backend endpoint instead of the direct provider URLs.