Works for now

This commit is contained in:
2025-11-12 13:30:51 +01:00
parent cbb2dec615
commit 8991fbec41
5 changed files with 35 additions and 42 deletions

10
app.py
View File

@@ -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)