Skip to content

Welcome to 🩺 MedicalAssistantGPT, a simple yet powerful Streamlit dashboard that leverages MongoDB, Streamlit, and OpenAI to help users explore medical symptom-disorder relationships. This repository is part of the Big Data Engineering course for the academic year 2024–2025 πŸŽ“.

License

Notifications You must be signed in to change notification settings

giuseppericcio/SimpleMongoDBDashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🩺 MedicalAssistantGPT

Welcome to MedicalAssistantGPT, a simple yet powerful Streamlit dashboard that leverages MongoDB, Streamlit, and OpenAI to help users explore medical symptom-disorder relationships. This repository is part of the Big Data Engineering course for the academic year 2024–2025 πŸŽ“.

✨ Features

  • πŸ“Š Interactive dashboard built with Streamlit
  • 🧠 Uses OpenAI GPT to generate simple medical explanations
  • πŸ—ƒοΈ Data storage and querying powered by MongoDB Atlas
  • πŸ”„ Easy CSV data import via load_data.py
  • πŸ” Symptom-based disorder filtering
  • πŸ“‹ Real-time relation type stats

πŸ“ Project Structure

.
β”œβ”€β”€ .streamlit/
β”‚   └── secrets.toml         # Stores API keys (OpenAI)
β”œβ”€β”€ .gitignore
β”œβ”€β”€ dashboard.py             # Streamlit app for interactive exploration
β”œβ”€β”€ LICENSE
β”œβ”€β”€ load_data.py             # Script to load CSV data into MongoDB Atlas
β”œβ”€β”€ README.md
β”œβ”€β”€ relations.csv            # Dataset: [source, relationType, destination]
└── requirements.txt         # Python dependencies

πŸš€ Getting Started

1. πŸ§ͺ Install Dependencies

Make sure you are using Python 3.8+. Then install all required libraries:

pip install -r requirements.txt

2. ☁️ Set Up MongoDB Atlas

  1. Create a free MongoDB Atlas account.
  2. Create a new cluster and database named healthcare.
  3. Inside the healthcare database, create a collection named relations.
  4. Whitelist your IP and get your connection string.
  5. Update the MongoDB connection string inside dashboard.py and load_data.py:
client = MongoClient("your-mongodb-connection-string")

3. πŸ” Set Up OpenAI API Key

In the file .streamlit/secrets.toml, store your OpenAI key like this:

[openai]
api_key = "your-openai-api-key"

πŸ”’ This file is ignored by Git. Don’t commit your secrets!


4. πŸ“₯ Load the CSV into MongoDB

Use the load_data.py script to populate the relations collection:

python load_data.py

5. πŸ–₯️ Run the Dashboard

Launch the Streamlit dashboard:

streamlit run dashboard.py

Then visit http://localhost:8501 in your browser πŸš€


🧠 How It Works

  • The dashboard lets users select two or more symptoms from the sidebar.
  • It queries MongoDB to find disorders that match all selected symptoms.
  • Then, it uses GPT to explain those disorders in simple termsβ€”perfect for educational and demo purposes!

πŸ“š Example Use Case

Select:

  • Symptom A: Fever
  • Symptom B: Cough

➑️ The app identifies disorders like Influenza associated with both symptoms and provides a plain-language description and potential treatments.


🧾 License

This project is licensed under the MIT License.


πŸ™Œ Acknowledgments

Made with ❀️ for students of Big Data Engineering 2024–25
Instructors: Antonio Romano, Giuseppe Riccio, Vincenzo Moscato πŸ‘¨β€πŸ«

About

Welcome to 🩺 MedicalAssistantGPT, a simple yet powerful Streamlit dashboard that leverages MongoDB, Streamlit, and OpenAI to help users explore medical symptom-disorder relationships. This repository is part of the Big Data Engineering course for the academic year 2024–2025 πŸŽ“.

Topics

Resources

License

Stars

Watchers

Forks

Languages