Spaces:
Runtime error
Runtime error
Create backupapp.py
Browse files- backupapp.py +150 -0
backupapp.py
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
# Set the page configuration to use the full width of the screen
|
4 |
+
st.set_page_config(layout="wide")
|
5 |
+
|
6 |
+
educationTopics = """
|
7 |
+
|
8 |
+
### Education Answers, Keywords and Ideal Answers to Common Questions
|
9 |
+
|
10 |
+
| Emoji | Question | Keywords | Ideal Answer |
|
11 |
+
|-------|----------|----------|--------------|
|
12 |
+
| π¦ | **Concerns about COVID-19 vaccines and boosters** | Covid, vaccines, boosters | Covid vaccines are developed to protect against the virus. Boosters are given to maintain and enhance protection. [Read More](https://en.wikipedia.org/wiki/COVID-19_vaccine) |
|
13 |
+
| π· | **Concerns about COVID-19 exposure and precautions** | Covid, exposure, precautions | If you were exposed to Covid-19, follow the guidelines for testing and isolation. [Read More](https://en.wikipedia.org/wiki/COVID-19_pandemic) |
|
14 |
+
| π₯ | **Queries about specific medical conditions (e.g., scabies, temporal arteritis, hypertension, nonspecific chest pain, etc.)** | Medical conditions, scabies, temporal arteritis, hypertension, chest pain | Medical conditions vary greatly in symptoms and treatment. Always consult with your healthcare provider for advice. [Read More](https://en.wikipedia.org/wiki/List_of_medical_conditions) |
|
15 |
+
| π | **Questions about shingles and other vaccines** | Shingles, vaccines | Vaccines are key in preventing serious diseases like shingles. Typically, shingles vaccine is given in two doses. [Read More](https://en.wikipedia.org/wiki/Shingles_vaccine) |
|
16 |
+
| π | **Inquiries about diet, e.g. low sodium for blood pressure issues** | Diet, low sodium, blood pressure | A low-sodium diet can help manage blood pressure. Include plenty of fruits, vegetables, lean proteins, and whole grains. [Read More](https://en.wikipedia.org/wiki/Low-sodium_diet) |
|
17 |
+
| π | **Questions about medication safety and interactions** | Medication, safety, interactions | Safety and interactions of medications can vary. Always consult your healthcare provider or pharmacist. [Read More](https://en.wikipedia.org/wiki/Drug_interaction) |
|
18 |
+
| ποΈ | **Inquiries about physical therapy coverage** | Physical therapy, coverage | Physical therapy coverage varies by health plan. It is commonly covered for many conditions. [Read More](https://en.wikipedia.org/wiki/Physical_therapy) |
|
19 |
+
| π | **Depression screening and mental health concerns** | Depression, mental health | Depression is a serious condition, but help is available. If you are feeling depressed, reach out to a healthcare provider. [Read More](https://en.wikipedia.org/wiki/Depression_(mood)) |
|
20 |
+
| π° | **Questions about healthcare costs and assistance** | Healthcare, costs, assistance | Many resources are available to help with healthcare costs, including medication copays and other expenses. [Read More](https://en.wikipedia.org/wiki/Health_care_finance_in_the_United_States) |
|
21 |
+
| π©Ί | **General health inquiries (e.g., seeking care for hemorrhoids, flu shot timing, etc.)** | Health, hemorrhoids, flu shot | For general health inquiries, your primary care physician is often the best place to start. [Read More](https://en.wikipedia.org/wiki/Health_care) |
|
22 |
+
|
23 |
+
"""
|
24 |
+
st.markdown(educationTopics)
|
25 |
+
|
26 |
+
GALMIO=("""
|
27 |
+
| π₯ **Letter Type** | π **Definition** | π **Data Fields** |
|
28 |
+
|-----------------------|-----------------------------------------|-----------------------------|
|
29 |
+
| 1οΈβ£ Referral Letters | π€ Letters asking for more help or treatment | π Patient info, Referral details |
|
30 |
+
| 2οΈβ£ Medical Certificate Letters | πΌ Letters about a patient's health problem or limits | π Patient info, Health problem details |
|
31 |
+
| 3οΈβ£ Prescription Letters | π Letters allowing medicine | π Patient info, Medicine details |
|
32 |
+
| 4οΈβ£ Diagnosis Letters | π Letters explaining a patient's health problem | π Patient info, Health problem details |
|
33 |
+
| 5οΈβ£ Treatment Plan Letters | π Letters with a plan for getting better | π Patient info, Treatment details |
|
34 |
+
| 6οΈβ£ Surgery Recommendation Letters | π₯ Letters saying a patient needs surgery | π Patient info, Surgery details |
|
35 |
+
| 7οΈβ£ Medical Clearance Letters | π Letters saying a patient can do activities | π Patient info, Activity details |
|
36 |
+
| 8οΈβ£ Follow-up Appointment Letters | π
Letters reminding about appointments | π Patient info, Appointment details |
|
37 |
+
| 9οΈβ£ Disability Support Letters | βΏ Letters about a patient's disability | π Patient info, Disability details |
|
38 |
+
| π Health Education Letters | π Letters teaching about health | π Patient info, Education topic |
|
39 |
+
""")
|
40 |
+
|
41 |
+
RL="""
|
42 |
+
### π€ Referral Letters
|
43 |
+
| **Referral Letter** | π **First** | π **Middle** | π **Last** |
|
44 |
+
|---------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
45 |
+
| π¨ State the request for consultation/treatment | - Urgent need for further diagnostic testing for Mrs. Smith, who has persistent stomach issues π€’ | - The patient has symptoms that suggest a more comprehensive review is required π | - Patient demographics, Referral details ποΈ |
|
46 |
+
| | - Request for an audiological assessment for Mr. Johnson, aged 60 π | - The patient's issue requires specialized care beyond the scope of the referring physician π©ββοΈ | - Diagnostic test reports, Medication details π |
|
47 |
+
"""
|
48 |
+
|
49 |
+
MCL="""
|
50 |
+
### π Medical Certificate Letters
|
51 |
+
| **Medical Certificate Letter** | π **First** | π **Middle** | π **Last** |
|
52 |
+
|--------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
53 |
+
| π¨ State the reason for certification | - To certify Mr. Brown's condition and advise on work restrictions πΌ | - Mr. Brown has suffered from a heart attack and is under medication ππ | - No driving should be allowed for 6 months π«π |
|
54 |
+
| | - To certify Ms. Lee's health status for her impending travel βοΈ | - Ms. Lee has a chronic back pain condition that requires special accommodations during her travel πΆββοΈ | - Ms. Lee must have an aisle seat and use cushions for lumbar support ποΈ |
|
55 |
+
"""
|
56 |
+
|
57 |
+
PL="""
|
58 |
+
### π Prescription Letters
|
59 |
+
| **Prescription Letter** | π **First** | π **Middle** | π **Last** |
|
60 |
+
|-------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
61 |
+
| π¨ Introduce prescription request | - Request for prescription for Mr. Clarke π | - Mr. Clarke requires medication for hypertension - Lisinopril 10mg BD with food π©Ί | - Medication details, allergies and any known side effects π« |
|
62 |
+
| | - Prescription authorization for Mrs. Davis π | - Mrs. Davis is required to take two 500mg penicillin V tablets every 6 hours π©Ί | - Medication details, allergies and any known side effects π« |
|
63 |
+
"""
|
64 |
+
|
65 |
+
DL="""
|
66 |
+
### π¬ Diagnosis Letters
|
67 |
+
|
68 |
+
| **Diagnosis Letter** | π **First** | π **Middle** | π **Last** |
|
69 |
+
|----------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
70 |
+
| π¨ State the diagnosis | - The results of Mr. Thompson's chest x-ray reveal Pneumonia π· | - Mr. Thompson has a bacterial infection that requires antibiotic treatment π | - Recommend follow-up visits for monitoring and periodic testing π |
|
71 |
+
| | - The blood test results indicate that Mrs. Jones has Type 2 diabetes π©Έ | - Mrs. Jones has a lifelong condition that requires medication, dietary adjustments, and lifestyle changes π½οΈπββοΈ | - Refer patients to the relevant healthcare specialist π©ββοΈ |
|
72 |
+
"""
|
73 |
+
|
74 |
+
TPL="""
|
75 |
+
### π©Ή Treatment Plan Letters
|
76 |
+
| **Treatment Plan Letter** | π **First** | π **Middle** | π **Last** |
|
77 |
+
|---------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
78 |
+
| π¨ Introduce treatment plan | - Outline treatment and testing plan for Mr. Smith π | - Mr. Smith's treatment will involve IV medication and chest x-ray ππΈ | - Recommend follow-up visits for monitoring and periodic testing π |
|
79 |
+
| | - Suggest handling chronic asthma for Mrs. White π | - Mrs. White's asthma management plan requires frequent use of recommended inhaler and daily monitoring π¬οΈπ | - Provide contact information in case of any emergencies βοΈ |
|
80 |
+
"""
|
81 |
+
|
82 |
+
SRL="""
|
83 |
+
### π₯ Surgery Recommendation Letters
|
84 |
+
| **Surgery Recommendation Letter** | π **First** | π **Middle** | π **Last** |
|
85 |
+
|-----------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
86 |
+
| π¨ Introduce surgical procedure | - Recommend endoscopy procedure for Mr. Baker π¬ | - Mr. Baker needs endoscopy for the diagnosis of GI tract abnormalities π« | - Suggest to take extra measures regarding allergies or post-procedural appointments π«βοΈ |
|
87 |
+
| | - Recommend an angiography for Mrs. Taylor π | - Mrs. Taylor needs angiography to locate any arterial blockages π©Ί | - Provide details on necessary pre and post-hospitalization guidance π₯ |
|
88 |
+
"""
|
89 |
+
|
90 |
+
MCL2="""
|
91 |
+
### πββοΈ Medical Clearance Letters
|
92 |
+
| **Medical Clearance Letters** | π **First** | π **Middle** | π **Last** |
|
93 |
+
|-------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
94 |
+
| π¨ State clearance conditions | - Allow Mrs. Anderson to safely participate in a marathon πββοΈ | - The patient has been tested and has no chronic medical conditions or injuries π«π©Ί | - Encourage gradual progression and cautious approach to intense activity π |
|
95 |
+
| | - Clear Mr. White to begin strength training πͺ | - The patient's prior conditions are monitored, and it is advised to begin any physical activity or routine ποΈββοΈ | - List exercises that should be avoided, for instance, weightlifting for an individual with a heart condition π«β€οΈ |
|
96 |
+
"""
|
97 |
+
|
98 |
+
FAL="""
|
99 |
+
### π
Follow-up Appointment Letters
|
100 |
+
| **Follow-up Appointment Letters** | π **First** | π **Middle** | π **Last** |
|
101 |
+
|-----------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
102 |
+
| π¨ Remind of the appointment | - This is a reminder for Mrs. Rodriguez's appointment on Friday, 17th September, at 11:00 am π | - Review the date, time, and location of appointment π | - Provide contact information and phone numbers in case of schedule change or emergency βοΈ |
|
103 |
+
| | - This letter is to confirm Mr. Johnson's appointment on Monday, 20th September, at 1:00 pm π | - Detail any necessary preparations for the appointment βοΈ | - Encourage to reach out if an appointment must be canceled, or if there are any questions or concerns βοΈ |
|
104 |
+
"""
|
105 |
+
|
106 |
+
DSL="""
|
107 |
+
### βΏ Disability Support Letters
|
108 |
+
| **Disability Support Letters** | π **First** | π **Middle** | π **Last** |
|
109 |
+
|--------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
110 |
+
| π¨ State the purpose of the letter | - The purpose of this letter is to validate Mr. Williams' disability so that he can receive disability benefits βΏ | - Detail the patient's physical or cognitive condition and how it affects their daily life π§ | - Outline the assistive equipment or technology necessary for the patient π οΈ |
|
111 |
+
| | - The purpose of this letter is to document Ms. Radcliff's disability to request special accommodations at work βΏ | - Explain the cause of the patient's condition and duration of symptoms β³ | - Describe the special consideration or modifications required π |
|
112 |
+
"""
|
113 |
+
|
114 |
+
HEL="""
|
115 |
+
### π Health Education Letters
|
116 |
+
| **Health Education Letters** | π **First** | π **Middle** | π **Last** |
|
117 |
+
|------------------------------|---------------------------------|------------------------------------|-----------------------------------|
|
118 |
+
| π Introduce the health education topic | - This letter is to provide Ms. Prince with information on healthy eating habits π₯ | - Outline the benefits of specific health practices for overall health π | - Provide handouts, online resources, or any relevant materials to supplement the information π |
|
119 |
+
| | - This letter offers suggestions for stress management to Mr. Martin π | - Detail steps that can be taken to manage specific health conditions properly πΆββοΈ | - Encourage patients to schedule follow-up appointments to discuss any questions or concerns ποΈ |
|
120 |
+
"""
|
121 |
+
|
122 |
+
def generate_letter_menu_ui():
|
123 |
+
|
124 |
+
st.markdown("""## Generative AI Letters for Managing Information Overload (GAL-MIO) - π₯ Letter Type Selection""")
|
125 |
+
|
126 |
+
# Define the letter types and their corresponding markdown sections
|
127 |
+
letter_types = {
|
128 |
+
"1οΈβ£ Referral Letters": RL,
|
129 |
+
"2οΈβ£ Medical Certificate Letters": MCL,
|
130 |
+
"3οΈβ£ Prescription Letters": PL,
|
131 |
+
"4οΈβ£ Diagnosis Letters": DL,
|
132 |
+
"5οΈβ£ Treatment Plan Letters": TPL,
|
133 |
+
"6οΈβ£ Surgery Recommendation Letters": SRL,
|
134 |
+
"7οΈβ£ Medical Clearance Letters": MCL2,
|
135 |
+
"8οΈβ£ Follow-up Appointment Letters": FAL,
|
136 |
+
"9οΈβ£ Disability Support Letters": DSL,
|
137 |
+
"π Health Education Letters": HEL
|
138 |
+
}
|
139 |
+
|
140 |
+
# Create buttons for each letter type
|
141 |
+
for letter_type, section in letter_types.items():
|
142 |
+
if st.button(letter_type):
|
143 |
+
# Display the selected section of the markdown content
|
144 |
+
st.markdown(section, unsafe_allow_html=True)
|
145 |
+
|
146 |
+
# Run the Streamlit UI function
|
147 |
+
generate_letter_menu_ui()
|
148 |
+
|
149 |
+
st.markdown(GALMIO)
|
150 |
+
|