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.3.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.3-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hospital_sim-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 7d995a2decab0a9d0eea9ddaf6186c5ad38256c6bf0fd321e75027f007f29254
MD5 7158348780f76191736ca870200c71b2
BLAKE2b-256 340a5fbca808cc609032d259abb730cf4ed5cb2de2ee6a9e2c11e7f61205c836

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hospital_sim-0.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0c9ca25f9ea2cfd842c8eb8ed52a9b7c6f6f8acd143fe072fc1d55e46ab7df8b
MD5 4b3fae3087f714429110cbe1e0c06fdd
BLAKE2b-256 ea82cb6ed7225704e326d0a58ee5028830a3093e3977d9b4eb71c4f3bfbae10d

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