Home Applications Smart Clinical Copilot - Configuration Management System

Smart Clinical Copilot - Configuration Management System

InterSystems does not provide technical support for this project. Please contact its developer for the technical assistance.
5
1 reviews
0
Awards
3.9k
Views
0
IPM installs
2
2
Details
Releases (4)
Reviews (1)
Issues
Videos (1)
Articles (1)
This app has a demo View
AI-powered Clinical Decision Support System (CDSS)

What's new in this version

Key Features
Core Features:

RESTful API for Configuration Management: Facilitates seamless configuration management through a well-structured API.
Secure Storage and Encryption: Ensures that all configurations are securely stored and encrypted.
Configuration Validation: Validates configurations to maintain data integrity and consistency.
Template Management: Allows for the creation and management of configuration templates, enhancing reusability and standardization.
Import/Export Functionality: Supports easy import and export of configurations, enabling efficient data migration and backup.
Audit Logging: Maintains detailed logs of all configuration changes for traceability and compliance.
Performance Monitoring: Continuously monitors system performance to ensure optimal operation.
Advanced Features:

Local LLM Integration with Fallback Support: Integrates local language models with fallback mechanisms to ensure uninterrupted service.
IRIS Database Integration: Provides seamless integration with InterSystems IRIS for efficient healthcare data management.
Redis Caching: Implements Redis caching to enhance performance and reduce latency.
Prometheus Metrics: Utilizes Prometheus for comprehensive metrics collection and monitoring.
Background Tasks: Supports background task processing for asynchronous operations.
Rate Limiting: Implements rate limiting to protect the API from abuse and ensure fair usage.
Role-Based Access Control: Enforces role-based access control to secure sensitive operations and data.
Database Migrations: Facilitates smooth database migrations using Alembic.
API Documentation: Provides thorough API documentation for easy integration and usage.
LLM Features:

Multiple Model Support: Supports multiple language models, including Mistral and Llama2.
Automatic Fallback Mechanisms: Ensures continuous service by automatically falling back to alternative models if needed.
Response Caching: Caches responses to improve performance and reduce load times.
Performance Metrics: Collects and monitors performance metrics for continuous optimization.
Configurable Parameters: Allows for the configuration of various parameters to tailor the system to specific needs.
Local Inference Optimization: Optimizes local inference to enhance performance and reduce resource consumption.
IRIS Integration:

Direct Table Access: Provides direct access to IRIS tables for efficient data management.
Connection Pooling: Implements connection pooling to optimize database connections.
Query Caching: Caches frequent queries to improve performance.
Transaction Support: Ensures data integrity with comprehensive transaction support.
Performance Monitoring: Continuously monitors performance to identify and address bottlenecks.
Error Recovery: Implements robust error recovery mechanisms to ensure system reliability.
Key Improvements
Enhanced Security: Strengthened security measures with secure storage, encryption, and role-based access control.
Improved Performance: Optimized performance through Redis caching, connection pooling, and query caching.
Comprehensive Monitoring: Implemented comprehensive monitoring with Prometheus metrics and performance monitoring.
Robust Error Handling: Enhanced error recovery mechanisms to ensure system reliability and robustness.
Detailed Documentation: Provided thorough API documentation and structured logging for better usability and maintenance.

πŸ₯ Smart Clinical Copilot

License: MIT
Python
FastAPI
React
Docker
FHIR

An AI-powered clinical decision support system that helps healthcare providers make better decisions by providing real-time clinical insights and recommendations.

Features β€’ Architecture β€’ Quick Start β€’ Development β€’ Contributing

✨ Features

Category Features
πŸ₯ Clinical Support β€’ Real-time clinical decision support
β€’ Rule-based alerting system
β€’ Patient risk assessment
β€’ Medication safety checks
πŸ”„ Integration β€’ FHIR integration for healthcare data
β€’ IRIS for Healthcare integration
β€’ Multi-system interoperability
β€’ Real-time data synchronization
πŸ’» User Interface β€’ Modern, responsive web interface
β€’ Intuitive clinical dashboard
β€’ Real-time alerts and notifications
β€’ Customizable views
πŸ› οΈ Technical β€’ Docker-based deployment
β€’ Scalable microservices architecture
β€’ High-performance data processing
β€’ Secure data handling

πŸ—οΈ Architecture

The system consists of the following components:

graph TD
    A[User
External Actor] --> B[Web Frontend] B --> C[Copilot Backend
Python/FastAPI] B --> D[Django Admin & API
Python/Django]
B -- "Requests data from" --> C
D -- "Requests data from" --> E[Database APIs<br>PostgreSQL, Redis, etc.]
D -- "Uses ORM for" --> E

B -- "Initializes" --> F[UI Entry Point<br>TypeScript/React]
F -- "Initializes" --> G[App Shell<br>TypeScript/React]
G -- "Manages" --> H[UI Pages<br>TSX/React Directory]
H -- "Uses" --> I[UI Components<br>TSX/React Directory]
H -- "Calls" --> J[Frontend API Client<br>TypeScript]
J -- "Requests data from" --> C

C -- "Uses" --> K[Rules Engine<br>Python Code]
C -- "Accesses" --> L[FHIR Client<br>Python Code]
L -- "Communicates with" --> M[External Systems<br>FHIR APIs, InterSystems IRIS, etc.]
C -- "Invokes" --> N[Monitoring Services<br>Python Code Directory]
C -- "Reads config from" --> O[Configuration Management<br>Python Code Directory]
O -- "Manages Uses" --> O
C -- "Invokes" --> P[LLM Service<br>Python Code]
P -- "Communicates with" --> Q[External Systems<br>OpenAI, Ollama, etc.]

D -- "Handles commands &<br>delegates HTTP to" --> R[URL Configuration<br>Python/Django]
R -- "Routes to" --> S[Core Business Logic<br>Python/Django Directory]
D -- "Loads" --> T[Application Settings<br>Python/Django]

Core Components

  • Frontend: React-based web interface with Material-UI
  • Backend: FastAPI-based API server with Python
  • FHIR Server: HAPI FHIR server for healthcare data
  • IRIS: InterSystems IRIS for Healthcare integration
  • Database: PostgreSQL for data persistence
  • Rule Engine: Custom rule processing system
  • Monitoring: System health and performance tracking

πŸš€ Quick Start

Prerequisites

  • Docker and Docker Compose
  • Git
  • Node.js (for local development)
  • Python 3.9+ (for local development)
  • PostgreSQL (for production)
  • Redis (for caching and session management)

Installation

  1. Clone the repository:

    git clone https://github.com/kunal0297/SmartClinicalCopilot.git
    cd SmartClinicalCopilot
    
  2. Create a .env file in the backend directory with the following content:

    # Environment
    ENVIRONMENT=development
    

    API Settings

    HOST=0.0.0.0
    PORT=8000

    Database

    DATABASE_URL=postgresql://postgres:postgres@db:5432/clinical_copilot

    FHIR Server

    FHIR_SERVER_URL=http://hapi.fhir.org/baseR4

    LLM Settings

    LLM_API_KEY=your-api-key-here
    LLM_MODEL=mistral

    Redis Settings

    REDIS_URL=redis://redis:6379/0

    Security

    SECRET_KEY=your-secret-key-here
    ACCESS_TOKEN_EXPIRE_MINUTES=11520 # 8 days

    Monitoring

    ENABLE_METRICS=true
    METRICS_PORT=9090

    Logging

    LOG_LEVEL=INFO

  3. Build and start the Docker containers:

    docker-compose build
    docker-compose up
    
  4. Access the services:

πŸ’» Development

Backend Development

  1. Set up the environment:

    python -m venv venv
    source venv/bin/activate  # Linux/Mac
    venv\Scripts\activate     # Windows
    
  2. Install dependencies:

    cd backend
    pip install -r requirements.txt
    
  3. Run the development server:

    cd backend
    uvicorn main:app --reload
    

Frontend Development

  1. Install dependencies:

    cd frontend
    npm install
    
  2. Run the development server:

    npm run dev
    

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Guidelines

  • Follow PEP 8 for Python code
  • Use TypeScript best practices for frontend code
  • Write meaningful commit messages
  • Include tests for new features
  • Update documentation as needed

πŸ“š Documentation

πŸ”’ Security

  • All data is encrypted in transit and at rest
  • Role-based access control
  • Regular security audits
  • HIPAA compliance measures

πŸ“„ License

This project is licensed under the MIT License - see the https://github.com/kunal0297/SmartClinicalCopilot/blob/main/LICENSE file for details.

πŸ“ž Contact

Team Kunal0297

πŸ› οΈ Post-Clone Frontend Setup (Important!)

After cloning the repository, you must set up the frontend dependencies to avoid common TypeScript and module errors:

  1. Install Frontend Dependencies

    cd frontend
    npm install
    
  2. Ensure TypeScript Type Definitions
    If you encounter errors about missing type definitions for node or vite/client, run:

    npm install --save-dev @types/node vite
    
  3. Check for utils.ts
    Make sure the file frontend/src/lib/utils.ts exists. If not, create it with the following content:

    import { type ClassValue, clsx } from "clsx";
    import { twMerge } from "tailwind-merge";
    

    export function cn(...inputs: ClassValue[]) {
    return twMerge(clsx(inputs));
    }

    export function formatDate(date: Date): string {
    return new Intl.DateTimeFormat("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    }).format(date);
    }

    export function debounce<T extends (...args: any[]) => any>(
    func: T,
    wait: number
    ): (...args: Parameters) => void {
    let timeout: NodeJS.Timeout;

    return function executedFunction(...args: Parameters) {
    const later = () => {
    clearTimeout(timeout);
    func(...args);
    };

    clearTimeout(timeout);
    timeout = setTimeout(later, wait);
    

    };
    }

    export function generateId(): string {
    return Math.random().toString(36).substring(2) + Date.now().toString(36);
    }

  4. Troubleshooting

    • If you see errors like Cannot find module '@/lib/utils', check that the file above exists and is committed.
    • If you see TypeScript errors about missing types, repeat step 2.
  5. Build the Frontend

    npm run build
    

Made with ❀️ by Team Kunal0297

Made with
Version
1.0.330 May, 2025
Ideas portal
https://ideas.intersystems.com/ideas/DPI-I-517
Category
Solutions
Works with
InterSystems IRIS for HealthInterSystems FHIR
First published
12 May, 2025
Last edited
30 May, 2025
Last checked by moderator
28 May, 2025Doesn't work