From 8991fbec41acc1621efecb1e62e67f71a7164b37 Mon Sep 17 00:00:00 2001 From: Udo Waechter Date: Wed, 12 Nov 2025 13:30:51 +0100 Subject: [PATCH] Works for now --- app.py | 10 ++---- instance/health_tracker.db | Bin 20480 -> 20480 bytes templates/base.html | 4 +-- templates/index.html | 57 ++++++++++++++---------------- templates/prediction_results.html | 6 ++-- 5 files changed, 35 insertions(+), 42 deletions(-) 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 91b2aeb1d19b29e7c301bcb1e600f1c213709eb0..a1265a19e77cdd960a1dfb80d55c9d7f9ed67787 100644 GIT binary patch delta 235 zcmZozz}T>Wae_1>>qHr6M%Il9OZYjM_@^-NpXQ&kSx}&Z-`tdmjX_vd(lI692#6d~ z^7WE467!2w@(qoQO^ghTOmz(nbq$Ra3@oio4Xq4}^~}sn49$!upO&`-n)Hc*{}=zK z&4LQg_@&sHg&BcHFtIWVa;D^SF)%PN@jqbTf586{D1U`tP=Hw#BoDWOY4S&VVKzqo z!wmd~fo|E!Z)?rS$-pSDD9X$0$mE%qmQ$LVSCxoxLvChH3W5i9k&(HcftiV^sW|}i C-8&}$ delta 89 zcmZozz}T>Wae_1>^F$eEM&^wPOZeFs`A;+OpWZB}aFBoUX?aT^{}%)QFChOR|HJ?R ier7?=lzc7*1_nm{j|}`Dq2g?lKiUg3F$h4o6C?qhYZ_<( 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 @@
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 %}