Skip to main content

HospitalSim - Swarms

Project description

HospitalSim

BACK GROUND IMAGE

Enterprise-Grade Hospital Management & Simulation System

Join our Discord Explore Swarms Platform Try Simulations Subscribe on YouTube Connect on LinkedIn Follow on X.com

Overview

HospitalSim is a sophisticated multi-agent hospital management and simulation system designed to optimize healthcare operations through intelligent automation. This enterprise-grade solution provides comprehensive patient care simulation, electronic health records management, and operational analytics to improve hospital efficiency and patient outcomes.

System Architecture Flow

flowchart TD
    A[Patient Arrives] --> B[Reception Check-in]
    B --> C[Patient Queue]
    C --> D{Triage Assessment}
    D --> E[Priority Scoring]
    E --> F{Emergency?}
    F -->|Yes| G[Emergency Doctor]
    F -->|No| H[General Doctor]
    G --> I[Consultation]
    H --> I[Consultation]
    I --> J[Diagnosis & Treatment Plan]
    J --> K[EHR Documentation]
    K --> L[Patient Discharge]
    
    M[Executive Team] --> N[Strategic Meetings]
    N --> O[Hospital Operations]
    O --> P[Performance Analytics]
    P --> Q[Resource Optimization]
    
    R[ChromaDB EHR] --> S[Patient History]
    S --> I
    R --> T[Similar Cases]
    T --> I
    
    U[AI Agents] --> B
    U --> D
    U --> G
    U --> H
    U --> M

Install

pip3 install -U hospital-sim

Usage

from hospital_sim.main import HospitalSimulation
from dotenv import load_dotenv

load_dotenv()

# Create hospital
hospital = HospitalSimulation("City General Hospital")

# Generate initial patients
hospital.generate_patients(3)

# Run short simulation
hospital.run_simulation(
    duration_minutes=10, patient_arrival_rate=0.1
)

Key Features

Feature Category Description
Executive Team CEO, CFO, and CMO agents for strategic decision-making
Medical Staff Specialized doctors (Emergency Medicine, General Practice) with domain expertise
Nursing Team Triage and floor nurses for comprehensive patient care
Administrative Staff Receptionists for patient check-in and queue management
Intelligent Priority Scoring Dynamic patient triage based on symptoms and vital signs
Queue Optimization Priority-based patient queue with estimated wait times
Real-time Status Tracking Complete patient journey monitoring
Multi-step Care Pipeline Reception → Triage → Consultation → Treatment → Documentation
ChromaDB Integration Advanced RAG (Retrieval-Augmented Generation) system for medical records
Historical Data Access Comprehensive patient history retrieval and analysis
Similar Case Matching AI-powered similarity search for diagnostic support
Persistent Storage Reliable data persistence with fallback mechanisms
Performance Analytics Real-time metrics on patient throughput, wait times, and satisfaction
Financial Modeling Revenue and cost analysis with profit optimization
Executive Decision Making Automated strategic planning through executive team collaboration
Quality Assurance Continuous monitoring of care quality and staff performance

Citation

If you use HospitalSim in your research or projects, please cite our work:

@software{hospitalsim2025,
  title={HospitalSim: Enterprise-Grade Hospital Management \& Simulation System},
  author={The Swarm Corporation},
  year={2025},
  url={https://github.com/The-Swarm-Corporation/HospitalSim},
  license={MIT}
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2025 The Swarm Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hospital_sim-0.0.2.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hospital_sim-0.0.2-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file hospital_sim-0.0.2.tar.gz.

File metadata

  • Download URL: hospital_sim-0.0.2.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Darwin/24.5.0

File hashes

Hashes for hospital_sim-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5f330d99962f0a43fba48981914ed6db090223a5d697494af566b132cb078d6f
MD5 342274ff4fcb7e5d961cd09665c0f23e
BLAKE2b-256 7e6ebbb7bcbae4a5f663bd11150c918b98e5b765878dccaec1316e3ae495b02a

See more details on using hashes here.

File details

Details for the file hospital_sim-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: hospital_sim-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Darwin/24.5.0

File hashes

Hashes for hospital_sim-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b1c1ebd034e35f6676fbde2a3b1fdf6b8ade1a81ce00095d1ed49033edd18f90
MD5 6e7e4c29a35acfdcec442dadd91c482f
BLAKE2b-256 7efcd95cd0d658ef20fed78ddd2b72cb944556237c7a9ec2a81cc20972181476

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page