From c130a6024d04d1d895ee0bc124d83882e4603aee Mon Sep 17 00:00:00 2001 From: mooserson Date: Mon, 31 Jul 2023 09:37:56 -0500 Subject: [PATCH 01/17] adds hotfix for case results sizing on graph pages --- website/static/css/main.css | 16 ---------------- website/static/css/results.css | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/website/static/css/main.css b/website/static/css/main.css index 960b2f7..dde3499 100644 --- a/website/static/css/main.css +++ b/website/static/css/main.css @@ -626,22 +626,6 @@ footer { } @media only screen and (max-width: 800px) { - body { - font-weight: 500; - } - - /* These are bandaid fixes; we will want to remove style tags in HTML pages*/ - - #left { - width: auto !important; - float: none !important; - } - - #right { - width: auto !important; - float: none !important; - } - button { font-size: 1.3em; } diff --git a/website/static/css/results.css b/website/static/css/results.css index d698492..aacb98d 100644 --- a/website/static/css/results.css +++ b/website/static/css/results.css @@ -25,7 +25,7 @@ .case-results { background: white; - width: 50%; + width: 55%; margin: 20px auto 20px auto; border: thin #c0c0c0 solid; border-top-right-radius: 8px; @@ -124,7 +124,17 @@ margin: 10px 10px 0 0; } +@media screen and (max-width: 1024px) { + .case-results { + width: 75%; + } +} + @media screen and (max-width: 650px) { + .case-results { + width: 90%; + } + .chart-center { zoom: .45; width: 90%; @@ -139,4 +149,5 @@ grid-template-rows: auto; grid-gap: 20px; } -} \ No newline at end of file +} + From bc835f26658d3dc9d6d9f017b2333979db88569f Mon Sep 17 00:00:00 2001 From: mooserson Date: Mon, 31 Jul 2023 10:31:13 -0500 Subject: [PATCH 02/17] moves screener questions into folder --- website/screener_views.py | 18 +++++++++--------- website/templates/{ => screener}/page1.html | 0 website/templates/{ => screener}/page2.html | 0 website/templates/{ => screener}/page3.html | 0 website/templates/{ => screener}/page4.html | 0 5 files changed, 9 insertions(+), 9 deletions(-) rename website/templates/{ => screener}/page1.html (100%) rename website/templates/{ => screener}/page2.html (100%) rename website/templates/{ => screener}/page3.html (100%) rename website/templates/{ => screener}/page4.html (100%) diff --git a/website/screener_views.py b/website/screener_views.py index efdecc1..91a2b21 100644 --- a/website/screener_views.py +++ b/website/screener_views.py @@ -39,9 +39,9 @@ def page1(): return redirect(url_for("screener_views.page2")) else: - return render_template("page1.html", pagenum=session['pagenum'], message=message, + return render_template("screener/page1.html", pagenum=session['pagenum'], message=message, selected_radio=selected_radio, selected_severity=selected_severity) - return render_template("page1.html", pagenum=session['pagenum'], message='') + return render_template("screener/page1.html", pagenum=session['pagenum'], message='') @screener_views.route('/minimum', methods=["post", "get"]) @@ -62,9 +62,9 @@ def page2(): return redirect(url_for("screener_views.page3")) else: - return render_template("page2.html", pagenum=session['pagenum'], message=message, + return render_template("screener/page2.html", pagenum=session['pagenum'], message=message, selected_s=selected_s, selected_f=selected_f) - return render_template("page2.html", pagenum=session['pagenum'], message='') + return render_template("screener/page2.html", pagenum=session['pagenum'], message='') @screener_views.route('/unrefreshed', methods=['post', 'get']) @@ -88,9 +88,9 @@ def page3(): return redirect(url_for("screener_views.page4")) else: - return render_template("page3.html", pagenum=session['pagenum'], message=message, + return render_template("screener/page3.html", pagenum=session['pagenum'], message=message, sleepf=sleepf, sleeps=sleeps) - return render_template("page3.html", pagenum=session['pagenum'], message='') + return render_template("screener/page3.html", pagenum=session['pagenum'], message='') @screener_views.route('/remember', methods=['post', 'get']) @@ -113,9 +113,9 @@ def page4(): return redirect(url_for('screener_views.graph')) else: - return render_template("page4.html", pagenum=session['pagenum'], message=message, + return render_template("screener/page4.html", pagenum=session['pagenum'], message=message, rememberf=rememberf, remembers=remembers) - return render_template("page4.html", pagenum=session['pagenum'], message='') + return render_template("screener/page4.html", pagenum=session['pagenum'], message='') @screener_views.route('/graph') @@ -180,7 +180,7 @@ def graph(): fig.update_yaxes(range=[0, 100], dtick=25) fig.add_hline(y=1.5 * 25, line_color='black') graphJSON = json.dumps(fig, cls=plotly.utils.PlotlyJSONEncoder) - return render_template("graph.html", + return render_template("results/graph.html", graphJSON = graphJSON, screen_message = screen_message) diff --git a/website/templates/page1.html b/website/templates/screener/page1.html similarity index 100% rename from website/templates/page1.html rename to website/templates/screener/page1.html diff --git a/website/templates/page2.html b/website/templates/screener/page2.html similarity index 100% rename from website/templates/page2.html rename to website/templates/screener/page2.html diff --git a/website/templates/page3.html b/website/templates/screener/page3.html similarity index 100% rename from website/templates/page3.html rename to website/templates/screener/page3.html diff --git a/website/templates/page4.html b/website/templates/screener/page4.html similarity index 100% rename from website/templates/page4.html rename to website/templates/screener/page4.html From c25b3eb20e6fa34985d28080e08c55ec6d3815d4 Mon Sep 17 00:00:00 2001 From: mooserson Date: Mon, 31 Jul 2023 10:31:32 -0500 Subject: [PATCH 03/17] moves results pages into folder --- main.py | 4 ++-- website/short_form.py | 2 +- website/templates/{ => results}/graph.html | 0 website/templates/{ => results}/graph2.html | 0 website/templates/{ => results}/graph3.html | 0 5 files changed, 3 insertions(+), 3 deletions(-) rename website/templates/{ => results}/graph.html (100%) rename website/templates/{ => results}/graph2.html (100%) rename website/templates/{ => results}/graph3.html (100%) diff --git a/main.py b/main.py index 348864a..0261d18 100644 --- a/main.py +++ b/main.py @@ -428,7 +428,7 @@ def diagnose2(): fig.add_hline(y=1.5 * 25, line_color='black') graphJSON = json.dumps(fig, cls=plotly.utils.PlotlyJSONEncoder) - return render_template("graph3.html", graphJSON=graphJSON, + return render_template("results/graph3.html", graphJSON=graphJSON, ccc_msg=ccc_msg, ccc_fatiguecheck=ccc_fatiguecheck, ccc_pemcheck=ccc_pemcheck, ccc_paincheck=ccc_paincheck, ccc_sleepcheck=ccc_sleepcheck, ccc_cogcheck=ccc_cogcheck, ccc_autocheck=ccc_autocheck, ccc_immunecheck=ccc_immunecheck, @@ -443,7 +443,7 @@ def graph(graphJSON, probCFS, sample_size): graphJSON = graphJSON probCFS = probCFS sample_size = sample_size - return render_template("graph.html", graphJSON=graphJSON, probCFS=probCFS, sample_size=sample_size) + return render_template("results/graph.html", graphJSON=graphJSON, probCFS=probCFS, sample_size=sample_size) @app.route('/end2', methods=['get']) diff --git a/website/short_form.py b/website/short_form.py index b1ef0b3..62a64e3 100644 --- a/website/short_form.py +++ b/website/short_form.py @@ -364,7 +364,7 @@ def graph2(): # This converts to figure fig to a JSON object so it can be dynamically rendered with javascript on the page graphJSON = json.dumps(fig, cls=plotly.utils.PlotlyJSONEncoder) - return render_template("graph2.html", graphJSON=graphJSON, ccc_msg=ccc_msg, ccc_fatiguecheck=ccc_fatiguecheck, + return render_template("results/graph2.html", graphJSON=graphJSON, ccc_msg=ccc_msg, ccc_fatiguecheck=ccc_fatiguecheck, ccc_pemcheck=ccc_pemcheck, ccc_paincheck=ccc_paincheck, ccc_sleepcheck=ccc_sleepcheck, ccc_cogcheck=ccc_cogcheck, ccc_autocheck=ccc_autocheck, ccc_immunecheck=ccc_immunecheck, ccc_neurocheck=ccc_neurocheck, ccc_dx=ccc_dx, ccc_reduction=ccc_reduction, diff --git a/website/templates/graph.html b/website/templates/results/graph.html similarity index 100% rename from website/templates/graph.html rename to website/templates/results/graph.html diff --git a/website/templates/graph2.html b/website/templates/results/graph2.html similarity index 100% rename from website/templates/graph2.html rename to website/templates/results/graph2.html diff --git a/website/templates/graph3.html b/website/templates/results/graph3.html similarity index 100% rename from website/templates/graph3.html rename to website/templates/results/graph3.html From ba6b3f1a92b6f8be67e755e7ee006f289c1a2bac Mon Sep 17 00:00:00 2001 From: mooserson Date: Mon, 31 Jul 2023 10:37:49 -0500 Subject: [PATCH 04/17] moves short_form templates into folder --- website/short_form.py | 40 +++++++++---------- .../templates/{ => short_form}/bloating.html | 0 .../templates/{ => short_form}/excog1.html | 0 .../templates/{ => short_form}/expem1.html | 0 website/templates/{ => short_form}/flu.html | 0 website/templates/{ => short_form}/hot.html | 0 website/templates/{ => short_form}/limbs.html | 0 .../{ => short_form}/musclepain.html | 0 .../templates/{ => short_form}/reduction.html | 0 .../templates/{ => short_form}/smells.html | 0 .../templates/{ => short_form}/unsteady.html | 0 11 files changed, 20 insertions(+), 20 deletions(-) rename website/templates/{ => short_form}/bloating.html (100%) rename website/templates/{ => short_form}/excog1.html (100%) rename website/templates/{ => short_form}/expem1.html (100%) rename website/templates/{ => short_form}/flu.html (100%) rename website/templates/{ => short_form}/hot.html (100%) rename website/templates/{ => short_form}/limbs.html (100%) rename website/templates/{ => short_form}/musclepain.html (100%) rename website/templates/{ => short_form}/reduction.html (100%) rename website/templates/{ => short_form}/smells.html (100%) rename website/templates/{ => short_form}/unsteady.html (100%) diff --git a/website/short_form.py b/website/short_form.py index 62a64e3..a9dee12 100644 --- a/website/short_form.py +++ b/website/short_form.py @@ -31,8 +31,8 @@ def expem1(): else: - return render_template("expem1.html", pagenum=session['pagenum'], message=message) - return render_template("expem1.html", pagenum=session['pagenum'], message='') + return render_template("short_form/expem1.html", pagenum=session['pagenum'], message=message) + return render_template("short_form/expem1.html", pagenum=session['pagenum'], message='') @short_form.route('/attention', methods=['post', 'get']) def excog1(): @@ -52,8 +52,8 @@ def excog1(): end = True return redirect(url_for("short_form.musclepain")) else: - return render_template("excog1.html", message=message, pagenum=session['pagenum']) - return render_template("excog1.html", message='', pagenum=session['pagenum']) + return render_template("short_form/excog1.html", message=message, pagenum=session['pagenum']) + return render_template("short_form/excog1.html", message='', pagenum=session['pagenum']) @short_form.route('/musclepain', methods=['post', 'get']) def musclepain(): @@ -67,8 +67,8 @@ def musclepain(): session['pagenum'] += 1 return redirect(url_for("short_form.bloating")) else: - return render_template("musclepain.html", message=message, pagenum=session['pagenum']) - return render_template("musclepain.html", message='', pagenum=session['pagenum']) + return render_template("short_form/musclepain.html", message=message, pagenum=session['pagenum']) + return render_template("short_form/musclepain.html", message='', pagenum=session['pagenum']) @short_form.route('/bloating', methods=['post', 'get']) def bloating(): @@ -82,8 +82,8 @@ def bloating(): session['pagenum'] += 1 return redirect(url_for("short_form.bowel")) else: - return render_template("bloating.html", message=message, pagenum=session['pagenum']) - return render_template("bloating.html", message='', pagenum=session['pagenum']) + return render_template("short_form/bloating.html", message=message, pagenum=session['pagenum']) + return render_template("short_form/bloating.html", message='', pagenum=session['pagenum']) @short_form.route('/bowel', methods=['post', 'get']) def bowel(): @@ -113,8 +113,8 @@ def unsteady(): session['pagenum'] += 1 return redirect(url_for("short_form.cold_limbs")) else: - return render_template("unsteady.html", message=message, pagenum=session['pagenum']) - return render_template("unsteady.html", message='', pagenum=session['pagenum']) + return render_template("short_form/unsteady.html", message=message, pagenum=session['pagenum']) + return render_template("short_form/unsteady.html", message='', pagenum=session['pagenum']) @short_form.route('/cold_limbs', methods=['post', 'get']) def cold_limbs(): @@ -128,8 +128,8 @@ def cold_limbs(): session['pagenum'] += 1 return redirect(url_for("short_form.hot_cold")) else: - return render_template("limbs.html", message=message, pagenum=session['pagenum']) - return render_template("limbs.html", message='', pagenum=session['pagenum']) + return render_template("short_form/limbs.html", message=message, pagenum=session['pagenum']) + return render_template("short_form/limbs.html", message='', pagenum=session['pagenum']) @short_form.route('/hot_cold', methods=['post', 'get']) def hot_cold(): @@ -143,8 +143,8 @@ def hot_cold(): session['pagenum'] += 1 return redirect(url_for("short_form.flu")) else: - return render_template("hot.html", message=message, pagenum=session['pagenum']) - return render_template("hot.html", message='', pagenum=session['pagenum']) + return render_template("short_form/hot.html", message=message, pagenum=session['pagenum']) + return render_template("short_form/hot.html", message='', pagenum=session['pagenum']) @short_form.route('/flu', methods=['post', 'get']) def flu(): @@ -158,8 +158,8 @@ def flu(): session['pagenum'] += 1 return redirect(url_for("short_form.smells")) else: - return render_template("flu.html", message=message, pagenum=session['pagenum']) - return render_template("flu.html", message='', pagenum=session['pagenum']) + return render_template("short_form/flu.html", message=message, pagenum=session['pagenum']) + return render_template("short_form/flu.html", message='', pagenum=session['pagenum']) @short_form.route('/smells', methods=['post', 'get']) def smells(): @@ -175,8 +175,8 @@ def smells(): survey='rf14' return redirect(url_for('short_form.reduction')) else: - return render_template("smells.html", message=message, pagenum=session['pagenum']) - return render_template("smells.html", message='', pagenum=session['pagenum']) + return render_template("short_form/smells.html", message=message, pagenum=session['pagenum']) + return render_template("short_form/smells.html", message='', pagenum=session['pagenum']) @short_form.route('/reduction', methods=['post', 'get']) def reduction(): @@ -188,8 +188,8 @@ def reduction(): session['pagenum'] += 1 return redirect(url_for('short_form.graph2')) else: - return render_template("reduction.html", message=msg_reduction, pagenum=session['pagenum']) - return render_template('reduction.html', message='', pagenum=session['pagenum']) + return render_template("short_form/reduction.html", message=msg_reduction, pagenum=session['pagenum']) + return render_template("short_form/reduction.html", message='', pagenum=session['pagenum']) @short_form.route('/short_form_dx', methods=['post', 'get']) diff --git a/website/templates/bloating.html b/website/templates/short_form/bloating.html similarity index 100% rename from website/templates/bloating.html rename to website/templates/short_form/bloating.html diff --git a/website/templates/excog1.html b/website/templates/short_form/excog1.html similarity index 100% rename from website/templates/excog1.html rename to website/templates/short_form/excog1.html diff --git a/website/templates/expem1.html b/website/templates/short_form/expem1.html similarity index 100% rename from website/templates/expem1.html rename to website/templates/short_form/expem1.html diff --git a/website/templates/flu.html b/website/templates/short_form/flu.html similarity index 100% rename from website/templates/flu.html rename to website/templates/short_form/flu.html diff --git a/website/templates/hot.html b/website/templates/short_form/hot.html similarity index 100% rename from website/templates/hot.html rename to website/templates/short_form/hot.html diff --git a/website/templates/limbs.html b/website/templates/short_form/limbs.html similarity index 100% rename from website/templates/limbs.html rename to website/templates/short_form/limbs.html diff --git a/website/templates/musclepain.html b/website/templates/short_form/musclepain.html similarity index 100% rename from website/templates/musclepain.html rename to website/templates/short_form/musclepain.html diff --git a/website/templates/reduction.html b/website/templates/short_form/reduction.html similarity index 100% rename from website/templates/reduction.html rename to website/templates/short_form/reduction.html diff --git a/website/templates/smells.html b/website/templates/short_form/smells.html similarity index 100% rename from website/templates/smells.html rename to website/templates/short_form/smells.html diff --git a/website/templates/unsteady.html b/website/templates/short_form/unsteady.html similarity index 100% rename from website/templates/unsteady.html rename to website/templates/short_form/unsteady.html From 4469b1195bc6646a9de125611708484012e16a1d Mon Sep 17 00:00:00 2001 From: mooserson Date: Mon, 31 Jul 2023 10:51:16 -0500 Subject: [PATCH 05/17] moves another short form template to folder --- website/short_form.py | 4 ++-- website/templates/{ => short_form}/bowel.html | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename website/templates/{ => short_form}/bowel.html (100%) diff --git a/website/short_form.py b/website/short_form.py index a9dee12..d43a2d8 100644 --- a/website/short_form.py +++ b/website/short_form.py @@ -97,8 +97,8 @@ def bowel(): session['pagenum'] += 1 return redirect(url_for("short_form.unsteady")) else: - return render_template("bowel.html", message=message, pagenum=session['pagenum']) - return render_template("bowel.html", message='', pagenum=session['pagenum']) + return render_template("short_form/bowel.html", message=message, pagenum=session['pagenum']) + return render_template("short_form/bowel.html", message='', pagenum=session['pagenum']) @short_form.route('/unsteady', methods=['post', 'get']) diff --git a/website/templates/bowel.html b/website/templates/short_form/bowel.html similarity index 100% rename from website/templates/bowel.html rename to website/templates/short_form/bowel.html From b6d7bf6eeef1034c0828063981f4d5eca92a634d Mon Sep 17 00:00:00 2001 From: mooserson Date: Mon, 31 Jul 2023 10:54:01 -0500 Subject: [PATCH 06/17] removes short_form routes from main.py --- main.py | 152 -------------------------------------------------------- 1 file changed, 152 deletions(-) diff --git a/main.py b/main.py index 0261d18..33816e7 100644 --- a/main.py +++ b/main.py @@ -1308,158 +1308,6 @@ def depth(): return render_template("depth42.html", message=message, pagenum=session['pagenum']) return render_template("depth42.html", message='', pagenum=session['pagenum']) - -@app.route('/musclepain', methods=['post', 'get']) -def musclepain(): - global end - form = FlaskForm() - if request.method == "POST": - musclef = request.form.get("musclef") - mucles = request.form.get("muscles") - if musclef is not None and mucles is not None: - session["musclef"] = musclef - session["muscles"] = mucles - session['pagenum'] += 1 - return redirect(url_for("bloating")) - else: - return render_template("musclepain.html", message=message, pagenum=session['pagenum']) - return render_template("musclepain.html", message='', pagenum=session['pagenum']) - - -@app.route('/bloating', methods=['post', 'get']) -def bloating(): - global end - form = FlaskForm() - if request.method == "POST": - bloatf = request.form.get("bloatf") - bloats = request.form.get("bloats") - if bloats is not None and bloatf is not None: - session["bloatf"] = bloatf - session["bloats"] = bloats - session['pagenum'] += 1 - return redirect(url_for("bowel")) - else: - return render_template("bloating.html", message=message, pagenum=session['pagenum']) - return render_template("bloating.html", message='', pagenum=session['pagenum']) - - -@app.route('/bowel', methods=['post', 'get']) -def bowel(): - global end - form = FlaskForm() - if request.method == "POST": - bowelf = request.form.get("bowelf") - bowels = request.form.get("bowels") - if bowels is not None and bowelf is not None: - session["bowelf"] = bowelf - session["bowels"] = bowels - session['pagenum'] += 1 - return redirect(url_for("unsteady")) - else: - return render_template("bowel.html", message=message, pagenum=session['pagenum']) - return render_template("bowel.html", message='', pagenum=session['pagenum']) - - -@app.route('/unsteady', methods=['post', 'get']) -def unsteady(): - global end - form = FlaskForm() - if request.method == "POST": - unsteadyf = request.form.get("unsteadyf") - unsteadys = request.form.get("unsteadys") - if unsteadyf is not None and unsteadys is not None: - session["unsteadyf"] = unsteadyf - session["unsteadys"] = unsteadys - session['pagenum'] += 1 - return redirect(url_for("cold_limbs")) - else: - return render_template("unsteady.html", message=message, pagenum=session['pagenum']) - return render_template("unsteady.html", message='', pagenum=session['pagenum']) - - -@app.route('/cold_limbs', methods=['post', 'get']) -def cold_limbs(): - global end - form = FlaskForm() - if request.method == "POST": - limbsf = request.form.get("limbsf") - limbss = request.form.get("limbss") - if limbsf is not None and limbss is not None: - session["limbsf"] = limbsf - session["limbss"] = limbss - session['pagenum'] += 1 - return redirect(url_for("hot_cold")) - else: - return render_template("limbs.html", message=message, pagenum=session['pagenum']) - return render_template("limbs.html", message='', pagenum=session['pagenum']) - - -@app.route('/hot_cold', methods=['post', 'get']) -def hot_cold(): - global end - form = FlaskForm() - if request.method == "POST": - hotf = request.form.get("hotf") - hots = request.form.get("hots") - if hotf is not None and hots is not None: - session["hotf"] = hotf - session["hots"] = hots - session['pagenum'] += 1 - return redirect(url_for("flu")) - else: - return render_template("hot.html", message=message, pagenum=session['pagenum']) - return render_template("hot.html", message='', pagenum=session['pagenum']) - - -@app.route('/flu', methods=['post', 'get']) -def flu(): - global end - form = FlaskForm() - if request.method == "POST": - fluf = request.form.get("fluf") - flus = request.form.get("flus") - if fluf is not None and flus is not None: - session["fluf"] = fluf - session["flus"] = flus - session['pagenum'] += 1 - return redirect(url_for("smells")) - else: - return render_template("flu.html", message=message, pagenum=session['pagenum']) - return render_template("flu.html", message='', pagenum=session['pagenum']) - - -@app.route('/smells', methods=['post', 'get']) -def smells(): - global end - global survey - form = FlaskForm() - if request.method == "POST": - smellf = request.form.get("smellf") - smells = request.form.get("smells") - if smellf is not None and smells is not None: - session["smellf"] = smellf - session["smells"] = smells - session['pagenum'] += 1 - survey = 'rf14' - return diagnose() - else: - return render_template("smells.html", message=message, pagenum=session['pagenum']) - return render_template("smells.html", message='', pagenum=session['pagenum']) - - -@app.route('/reduction', methods=['post', 'get']) -def reduction(): - msg_reduction = "Please select one of the options before continuing" - if request.method == 'POST': - reduction = request.form.get('reduction') - if reduction is not None: - session['reduction'] = reduction - return diagnose() - else: - return render_template("reduction.html", message=msg_reduction, pagenum=session['pagenum']) - return render_template('reduction.html', message='', pagenum=session['pagenum']) - - @app.route('/end', methods=['post', 'get']) def end(): form = FlaskForm() From dfa7fd926e94c860b19ee96502d43dbff9c53e2a Mon Sep 17 00:00:00 2001 From: mooserson Date: Mon, 31 Jul 2023 10:54:59 -0500 Subject: [PATCH 07/17] removes screener graph route from main --- main.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/main.py b/main.py index 33816e7..3080adb 100644 --- a/main.py +++ b/main.py @@ -437,15 +437,6 @@ def diagnose2(): iompemcheck=iompemcheck, iomdxcheck=iomdxcheck, iom_msg=iom_msg, iomsleepcheck=iomsleepcheck, iomcogcheck=iomcogcheck) - -@app.route('/graph') -def graph(graphJSON, probCFS, sample_size): - graphJSON = graphJSON - probCFS = probCFS - sample_size = sample_size - return render_template("results/graph.html", graphJSON=graphJSON, probCFS=probCFS, sample_size=sample_size) - - @app.route('/end2', methods=['get']) def end2(): global pagenum From 76f67f1cc2a0091fd1722c2c1c068468713ec643 Mon Sep 17 00:00:00 2001 From: mooserson Date: Mon, 31 Jul 2023 11:16:31 -0500 Subject: [PATCH 08/17] deletes short_form routes and moves template uris to folder --- main.py | 215 +++++++++++++++++++++----------------------------------- 1 file changed, 82 insertions(+), 133 deletions(-) diff --git a/main.py b/main.py index 3080adb..acbca20 100644 --- a/main.py +++ b/main.py @@ -458,33 +458,6 @@ def end2(): else: return f"

{pemdomain}You probably don't have ME/CFS

" - -@app.route('/soreness', methods=['post', 'get']) -def expem1(): - form = FlaskForm() - global pemname - if request.method == "POST": - soref = request.form.get("soref") - sores = request.form.get("sores") - if soref is not None and sores is not None: - session["soref"] = soref - session["sores"] = sores - session['pagenum'] += 1 - - if int(session["soref"]) >= 0 and int(session["sores"]) >= 0: - session['pemscoref'] = session['soref'] - session['pemscores'] = session['sores'] - session['pemscore'] = (int(session['soref']) + int(session['sores'])) / 2 - pemname = 'soreness15' - - return redirect(url_for("excog1")) - - - else: - return render_template("expem1.html", pagenum=session['pagenum'], message=message) - return render_template("expem1.html", pagenum=session['pagenum'], message='') - - @app.route('/drained', methods=['post', 'get']) def expem2(): form = FlaskForm() @@ -503,8 +476,8 @@ def expem2(): pemname = 'drained18' return redirect(url_for("weakness")) else: - return render_template("expem2.html", pagenum=session['pagenum'], message=message) - return render_template("expem2.html", pagenum=session['pagenum'], message='') + return render_template("dsq/expem2.html", pagenum=session['pagenum'], message=message) + return render_template("dsq/expem2.html", pagenum=session['pagenum'], message='') @app.route('/viral', methods=['post', 'get']) @@ -518,8 +491,8 @@ def viral(): session['pagenum'] += 1 return redirect(url_for('expem3')) else: - return render_template("viral.html", message=msg_viral, pagenum=session['pagenum']) - return render_template('viral.html', message='', pagenum=session['pagenum']) + return render_template("dsq/viral.html", message=msg_viral, pagenum=session['pagenum']) + return render_template('dsq/viral.html', message='', pagenum=session['pagenum']) @app.route('/heavy', methods=['post', 'get']) @@ -541,8 +514,8 @@ def expem3(): pemname = 'heavy14' return redirect(url_for("expem4")) else: - return render_template("expem3.html", pagenum=session['pagenum'], message=message) - return render_template("expem3.html", pagenum=session['pagenum'], message='') + return render_template("dsq/expem3.html", pagenum=session['pagenum'], message=message) + return render_template("dsq/expem3.html", pagenum=session['pagenum'], message='') @app.route('/mentally', methods=['post', 'get']) @@ -563,8 +536,8 @@ def expem4(): pemname = 'mental16' return redirect(url_for("expem2")) else: - return render_template("expem4.html", message=message, pagenum=session['pagenum']) - return render_template("expem4.html", message='', pagenum=session['pagenum']) + return render_template("dsq/expem4.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/expem4.html", message='', pagenum=session['pagenum']) @app.route('/weakness', methods=['post', 'get']) @@ -584,8 +557,8 @@ def weakness(): session['pemscore'] = (int(session['weakf']) + int(session['weaks'])) / 2 return redirect(url_for("exsleep2")) else: - return render_template("weakness33.html", message=message, pagenum=session['pagenum']) - return render_template("weakness33.html", message='', pagenum=session['pagenum']) + return render_template("dsq/weakness33.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/weakness33.html", message='', pagenum=session['pagenum']) @app.route('/staying', methods=['post', 'get']) @@ -606,8 +579,8 @@ def exsleep1(): sleepname = 'staying22' return redirect(url_for("early")) else: - return render_template("exsleep1.html", message=message, pagenum=session['pagenum']) - return render_template("exsleep1.html", message='', pagenum=session['pagenum']) + return render_template("dsq/exsleep1.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/exsleep1.html", message='', pagenum=session['pagenum']) @app.route('/nap', methods=['post', 'get']) @@ -628,8 +601,8 @@ def exsleep2(): sleepname = 'nap20' return redirect(url_for("exsleep3")) else: - return render_template("exsleep2.html", message=message, pagenum=session['pagenum']) - return render_template("exsleep2.html", message='', pagenum=session['pagenum']) + return render_template("dsq/exsleep2.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/exsleep2.html", message='', pagenum=session['pagenum']) @app.route('/falling', methods=['post', 'get']) @@ -650,8 +623,8 @@ def exsleep3(): sleepname = 'falling21' return redirect(url_for("exsleep1")) else: - return render_template("exsleep3.html", message=message, pagenum=session['pagenum']) - return render_template("exsleep3.html", message='', pagenum=session['pagenum']) + return render_template("dsq/exsleep3.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/exsleep3.html", message='', pagenum=session['pagenum']) @app.route('/early', methods=['post', 'get']) @@ -672,8 +645,8 @@ def early(): sleepname = 'falling21' return redirect(url_for("exsleep4")) else: - return render_template("early23.html", message=message, pagenum=session['pagenum']) - return render_template("early23.html", message='', pagenum=session['pagenum']) + return render_template("dsq/early23.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/early23.html", message='', pagenum=session['pagenum']) @app.route('/allday', methods=['post', 'get']) @@ -700,8 +673,8 @@ def exsleep4(): session['sleepscore'] = (int(session['jointpain']) + int(session['alldays'])) / 2 return redirect(url_for("jointpain")) else: - return render_template("exsleep4.html", message=message, pagenum=session['pagenum']) - return render_template("exsleep4.html", message='', pagenum=session['pagenum']) + return render_template("dsq/exsleep4.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/exsleep4.html", message='', pagenum=session['pagenum']) @app.route('/jointpain', methods=['post', 'get']) @@ -717,8 +690,8 @@ def jointpain(): session['pagenum'] += 1 return redirect(url_for("eyepain")) else: - return render_template("jointpain26.html", message=message, pagenum=session['pagenum']) - return render_template("jointpain26.html", message='', pagenum=session['pagenum']) + return render_template("dsq/jointpain26.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/jointpain26.html", message='', pagenum=session['pagenum']) @app.route('/eyepain', methods=['post', 'get']) @@ -734,8 +707,8 @@ def eyepain(): session['pagenum'] += 1 return redirect(url_for("chestpain")) else: - return render_template("eyepain27.html", message=message, pagenum=session['pagenum']) - return render_template("eyepain27.html", message='', pagenum=session['pagenum']) + return render_template("dsq/eyepain27.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/eyepain27.html", message='', pagenum=session['pagenum']) @app.route('/chestpain', methods=['post', 'get']) @@ -751,8 +724,8 @@ def chestpain(): session['pagenum'] += 1 return redirect(url_for("stomach")) else: - return render_template("chestpain28.html", message=message, pagenum=session['pagenum']) - return render_template("chestpain28.html", message='', pagenum=session['pagenum']) + return render_template("dsq/chestpain28.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/chestpain28.html", message='', pagenum=session['pagenum']) @app.route('/stomach', methods=['post', 'get']) @@ -768,8 +741,8 @@ def stomach(): session['pagenum'] += 1 return redirect(url_for("headaches")) else: - return render_template("stomach30.html", message=message, pagenum=session['pagenum']) - return render_template("stomach30.html", message='', pagenum=session['pagenum']) + return render_template("dsq/stomach30.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/stomach30.html", message='', pagenum=session['pagenum']) @app.route('/headaches', methods=['post', 'get']) @@ -785,8 +758,8 @@ def headaches(): session['pagenum'] += 1 return redirect(url_for("twitches")) else: - return render_template("headaches31.html", message=message, pagenum=session['pagenum']) - return render_template("headaches31.html", message='', pagenum=session['pagenum']) + return render_template("dsq/headaches31.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/headaches31.html", message='', pagenum=session['pagenum']) @app.route('/twitches', methods=['post', 'get']) @@ -802,8 +775,8 @@ def twitches(): session['pagenum'] += 1 return redirect(url_for("noise")) else: - return render_template("twitches32.html", message=message, pagenum=session['pagenum']) - return render_template("twitches32.html", message='', pagenum=session['pagenum']) + return render_template("dsq/twitches32.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/twitches32.html", message='', pagenum=session['pagenum']) @app.route('/noise', methods=['post', 'get']) @@ -819,8 +792,8 @@ def noise(): session['pagenum'] += 1 return redirect(url_for("lights")) else: - return render_template("noise34.html", message=message, pagenum=session['pagenum']) - return render_template("noise34.html", message='', pagenum=session['pagenum']) + return render_template("dsq/noise34.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/noise34.html", message='', pagenum=session['pagenum']) @app.route('/lights', methods=['post', 'get']) @@ -836,32 +809,8 @@ def lights(): session['pagenum'] += 1 return redirect(url_for("excog2")) else: - return render_template("lights35.html", message=message, pagenum=session['pagenum']) - return render_template("lights35.html", message='', pagenum=session['pagenum']) - - -@app.route('/attention', methods=['post', 'get']) -def excog1(): - form = FlaskForm() - global cogname - if request.method == "POST": - attentionf = request.form.get("attentionf") - attentions = request.form.get("attentions") - if attentions is not None and attentionf is not None: - session["attentionf"] = attentionf - session["attentions"] = attentions - session['pagenum'] += 1 - if int(session["attentionf"]) >= 0 and int(session["attentions"]) >= 0: - session['cogscoref'] = int(attentionf) - session['cogscores'] = int(attentions) - cogname = 'difficulty37' - session['cogscore'] = (int(session['attentionf']) + int(session['attentions'])) / 2 - end = True - return redirect(url_for("musclepain")) - else: - return render_template("excog1.html", message=message, pagenum=session['pagenum']) - return render_template("excog1.html", message='', pagenum=session['pagenum']) - + return render_template("dsq/lights35.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/lights35.html", message='', pagenum=session['pagenum']) @app.route('/word', methods=['post', 'get']) def excog2(): @@ -881,8 +830,8 @@ def excog2(): session['cogscore'] = (int(session['wordf']) + int(session['words'])) / 2 return redirect(url_for("understand")) else: - return render_template("excog2.html", message=message, pagenum=session['pagenum']) - return render_template("excog2.html", message='', pagenum=session['pagenum']) + return render_template("dsq/excog2.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/excog2.html", message='', pagenum=session['pagenum']) @app.route('/focus', methods=['post', 'get']) @@ -905,8 +854,8 @@ def excog3(): cogname = 'focus40' return redirect(url_for('vision')) else: - return render_template("excog3.html", message=message, pagenum=session['pagenum']) - return render_template("excog3.html", message='', pagenum=session['pagenum']) + return render_template("dsq/excog3.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/excog3.html", message='', pagenum=session['pagenum']) @app.route('/understand', methods=['post', 'get']) @@ -929,8 +878,8 @@ def understand(): cogname = 'understand39' return redirect(url_for("excog3")) else: - return render_template("understand39.html", message=message, pagenum=session['pagenum']) - return render_template("understand39.html", message='', pagenum=session['pagenum']) + return render_template("dsq/understand39.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/understand39.html", message='', pagenum=session['pagenum']) @app.route('/slowness', methods=['post', 'get']) @@ -955,8 +904,8 @@ def slowness(): else: return redirect(url_for("absent")) else: - return render_template("slowness43.html", message=message, pagenum=session['pagenum']) - return render_template("slowness43.html", message='', pagenum=session['pagenum']) + return render_template("dsq/slowness43.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/slowness43.html", message='', pagenum=session['pagenum']) @app.route('/absent', methods=['post', 'get']) @@ -979,8 +928,8 @@ def absent(): cogname = 'absent44' return redirect(url_for("bladder")) else: - return render_template("absent44.html", message=message, pagenum=session['pagenum']) - return render_template("absent44.html", message='', pagenum=session['pagenum']) + return render_template("dsq/absent44.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/absent44.html", message='', pagenum=session['pagenum']) @app.route('/bladder', methods=['post', 'get']) @@ -996,8 +945,8 @@ def bladder(): session['pagenum'] += 1 return redirect(url_for("nausea")) else: - return render_template("bladder45.html", message=message, pagenum=session['pagenum']) - return render_template("bladder45.html", message='', pagenum=session['pagenum']) + return render_template("dsq/bladder45.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/bladder45.html", message='', pagenum=session['pagenum']) @app.route('/nausea', methods=['post', 'get']) @@ -1013,8 +962,8 @@ def nausea(): session['pagenum'] += 1 return redirect(url_for("shortness")) else: - return render_template("nausea47.html", message=message, pagenum=session['pagenum']) - return render_template("nausea47.html", message='', pagenum=session['pagenum']) + return render_template("dsq/nausea47.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/nausea47.html", message='', pagenum=session['pagenum']) @app.route('/shortness', methods=['post', 'get']) @@ -1030,8 +979,8 @@ def shortness(): session['pagenum'] += 1 return redirect(url_for("dizzy")) else: - return render_template("shortness49.html", message=message, pagenum=session['pagenum']) - return render_template("shortness49.html", message='', pagenum=session['pagenum']) + return render_template("dsq/shortness49.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/shortness49.html", message='', pagenum=session['pagenum']) @app.route('/dizzy', methods=['post', 'get']) @@ -1047,8 +996,8 @@ def dizzy(): session['pagenum'] += 1 return redirect(url_for("heart")) else: - return render_template("dizzy50.html", message=message, pagenum=session['pagenum']) - return render_template("dizzy50.html", message='', pagenum=session['pagenum']) + return render_template("dsq/dizzy50.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/dizzy50.html", message='', pagenum=session['pagenum']) @app.route('/heart', methods=['post', 'get']) @@ -1064,8 +1013,8 @@ def heart(): session['pagenum'] += 1 return redirect(url_for("weight")) else: - return render_template("heart51.html", message=message, pagenum=session['pagenum']) - return render_template("heart51.html", message='', pagenum=session['pagenum']) + return render_template("dsq/heart51.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/heart51.html", message='', pagenum=session['pagenum']) @app.route('/weight', methods=['post', 'get']) @@ -1081,8 +1030,8 @@ def weight(): session['pagenum'] += 1 return redirect(url_for("appetite")) else: - return render_template("weight52.html", message=message, pagenum=session['pagenum']) - return render_template("weight52.html", message='', pagenum=session['pagenum']) + return render_template("dsq/weight52.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/weight52.html", message='', pagenum=session['pagenum']) @app.route('/appetite', methods=['post', 'get']) @@ -1098,8 +1047,8 @@ def appetite(): session['pagenum'] += 1 return redirect(url_for("sweating")) else: - return render_template("appetite53.html", message=message, pagenum=session['pagenum']) - return render_template("appetite53.html", message='', pagenum=session['pagenum']) + return render_template("dsq/appetite53.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/appetite53.html", message='', pagenum=session['pagenum']) @app.route('/sweating', methods=['post', 'get']) @@ -1115,8 +1064,8 @@ def sweating(): session['pagenum'] += 1 return redirect(url_for("night")) else: - return render_template("sweating54.html", message=message, pagenum=session['pagenum']) - return render_template("sweating54.html", message='', pagenum=session['pagenum']) + return render_template("dsq/sweating54.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/sweating54.html", message='', pagenum=session['pagenum']) @app.route('/night', methods=['post', 'get']) @@ -1132,8 +1081,8 @@ def night(): session['pagenum'] += 1 return redirect(url_for("chills")) else: - return render_template("night55.html", message=message, pagenum=session['pagenum']) - return render_template("night55.html", message='', pagenum=session['pagenum']) + return render_template("dsq/night55.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/night55.html", message='', pagenum=session['pagenum']) @app.route('/chills', methods=['post', 'get']) @@ -1149,8 +1098,8 @@ def chills(): session['pagenum'] += 1 return redirect(url_for("hitemp")) else: - return render_template("chills57.html", message=message, pagenum=session['pagenum']) - return render_template("chills57.html", message='', pagenum=session['pagenum']) + return render_template("dsq/chills57.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/chills57.html", message='', pagenum=session['pagenum']) @app.route('/59', methods=['post', 'get']) @@ -1167,8 +1116,8 @@ def hitemp(): session['pagenum'] += 1 return redirect(url_for("lotemp")) else: - return render_template("hitemp59.html", message=message, pagenum=session['pagenum']) - return render_template("hitemp59.html", message='', pagenum=session['pagenum']) + return render_template("dsq/hitemp59.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/hitemp59.html", message='', pagenum=session['pagenum']) @app.route('/60', methods=['post', 'get']) @@ -1185,8 +1134,8 @@ def lotemp(): session['pagenum'] += 1 return redirect(url_for("alcohol")) else: - return render_template("lotemp60.html", message=message, pagenum=session['pagenum']) - return render_template("lotemp60.html", message='', pagenum=session['pagenum']) + return render_template("dsq/lotemp60.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/lotemp60.html", message='', pagenum=session['pagenum']) @app.route('/61', methods=['post', 'get']) @@ -1203,8 +1152,8 @@ def alcohol(): session['pagenum'] += 1 return redirect(url_for("throat")) else: - return render_template("alcohol61.html", message=message, pagenum=session['pagenum']) - return render_template("alcohol61.html", message='', pagenum=session['pagenum']) + return render_template("dsq/alcohol61.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/alcohol61.html", message='', pagenum=session['pagenum']) @app.route('/62', methods=['post', 'get']) @@ -1220,8 +1169,8 @@ def throat(): session['pagenum'] += 1 return redirect(url_for("lymphnodes")) else: - return render_template("throat62.html", message=message, pagenum=session['pagenum']) - return render_template("throat62.html", message='', pagenum=session['pagenum']) + return render_template("dsq/throat62.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/throat62.html", message='', pagenum=session['pagenum']) @app.route('/63', methods=['post', 'get']) @@ -1237,8 +1186,8 @@ def lymphnodes(): session['pagenum'] += 1 return redirect(url_for("fever")) else: - return render_template("lymphnodes63.html", message=message, pagenum=session['pagenum']) - return render_template("lymphnodes63.html", message='', pagenum=session['pagenum']) + return render_template("dsq/lymphnodes63.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/lymphnodes63.html", message='', pagenum=session['pagenum']) @app.route('/64', methods=['post', 'get']) @@ -1254,8 +1203,8 @@ def fever(): session['pagenum'] += 1 return diagnose2() else: - return render_template("fever64.html", message=message, pagenum=session['pagenum']) - return render_template("fever64.html", message='', pagenum=session['pagenum']) + return render_template("dsq/fever64.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/fever64.html", message='', pagenum=session['pagenum']) @app.route('/vision', methods=['post', 'get']) @@ -1279,8 +1228,8 @@ def vision(): return redirect(url_for('depth')) else: - return render_template("vision41.html", message=message, pagenum=session['pagenum']) - return render_template("vision41.html", message='', pagenum=session['pagenum']) + return render_template("dsq/vision41.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/vision41.html", message='', pagenum=session['pagenum']) @app.route('/depth', methods=['post', 'get']) @@ -1296,8 +1245,8 @@ def depth(): session['pagenum'] += 1 return redirect(url_for("slowness")) else: - return render_template("depth42.html", message=message, pagenum=session['pagenum']) - return render_template("depth42.html", message='', pagenum=session['pagenum']) + return render_template("dsq/depth42.html", message=message, pagenum=session['pagenum']) + return render_template("dsq/depth42.html", message='', pagenum=session['pagenum']) @app.route('/end', methods=['post', 'get']) def end(): From dd5772480ff67ead0ffa31dbeb43886dbe8b3271 Mon Sep 17 00:00:00 2001 From: mooserson Date: Mon, 31 Jul 2023 11:16:46 -0500 Subject: [PATCH 09/17] moves all dsq templates for folder --- website/templates/{ => dsq}/absent44.html | 0 website/templates/{ => dsq}/alcohol61.html | 0 website/templates/{ => dsq}/appetite53.html | 0 website/templates/{ => dsq}/bladder45.html | 0 website/templates/{ => dsq}/chestpain28.html | 0 website/templates/{ => dsq}/chills57.html | 0 website/templates/{ => dsq}/depth42.html | 0 website/templates/{ => dsq}/dizzy50.html | 0 website/templates/{ => dsq}/early23.html | 0 website/templates/{ => dsq}/excog2.html | 0 website/templates/{ => dsq}/excog3.html | 0 website/templates/{ => dsq}/expem2.html | 0 website/templates/{ => dsq}/expem3.html | 0 website/templates/{ => dsq}/expem4.html | 0 website/templates/{ => dsq}/exsleep1.html | 0 website/templates/{ => dsq}/exsleep2.html | 0 website/templates/{ => dsq}/exsleep3.html | 0 website/templates/{ => dsq}/exsleep4.html | 0 website/templates/{ => dsq}/eyepain27.html | 0 website/templates/{ => dsq}/fever64.html | 0 website/templates/{ => dsq}/headaches31.html | 0 website/templates/{ => dsq}/heart51.html | 0 website/templates/{ => dsq}/hitemp59.html | 0 website/templates/{ => dsq}/jointpain26.html | 0 website/templates/{ => dsq}/lights35.html | 0 website/templates/{ => dsq}/lotemp60.html | 0 website/templates/{ => dsq}/lymphnodes63.html | 0 website/templates/{ => dsq}/nausea47.html | 0 website/templates/{ => dsq}/night55.html | 0 website/templates/{ => dsq}/noise34.html | 0 website/templates/{ => dsq}/shortness49.html | 0 website/templates/{ => dsq}/slowness43.html | 0 website/templates/{ => dsq}/stomach30.html | 0 website/templates/{ => dsq}/sweating54.html | 0 website/templates/{ => dsq}/throat62.html | 0 website/templates/{ => dsq}/twitches32.html | 0 website/templates/{ => dsq}/understand39.html | 0 website/templates/{ => dsq}/viral.html | 0 website/templates/{ => dsq}/vision41.html | 0 website/templates/{ => dsq}/weakness33.html | 0 website/templates/{ => dsq}/weight52.html | 0 41 files changed, 0 insertions(+), 0 deletions(-) rename website/templates/{ => dsq}/absent44.html (100%) rename website/templates/{ => dsq}/alcohol61.html (100%) rename website/templates/{ => dsq}/appetite53.html (100%) rename website/templates/{ => dsq}/bladder45.html (100%) rename website/templates/{ => dsq}/chestpain28.html (100%) rename website/templates/{ => dsq}/chills57.html (100%) rename website/templates/{ => dsq}/depth42.html (100%) rename website/templates/{ => dsq}/dizzy50.html (100%) rename website/templates/{ => dsq}/early23.html (100%) rename website/templates/{ => dsq}/excog2.html (100%) rename website/templates/{ => dsq}/excog3.html (100%) rename website/templates/{ => dsq}/expem2.html (100%) rename website/templates/{ => dsq}/expem3.html (100%) rename website/templates/{ => dsq}/expem4.html (100%) rename website/templates/{ => dsq}/exsleep1.html (100%) rename website/templates/{ => dsq}/exsleep2.html (100%) rename website/templates/{ => dsq}/exsleep3.html (100%) rename website/templates/{ => dsq}/exsleep4.html (100%) rename website/templates/{ => dsq}/eyepain27.html (100%) rename website/templates/{ => dsq}/fever64.html (100%) rename website/templates/{ => dsq}/headaches31.html (100%) rename website/templates/{ => dsq}/heart51.html (100%) rename website/templates/{ => dsq}/hitemp59.html (100%) rename website/templates/{ => dsq}/jointpain26.html (100%) rename website/templates/{ => dsq}/lights35.html (100%) rename website/templates/{ => dsq}/lotemp60.html (100%) rename website/templates/{ => dsq}/lymphnodes63.html (100%) rename website/templates/{ => dsq}/nausea47.html (100%) rename website/templates/{ => dsq}/night55.html (100%) rename website/templates/{ => dsq}/noise34.html (100%) rename website/templates/{ => dsq}/shortness49.html (100%) rename website/templates/{ => dsq}/slowness43.html (100%) rename website/templates/{ => dsq}/stomach30.html (100%) rename website/templates/{ => dsq}/sweating54.html (100%) rename website/templates/{ => dsq}/throat62.html (100%) rename website/templates/{ => dsq}/twitches32.html (100%) rename website/templates/{ => dsq}/understand39.html (100%) rename website/templates/{ => dsq}/viral.html (100%) rename website/templates/{ => dsq}/vision41.html (100%) rename website/templates/{ => dsq}/weakness33.html (100%) rename website/templates/{ => dsq}/weight52.html (100%) diff --git a/website/templates/absent44.html b/website/templates/dsq/absent44.html similarity index 100% rename from website/templates/absent44.html rename to website/templates/dsq/absent44.html diff --git a/website/templates/alcohol61.html b/website/templates/dsq/alcohol61.html similarity index 100% rename from website/templates/alcohol61.html rename to website/templates/dsq/alcohol61.html diff --git a/website/templates/appetite53.html b/website/templates/dsq/appetite53.html similarity index 100% rename from website/templates/appetite53.html rename to website/templates/dsq/appetite53.html diff --git a/website/templates/bladder45.html b/website/templates/dsq/bladder45.html similarity index 100% rename from website/templates/bladder45.html rename to website/templates/dsq/bladder45.html diff --git a/website/templates/chestpain28.html b/website/templates/dsq/chestpain28.html similarity index 100% rename from website/templates/chestpain28.html rename to website/templates/dsq/chestpain28.html diff --git a/website/templates/chills57.html b/website/templates/dsq/chills57.html similarity index 100% rename from website/templates/chills57.html rename to website/templates/dsq/chills57.html diff --git a/website/templates/depth42.html b/website/templates/dsq/depth42.html similarity index 100% rename from website/templates/depth42.html rename to website/templates/dsq/depth42.html diff --git a/website/templates/dizzy50.html b/website/templates/dsq/dizzy50.html similarity index 100% rename from website/templates/dizzy50.html rename to website/templates/dsq/dizzy50.html diff --git a/website/templates/early23.html b/website/templates/dsq/early23.html similarity index 100% rename from website/templates/early23.html rename to website/templates/dsq/early23.html diff --git a/website/templates/excog2.html b/website/templates/dsq/excog2.html similarity index 100% rename from website/templates/excog2.html rename to website/templates/dsq/excog2.html diff --git a/website/templates/excog3.html b/website/templates/dsq/excog3.html similarity index 100% rename from website/templates/excog3.html rename to website/templates/dsq/excog3.html diff --git a/website/templates/expem2.html b/website/templates/dsq/expem2.html similarity index 100% rename from website/templates/expem2.html rename to website/templates/dsq/expem2.html diff --git a/website/templates/expem3.html b/website/templates/dsq/expem3.html similarity index 100% rename from website/templates/expem3.html rename to website/templates/dsq/expem3.html diff --git a/website/templates/expem4.html b/website/templates/dsq/expem4.html similarity index 100% rename from website/templates/expem4.html rename to website/templates/dsq/expem4.html diff --git a/website/templates/exsleep1.html b/website/templates/dsq/exsleep1.html similarity index 100% rename from website/templates/exsleep1.html rename to website/templates/dsq/exsleep1.html diff --git a/website/templates/exsleep2.html b/website/templates/dsq/exsleep2.html similarity index 100% rename from website/templates/exsleep2.html rename to website/templates/dsq/exsleep2.html diff --git a/website/templates/exsleep3.html b/website/templates/dsq/exsleep3.html similarity index 100% rename from website/templates/exsleep3.html rename to website/templates/dsq/exsleep3.html diff --git a/website/templates/exsleep4.html b/website/templates/dsq/exsleep4.html similarity index 100% rename from website/templates/exsleep4.html rename to website/templates/dsq/exsleep4.html diff --git a/website/templates/eyepain27.html b/website/templates/dsq/eyepain27.html similarity index 100% rename from website/templates/eyepain27.html rename to website/templates/dsq/eyepain27.html diff --git a/website/templates/fever64.html b/website/templates/dsq/fever64.html similarity index 100% rename from website/templates/fever64.html rename to website/templates/dsq/fever64.html diff --git a/website/templates/headaches31.html b/website/templates/dsq/headaches31.html similarity index 100% rename from website/templates/headaches31.html rename to website/templates/dsq/headaches31.html diff --git a/website/templates/heart51.html b/website/templates/dsq/heart51.html similarity index 100% rename from website/templates/heart51.html rename to website/templates/dsq/heart51.html diff --git a/website/templates/hitemp59.html b/website/templates/dsq/hitemp59.html similarity index 100% rename from website/templates/hitemp59.html rename to website/templates/dsq/hitemp59.html diff --git a/website/templates/jointpain26.html b/website/templates/dsq/jointpain26.html similarity index 100% rename from website/templates/jointpain26.html rename to website/templates/dsq/jointpain26.html diff --git a/website/templates/lights35.html b/website/templates/dsq/lights35.html similarity index 100% rename from website/templates/lights35.html rename to website/templates/dsq/lights35.html diff --git a/website/templates/lotemp60.html b/website/templates/dsq/lotemp60.html similarity index 100% rename from website/templates/lotemp60.html rename to website/templates/dsq/lotemp60.html diff --git a/website/templates/lymphnodes63.html b/website/templates/dsq/lymphnodes63.html similarity index 100% rename from website/templates/lymphnodes63.html rename to website/templates/dsq/lymphnodes63.html diff --git a/website/templates/nausea47.html b/website/templates/dsq/nausea47.html similarity index 100% rename from website/templates/nausea47.html rename to website/templates/dsq/nausea47.html diff --git a/website/templates/night55.html b/website/templates/dsq/night55.html similarity index 100% rename from website/templates/night55.html rename to website/templates/dsq/night55.html diff --git a/website/templates/noise34.html b/website/templates/dsq/noise34.html similarity index 100% rename from website/templates/noise34.html rename to website/templates/dsq/noise34.html diff --git a/website/templates/shortness49.html b/website/templates/dsq/shortness49.html similarity index 100% rename from website/templates/shortness49.html rename to website/templates/dsq/shortness49.html diff --git a/website/templates/slowness43.html b/website/templates/dsq/slowness43.html similarity index 100% rename from website/templates/slowness43.html rename to website/templates/dsq/slowness43.html diff --git a/website/templates/stomach30.html b/website/templates/dsq/stomach30.html similarity index 100% rename from website/templates/stomach30.html rename to website/templates/dsq/stomach30.html diff --git a/website/templates/sweating54.html b/website/templates/dsq/sweating54.html similarity index 100% rename from website/templates/sweating54.html rename to website/templates/dsq/sweating54.html diff --git a/website/templates/throat62.html b/website/templates/dsq/throat62.html similarity index 100% rename from website/templates/throat62.html rename to website/templates/dsq/throat62.html diff --git a/website/templates/twitches32.html b/website/templates/dsq/twitches32.html similarity index 100% rename from website/templates/twitches32.html rename to website/templates/dsq/twitches32.html diff --git a/website/templates/understand39.html b/website/templates/dsq/understand39.html similarity index 100% rename from website/templates/understand39.html rename to website/templates/dsq/understand39.html diff --git a/website/templates/viral.html b/website/templates/dsq/viral.html similarity index 100% rename from website/templates/viral.html rename to website/templates/dsq/viral.html diff --git a/website/templates/vision41.html b/website/templates/dsq/vision41.html similarity index 100% rename from website/templates/vision41.html rename to website/templates/dsq/vision41.html diff --git a/website/templates/weakness33.html b/website/templates/dsq/weakness33.html similarity index 100% rename from website/templates/weakness33.html rename to website/templates/dsq/weakness33.html diff --git a/website/templates/weight52.html b/website/templates/dsq/weight52.html similarity index 100% rename from website/templates/weight52.html rename to website/templates/dsq/weight52.html From 499e64abf872b3a989e6ccf69f2cf02814c07de4 Mon Sep 17 00:00:00 2001 From: mooserson Date: Mon, 31 Jul 2023 11:49:22 -0500 Subject: [PATCH 10/17] moves dsq diagnose out of main and comments out unused imports --- dsq_utils.py | 406 +++++++++++++++++++++++++++++++++++++++++++++++ main.py | 432 ++------------------------------------------------- 2 files changed, 422 insertions(+), 416 deletions(-) create mode 100644 dsq_utils.py diff --git a/dsq_utils.py b/dsq_utils.py new file mode 100644 index 0000000..4c60d47 --- /dev/null +++ b/dsq_utils.py @@ -0,0 +1,406 @@ +from flask import render_template, session +import numpy as np +import plotly.graph_objects as go +import json +import plotly.utils + +# +def dsq_diagnose(): + import domainScores as ds + pem_domainscore = (int(session["minexf"]) + int(session["minexs"]) + int(session['soref']) + int(session['sores']) + + int(session['heavyf']) + int(session['heavys']) + int(session['drainedf']) + int( + session['draineds']) + + int(session['mentalf']) + int(session['mentals']) + int(session['weakf']) + int( + session['weaks'])) / 12 + + sleep_domainscore = (int(session["sleepf"]) + int(session["sleeps"]) + int(session['napf']) + int(session['naps']) + + int(session['fallf']) + int(session['falls']) + int(session['stayf']) + int(session['stays']) + + int(session['earlyf']) + int(session['earlys']) + int(session['alldayf']) + int( + session['alldays'])) / 12 + + cog_domainscore = (int(session["rememberf"]) + int(session["remembers"]) + int(session['attentionf']) + + int(session['attentions']) + int(session['wordf']) + int(session['words']) + + int(session['understandf']) + int(session['understands']) + int(session['focusf']) + + int(session['focuss']) + int(session['slowf']) + int(session['slows']) + + int(session['absentf']) + int(session['absents']) + int(session['visionf']) + + int(session['visions'])) / 16 + pain_domainscore = (int(session['musclef']) + int(session['muscles']) + int(session['jointpainf']) + + int(session['jointpains']) + int(session['eyepainf']) + int(session['eyepains']) + + int(session['headachesf']) + int(session['headachess'])) / 8 + gastro_domainscore = (int(session['bloatf']) + int(session['bloats']) + int(session['bowelf']) + + int(session['bowels']) + int(session['stomachf']) + int(session['stomachs']) + + int(session['bladderf']) + int(session['bladders'])) / 8 + ortho_domainscore = (int(session['unsteadyf']) + int(session['unsteadys']) + int(session['chestpainf']) + + int(session['chestpains']) + int(session['shortf']) + int(session['shorts']) + + int(session['dizzyf']) + int(session['dizzys']) + int(session['heartf']) + + int(session['hearts']) + int(session['nauseaf']) + int(session['nauseas'])) / 12 + circ_domainscore = (int(session['limbsf']) + int(session['limbss']) + int(session['hotf']) + + int(session['hots']) + int(session['lotempf']) + int(session['lotemps']) + + int(session['sweatf']) + int(session['sweats']) + int(session['chillsf']) + + int(session['chillss']) + int(session['weightf']) + int(session['weights']) + + int(session['appetitef']) + int(session['appetites']) + int(session['nightf']) + + int(session['nights'])) / 16 + immune_domainscore = (int(session['fluf']) + int(session['flus']) + int(session['feverf']) + + int(session['fevers']) + int(session['lymphnodesf']) + int(session['lymphnodess']) + + int(session['throatf']) + int(session['throats']) + int(session['hitempf']) + + int(session['hitemps'])) / 10 + neuroen_domainscore = (int(session['smellf']) + int(session['smells']) + int(session['alcoholf']) + + int(session['alcohols']) + int(session['twitchesf']) + int(session['twitchess']) + + int(session['noisef']) + int(session['noises']) + int(session['lightsf']) + + int(session['lightss']) + int(session['depthf']) + int(session['depths'])) / 12 + + mecfs = ds.df[(ds.df['dx'] == 1)] + control = ds.df[(ds.df['dx'] != 1)] + user_scores = [(int(session['fatiguescoref']) + int(session['fatiguescores'])) / 2, + pem_domainscore, sleep_domainscore, cog_domainscore, pain_domainscore, gastro_domainscore, + ortho_domainscore, circ_domainscore, immune_domainscore, neuroen_domainscore] + cfsdomains = np.mean(mecfs.iloc[:, 110:120], axis=0) + conDomains = np.mean(control.iloc[:, 110:120], axis=0) + + categories = ['Fatigue', 'PEM', 'Sleep', 'Cognitive Problems', 'Pain', 'Gastro Problems', + 'Orthostatic Intolerance', 'Circulatory Problems', 'Immune System', 'Neuroendocrine Problems'] + + # IOM assessment + iomfatiguecheck = "No" + iomreductioncheck = "No" + iompemcheck = "No" + iomsleepcheck = "No" + iomcogcheck = "No" + if int(session['fatiguescoref']) >= 2 and int(session['fatiguescores']) >= 2: + iomfatiguecheck = "Yes" + if int(session['reduction']) == 1: + iomreductioncheck = "Yes" + if (int(session['minexf']) >= 2 and int(session['minexs']) >= 2) or ( + int(session['heavyf']) >= 2 and int(session['heavys']) >= 2) or \ + (int(session['soref']) >= 2 and int(session['sores']) >= 2) or ( + int(session['mentalf']) >= 2 and int(session['mentals']) >= 2) or \ + (int(session['drainedf']) >= 2 and int(session['draineds']) >= 2): + iompemcheck = "Yes" + if (int(session['sleepf']) >= 2 and int(session['sleeps']) >= 2) or ( + int(session['napf']) >= 2 and int(session['naps']) >= 2) or \ + (int(session['fallf']) >= 2 and int(session['falls']) >= 2) or ( + int(session['stayf']) >= 2 and int(session['stays']) >= 2) or \ + (int(session['earlyf']) >= 2 and int(session['earlys']) >= 2) or ( + int(session['alldayf']) >= 2 and int(session['alldays']) >= 2): + iomsleepcheck = "Yes" + if (int(session['lightsf']) >= 2 and int(session['lightss']) >= 2) or \ + (int(session['rememberf']) >= 2 and int(session['remembers']) >= 2) or \ + (int(session['attentionf']) >= 2 and int(session['attentions']) >= 2) or \ + (int(session['wordf']) >= 2 and int(session['words']) >= 2) or ( + int(session['understandf']) >= 2 and int(session['understands']) >= 2) or \ + (int(session['focusf']) >= 2 and int(session['focuss']) >= 2) or ( + int(session['visionf']) >= 2 and int(session['visions']) >= 2) or \ + (int(session['depthf']) >= 2 and int(session['depths']) >= 2) or ( + int(session['slowf']) >= 2 and int(session['slows']) >= 2) or \ + (int(session['absentf']) >= 2 and int(session['absents']) >= 2): + iomcogcheck = "Yes" + + if iomfatiguecheck == "Yes" and iomreductioncheck == "Yes" and iompemcheck == "Yes" and iomsleepcheck == "Yes" and iomcogcheck == "Yes": + iom_msg = "Your responses suggest you meet the IOM Criteria for ME/CFS." + iomdxcheck = "Met" + + else: + iom_msg = "Your responses do not meet the IOM Criteria for ME/CFS." + iomdxcheck = "Not met" + + # Canadian criteria assessment + ccc_dx = False + + if int(session['fatiguescoref']) >= 2 and int(session['fatiguescores']) >= 2: + ccc_fatigue = 1 + + ccc_fatiguecheck = "Yes" + else: + ccc_fatigue = 0 + ccc_fatiguecheck = "No" + if int(session['reduction']) == 1: + ccc_reduction = "Yes" + else: + ccc_reduction = "No" + if (int(session['musclef']) >= 2 and int(session['muscles']) >= 2) or ( + int(session['jointpainf']) >= 2 and int(session['jointpains']) >= 2) or \ + (int(session['eyepainf']) >= 2 and int(session['eyepains']) >= 2) or ( + int(session['chestpainf']) >= 2 and int(session['chestpains']) >= 2) or \ + (int(session['headachesf']) >= 2 and int(session['headachess']) >= 2) or ( + int(session['bloatf']) >= 2 and int(session['bloats']) >= 2) or \ + (int(session['stomachf']) >= 2 and int(session['stomachs']) >= 2): + ccc_pain = 1 + ccc_paincheck = "Yes" + else: + ccc_pain = 0 + ccc_paincheck = "No" + if int(session['sleepf']) >= 2 and int(session['sleeps']) >= 2: + ccc_sleep = 1 + ccc_sleepcheck = "Yes" + else: + ccc_sleep = 0 + ccc_sleepcheck = "No" + if (int(session['minexf']) >= 2 and int(session['minexs']) >= 2) or ( + int(session['soref']) >= 2 and int(session['sores']) >= 2): + ccc_pem = 1 + ccc_pemcheck = "Yes" + else: + ccc_pem = 0 + ccc_pemcheck = "No" + if (int(session['twitchesf']) >= 2 and int(session['twitchess']) >= 2) or ( + int(session['weakf']) >= 2 and int(session['weaks']) >= 2) or \ + (int(session['noisef']) >= 2 and int(session['noises']) >= 2) or ( + int(session['lightsf']) >= 2 and int(session['lightss']) >= 2) or \ + (int(session['rememberf']) >= 2 and int(session['remembers']) >= 2) or \ + (int(session['attentionf']) >= 2 and int(session['attentions']) >= 2) or \ + (int(session['wordf']) >= 2 and int(session['words']) >= 2) or ( + int(session['understandf']) >= 2 and int(session['understands']) >= 2) or \ + (int(session['focusf']) >= 2 and int(session['focuss']) >= 2) or ( + int(session['visionf']) >= 2 and int(session['visions']) >= 2) or \ + (int(session['depthf']) >= 2 and int(session['depths']) >= 2) or ( + int(session['slowf']) >= 2 and int(session['slows']) >= 2) or \ + (int(session['absentf']) >= 2 and int(session['absents']) >= 2): + ccc_cog = 1 + ccc_cogcheck = "Yes" + else: + ccc_cog = 0 + ccc_cogcheck = "No" + + if (int(session['unsteadyf']) >= 2 and int(session['unsteadys']) >= 2) or ( + int(session['bowelf']) >= 2 and int(session['bowels']) >= 2) or \ + (int(session['bladderf']) >= 2 and int(session['bladders']) >= 2) or ( + int(session['nauseaf']) >= 2 and int(session['nauseas']) >= 2) or ( + int(session['shortf']) >= 2 and int(session['shorts']) >= 2) or ( + int(session['dizzyf']) >= 2 and int(session['dizzys']) >= 2) or ( + int(session['heartf']) >= 2 and int(session['hearts']) >= 2): + ccc_auto = 1 + ccc_autocheck = "Yes" + else: + ccc_auto = 0 + ccc_autocheck = "No" + if (int(session['sweatf']) >= 2 and int(session['sweats']) >= 2) or ( + int(session['nightf']) >= 2 and int(session['nights']) >= 2) or \ + (int(session['limbsf']) >= 2 and int(session['limbss']) >= 2) or ( + int(session['chillsf']) >= 2 and int(session['chillss']) >= 2) or \ + (int(session['hotf']) >= 2 and int(session['hots']) >= 2) or ( + int(session['hitempf']) >= 2 and int(session['hitemps']) >= 2) or \ + (int(session['lotempf']) >= 2 and int(session['lotemps']) >= 2) or ( + int(session['appetitef']) >= 2 and int(session['appetites']) >= 2) or ( + int(session['weightf']) >= 2 and int(session['weights']) >= 2) or ( + int(session['alcoholf']) >= 2 and int(session['alcohols']) >= 2): + ccc_neuro = 1 + ccc_neurocheck = "Yes" + else: + ccc_neuro = 0 + ccc_neurocheck = "No" + if (int(session['fluf']) >= 2 and int(session['flus']) >= 2) or ( + int(session['smellf']) >= 2 and int(session['smells']) >= 2) or \ + (int(session['throatf']) >= 2 and int(session['throats']) >= 2) or \ + (int(session['lymphnodesf']) >= 2 and int(session['lymphnodess']) >= 2) or \ + (int(session['feverf']) >= 2 and int(session['fevers']) >= 2): + ccc_immune = 1 + ccc_immunecheck = "Yes" + else: + ccc_immune = 0 + ccc_immunecheck = "No" + ccc_poly = np.sum([ccc_auto, ccc_neuro, ccc_immune]) + # most of the symptoms are required, but there is one polythetic criteria, shown here by ccc_poly + if np.sum([ccc_fatigue, ccc_pem, ccc_sleep, ccc_pain, ccc_cog]) >= 5 and ccc_poly >= 2: + ccc_dx = "Met" + ccc_msg = "Your responses suggest that you meet the Canadian Consensus Criteria for ME/CFS." + else: + ccc_dx = "Not met" + ccc_msg = "Your responses do not meet the Canadian Consensus Criteria for ME/CFS." + + # ME-ICC assessment starts here, the longest and most complicated assessment + if int(session['reduction']) == 1: + ME_R = 1 + else: + ME_R = 0 + + if (int(session['minexf']) >= 2 and int(session['minexs']) >= 2) or ( + int(session['heavyf']) >= 2 and int(session['heavys']) >= 2) or \ + (int(session['soref']) >= 2 and int(session['sores']) >= 2) or ( + int(session['mentalf']) >= 2 and int(session['mentals']) >= 2) or \ + (int(session['drainedf']) >= 2 and int(session['draineds']) >= 2): + ME_A = 1 + meicc_pemcheck = "Yes" + else: + ME_A = 0 + meicc_pemcheck = "No" + print(ME_A) + if (int(session['rememberf']) >= 2 and int(session['remembers']) >= 2) or ( + int(session['attentionf']) >= 2 and int(session['attentions']) >= 2) or \ + (int(session['wordf']) >= 2 and int(session['words']) >= 2) or ( + int(session['understandf']) >= 2 and int(session['understands']) >= 2) or \ + (int(session['focusf']) >= 2 and int(session['focuss']) >= 2) or ( + int(session['visionf']) >= 2 and int(session['visions']) >= 2) or \ + (int(session['depthf']) >= 2 and int(session['depths']) >= 2) or ( + int(session['slowf']) >= 2 and int(session['slows']) >= 2) or \ + (int(session['absentf']) >= 2 and int(session['absents']) >= 2): + ME_B1 = 1 + meicc_cogcheck = "Yes" + else: + ME_B1 = 0 + meicc_cogcheck = "No" + print(ME_B1) + if (int(session['musclef']) >= 2 and int(session['muscles']) >= 2) or ( + int(session['jointpainf']) >= 2 and int(session['jointpains']) >= 2) or \ + (int(session['eyepainf']) >= 2 and int(session['eyepains']) >= 2) or ( + int(session['chestpainf']) >= 2 and int(session['chestpains']) >= 2) or \ + (int(session['headachesf']) >= 2 and int(session['headachess']) >= 2): + ME_B2 = 1 + meicc_paincheck = "Yes" + else: + ME_B2 = 0 + meicc_paincheck = "No" + print(ME_B2) + if (int(session['sleepf']) >= 2 and int(session['sleeps']) >= 2) or ( + int(session['napf']) >= 2 and int(session['naps']) >= 2) or \ + (int(session['fallf']) >= 2 and int(session['falls']) >= 2) or ( + int(session['stayf']) >= 2 and int(session['stays']) >= 2) or \ + (int(session['earlyf']) >= 2 and int(session['earlys']) >= 2) or ( + int(session['alldayf']) >= 2 and int(session['alldays']) >= 2): + ME_B3 = 1 + meicc_sleepcheck = "Yes" + else: + ME_B3 = 0 + meicc_sleepcheck = "No" + print(ME_B3) + if (int(session['twitchesf']) >= 2 and int(session['twitchess']) >= 2) or ( + int(session['weakf']) >= 2 and int(session['weaks']) >= 2) or \ + (int(session['noisef']) >= 2 and int(session['noises']) >= 2) or ( + int(session['lightsf']) >= 2 and int(session['lightss']) >= 2) or \ + (int(session['unsteadyf']) >= 2 and int(session['unsteadys']) >= 2): + ME_B4 = 1 + meicc_motorcheck = "Yes" + else: + ME_B4 = 0 + meicc_motorcheck = "No" + print(ME_B4) + if (ME_B1 + ME_B2 + ME_B3 + ME_B4) >= 3: + ME_B = 1 + else: + ME_B = 0 + print(ME_B) + if (int(session['throatf']) >= 2 and int(session['throats']) >= 2) or ( + int(session['lymphnodesf']) >= 2 and int(session['lymphnodess']) >= 2) or \ + (int(session['feverf']) >= 2 and int(session['fevers']) >= 2) or ( + int(session['fluf']) >= 2 and int(session['flus']) >= 2): + ME_C1 = 1 + meicc_flucheck = "Yes" + else: + ME_C1 = 0 + meicc_flucheck = "No" + print(ME_C1) + + if int(session['viral']) == 1: + ME_C2 = 1 + meicc_viralcheck = "Yes" + else: + ME_C2 = 0 + meicc_viralcheck = "No" + if (int(session['bloatf']) >= 2 and int(session['bloats']) >= 2) or ( + int(session['stomachf']) >= 2 and int(session['stomachs']) >= 2) or \ + (int(session['bowelf']) >= 2 and int(session['bowels']) >= 2) or ( + int(session['nauseaf']) >= 2 and int(session['nauseas']) >= 2): + ME_C3 = 1 + meicc_gastrocheck = "Yes" + else: + ME_C3 = 0 + meicc_gastrocheck = "No" + print(ME_C3) + if int(session['bladderf']) >= 2 and int(session['bladders']) >= 2: + ME_C4 = 1 + meicc_bladdercheck = "Yes" + else: + ME_C4 = 0 + meicc_bladdercheck = "No" + print(ME_C4) + if (int(session['alcoholf']) >= 2 and int(session['alcohols']) >= 2) or ( + int(session['smellf']) >= 2 and int(session['smells']) >= 2): + ME_C5 = 1 + meicc_sensitivitycheck = "Yes" + else: + ME_C5 = 0 + meicc_sensitivitycheck = "No" + print(ME_C5) + if (ME_C1 + ME_C2 + ME_C3 + ME_C4 + ME_C5) >= 3: + ME_C = 1 + else: + ME_C = 0 + print(ME_C) + if (int(session['dizzyf']) >= 2 and int(session['dizzys']) >= 2) or ( + int(session['heartf']) >= 2 and int(session['hearts']) >= 2): + ME_D1 = 1 + meicc_cardiocheck = "Yes" + else: + ME_D1 = 0 + meicc_cardiocheck = "No" + print(ME_D1) + if int(session['shortf']) >= 2 and int(session['shorts']) >= 2: + ME_D2 = 1 + meicc_respiratorycheck = "Yes" + else: + ME_D2 = 0 + meicc_respiratorycheck = "No" + print(ME_D2) + if (int(session['sweatf']) >= 2 and int(session['sweats']) >= 2) or ( + int(session['nightf']) >= 2 and int(session['nights']) >= 2) or \ + (int(session['limbsf']) >= 2 and int(session['limbss']) >= 2) or ( + int(session['chillsf']) >= 2 and int(session['chillss']) >= 2) or \ + (int(session['hotf']) >= 2 and int(session['hots']) >= 2) or ( + int(session['hitempf']) >= 2 and int(session['hitemps']) >= 2) or \ + (int(session['lotempf']) >= 2 and int(session['lotemps']) >= 2) or ( + int(session['slowf']) >= 2 and int(session['slows']) >= 2) or \ + (int(session['absentf']) >= 2 and int(session['absents']) >= 2): + ME_D3 = 1 + meicc_thermocheck = "Yes" + meicc_tempcheck = "Yes" + else: + ME_D3 = 0 + meicc_thermocheck = "No" + meicc_tempcheck = "No" + print(ME_D3) + if (ME_D1 + ME_D2 + ME_D3) >= 1: + ME_D = 1 + else: + ME_D = 0 + print(ME_D) + ME_score = (ME_R + ME_A + ME_B + ME_C + ME_D) + print(ME_score) + if ME_score == 5: + ME_diagnosis = 1 + me_icc = "Your scores suggest you meet the ME-ICC case definition criteria for ME/CFS" + meicc_dxcheck = "Met" + else: + ME_diagnosis = 0 + me_icc = "Your scores suggest you do not meet the ME-ICC case definition criteria for ME/CFS" + meicc_dxcheck = "Not met" + + # converts scores to 100pt scale + user_scores = np.multiply(user_scores, 25).tolist() + cfsdomains = np.multiply(cfsdomains, 25).tolist() + + fig = go.Figure( + data=[ + go.Bar(y=user_scores, x=categories, name="Your scores"), + go.Bar(y=cfsdomains, x=categories, name="Average ME/CFS scores")], + layout=go.Layout( + title=go.layout.Title(text='Your scores compared with our dataset of
' + 'over 2,400 participants with ME/CFS', x=0.5), + showlegend=True, legend=dict( + orientation="h", + yanchor="bottom", + y=1.02, + xanchor="right", + x=1))) + fig.update_layout(yaxis_title='Averaged Frequency and Severity Scores', + xaxis_title='Symptom Domains') + fig.update_yaxes(range=[0, 100], dtick=25) + fig.add_hline(y=1.5 * 25, line_color='black') + graphJSON = json.dumps(fig, cls=plotly.utils.PlotlyJSONEncoder) + + return render_template("results/graph3.html", graphJSON=graphJSON, + ccc_msg=ccc_msg, ccc_fatiguecheck=ccc_fatiguecheck, + ccc_pemcheck=ccc_pemcheck, ccc_paincheck=ccc_paincheck, ccc_sleepcheck=ccc_sleepcheck, + ccc_cogcheck=ccc_cogcheck, ccc_autocheck=ccc_autocheck, ccc_immunecheck=ccc_immunecheck, + ccc_neurocheck=ccc_neurocheck, ccc_dx=ccc_dx, ccc_reduction=ccc_reduction, + iomfatiguecheck=iomfatiguecheck, iomreductioncheck=iomreductioncheck, + iompemcheck=iompemcheck, iomdxcheck=iomdxcheck, iom_msg=iom_msg, + iomsleepcheck=iomsleepcheck, iomcogcheck=iomcogcheck) \ No newline at end of file diff --git a/main.py b/main.py index acbca20..c2f743e 100644 --- a/main.py +++ b/main.py @@ -1,22 +1,21 @@ import numpy as np -import plotly.utils -from flask import Flask, render_template, request, redirect, url_for, session, flash -from flask_session import Session +from flask import render_template, request, redirect, url_for, session from flask_wtf import FlaskForm -from wtforms import RadioField, SubmitField -import pandas as pd -import matplotlib.pyplot as plt -import plotly.graph_objects as go -import plotly.offline as pyo -import base64 -from io import BytesIO -import json +import dsq_utils +# commented out unused imports, can probably delete soon -- PC 7/31/23 +# import plotly.utils +# import plotly.graph_objects as go +# import json +# from flask_session import Session +# from wtforms import RadioField, SubmitField +# import pandas as pd +# import matplotlib.pyplot as plt +# import plotly.offline as pyo +# import base64 +# from io import BytesIO # from wtforms.validators import InputRequired - - - -import re -from os import path +# import re +# from os import path # imports the flask app we configured in the websites folder: from website import create_app @@ -37,405 +36,6 @@ cogname = str # used for the full-form results -def diagnose2(): - import domainScores as ds - pem_domainscore = (int(session["minexf"]) + int(session["minexs"]) + int(session['soref']) + int(session['sores']) + - int(session['heavyf']) + int(session['heavys']) + int(session['drainedf']) + int( - session['draineds']) + - int(session['mentalf']) + int(session['mentals']) + int(session['weakf']) + int( - session['weaks'])) / 12 - - sleep_domainscore = (int(session["sleepf"]) + int(session["sleeps"]) + int(session['napf']) + int(session['naps']) + - int(session['fallf']) + int(session['falls']) + int(session['stayf']) + int(session['stays']) + - int(session['earlyf']) + int(session['earlys']) + int(session['alldayf']) + int( - session['alldays'])) / 12 - - cog_domainscore = (int(session["rememberf"]) + int(session["remembers"]) + int(session['attentionf']) + - int(session['attentions']) + int(session['wordf']) + int(session['words']) + - int(session['understandf']) + int(session['understands']) + int(session['focusf']) + - int(session['focuss']) + int(session['slowf']) + int(session['slows']) + - int(session['absentf']) + int(session['absents']) + int(session['visionf']) + - int(session['visions'])) / 16 - pain_domainscore = (int(session['musclef']) + int(session['muscles']) + int(session['jointpainf']) + - int(session['jointpains']) + int(session['eyepainf']) + int(session['eyepains']) + - int(session['headachesf']) + int(session['headachess'])) / 8 - gastro_domainscore = (int(session['bloatf']) + int(session['bloats']) + int(session['bowelf']) + - int(session['bowels']) + int(session['stomachf']) + int(session['stomachs']) + - int(session['bladderf']) + int(session['bladders'])) / 8 - ortho_domainscore = (int(session['unsteadyf']) + int(session['unsteadys']) + int(session['chestpainf']) + - int(session['chestpains']) + int(session['shortf']) + int(session['shorts']) + - int(session['dizzyf']) + int(session['dizzys']) + int(session['heartf']) + - int(session['hearts']) + int(session['nauseaf']) + int(session['nauseas'])) / 12 - circ_domainscore = (int(session['limbsf']) + int(session['limbss']) + int(session['hotf']) + - int(session['hots']) + int(session['lotempf']) + int(session['lotemps']) + - int(session['sweatf']) + int(session['sweats']) + int(session['chillsf']) + - int(session['chillss']) + int(session['weightf']) + int(session['weights']) + - int(session['appetitef']) + int(session['appetites']) + int(session['nightf']) + - int(session['nights'])) / 16 - immune_domainscore = (int(session['fluf']) + int(session['flus']) + int(session['feverf']) + - int(session['fevers']) + int(session['lymphnodesf']) + int(session['lymphnodess']) + - int(session['throatf']) + int(session['throats']) + int(session['hitempf']) + - int(session['hitemps'])) / 10 - neuroen_domainscore = (int(session['smellf']) + int(session['smells']) + int(session['alcoholf']) + - int(session['alcohols']) + int(session['twitchesf']) + int(session['twitchess']) + - int(session['noisef']) + int(session['noises']) + int(session['lightsf']) + - int(session['lightss']) + int(session['depthf']) + int(session['depths'])) / 12 - - mecfs = ds.df[(ds.df['dx'] == 1)] - control = ds.df[(ds.df['dx'] != 1)] - user_scores = [(int(session['fatiguescoref']) + int(session['fatiguescores'])) / 2, - pem_domainscore, sleep_domainscore, cog_domainscore, pain_domainscore, gastro_domainscore, - ortho_domainscore, circ_domainscore, immune_domainscore, neuroen_domainscore] - cfsdomains = np.mean(mecfs.iloc[:, 110:120], axis=0) - conDomains = np.mean(control.iloc[:, 110:120], axis=0) - - categories = ['Fatigue', 'PEM', 'Sleep', 'Cognitive Problems', 'Pain', 'Gastro Problems', - 'Orthostatic Intolerance', 'Circulatory Problems', 'Immune System', 'Neuroendocrine Problems'] - - # IOM assessment - iomfatiguecheck = "No" - iomreductioncheck = "No" - iompemcheck = "No" - iomsleepcheck = "No" - iomcogcheck = "No" - if int(session['fatiguescoref']) >= 2 and int(session['fatiguescores']) >= 2: - iomfatiguecheck = "Yes" - if int(session['reduction']) == 1: - iomreductioncheck = "Yes" - if (int(session['minexf']) >= 2 and int(session['minexs']) >= 2) or ( - int(session['heavyf']) >= 2 and int(session['heavys']) >= 2) or \ - (int(session['soref']) >= 2 and int(session['sores']) >= 2) or ( - int(session['mentalf']) >= 2 and int(session['mentals']) >= 2) or \ - (int(session['drainedf']) >= 2 and int(session['draineds']) >= 2): - iompemcheck = "Yes" - if (int(session['sleepf']) >= 2 and int(session['sleeps']) >= 2) or ( - int(session['napf']) >= 2 and int(session['naps']) >= 2) or \ - (int(session['fallf']) >= 2 and int(session['falls']) >= 2) or ( - int(session['stayf']) >= 2 and int(session['stays']) >= 2) or \ - (int(session['earlyf']) >= 2 and int(session['earlys']) >= 2) or ( - int(session['alldayf']) >= 2 and int(session['alldays']) >= 2): - iomsleepcheck = "Yes" - if (int(session['lightsf']) >= 2 and int(session['lightss']) >= 2) or \ - (int(session['rememberf']) >= 2 and int(session['remembers']) >= 2) or \ - (int(session['attentionf']) >= 2 and int(session['attentions']) >= 2) or \ - (int(session['wordf']) >= 2 and int(session['words']) >= 2) or ( - int(session['understandf']) >= 2 and int(session['understands']) >= 2) or \ - (int(session['focusf']) >= 2 and int(session['focuss']) >= 2) or ( - int(session['visionf']) >= 2 and int(session['visions']) >= 2) or \ - (int(session['depthf']) >= 2 and int(session['depths']) >= 2) or ( - int(session['slowf']) >= 2 and int(session['slows']) >= 2) or \ - (int(session['absentf']) >= 2 and int(session['absents']) >= 2): - iomcogcheck = "Yes" - - if iomfatiguecheck == "Yes" and iomreductioncheck == "Yes" and iompemcheck == "Yes" and iomsleepcheck == "Yes" and iomcogcheck == "Yes": - iom_msg = "Your responses suggest you meet the IOM Criteria for ME/CFS." - iomdxcheck = "Met" - - else: - iom_msg = "Your responses do not meet the IOM Criteria for ME/CFS." - iomdxcheck = "Not met" - - # Canadian criteria assessment - ccc_dx = False - - if int(session['fatiguescoref']) >= 2 and int(session['fatiguescores']) >= 2: - ccc_fatigue = 1 - - ccc_fatiguecheck = "Yes" - else: - ccc_fatigue = 0 - ccc_fatiguecheck = "No" - if int(session['reduction']) == 1: - ccc_reduction = "Yes" - else: - ccc_reduction = "No" - if (int(session['musclef']) >= 2 and int(session['muscles']) >= 2) or ( - int(session['jointpainf']) >= 2 and int(session['jointpains']) >= 2) or \ - (int(session['eyepainf']) >= 2 and int(session['eyepains']) >= 2) or ( - int(session['chestpainf']) >= 2 and int(session['chestpains']) >= 2) or \ - (int(session['headachesf']) >= 2 and int(session['headachess']) >= 2) or ( - int(session['bloatf']) >= 2 and int(session['bloats']) >= 2) or \ - (int(session['stomachf']) >= 2 and int(session['stomachs']) >= 2): - ccc_pain = 1 - ccc_paincheck = "Yes" - else: - ccc_pain = 0 - ccc_paincheck = "No" - if int(session['sleepf']) >= 2 and int(session['sleeps']) >= 2: - ccc_sleep = 1 - ccc_sleepcheck = "Yes" - else: - ccc_sleep = 0 - ccc_sleepcheck = "No" - if (int(session['minexf']) >= 2 and int(session['minexs']) >= 2) or ( - int(session['soref']) >= 2 and int(session['sores']) >= 2): - ccc_pem = 1 - ccc_pemcheck = "Yes" - else: - ccc_pem = 0 - ccc_pemcheck = "No" - if (int(session['twitchesf']) >= 2 and int(session['twitchess']) >= 2) or ( - int(session['weakf']) >= 2 and int(session['weaks']) >= 2) or \ - (int(session['noisef']) >= 2 and int(session['noises']) >= 2) or ( - int(session['lightsf']) >= 2 and int(session['lightss']) >= 2) or \ - (int(session['rememberf']) >= 2 and int(session['remembers']) >= 2) or \ - (int(session['attentionf']) >= 2 and int(session['attentions']) >= 2) or \ - (int(session['wordf']) >= 2 and int(session['words']) >= 2) or ( - int(session['understandf']) >= 2 and int(session['understands']) >= 2) or \ - (int(session['focusf']) >= 2 and int(session['focuss']) >= 2) or ( - int(session['visionf']) >= 2 and int(session['visions']) >= 2) or \ - (int(session['depthf']) >= 2 and int(session['depths']) >= 2) or ( - int(session['slowf']) >= 2 and int(session['slows']) >= 2) or \ - (int(session['absentf']) >= 2 and int(session['absents']) >= 2): - ccc_cog = 1 - ccc_cogcheck = "Yes" - else: - ccc_cog = 0 - ccc_cogcheck = "No" - - if (int(session['unsteadyf']) >= 2 and int(session['unsteadys']) >= 2) or ( - int(session['bowelf']) >= 2 and int(session['bowels']) >= 2) or \ - (int(session['bladderf']) >= 2 and int(session['bladders']) >= 2) or ( - int(session['nauseaf']) >= 2 and int(session['nauseas']) >= 2) or ( - int(session['shortf']) >= 2 and int(session['shorts']) >= 2) or ( - int(session['dizzyf']) >= 2 and int(session['dizzys']) >= 2) or ( - int(session['heartf']) >= 2 and int(session['hearts']) >= 2): - ccc_auto = 1 - ccc_autocheck = "Yes" - else: - ccc_auto = 0 - ccc_autocheck = "No" - if (int(session['sweatf']) >= 2 and int(session['sweats']) >= 2) or ( - int(session['nightf']) >= 2 and int(session['nights']) >= 2) or \ - (int(session['limbsf']) >= 2 and int(session['limbss']) >= 2) or ( - int(session['chillsf']) >= 2 and int(session['chillss']) >= 2) or \ - (int(session['hotf']) >= 2 and int(session['hots']) >= 2) or ( - int(session['hitempf']) >= 2 and int(session['hitemps']) >= 2) or \ - (int(session['lotempf']) >= 2 and int(session['lotemps']) >= 2) or ( - int(session['appetitef']) >= 2 and int(session['appetites']) >= 2) or ( - int(session['weightf']) >= 2 and int(session['weights']) >= 2) or ( - int(session['alcoholf']) >= 2 and int(session['alcohols']) >= 2): - ccc_neuro = 1 - ccc_neurocheck = "Yes" - else: - ccc_neuro = 0 - ccc_neurocheck = "No" - if (int(session['fluf']) >= 2 and int(session['flus']) >= 2) or ( - int(session['smellf']) >= 2 and int(session['smells']) >= 2) or \ - (int(session['throatf']) >= 2 and int(session['throats']) >= 2) or \ - (int(session['lymphnodesf']) >= 2 and int(session['lymphnodess']) >= 2) or \ - (int(session['feverf']) >= 2 and int(session['fevers']) >= 2): - ccc_immune = 1 - ccc_immunecheck = "Yes" - else: - ccc_immune = 0 - ccc_immunecheck = "No" - ccc_poly = np.sum([ccc_auto, ccc_neuro, ccc_immune]) - # most of the symptoms are required, but there is one polythetic criteria, shown here by ccc_poly - if np.sum([ccc_fatigue, ccc_pem, ccc_sleep, ccc_pain, ccc_cog]) >= 5 and ccc_poly >= 2: - ccc_dx = "Met" - ccc_msg = "Your responses suggest that you meet the Canadian Consensus Criteria for ME/CFS." - else: - ccc_dx = "Not met" - ccc_msg = "Your responses do not meet the Canadian Consensus Criteria for ME/CFS." - - # ME-ICC assessment starts here, the longest and most complicated assessment - if int(session['reduction']) == 1: - ME_R = 1 - else: - ME_R = 0 - - if (int(session['minexf']) >= 2 and int(session['minexs']) >= 2) or ( - int(session['heavyf']) >= 2 and int(session['heavys']) >= 2) or \ - (int(session['soref']) >= 2 and int(session['sores']) >= 2) or ( - int(session['mentalf']) >= 2 and int(session['mentals']) >= 2) or \ - (int(session['drainedf']) >= 2 and int(session['draineds']) >= 2): - ME_A = 1 - meicc_pemcheck = "Yes" - else: - ME_A = 0 - meicc_pemcheck = "No" - print(ME_A) - if (int(session['rememberf']) >= 2 and int(session['remembers']) >= 2) or ( - int(session['attentionf']) >= 2 and int(session['attentions']) >= 2) or \ - (int(session['wordf']) >= 2 and int(session['words']) >= 2) or ( - int(session['understandf']) >= 2 and int(session['understands']) >= 2) or \ - (int(session['focusf']) >= 2 and int(session['focuss']) >= 2) or ( - int(session['visionf']) >= 2 and int(session['visions']) >= 2) or \ - (int(session['depthf']) >= 2 and int(session['depths']) >= 2) or ( - int(session['slowf']) >= 2 and int(session['slows']) >= 2) or \ - (int(session['absentf']) >= 2 and int(session['absents']) >= 2): - ME_B1 = 1 - meicc_cogcheck = "Yes" - else: - ME_B1 = 0 - meicc_cogcheck = "No" - print(ME_B1) - if (int(session['musclef']) >= 2 and int(session['muscles']) >= 2) or ( - int(session['jointpainf']) >= 2 and int(session['jointpains']) >= 2) or \ - (int(session['eyepainf']) >= 2 and int(session['eyepains']) >= 2) or ( - int(session['chestpainf']) >= 2 and int(session['chestpains']) >= 2) or \ - (int(session['headachesf']) >= 2 and int(session['headachess']) >= 2): - ME_B2 = 1 - meicc_paincheck = "Yes" - else: - ME_B2 = 0 - meicc_paincheck = "No" - print(ME_B2) - if (int(session['sleepf']) >= 2 and int(session['sleeps']) >= 2) or ( - int(session['napf']) >= 2 and int(session['naps']) >= 2) or \ - (int(session['fallf']) >= 2 and int(session['falls']) >= 2) or ( - int(session['stayf']) >= 2 and int(session['stays']) >= 2) or \ - (int(session['earlyf']) >= 2 and int(session['earlys']) >= 2) or ( - int(session['alldayf']) >= 2 and int(session['alldays']) >= 2): - ME_B3 = 1 - meicc_sleepcheck = "Yes" - else: - ME_B3 = 0 - meicc_sleepcheck = "No" - print(ME_B3) - if (int(session['twitchesf']) >= 2 and int(session['twitchess']) >= 2) or ( - int(session['weakf']) >= 2 and int(session['weaks']) >= 2) or \ - (int(session['noisef']) >= 2 and int(session['noises']) >= 2) or ( - int(session['lightsf']) >= 2 and int(session['lightss']) >= 2) or \ - (int(session['unsteadyf']) >= 2 and int(session['unsteadys']) >= 2): - ME_B4 = 1 - meicc_motorcheck = "Yes" - else: - ME_B4 = 0 - meicc_motorcheck = "No" - print(ME_B4) - if (ME_B1 + ME_B2 + ME_B3 + ME_B4) >= 3: - ME_B = 1 - else: - ME_B = 0 - print(ME_B) - if (int(session['throatf']) >= 2 and int(session['throats']) >= 2) or ( - int(session['lymphnodesf']) >= 2 and int(session['lymphnodess']) >= 2) or \ - (int(session['feverf']) >= 2 and int(session['fevers']) >= 2) or ( - int(session['fluf']) >= 2 and int(session['flus']) >= 2): - ME_C1 = 1 - meicc_flucheck = "Yes" - else: - ME_C1 = 0 - meicc_flucheck = "No" - print(ME_C1) - - if int(session['viral']) == 1: - ME_C2 = 1 - meicc_viralcheck = "Yes" - else: - ME_C2 = 0 - meicc_viralcheck = "No" - if (int(session['bloatf']) >= 2 and int(session['bloats']) >= 2) or ( - int(session['stomachf']) >= 2 and int(session['stomachs']) >= 2) or \ - (int(session['bowelf']) >= 2 and int(session['bowels']) >= 2) or ( - int(session['nauseaf']) >= 2 and int(session['nauseas']) >= 2): - ME_C3 = 1 - meicc_gastrocheck = "Yes" - else: - ME_C3 = 0 - meicc_gastrocheck = "No" - print(ME_C3) - if int(session['bladderf']) >= 2 and int(session['bladders']) >= 2: - ME_C4 = 1 - meicc_bladdercheck = "Yes" - else: - ME_C4 = 0 - meicc_bladdercheck = "No" - print(ME_C4) - if (int(session['alcoholf']) >= 2 and int(session['alcohols']) >= 2) or ( - int(session['smellf']) >= 2 and int(session['smells']) >= 2): - ME_C5 = 1 - meicc_sensitivitycheck = "Yes" - else: - ME_C5 = 0 - meicc_sensitivitycheck = "No" - print(ME_C5) - if (ME_C1 + ME_C2 + ME_C3 + ME_C4 + ME_C5) >= 3: - ME_C = 1 - else: - ME_C = 0 - print(ME_C) - if (int(session['dizzyf']) >= 2 and int(session['dizzys']) >= 2) or ( - int(session['heartf']) >= 2 and int(session['hearts']) >= 2): - ME_D1 = 1 - meicc_cardiocheck = "Yes" - else: - ME_D1 = 0 - meicc_cardiocheck = "No" - print(ME_D1) - if int(session['shortf']) >= 2 and int(session['shorts']) >= 2: - ME_D2 = 1 - meicc_respiratorycheck = "Yes" - else: - ME_D2 = 0 - meicc_respiratorycheck = "No" - print(ME_D2) - if (int(session['sweatf']) >= 2 and int(session['sweats']) >= 2) or ( - int(session['nightf']) >= 2 and int(session['nights']) >= 2) or \ - (int(session['limbsf']) >= 2 and int(session['limbss']) >= 2) or ( - int(session['chillsf']) >= 2 and int(session['chillss']) >= 2) or \ - (int(session['hotf']) >= 2 and int(session['hots']) >= 2) or ( - int(session['hitempf']) >= 2 and int(session['hitemps']) >= 2) or \ - (int(session['lotempf']) >= 2 and int(session['lotemps']) >= 2) or ( - int(session['slowf']) >= 2 and int(session['slows']) >= 2) or \ - (int(session['absentf']) >= 2 and int(session['absents']) >= 2): - ME_D3 = 1 - meicc_thermocheck = "Yes" - meicc_tempcheck = "Yes" - else: - ME_D3 = 0 - meicc_thermocheck = "No" - meicc_tempcheck = "No" - print(ME_D3) - if (ME_D1 + ME_D2 + ME_D3) >= 1: - ME_D = 1 - else: - ME_D = 0 - print(ME_D) - ME_score = (ME_R + ME_A + ME_B + ME_C + ME_D) - print(ME_score) - if ME_score == 5: - ME_diagnosis = 1 - me_icc = "Your scores suggest you meet the ME-ICC case definition criteria for ME/CFS" - meicc_dxcheck = "Met" - else: - ME_diagnosis = 0 - me_icc = "Your scores suggest you do not meet the ME-ICC case definition criteria for ME/CFS" - meicc_dxcheck = "Not met" - - # converts scores to 100pt scale - user_scores = np.multiply(user_scores, 25).tolist() - cfsdomains = np.multiply(cfsdomains, 25).tolist() - - fig = go.Figure( - data=[ - go.Bar(y=user_scores, x=categories, name="Your scores"), - go.Bar(y=cfsdomains, x=categories, name="Average ME/CFS scores")], - layout=go.Layout( - title=go.layout.Title(text='Your scores compared with our dataset of
' - 'over 2,400 participants with ME/CFS', x=0.5), - showlegend=True, legend=dict( - orientation="h", - yanchor="bottom", - y=1.02, - xanchor="right", - x=1))) - fig.update_layout(yaxis_title='Averaged Frequency and Severity Scores', - xaxis_title='Symptom Domains') - fig.update_yaxes(range=[0, 100], dtick=25) - fig.add_hline(y=1.5 * 25, line_color='black') - graphJSON = json.dumps(fig, cls=plotly.utils.PlotlyJSONEncoder) - - return render_template("results/graph3.html", graphJSON=graphJSON, - ccc_msg=ccc_msg, ccc_fatiguecheck=ccc_fatiguecheck, - ccc_pemcheck=ccc_pemcheck, ccc_paincheck=ccc_paincheck, ccc_sleepcheck=ccc_sleepcheck, - ccc_cogcheck=ccc_cogcheck, ccc_autocheck=ccc_autocheck, ccc_immunecheck=ccc_immunecheck, - ccc_neurocheck=ccc_neurocheck, ccc_dx=ccc_dx, ccc_reduction=ccc_reduction, - iomfatiguecheck=iomfatiguecheck, iomreductioncheck=iomreductioncheck, - iompemcheck=iompemcheck, iomdxcheck=iomdxcheck, iom_msg=iom_msg, - iomsleepcheck=iomsleepcheck, iomcogcheck=iomcogcheck) @app.route('/end2', methods=['get']) def end2(): @@ -1201,7 +801,7 @@ def fever(): session["feverf"] = feverf session["fevers"] = fevers session['pagenum'] += 1 - return diagnose2() + return dsq_utils.dsq_diagnose() else: return render_template("dsq/fever64.html", message=message, pagenum=session['pagenum']) return render_template("dsq/fever64.html", message='', pagenum=session['pagenum']) From 698a26c5e6542997b39c69d6540fa098794329d9 Mon Sep 17 00:00:00 2001 From: mooserson Date: Mon, 31 Jul 2023 11:56:24 -0500 Subject: [PATCH 11/17] removes typo --- dsq_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/dsq_utils.py b/dsq_utils.py index 4c60d47..98f3496 100644 --- a/dsq_utils.py +++ b/dsq_utils.py @@ -4,7 +4,6 @@ import json import plotly.utils -# def dsq_diagnose(): import domainScores as ds pem_domainscore = (int(session["minexf"]) + int(session["minexs"]) + int(session['soref']) + int(session['sores']) + From 67972e5f79821da7efdd5a0d1d3cfeb4b979da3c Mon Sep 17 00:00:00 2001 From: mooserson Date: Mon, 31 Jul 2023 14:35:52 -0500 Subject: [PATCH 12/17] fixes typo in iom scoring for SF --- website/short_form.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/short_form.py b/website/short_form.py index d43a2d8..3deed19 100644 --- a/website/short_form.py +++ b/website/short_form.py @@ -241,7 +241,7 @@ def graph2(): iompemcheck = "Yes" if int(session['sleepf']) >= 2 and int(session['sleeps']) >= 2: iomsleepcheck = "Yes" - if (int(session['rememberf']) and int(session['remembers']) >= 2 ) or ( + if (int(session['rememberf']) >= 2 and int(session['remembers']) >= 2 ) or ( int(session['attentionf']) >= 2 and int(session['attentions']) >= 2): iomcogcheck = "Yes" From 614255e1b4287c9c8c6881fa5d955733a3ef9f57 Mon Sep 17 00:00:00 2001 From: mooserson Date: Mon, 31 Jul 2023 14:38:13 -0500 Subject: [PATCH 13/17] fixes typo in screener scoring for iomcogcheck --- website/screener_views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/screener_views.py b/website/screener_views.py index 91a2b21..9116649 100644 --- a/website/screener_views.py +++ b/website/screener_views.py @@ -139,7 +139,7 @@ def graph(): iompemcheck = "Yes" if session['sleepf'] >= 2 and session['sleeps'] >= 2: iomsleepcheck = "Yes" - if session['rememberf'] and session['remembers'] >= 2: + if session['rememberf'] >= 2 and session['remembers'] >= 2: iomcogcheck = "Yes" if iomfatiguecheck == "Yes" or iompemcheck == "Yes" or iomsleepcheck == "Yes" or iomcogcheck == "Yes": From 26531fd720659162d9e2ac8882582c847329bbca Mon Sep 17 00:00:00 2001 From: mooserson Date: Mon, 31 Jul 2023 15:01:05 -0500 Subject: [PATCH 14/17] adds orthointolerance to short form results --- website/short_form.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/website/short_form.py b/website/short_form.py index 3deed19..c42bd53 100644 --- a/website/short_form.py +++ b/website/short_form.py @@ -232,6 +232,8 @@ def graph2(): iompemcheck = "No" iomsleepcheck = "No" iomcogcheck = "No" + iomorthocheck = "No" + if int(session['fatiguescoref']) >= 2 and int(session['fatiguescores']) >= 2: iomfatiguecheck = "Yes" if int(session['reduction']) == 1: @@ -244,8 +246,10 @@ def graph2(): if (int(session['rememberf']) >= 2 and int(session['remembers']) >= 2 ) or ( int(session['attentionf']) >= 2 and int(session['attentions']) >= 2): iomcogcheck = "Yes" + if int(session['unsteadyf']) >= 2 and int(session['unsteadys']) >= 2: + iomorthocheck = "Yes" - if iomfatiguecheck == "Yes" and iomreductioncheck == "Yes" and iompemcheck == "Yes" and iomsleepcheck == "Yes" and iomcogcheck == "Yes": + if iomfatiguecheck == "Yes" and iomreductioncheck == "Yes" and iompemcheck == "Yes" and iomsleepcheck == "Yes" and (iomcogcheck == "Yes" or iomorthocheck == "Yes"): iom_msg = "Your responses suggest you meet the IOM Criteria for ME/CFS. To improve the accuracy" \ " of your assessment with more questions continue to the next section." iomdxcheck = "Met" @@ -370,5 +374,5 @@ def graph2(): ccc_neurocheck=ccc_neurocheck, ccc_dx=ccc_dx, ccc_reduction=ccc_reduction, iomfatiguecheck=iomfatiguecheck, iomreductioncheck=iomreductioncheck, iompemcheck=iompemcheck, iomdxcheck=iomdxcheck, iom_msg=iom_msg, - iomsleepcheck=iomsleepcheck, iomcogcheck=iomcogcheck + iomsleepcheck=iomsleepcheck, iomcogcheck=iomcogcheck, iomorthocheck=iomorthocheck ) \ No newline at end of file From 27ae682f87e03ad1f3475966a20a44c2a560b6a6 Mon Sep 17 00:00:00 2001 From: mooserson Date: Mon, 31 Jul 2023 15:01:50 -0500 Subject: [PATCH 15/17] cleans up spacing and adds orthointolerance to graph2 --- website/templates/results/graph2.html | 30 ++++++++++++++------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/website/templates/results/graph2.html b/website/templates/results/graph2.html index 2463921..0bf12c2 100644 --- a/website/templates/results/graph2.html +++ b/website/templates/results/graph2.html @@ -13,15 +13,17 @@

Institute of Medicine (IOM) Case Definition

Case Definition Requirements Met:
Fatigue that persists at least 6 months
-
{{ iomfatiguecheck }}
+
{{ iomfatiguecheck }}
50% or more reduction in functioning
-
{{ iomreductioncheck }}
+
{{ iomreductioncheck }}
Post-exertional malaise (PEM)
-
{{ iompemcheck }}
+
{{ iompemcheck }}
Unrefreshing sleep
-
{{ iomsleepcheck }}
+
{{ iomsleepcheck }}
Cognitive impairment
-
{{ iomcogcheck }}
+
{{ iomcogcheck }}
+
Orthostatic intolerance
+
{{ iomorthocheck }}
Diagnosis:
{{ iomdxcheck }}
@@ -33,23 +35,23 @@

Canadian 2003 ME/CFS Case Definition

Case Definition Requirements Met:
Fatigue that persists at least 6 months
-
{{ ccc_fatiguecheck }}
+
{{ ccc_fatiguecheck }}
50% or more reduction in functioning
-
{{ ccc_reduction }}
+
{{ ccc_reduction }}
Post-exertional malaise (PEM)
-
{{ ccc_pemcheck }}
+
{{ ccc_pemcheck }}
Sleep Problems
-
{{ ccc_sleepcheck }}
+
{{ ccc_sleepcheck }}
Pain
-
{{ ccc_paincheck }}
+
{{ ccc_paincheck }}
Neurocognitive Issues
-
{{ ccc_cogcheck }}
+
{{ ccc_cogcheck }}
Autonomic Dysfunction
-
{{ ccc_autocheck }}
+
{{ ccc_autocheck }}
Neuroendocrine Issues
-
{{ ccc_neurocheck }}
+
{{ ccc_neurocheck }}
Immune Symptoms
-
{{ ccc_immunecheck }}
+
{{ ccc_immunecheck }}
Diagnosis:
{{ ccc_dx }}
From d253a4d7aa666708318116338df5d8533ee7890a Mon Sep 17 00:00:00 2001 From: mooserson Date: Wed, 2 Aug 2023 14:14:15 -0500 Subject: [PATCH 16/17] adds OI to dsq IOM assessment --- dsq_utils.py | 177 +++------------------------------------------------ 1 file changed, 9 insertions(+), 168 deletions(-) diff --git a/dsq_utils.py b/dsq_utils.py index 98f3496..ef74f44 100644 --- a/dsq_utils.py +++ b/dsq_utils.py @@ -65,6 +65,8 @@ def dsq_diagnose(): iompemcheck = "No" iomsleepcheck = "No" iomcogcheck = "No" + iomorthocheck = "No" + if int(session['fatiguescoref']) >= 2 and int(session['fatiguescores']) >= 2: iomfatiguecheck = "Yes" if int(session['reduction']) == 1: @@ -93,8 +95,13 @@ def dsq_diagnose(): int(session['slowf']) >= 2 and int(session['slows']) >= 2) or \ (int(session['absentf']) >= 2 and int(session['absents']) >= 2): iomcogcheck = "Yes" + if (int(session['unsteadyf']) >= 2 and int(session['unsteadys']) >= 2) or \ + (int(session['shortf']) >= 2 and int(session['shorts']) >= 2) or \ + (int(session['dizzyf']) >= 2 and int(session['dizzys']) >= 2) or \ + (int(session['heartf']) >= 2 and int(session['hearts']) >= 2): + iomorthocheck = "Yes" - if iomfatiguecheck == "Yes" and iomreductioncheck == "Yes" and iompemcheck == "Yes" and iomsleepcheck == "Yes" and iomcogcheck == "Yes": + if iomfatiguecheck == "Yes" and iomreductioncheck == "Yes" and iompemcheck == "Yes" and iomsleepcheck == "Yes" and (iomcogcheck == "Yes" or iomorthocheck == "Yes"): iom_msg = "Your responses suggest you meet the IOM Criteria for ME/CFS." iomdxcheck = "Met" @@ -205,172 +212,6 @@ def dsq_diagnose(): else: ccc_dx = "Not met" ccc_msg = "Your responses do not meet the Canadian Consensus Criteria for ME/CFS." - - # ME-ICC assessment starts here, the longest and most complicated assessment - if int(session['reduction']) == 1: - ME_R = 1 - else: - ME_R = 0 - - if (int(session['minexf']) >= 2 and int(session['minexs']) >= 2) or ( - int(session['heavyf']) >= 2 and int(session['heavys']) >= 2) or \ - (int(session['soref']) >= 2 and int(session['sores']) >= 2) or ( - int(session['mentalf']) >= 2 and int(session['mentals']) >= 2) or \ - (int(session['drainedf']) >= 2 and int(session['draineds']) >= 2): - ME_A = 1 - meicc_pemcheck = "Yes" - else: - ME_A = 0 - meicc_pemcheck = "No" - print(ME_A) - if (int(session['rememberf']) >= 2 and int(session['remembers']) >= 2) or ( - int(session['attentionf']) >= 2 and int(session['attentions']) >= 2) or \ - (int(session['wordf']) >= 2 and int(session['words']) >= 2) or ( - int(session['understandf']) >= 2 and int(session['understands']) >= 2) or \ - (int(session['focusf']) >= 2 and int(session['focuss']) >= 2) or ( - int(session['visionf']) >= 2 and int(session['visions']) >= 2) or \ - (int(session['depthf']) >= 2 and int(session['depths']) >= 2) or ( - int(session['slowf']) >= 2 and int(session['slows']) >= 2) or \ - (int(session['absentf']) >= 2 and int(session['absents']) >= 2): - ME_B1 = 1 - meicc_cogcheck = "Yes" - else: - ME_B1 = 0 - meicc_cogcheck = "No" - print(ME_B1) - if (int(session['musclef']) >= 2 and int(session['muscles']) >= 2) or ( - int(session['jointpainf']) >= 2 and int(session['jointpains']) >= 2) or \ - (int(session['eyepainf']) >= 2 and int(session['eyepains']) >= 2) or ( - int(session['chestpainf']) >= 2 and int(session['chestpains']) >= 2) or \ - (int(session['headachesf']) >= 2 and int(session['headachess']) >= 2): - ME_B2 = 1 - meicc_paincheck = "Yes" - else: - ME_B2 = 0 - meicc_paincheck = "No" - print(ME_B2) - if (int(session['sleepf']) >= 2 and int(session['sleeps']) >= 2) or ( - int(session['napf']) >= 2 and int(session['naps']) >= 2) or \ - (int(session['fallf']) >= 2 and int(session['falls']) >= 2) or ( - int(session['stayf']) >= 2 and int(session['stays']) >= 2) or \ - (int(session['earlyf']) >= 2 and int(session['earlys']) >= 2) or ( - int(session['alldayf']) >= 2 and int(session['alldays']) >= 2): - ME_B3 = 1 - meicc_sleepcheck = "Yes" - else: - ME_B3 = 0 - meicc_sleepcheck = "No" - print(ME_B3) - if (int(session['twitchesf']) >= 2 and int(session['twitchess']) >= 2) or ( - int(session['weakf']) >= 2 and int(session['weaks']) >= 2) or \ - (int(session['noisef']) >= 2 and int(session['noises']) >= 2) or ( - int(session['lightsf']) >= 2 and int(session['lightss']) >= 2) or \ - (int(session['unsteadyf']) >= 2 and int(session['unsteadys']) >= 2): - ME_B4 = 1 - meicc_motorcheck = "Yes" - else: - ME_B4 = 0 - meicc_motorcheck = "No" - print(ME_B4) - if (ME_B1 + ME_B2 + ME_B3 + ME_B4) >= 3: - ME_B = 1 - else: - ME_B = 0 - print(ME_B) - if (int(session['throatf']) >= 2 and int(session['throats']) >= 2) or ( - int(session['lymphnodesf']) >= 2 and int(session['lymphnodess']) >= 2) or \ - (int(session['feverf']) >= 2 and int(session['fevers']) >= 2) or ( - int(session['fluf']) >= 2 and int(session['flus']) >= 2): - ME_C1 = 1 - meicc_flucheck = "Yes" - else: - ME_C1 = 0 - meicc_flucheck = "No" - print(ME_C1) - - if int(session['viral']) == 1: - ME_C2 = 1 - meicc_viralcheck = "Yes" - else: - ME_C2 = 0 - meicc_viralcheck = "No" - if (int(session['bloatf']) >= 2 and int(session['bloats']) >= 2) or ( - int(session['stomachf']) >= 2 and int(session['stomachs']) >= 2) or \ - (int(session['bowelf']) >= 2 and int(session['bowels']) >= 2) or ( - int(session['nauseaf']) >= 2 and int(session['nauseas']) >= 2): - ME_C3 = 1 - meicc_gastrocheck = "Yes" - else: - ME_C3 = 0 - meicc_gastrocheck = "No" - print(ME_C3) - if int(session['bladderf']) >= 2 and int(session['bladders']) >= 2: - ME_C4 = 1 - meicc_bladdercheck = "Yes" - else: - ME_C4 = 0 - meicc_bladdercheck = "No" - print(ME_C4) - if (int(session['alcoholf']) >= 2 and int(session['alcohols']) >= 2) or ( - int(session['smellf']) >= 2 and int(session['smells']) >= 2): - ME_C5 = 1 - meicc_sensitivitycheck = "Yes" - else: - ME_C5 = 0 - meicc_sensitivitycheck = "No" - print(ME_C5) - if (ME_C1 + ME_C2 + ME_C3 + ME_C4 + ME_C5) >= 3: - ME_C = 1 - else: - ME_C = 0 - print(ME_C) - if (int(session['dizzyf']) >= 2 and int(session['dizzys']) >= 2) or ( - int(session['heartf']) >= 2 and int(session['hearts']) >= 2): - ME_D1 = 1 - meicc_cardiocheck = "Yes" - else: - ME_D1 = 0 - meicc_cardiocheck = "No" - print(ME_D1) - if int(session['shortf']) >= 2 and int(session['shorts']) >= 2: - ME_D2 = 1 - meicc_respiratorycheck = "Yes" - else: - ME_D2 = 0 - meicc_respiratorycheck = "No" - print(ME_D2) - if (int(session['sweatf']) >= 2 and int(session['sweats']) >= 2) or ( - int(session['nightf']) >= 2 and int(session['nights']) >= 2) or \ - (int(session['limbsf']) >= 2 and int(session['limbss']) >= 2) or ( - int(session['chillsf']) >= 2 and int(session['chillss']) >= 2) or \ - (int(session['hotf']) >= 2 and int(session['hots']) >= 2) or ( - int(session['hitempf']) >= 2 and int(session['hitemps']) >= 2) or \ - (int(session['lotempf']) >= 2 and int(session['lotemps']) >= 2) or ( - int(session['slowf']) >= 2 and int(session['slows']) >= 2) or \ - (int(session['absentf']) >= 2 and int(session['absents']) >= 2): - ME_D3 = 1 - meicc_thermocheck = "Yes" - meicc_tempcheck = "Yes" - else: - ME_D3 = 0 - meicc_thermocheck = "No" - meicc_tempcheck = "No" - print(ME_D3) - if (ME_D1 + ME_D2 + ME_D3) >= 1: - ME_D = 1 - else: - ME_D = 0 - print(ME_D) - ME_score = (ME_R + ME_A + ME_B + ME_C + ME_D) - print(ME_score) - if ME_score == 5: - ME_diagnosis = 1 - me_icc = "Your scores suggest you meet the ME-ICC case definition criteria for ME/CFS" - meicc_dxcheck = "Met" - else: - ME_diagnosis = 0 - me_icc = "Your scores suggest you do not meet the ME-ICC case definition criteria for ME/CFS" - meicc_dxcheck = "Not met" # converts scores to 100pt scale user_scores = np.multiply(user_scores, 25).tolist() @@ -402,4 +243,4 @@ def dsq_diagnose(): ccc_neurocheck=ccc_neurocheck, ccc_dx=ccc_dx, ccc_reduction=ccc_reduction, iomfatiguecheck=iomfatiguecheck, iomreductioncheck=iomreductioncheck, iompemcheck=iompemcheck, iomdxcheck=iomdxcheck, iom_msg=iom_msg, - iomsleepcheck=iomsleepcheck, iomcogcheck=iomcogcheck) \ No newline at end of file + iomsleepcheck=iomsleepcheck, iomcogcheck=iomcogcheck, iomorthocheck=iomorthocheck) \ No newline at end of file From f29d03411642be3d377f8fdf85f4c342a4e5f635 Mon Sep 17 00:00:00 2001 From: mooserson Date: Wed, 2 Aug 2023 14:14:34 -0500 Subject: [PATCH 17/17] adds OI to graph 3 page, deletes meicc code --- website/templates/results/graph3.html | 63 +++++++-------------------- 1 file changed, 16 insertions(+), 47 deletions(-) diff --git a/website/templates/results/graph3.html b/website/templates/results/graph3.html index bc6dcbf..e28f558 100644 --- a/website/templates/results/graph3.html +++ b/website/templates/results/graph3.html @@ -13,15 +13,17 @@

Institute of Medicine (IOM) Case Definition

Case Definition Requirements Met:
Fatigue that persists at least 6 months
-
{{ iomfatiguecheck }}
+
{{ iomfatiguecheck }}
50% or more reduction in functioning
-
{{ iomreductioncheck }}
+
{{ iomreductioncheck }}
Post-exertional malaise (PEM)
-
{{ iompemcheck }}
+
{{ iompemcheck }}
Unrefreshing sleep
-
{{ iomsleepcheck }}
+
{{ iomsleepcheck }}
Cognitive impairment
-
{{ iomcogcheck }}
+
{{ iomcogcheck }}
+
Orthostatic intolerance
+
{{ iomorthocheck }}
Diagnosis:
{{ iomdxcheck }}
@@ -33,23 +35,23 @@

Canadian 2003 ME/CFS Case Definition

Case Definition Requirements Met:
Fatigue that persists at least 6 months
-
{{ ccc_fatiguecheck }}
+
{{ ccc_fatiguecheck }}
50% or more reduction in functioning
-
{{ ccc_reduction }}
+
{{ ccc_reduction }}
Post-exertional malaise (PEM)
-
{{ ccc_pemcheck }}
+
{{ ccc_pemcheck }}
Sleep Problems
-
{{ ccc_sleepcheck }}
+
{{ ccc_sleepcheck }}
Pain
-
{{ ccc_paincheck }}
+
{{ ccc_paincheck }}
Neurocognitive Issues
-
{{ ccc_cogcheck }}
+
{{ ccc_cogcheck }}
Autonomic Dysfunction
-
{{ ccc_autocheck }}
+
{{ ccc_autocheck }}
Neuroendocrine Issues
-
{{ ccc_neurocheck }}
+
{{ ccc_neurocheck }}
Immune Symptoms
-
{{ ccc_immunecheck }}
+
{{ ccc_immunecheck }}
Diagnosis:
{{ ccc_dx }}
@@ -66,39 +68,6 @@

Canadian 2003 ME/CFS Case Definition

- - -