This project sets up a MongoDB database containing patient datasets to analyze comorbidities between hypertension and mental health conditions, focusing on depression and anxiety. The database is designed for healthcare analytics and research.
- Preprocessed datasets for hypertension and mental health conditions.
- Python script to automatically load datasets into MongoDB collections.
- Instructions to verify data and use it for analysis.
Before starting, ensure you have the following installed:
- Python (version 3.8 or higher)
- MongoDB (installed and running locally or accessible remotely)
- Required Python libraries (see
requirements.txt)
git clone https://github.com/your-username/lang-patient-db.git
cd lang-patient-dbInstall the required Python libraries:
pip install -r requirements.txtRun the Python script to load the datasets into your MongoDB instance:
python setup_mongodb.pyTo confirm the data is loaded successfully, start the MongoDB shell and verify:
mongoshThen run the following commands:
use health_data
show collectionsYou should see:
hypertensiondepression_anxiety
lang-patient-db/
├── setup_mongodb.py # Script to load data into MongoDB
├── requirements.txt # List of required Python libraries
├── README.md # Project documentation
├── .gitignore # Git ignore file
├── data/ # Contains the datasets
│ ├── processed_depression_anxiety.csv
│ ├── final_hypertension_dataset.csv
- Contains data on depression and anxiety patients.
- Attributes:
patient_id,age,gender,anxiety_level,depression_level, etc.
- Contains data on hypertension patients.
- Attributes:
patient_id,age,gender,blood_pressure,medication_status, etc.
-
Once the database is set up, you can access the data programmatically using MongoDB drivers for Python, such as
pymongo. -
Example query to fetch hypertension data:
from pymongo import MongoClient
# Connect to MongoDB
client = MongoClient("mongodb://localhost:27017/")
db = client["health_data"]
# Fetch hypertension collection
hypertension_data = db["hypertension"].find()
for record in hypertension_data:
print(record)- Replace the query parameters to fit your analysis needs.
- Aysha
- Shruti
Contributions, issues, and feature requests are welcome! Feel free to fork this repository and submit a pull request.
This project is open source and available under the MIT License. See the LICENSE file for details.