Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,11 +2,9 @@ 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 |
-
st.markdown("""
|
6 |
-
|
7 |
-
|
8 |
-
## Content for Letter Generator AI UI UX
|
9 |
|
|
|
|
|
10 |
| π₯ **Letter Type** | π **Definition** | π **Fields Usually Needed** |
|
11 |
|-----------------------|-----------------------------------------|-----------------------------|
|
12 |
| 1οΈβ£ Referral Letters | π€ Letters asking for more help or treatment | π Patient info, Referral details |
|
@@ -19,15 +17,10 @@ st.markdown("""
|
|
19 |
| 8οΈβ£ Follow-up Appointment Letters | π
Letters reminding about appointments | π Patient info, Appointment details |
|
20 |
| 9οΈβ£ Disability Support Letters | βΏ Letters about a patient's disability | π Patient info, Disability details |
|
21 |
| π Health Education Letters | π Letters teaching about health | π Patient info, Education topic |
|
22 |
-
|
23 |
""")
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
RL="""
|
29 |
### π€ Referral Letters
|
30 |
-
|
31 |
| **Referral Letter** | π **First** | π **Middle** | π **Last** |
|
32 |
|---------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
33 |
| π¨ 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 ποΈ |
|
@@ -36,7 +29,6 @@ RL="""
|
|
36 |
|
37 |
MCL="""
|
38 |
### π Medical Certificate Letters
|
39 |
-
|
40 |
| **Medical Certificate Letter** | π **First** | π **Middle** | π **Last** |
|
41 |
|--------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
42 |
| π¨ 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 π«π |
|
@@ -45,7 +37,6 @@ MCL="""
|
|
45 |
|
46 |
PL="""
|
47 |
### π Prescription Letters
|
48 |
-
|
49 |
| **Prescription Letter** | π **First** | π **Middle** | π **Last** |
|
50 |
|-------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
51 |
| π¨ 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 π« |
|
@@ -63,7 +54,6 @@ DL="""
|
|
63 |
|
64 |
TPL="""
|
65 |
### π©Ή Treatment Plan Letters
|
66 |
-
|
67 |
| **Treatment Plan Letter** | π **First** | π **Middle** | π **Last** |
|
68 |
|---------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
69 |
| π¨ 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 π |
|
@@ -72,7 +62,6 @@ TPL="""
|
|
72 |
|
73 |
SRL="""
|
74 |
### π₯ Surgery Recommendation Letters
|
75 |
-
|
76 |
| **Surgery Recommendation Letter** | π **First** | π **Middle** | π **Last** |
|
77 |
|-----------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
78 |
| π¨ 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 π«βοΈ |
|
@@ -81,7 +70,6 @@ SRL="""
|
|
81 |
|
82 |
MCL="""
|
83 |
### πββοΈ Medical Clearance Letters
|
84 |
-
|
85 |
| **Medical Clearance Letters** | π **First** | π **Middle** | π **Last** |
|
86 |
|-------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
87 |
| π¨ 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 π |
|
@@ -90,7 +78,6 @@ MCL="""
|
|
90 |
|
91 |
FAL="""
|
92 |
### π
Follow-up Appointment Letters
|
93 |
-
|
94 |
| **Follow-up Appointment Letters** | π **First** | π **Middle** | π **Last** |
|
95 |
|-----------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
96 |
| π¨ 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 βοΈ |
|
@@ -99,7 +86,6 @@ FAL="""
|
|
99 |
|
100 |
DSL="""
|
101 |
### βΏ Disability Support Letters
|
102 |
-
|
103 |
| **Disability Support Letters** | π **First** | π **Middle** | π **Last** |
|
104 |
|--------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
105 |
| π¨ 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 π οΈ |
|
@@ -108,14 +94,12 @@ DSL="""
|
|
108 |
|
109 |
HEL="""
|
110 |
### π Health Education Letters
|
111 |
-
|
112 |
| **Health Education Letters** | π **First** | π **Middle** | π **Last** |
|
113 |
|------------------------------|---------------------------------|------------------------------------|-----------------------------------|
|
114 |
| π 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 π |
|
115 |
| | - 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 ποΈ |
|
116 |
"""
|
117 |
|
118 |
-
|
119 |
def generate_letter_menu_ui():
|
120 |
st.title("π₯ Letter Type Selection")
|
121 |
|
|
|
2 |
|
3 |
# Set the page configuration to use the full width of the screen
|
4 |
st.set_page_config(layout="wide")
|
|
|
|
|
|
|
|
|
5 |
|
6 |
+
st.markdown("""
|
7 |
+
## Generative AI for Letters - Managing Information Overload (GAL-MIO)
|
8 |
| π₯ **Letter Type** | π **Definition** | π **Fields Usually Needed** |
|
9 |
|-----------------------|-----------------------------------------|-----------------------------|
|
10 |
| 1οΈβ£ Referral Letters | π€ Letters asking for more help or treatment | π Patient info, Referral details |
|
|
|
17 |
| 8οΈβ£ Follow-up Appointment Letters | π
Letters reminding about appointments | π Patient info, Appointment details |
|
18 |
| 9οΈβ£ Disability Support Letters | βΏ Letters about a patient's disability | π Patient info, Disability details |
|
19 |
| π Health Education Letters | π Letters teaching about health | π Patient info, Education topic |
|
|
|
20 |
""")
|
21 |
|
|
|
|
|
|
|
22 |
RL="""
|
23 |
### π€ Referral Letters
|
|
|
24 |
| **Referral Letter** | π **First** | π **Middle** | π **Last** |
|
25 |
|---------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
26 |
| π¨ 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 ποΈ |
|
|
|
29 |
|
30 |
MCL="""
|
31 |
### π Medical Certificate Letters
|
|
|
32 |
| **Medical Certificate Letter** | π **First** | π **Middle** | π **Last** |
|
33 |
|--------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
34 |
| π¨ 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 π«π |
|
|
|
37 |
|
38 |
PL="""
|
39 |
### π Prescription Letters
|
|
|
40 |
| **Prescription Letter** | π **First** | π **Middle** | π **Last** |
|
41 |
|-------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
42 |
| π¨ 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 π« |
|
|
|
54 |
|
55 |
TPL="""
|
56 |
### π©Ή Treatment Plan Letters
|
|
|
57 |
| **Treatment Plan Letter** | π **First** | π **Middle** | π **Last** |
|
58 |
|---------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
59 |
| π¨ 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 π |
|
|
|
62 |
|
63 |
SRL="""
|
64 |
### π₯ Surgery Recommendation Letters
|
|
|
65 |
| **Surgery Recommendation Letter** | π **First** | π **Middle** | π **Last** |
|
66 |
|-----------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
67 |
| π¨ 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 π«βοΈ |
|
|
|
70 |
|
71 |
MCL="""
|
72 |
### πββοΈ Medical Clearance Letters
|
|
|
73 |
| **Medical Clearance Letters** | π **First** | π **Middle** | π **Last** |
|
74 |
|-------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
75 |
| π¨ 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 π |
|
|
|
78 |
|
79 |
FAL="""
|
80 |
### π
Follow-up Appointment Letters
|
|
|
81 |
| **Follow-up Appointment Letters** | π **First** | π **Middle** | π **Last** |
|
82 |
|-----------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
83 |
| π¨ 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 βοΈ |
|
|
|
86 |
|
87 |
DSL="""
|
88 |
### βΏ Disability Support Letters
|
|
|
89 |
| **Disability Support Letters** | π **First** | π **Middle** | π **Last** |
|
90 |
|--------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
91 |
| π¨ 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 π οΈ |
|
|
|
94 |
|
95 |
HEL="""
|
96 |
### π Health Education Letters
|
|
|
97 |
| **Health Education Letters** | π **First** | π **Middle** | π **Last** |
|
98 |
|------------------------------|---------------------------------|------------------------------------|-----------------------------------|
|
99 |
| π 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 π |
|
100 |
| | - 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 ποΈ |
|
101 |
"""
|
102 |
|
|
|
103 |
def generate_letter_menu_ui():
|
104 |
st.title("π₯ Letter Type Selection")
|
105 |
|