diff --git a/app.py b/app.py index db91f87..fb83eea 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,4 @@ -# app.py (updated) +# app.py (final version) from flask import Flask, render_template, request, redirect, url_for, session, flash from flask_sqlalchemy import SQLAlchemy from datetime import datetime @@ -37,8 +37,6 @@ with app.app_context(): @app.route('/') def index(): - if 'user_id' in session: - return redirect(url_for('dashboard')) return render_template('index.html') @app.route('/register', methods=['GET', 'POST']) @@ -180,15 +178,13 @@ def delete_record(record_id): @app.route('/predict_diseases', methods=['POST']) def predict_diseases(): - if 'user_id' not in session: - return redirect(url_for('login')) - + # Make this endpoint publicly accessible current_disease = request.form['current_disease'].strip() # In a real application, this would process the data and generate predictions # For demonstration, we'll just simulate the result based on some common patterns - # Get all health records to analyze correlations + # Get all health records to analyze correlations (no user session required) all_records = HealthRecord.query.all() # Simple correlation analysis (would be more complex in reality) diff --git a/instance/health_tracker.db b/instance/health_tracker.db index 91b2aeb..a1265a1 100644 Binary files a/instance/health_tracker.db and b/instance/health_tracker.db differ diff --git a/templates/base.html b/templates/base.html index f6052f5..0336c38 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,4 +1,4 @@ - + @@ -391,7 +391,7 @@

{{ session.username }}

-

Member since {{ user.created_at.strftime('%b %Y') if 'user' in locals() and user else '' }}

+

Member since {{ user.created_at.strftime('%b %Y') if user and user.created_at else '' }}

Logout
diff --git a/templates/index.html b/templates/index.html index 448764a..57c9876 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,40 +3,37 @@ {% block content %}
-
-

Welcome to Health History Tracker

-

Track and manage your health records with our secure platform.

-
- {% if session.user_id %} - Go to Dashboard - Logout - {% else %} - Login - Register - {% endif %} +
+

Health Disease Prediction Engine

+

Enter your current illness and get statistical recommendations based on health records from all users

+ +
+
+
+
+ + +
+ +
+
-
-
- - -
-
-
+ +
-

Disease Prediction Engine

+

How It Works

-

Enter your current illness to get statistical recommendations based on all registered users' health records.

- -
-
- - -
-
+

This tool analyzes statistical patterns from all registered users' health records to provide insights into related conditions.

+
    +
  • Enter your current illness in the search box above
  • +
  • View statistically significant related conditions
  • +
  • Understand common co-occurrences with your symptoms
  • +
  • This is for informational purposes only - not medical advice
  • +
diff --git a/templates/prediction_results.html b/templates/prediction_results.html index 9453ed7..6242b67 100644 --- a/templates/prediction_results.html +++ b/templates/prediction_results.html @@ -3,7 +3,7 @@ {% block content %}