Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,6 +31,24 @@ def download_data(data):
|
|
31 |
href = f'<a href="data:file/csv;base64,{base64.b64encode(csv.encode()).decode()}" download="health_conditions.csv">Download CSV file</a>'
|
32 |
return href
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
# Define main function
|
35 |
def main():
|
36 |
st.title("Health Condition Costs Visualization")
|
@@ -61,5 +79,14 @@ def main():
|
|
61 |
update_data(data)
|
62 |
st.markdown(download_data(data), unsafe_allow_html=True)
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
if __name__ == "__main__":
|
65 |
main()
|
|
|
31 |
href = f'<a href="data:file/csv;base64,{base64.b64encode(csv.encode()).decode()}" download="health_conditions.csv">Download CSV file</a>'
|
32 |
return href
|
33 |
|
34 |
+
def create_phq9_questions():
|
35 |
+
questions = [
|
36 |
+
{"question": "Little interest or pleasure in doing things", "icd10": "F32.1"},
|
37 |
+
{"question": "Feeling down, depressed, or hopeless", "icd10": "F32.1"},
|
38 |
+
{"question": "Trouble falling or staying asleep, or sleeping too much", "icd10": "F32.1"},
|
39 |
+
{"question": "Feeling tired or having little energy", "icd10": "F32.1"},
|
40 |
+
{"question": "Poor appetite or overeating", "icd10": "F32.1"},
|
41 |
+
{"question": "Feeling bad about yourself — or that you are a failure or have let yourself or your family down", "icd10": "F32.1"},
|
42 |
+
{"question": "Trouble concentrating on things, such as reading the newspaper or watching television", "icd10": "F32.1"},
|
43 |
+
{"question": "Moving or speaking so slowly that other people could have noticed? Or the opposite — being so fidgety or restless that you have been moving around a lot more than usual", "icd10": "F32.1"},
|
44 |
+
{"question": "Thoughts that you would be better off dead or of hurting yourself in some way", "icd10": "F32.1"}
|
45 |
+
]
|
46 |
+
return questions
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
|
52 |
# Define main function
|
53 |
def main():
|
54 |
st.title("Health Condition Costs Visualization")
|
|
|
79 |
update_data(data)
|
80 |
st.markdown(download_data(data), unsafe_allow_html=True)
|
81 |
|
82 |
+
|
83 |
+
# Get the PHQ9 questions
|
84 |
+
questions = create_phq9_questions()
|
85 |
+
|
86 |
+
# Display each question and an input text field for the answer
|
87 |
+
for question in questions:
|
88 |
+
st.markdown(question["question"])
|
89 |
+
answer = st.text_input("Your Answer:")
|
90 |
+
|
91 |
if __name__ == "__main__":
|
92 |
main()
|