This Flask-based web application allows users to upload previous and latest prescriptions in PDF format to compare medications, their strengths, and dosage forms. The app also features user authentication with signup and login functionality.
- User Authentication: Users can sign up and sign in to access their personalized dashboard.
- PDF Prescription Analysis: The application extracts text from prescription PDFs and compares the medications, checking their strengths against a dataset of medicines.
- Comparison with Dataset: The app checks medication strength and form (tablet, syrup, etc.) from a provided dataset of medicines.
Before running the application, make sure you have the following installed:
- Python 3.7+
- Flask
- Pandas
- PyPDF2
-
Clone the repository:
git clone https://github.com/yourusername/medbud-app.git cd medbud-app
-
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
-
Install the required packages:
pip install Flask pandas PyPDF2
-
Place your
medicine_dataset.csv
file in the/mnt/data/
directory. -
Make sure the directory structure for user pages is in place:
mkdir users
-
Run the Flask application:
python app.py
-
Open your browser and navigate to:
http://127.0.0.1:5000/
- Navigate to the sign-up page.
- Enter your username, email, and password to create an account.
- Enter your username and password on the login page to access your personalized dashboard.
- Upload both the previous and latest prescription PDFs.
- The app will extract text from both prescriptions, compare the medications, and present the differences (e.g., increased dosage).
- The analysis results will be compared to the
medicine_dataset.csv
file to check for standard strengths and dosage forms.
├── app.py
├── templates
│ ├── first.html
│ ├── index.html
│ ├── signin.html
│ ├── signup.html
│ ├── user.html
│ └── prescription_analysis.html
├── users
│ └── (auto-generated HTML files for users)
├── mnt
│ └── data
│ └── medicine_dataset.csv
└── README.md
The app uses a dataset (medicine_dataset.csv
) that contains medicine information such as:
- Name: The name of the medicine.
- Strength: The strength (e.g., 500 mg).
- Dosage Form: The form in which the medicine is administered (e.g., tablet, syrup).
Feel free to fork this repository and submit pull requests for any improvements.