EmergencyX is an intelligent desktop application that leverages Machine Learning to revolutionize patient triage in emergency departments β predicting emergency severity levels and cardiac arrest risk in real time.
- Overview
- Key Features
- System Architecture
- Modules
- Tech Stack
- Installation
- How to Use
- ML Model Details
- Project Structure
- Screenshots
- Contributing
- Author
EmergencyX addresses one of the most critical challenges in emergency medicine β speed and accuracy of triage. Every second counts in an emergency, and misclassifying a patient's severity can be fatal.
By combining a modern Windows desktop UI with a trained Machine Learning backend, EmergencyX empowers medical staff to:
- Instantly assess emergency severity for incoming patients
- Predict cardiac arrest risk based on vital signs and clinical data
- Prioritize patients with confidence backed by data-driven AI
This project demonstrates the real-world integration of C# desktop development with ML-based predictive modeling.
| Feature | Description |
|---|---|
| π₯ Smart Triage | Predicts emergency level (1β5 scale) based on patient vitals & symptoms |
| β€οΈ Cardiac Risk Prediction | Detects risk of cardiac crisis using clinical indicators |
| π€ ML Integration | C# frontend communicates with trained ML model for real-time inference |
| π₯οΈ Desktop Application | Native Windows app β fast, offline-capable, no browser needed |
| π Instant Results | Predictions displayed within milliseconds of data entry |
| π― Dual Module System | Two independent prediction modules in one unified interface |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β EmergencyX Desktop App β
β (C# / .NET) β
β β
β βββββββββββββββββββββββ βββββββββββββββββββββββββββ β
β β Module 1 β β Module 2 β β
β β Emergency Triage β β Cardiac Crisis β β
β β (Patient Input) β β Prediction β β
β ββββββββββ¬βββββββββββββ ββββββββββββββ¬βββββββββββββ β
β β β β
β ββββββββββββ¬βββββββββββββββββββ β
β β β
β ββββββββββΌβββββββββ β
β β ML Bridge β β
β β (API / .NET) β β
β ββββββββββ¬βββββββββ β
βββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββΌβββββββββββββββ
β ML Model Backend β
β (ML.NET / Python / ONNX) β
β β
β ββββββββββββ ββββββββββββ β
β β Triage β β Cardiac β β
β β Model β β Model β β
β ββββββββββββ ββββββββββββ β
ββββββββββββββββββββββββββββββ
The triage module accepts patient data and classifies the emergency level using a trained classification model.
Input Parameters:
- Age, Gender
- Chief complaint / Symptoms
- Vital signs (Heart Rate, Blood Pressure, Oβ Saturation, Temperature, Respiratory Rate)
- Consciousness level (GCS)
- Pain score (0β10)
Output:
- Emergency Level:
Level 1 (Resuscitation)βLevel 5 (Non-Urgent) - Confidence score (%)
- Recommended action
The cardiac module analyzes clinical indicators to assess the risk of an acute cardiac event.
Input Parameters:
- Age, Gender, BMI
- Chest pain type & duration
- ECG findings
- Cardiac biomarkers (Troponin, CK-MB)
- Blood pressure, Cholesterol
- History of diabetes, hypertension, smoking
Output:
- Risk Level:
Low/Moderate/High/Critical - Probability score (%)
- Alert flag for immediate intervention
Frontend (Desktop UI)
βββ Language : C# (.NET 6 / .NET Framework)
βββ UI Framework : Windows Forms / WPF
βββ IDE : Visual Studio 2022
Machine Learning Backend
βββ ML Framework : ML.NET ββorββ Python (scikit-learn / XGBoost)
βββ Model Format : .ZIP (ML.NET) ββorββ .pkl / .onnx (Python)
βββ Integration : REST API (Flask) ββorββ Direct ML.NET call
βββ Training Data : Emergency & Cardiac clinical datasets
Communication Layer
βββ If Python ML : HTTP REST API (localhost Flask server)
βββ If ML.NET : Direct in-process model loading
- Windows 10 / 11 (64-bit)
- .NET 6.0 Runtime or higher
- Python 3.8+ (only if using Python ML backend)
- Visual Studio 2022 (for development)
git clone https://github.com/YOUR_USERNAME/EmergencyX.git
cd EmergencyX# Open solution in Visual Studio
start EmergencyX.sln
# Or build via CLI
dotnet restore
dotnet build
dotnet runcd MLBackend
pip install -r requirements.txt
python app.pyThe Flask server will start on
http://localhost:5000and the C# app will connect automatically.
1. Launch the Application
Run
EmergencyX.exefrom thebin/Releasefolder or pressF5in Visual Studio.
2. Select a Module
Choose between
Emergency TriageorCardiac Crisis Predictionfrom the main dashboard.
3. Enter Patient Data
Fill in the patient's clinical information in the structured form.
4. Run Prediction
Click "Analyze" β the ML model processes the input and returns results instantly.
5. Review Results
View the predicted severity level, confidence score, and recommended clinical action.
| Property | Triage Model | Cardiac Model |
|---|---|---|
| Type | Multi-class Classification | Binary / Multi-class Classification |
| Algorithm | Random Forest / XGBoost | Logistic Regression / Neural Net |
| Output Classes | 5 Emergency Levels | 4 Risk Levels |
| Input Features | ~10 clinical features | ~12 clinical features |
| Model Format | .zip (ML.NET) / .pkl |
.zip (ML.NET) / .pkl |
EmergencyX/
β
βββ EmergencyX/ # Main C# Application
β βββ Forms/
β β βββ MainDashboard.cs # Main window
β β βββ TriageForm.cs # Module 1 UI
β β βββ CardiacForm.cs # Module 2 UI
β βββ Models/
β β βββ PatientData.cs # Patient data model
β β βββ PredictionResult.cs # Result model
β βββ Services/
β β βββ MLService.cs # ML model communication
β β βββ ApiService.cs # REST API client (if Python)
β βββ EmergencyX.csproj
β
βββ MLBackend/ # Python ML Backend (optional)
β βββ models/
β β βββ triage_model.pkl
β β βββ cardiac_model.pkl
β βββ app.py # Flask API server
β βββ train_triage.py # Model training script
β βββ train_cardiac.py # Model training script
β βββ requirements.txt
β
βββ MLModels/ # ML.NET Models (alternative)
β βββ TriageModel.zip
β βββ CardiacModel.zip
β
βββ Screenshots/ # App screenshots
βββ README.md
βββ .gitignore
βββ LICENSE
| Dashboard | Triage Module | Cardiac Module |
|---|---|---|
![]() |
![]() |
![]() |
# Visual Studio
.vs/
bin/
obj/
*.user
*.suo
# Python
__pycache__/
*.pyc
*.pyo
.env
venv/
*.pkl # optional: ignore trained models if large
# ML.NET models (if large, use Git LFS instead)
# *.zip
# OS
.DS_Store
Thumbs.db
*.logContributions, issues and feature requests are welcome!
- Fork the repository
- Create your feature branch:
git checkout -b feature/AmazingFeature - Commit your changes:
git commit -m 'Add AmazingFeature' - Push to the branch:
git push origin feature/AmazingFeature - Open a Pull Request
Ahmad Albasha
This project is licensed under the MIT License β see the LICENSE file for details.
β If you find this project useful, please consider giving it a star!
Built with β€οΈ to save lives through technology


