Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.7.2 #42

Merged
merged 11 commits into from
Aug 22, 2023
4 changes: 2 additions & 2 deletions utils/dsq_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ def dsq_diagnose():

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")],
go.Bar(y=user_scores, x=categories, name="Your scores", marker_color='#00CC9C'),
go.Bar(y=cfsdomains, x=categories, name="Average ME/CFS scores", marker_color='#1E3888')],
layout=go.Layout(
title=go.layout.Title(text='Your scores compared with our dataset of <br>'
'over 2,400 participants with ME/CFS', x=0.5),
Expand Down
6 changes: 3 additions & 3 deletions utils/screener_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import json
import plotly.utils

# screener questions
# 'fatigue13c', 'remember36c', 'minimum17c', 'unrefreshed19c',
# screener: 4 questions
# fatigue13c, minimum17c, unrefreshed19c, remember36c

def screener_diagnose():
# we *25 to scale 4pt scale to 100 pt scale
Expand Down Expand Up @@ -42,7 +42,7 @@ def screener_diagnose():
# composite f/s score graph
fig = go.Figure(
data=[
go.Bar(y=composite_scores, x=categories, name="Your scores", marker=dict(color=colors))],
go.Bar(y=composite_scores, x=categories, name="Your scores", marker_color = '#00CC9C')],
layout=go.Layout(
title=go.layout.Title(text='Your Summary Score', x=0.5),
showlegend=True,
Expand Down
12 changes: 6 additions & 6 deletions utils/short_form_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import json
import plotly.utils

# short form questions:
# 'fatigue13c', 'soreness15c', 'minimum17c', 'unrefreshed19c',
# 'musclepain25c', 'bloating29c', 'remember36c', 'difficulty37c',
# 'bowel46c', 'unsteady48c', 'limbs56c', 'hot58c', 'flu65c','smells66c'
# short form: +10 questions
# soreness15c, difficulty37c, musclepain25c, bloating29c,
# bowel46c, unsteady48c, limbs56c, hot58c, flu65c, smells66c, reduction97
# includes screener qs: (fatigue13c, minimum17c, unrefreshed19c, remember36c)

def short_form_diagnose():
import domainScores as ds
Expand Down Expand Up @@ -159,8 +159,8 @@ def short_form_diagnose():
# Creates a figure using the plotly library, which can be dynamically embedded in the HTML page
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")],
go.Bar(y=user_scores, x=categories, name="Your scores", marker_color='#00CC9C'),
go.Bar(y=cfsdomains, x=categories, name="Average ME/CFS scores", marker_color='#1E3888')],
layout=go.Layout(
title=go.layout.Title(text='Your scores compared with our dataset of <br>'
'over 2,400 participants with ME/CFS', x=0.5),
Expand Down
22 changes: 3 additions & 19 deletions website/screener_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
# import numpy as np

screener_views = Blueprint('screener_views', __name__)

message = "Please enter a response for both frequency and severity before continuing"


@screener_views.route('/', methods=['post', 'get'])
def home():
session["pagenum"] = 0
Expand All @@ -17,14 +15,11 @@ def home():
return redirect(url_for("screener_views.page1"))
return render_template("home.html", session=session)


# First symptom question
@screener_views.route('/fatigue', methods=['post', 'get'])
def page1():
session['pagenum'] = 1
if request.method == "POST":
selected_radio = request.form.get('fatigue')
selected_severity = request.form.get('severity')
fatiguescoref = request.form.get("fatigue")
fatiguescores = request.form.get("severity")
if fatiguescores is not None and fatiguescoref is not None:
Expand All @@ -34,16 +29,12 @@ def page1():
session['pagenum'] += 1
return redirect(url_for("screener_views.page2"))
else:
return render_template("screener/page1.html", pagenum=session['pagenum'], message=message,
selected_radio=selected_radio, selected_severity=selected_severity)
return render_template("screener/page1.html", pagenum=session['pagenum'], message=message)
return render_template("screener/page1.html", pagenum=session['pagenum'], message='')


@screener_views.route('/minimum', methods=["post", "get"])
def page2():
global pemname
selected_f = request.form.get('minex')
selected_s = request.form.get('minex_s')
if request.method == "POST":
minexf = request.form.get("minex")
minexs = request.form.get("minex_s")
Expand All @@ -53,15 +44,11 @@ def page2():
session["pemscore"] = (int(minexf) + int(minexs)) / 2
session["pemname"] = "minimum17"
session['pagenum'] += 1

return redirect(url_for("screener_views.page3"))

else:
return render_template("screener/page2.html", pagenum=session['pagenum'], message=message,
selected_s=selected_s, selected_f=selected_f)
return render_template("screener/page2.html", pagenum=session['pagenum'], message=message)
return render_template("screener/page2.html", pagenum=session['pagenum'], message='')


@screener_views.route('/unrefreshed', methods=['post', 'get'])
def page3():
global sleepname
Expand All @@ -79,11 +66,9 @@ def page3():
session["sleepname"] = 'unrefreshed19'
return redirect(url_for("screener_views.page4"))
else:
return render_template("screener/page3.html", pagenum=session['pagenum'], message=message,
sleepf=sleepf, sleeps=sleeps)
return render_template("screener/page3.html", pagenum=session['pagenum'], message=message, sleepf=sleepf, sleeps=sleeps)
return render_template("screener/page3.html", pagenum=session['pagenum'], message='')


@screener_views.route('/remember', methods=['post', 'get'])
def page4():
global cogname
Expand All @@ -104,7 +89,6 @@ def page4():
rememberf=rememberf, remembers=remembers)
return render_template("screener/page4.html", pagenum=session['pagenum'], message='')


@screener_views.route('/screener_dx')
def graph():
return screener_utils.screener_diagnose()
Expand Down
87 changes: 1 addition & 86 deletions website/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ DePaul blue: #0057B7
Screener: #F3CFC6
Short Form: #C2EFEB
DSQ: #ED7E63
Graph: #00CC9C #1E3888
*/

body {
Expand Down Expand Up @@ -529,92 +530,6 @@ footer {
button {
display: none;
}

.container {
display: none;
}

body {
max-width: 100%;
margin: 0;
padding: 0;
}

p,
span,
a {
margin-left: 20px;
margin-right: 20px;
}

div {
width: 100%;
border: none;
display: block;
margin: auto;
text-align: center;
}

div h3 {
width: 100%;
border: none;
display: block;
margin: auto;
text-align: center;
}

#chart {
display: block;
position: absolute;
height: auto;
margin-top: 5px;
bottom: 0px;
filter: grayscale(0%);
display: none;
}

.case-results {
width: 100%;
border: none;
margin: auto;
position: relative;
top: 100px;
margin-bottom: 5px;
}

.symptoms {
display: inline-block;
flex-wrap: nowrap;
}

.left-column {
display: inline-block;
width: 50%;
float: left;
}

.right-column {
display: inline-block;
width: 50%;
float: right;
}

.chart-left {
position: absolute;
border: none;
height: auto;
width: auto;
margin-top: 5px;
display: none;
}

button {
display: none !important;
}

.disclaimer {
display: none;
}
}

@media screen and (min-width: 1024px) {
Expand Down
29 changes: 24 additions & 5 deletions website/static/css/questions.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
.question-form-wrapper {
display: flex;
flex-direction: column;
min-height: 100vh;
justify-content: center;
align-items: center;
}

.single-question-form-wrapper {
display: flex;
flex-direction: column;
min-height: 100vh;
align-items: center;
}

form[method="post"] {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: 1fr 1fr 1fr;
padding: 0 10% 0 10%;
height: min-content;
}

#begin-screener {
Expand Down Expand Up @@ -62,7 +77,8 @@ div#right {
display: grid;
justify-content: center;
justify-items: center;
margin-bottom: 30px;
margin-bottom: 25px;
height: min-content;
}

.question-navigation .back-button {
Expand Down Expand Up @@ -94,9 +110,7 @@ li > label {
}

.meter {
height: 20px;
position: relative;
bottom: 10px;
height: 15px;
left: 1%;
background: #555;
border-radius: 25px;
Expand Down Expand Up @@ -197,6 +211,10 @@ li > label {
}

@media only screen and (max-width: 899px) {
.question-form-wrapper {
justify-content: flex-start;
}

.error-message {
margin: 0 0 .8em 0;
}
Expand Down Expand Up @@ -232,6 +250,7 @@ li > label {
.question-navigation {
grid-column: 1;
grid-row: 4;
margin-bottom: 10px;
}

fieldset {
Expand Down
12 changes: 6 additions & 6 deletions website/static/css/results.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
.diagnostic-message {
/* font-weight: bold; */
padding: 10px;
margin-bottom: 10px;
text-align: center;
background-color: #F3CFC6;
border-top: 1px solid black;
border-bottom: 1px solid black;
border-top: 2px solid black;
border-bottom: 2px solid black;
font-size: 1.1em;
}

Expand All @@ -16,8 +15,8 @@
.continue-message {
text-align: center;
background-color: #bfffb7;
border-top: 1px solid black;
border-bottom: 1px solid black;
border-top: 2px solid black;
border-bottom: 2px solid black;
margin: 10px auto 20px;
padding: 5px 5px 5px 5px;
font-size: 1.1em;
Expand Down Expand Up @@ -113,7 +112,8 @@
.result-navigation .print-button {
grid-row: 2;
grid-column: 1/3;
padding: 20px;
padding: 10px;
font-size: 1em;
}

.symptom-list {
Expand Down
1 change: 0 additions & 1 deletion website/templates/dsq/expem3.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends 'base.html' %}
{% block content %}
{% set instructions = True %}
{% set title = "Dead, heavy feeling after starting to exercise" %}
{% set fname = "heavyf" %}
{% set sname = "heavys" %}
Expand Down
47 changes: 24 additions & 23 deletions website/templates/dsq/viral.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
{% extends 'base.html' %}
{% block content %}
<form method="post" class="single-question">
<div class="question-header">
<h3 class="question-title">Do you experience frequent viral infections with prolonged
recovery periods?
</h3>
</div>
<div class="single-question-container">
<fieldset>
<legend>
Please select the choice that best fits your experience:
</legend>
<ol class="radio-button-list">
<li>
<input type="radio" id="f1" name="viral" value="1" />
<label for="f1">Yes</label>
</li>
<li>
<input type="radio" id="f0" name="viral" value="0" />
<label for="f0">No</label>
</li>
</ol>
</fieldset>
</div>
<div class="single-question-form-wrapper">
<form method="post" class="single-question">
<div class="question-header">
<h3 class="question-title">Do you experience frequent viral infections with prolonged
recovery periods?
</h3>
</div>
<div class="single-question-container">
<fieldset>
<legend>
Please select the choice that best fits your experience:
</legend>
<ol class="radio-button-list">
<li>
<input type="radio" id="f1" name="viral" value="1" />
<label for="f1">Yes</label>
</li>
<li>
<input type="radio" id="f0" name="viral" value="0" />
<label for="f0">No</label>
</li>
</ol>
</fieldset>
</div>
<!-- <form> element closes in /_f_s_question template -->
{% set single_question = True %}
{% set next_button_text = "Next" %}
Expand Down
Loading