diff --git a/dsq_utils.py b/dsq_utils.py new file mode 100644 index 0000000..ef74f44 --- /dev/null +++ b/dsq_utils.py @@ -0,0 +1,246 @@ +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" + iomorthocheck = "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 (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" or iomorthocheck == "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." + + # 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, iomorthocheck=iomorthocheck) \ No newline at end of file diff --git a/main.py b/main.py index 348864a..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,414 +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("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('/graph') -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) - @app.route('/end2', methods=['get']) def end2(): @@ -467,33 +58,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() @@ -512,8 +76,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']) @@ -527,8 +91,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']) @@ -550,8 +114,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']) @@ -572,8 +136,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']) @@ -593,8 +157,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']) @@ -615,8 +179,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']) @@ -637,8 +201,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']) @@ -659,8 +223,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']) @@ -681,8 +245,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']) @@ -709,8 +273,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']) @@ -726,8 +290,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']) @@ -743,8 +307,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']) @@ -760,8 +324,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']) @@ -777,8 +341,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']) @@ -794,8 +358,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']) @@ -811,8 +375,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']) @@ -828,8 +392,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']) @@ -845,32 +409,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(): @@ -890,8 +430,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']) @@ -914,8 +454,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']) @@ -938,8 +478,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']) @@ -964,8 +504,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']) @@ -988,8 +528,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']) @@ -1005,8 +545,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']) @@ -1022,8 +562,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']) @@ -1039,8 +579,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']) @@ -1056,8 +596,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']) @@ -1073,8 +613,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']) @@ -1090,8 +630,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']) @@ -1107,8 +647,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']) @@ -1124,8 +664,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']) @@ -1141,8 +681,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']) @@ -1158,8 +698,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']) @@ -1176,8 +716,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']) @@ -1194,8 +734,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']) @@ -1212,8 +752,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']) @@ -1229,8 +769,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']) @@ -1246,8 +786,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']) @@ -1261,10 +801,10 @@ def fever(): session["feverf"] = feverf session["fevers"] = fevers session['pagenum'] += 1 - return diagnose2() + return dsq_utils.dsq_diagnose() 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']) @@ -1288,8 +828,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']) @@ -1305,160 +845,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']) - - -@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']) - + 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(): diff --git a/website/screener_views.py b/website/screener_views.py index efdecc1..9116649 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') @@ -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": @@ -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/short_form.py b/website/short_form.py index b1ef0b3..c42bd53 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(): @@ -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']) @@ -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']) @@ -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: @@ -241,11 +243,13 @@ 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" + 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" @@ -364,11 +368,11 @@ 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, 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 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 +} + 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 diff --git a/website/templates/graph3.html b/website/templates/graph3.html deleted file mode 100644 index bc6dcbf..0000000 --- a/website/templates/graph3.html +++ /dev/null @@ -1,107 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} -{% include "partials/_top_nav_bar.html" %} - -

Full DePaul University Symptom Questionnaire Results

-
- -
-
-

Institute of Medicine (IOM) Case Definition

-
{{ iom_msg }}
-
Case Definition Requirements Met:
-
-
Fatigue that persists at least 6 months
-
{{ iomfatiguecheck }}
-
50% or more reduction in functioning
-
{{ iomreductioncheck }}
-
Post-exertional malaise (PEM)
-
{{ iompemcheck }}
-
Unrefreshing sleep
-
{{ iomsleepcheck }}
-
Cognitive impairment
-
{{ iomcogcheck }}
-
Diagnosis:
-
{{ iomdxcheck }}
-
-
- -
-

Canadian 2003 ME/CFS Case Definition

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

Disclaimer: This screener is not meant to provide medical diagnoses. Please consult with your physician if you believe you may be suffering from ME/CFS.

-{% endblock %} 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 57% rename from website/templates/graph2.html rename to website/templates/results/graph2.html index 2463921..0bf12c2 100644 --- a/website/templates/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 }}
diff --git a/website/templates/results/graph3.html b/website/templates/results/graph3.html new file mode 100644 index 0000000..e28f558 --- /dev/null +++ b/website/templates/results/graph3.html @@ -0,0 +1,76 @@ +{% extends 'base.html' %} + +{% block content %} +{% include "partials/_top_nav_bar.html" %} + +

Full DePaul University Symptom Questionnaire Results

+
+ +
+
+

Institute of Medicine (IOM) Case Definition

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

Canadian 2003 ME/CFS Case Definition

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

Disclaimer: This screener is not meant to provide medical diagnoses. Please consult with your physician if you believe you may be suffering from ME/CFS.

+{% endblock %} 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 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/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 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