Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -20,98 +20,100 @@ st.markdown("""
|
|
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 |
### π€ Referral Letters
|
25 |
|
26 |
| **Referral Letter** | π **First** | π **Middle** | π **Last** |
|
27 |
|---------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
28 |
| π¨ 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 |
| | - 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 π |
|
|
|
30 |
|
|
|
31 |
### π Medical Certificate Letters
|
32 |
|
33 |
| **Medical Certificate Letter** | π **First** | π **Middle** | π **Last** |
|
34 |
|--------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
35 |
| π¨ 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 π«π |
|
36 |
| | - 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 ποΈ |
|
|
|
37 |
|
38 |
-
|
39 |
### π Prescription Letters
|
40 |
|
41 |
| **Prescription Letter** | π **First** | π **Middle** | π **Last** |
|
42 |
|-------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
43 |
| π¨ 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 π« |
|
44 |
| | - 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 π« |
|
|
|
45 |
|
46 |
-
|
47 |
### π¬ Diagnosis Letters
|
48 |
|
49 |
| **Diagnosis Letter** | π **First** | π **Middle** | π **Last** |
|
50 |
|----------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
51 |
| π¨ 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 π |
|
52 |
| | - 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 π©ββοΈ |
|
|
|
53 |
|
54 |
-
|
55 |
### π©Ή Treatment Plan Letters
|
56 |
|
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 π |
|
60 |
| | - 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 βοΈ |
|
|
|
61 |
|
62 |
-
|
63 |
### π₯ Surgery Recommendation Letters
|
64 |
|
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 π«βοΈ |
|
68 |
| | - Recommend an angiography for Mrs. Taylor π | - Mrs. Taylor needs angiography to locate any arterial blockages π©Ί | - Provide details on necessary pre and post-hospitalization guidance π₯ |
|
|
|
69 |
|
70 |
-
|
71 |
-
### π€ Referral Letters
|
72 |
-
|
73 |
-
| **Referral Letter** | π **First** | π **Middle** | π **Last** |
|
74 |
-
|---------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
75 |
-
| π¨ 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 ποΈ |
|
76 |
-
| | - 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 π |
|
77 |
-
|
78 |
-
|
79 |
### πββοΈ Medical Clearance Letters
|
80 |
|
81 |
| **Medical Clearance Letters** | π **First** | π **Middle** | π **Last** |
|
82 |
|-------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
83 |
| π¨ 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 π |
|
84 |
| | - 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 π«β€οΈ |
|
|
|
85 |
|
86 |
-
|
87 |
### π
Follow-up Appointment Letters
|
88 |
|
89 |
| **Follow-up Appointment Letters** | π **First** | π **Middle** | π **Last** |
|
90 |
|-----------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
91 |
| π¨ 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 βοΈ |
|
92 |
| | - 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 βοΈ |
|
|
|
93 |
|
|
|
94 |
### βΏ Disability Support Letters
|
95 |
|
96 |
| **Disability Support Letters** | π **First** | π **Middle** | π **Last** |
|
97 |
|--------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
98 |
| π¨ 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 π οΈ |
|
99 |
| | - 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 π |
|
|
|
100 |
|
101 |
-
|
102 |
### π Health Education Letters
|
103 |
|
104 |
| **Health Education Letters** | π **First** | π **Middle** | π **Last** |
|
105 |
|------------------------------|---------------------------------|------------------------------------|-----------------------------------|
|
106 |
| π 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 π |
|
107 |
| | - 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 ποΈ |
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
""")
|
113 |
-
|
114 |
-
|
115 |
|
116 |
|
117 |
def generate_letter_menu_ui():
|
@@ -119,16 +121,16 @@ def generate_letter_menu_ui():
|
|
119 |
|
120 |
# Define the letter types and their corresponding markdown sections
|
121 |
letter_types = {
|
122 |
-
"1οΈβ£ Referral Letters":
|
123 |
-
"2οΈβ£ Medical Certificate Letters":
|
124 |
-
"3οΈβ£ Prescription Letters":
|
125 |
-
"4οΈβ£ Diagnosis Letters":
|
126 |
-
"5οΈβ£ Treatment Plan Letters":
|
127 |
-
"6οΈβ£ Surgery Recommendation Letters":
|
128 |
-
"7οΈβ£ Medical Clearance Letters":
|
129 |
-
"8οΈβ£ Follow-up Appointment Letters":
|
130 |
-
"9οΈβ£ Disability Support Letters":
|
131 |
-
"π Health Education Letters":
|
132 |
}
|
133 |
|
134 |
# Create buttons for each letter type
|
|
|
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 ποΈ |
|
34 |
| | - 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 π |
|
35 |
+
"""
|
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 π«π |
|
43 |
| | - 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 ποΈ |
|
44 |
+
"""
|
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 π« |
|
52 |
| | - 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 π« |
|
53 |
+
"""
|
54 |
|
55 |
+
DL="""
|
56 |
### π¬ Diagnosis Letters
|
57 |
|
58 |
| **Diagnosis Letter** | π **First** | π **Middle** | π **Last** |
|
59 |
|----------------------|------------------------------------|---------------------------------------|--------------------------------------|
|
60 |
| π¨ 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 π |
|
61 |
| | - 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 π©ββοΈ |
|
62 |
+
"""
|
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 π |
|
70 |
| | - 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 βοΈ |
|
71 |
+
"""
|
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 π«βοΈ |
|
79 |
| | - Recommend an angiography for Mrs. Taylor π | - Mrs. Taylor needs angiography to locate any arterial blockages π©Ί | - Provide details on necessary pre and post-hospitalization guidance π₯ |
|
80 |
+
"""
|
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 π |
|
88 |
| | - 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 π«β€οΈ |
|
89 |
+
"""
|
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 βοΈ |
|
97 |
| | - 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 βοΈ |
|
98 |
+
"""
|
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 π οΈ |
|
106 |
| | - 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 π |
|
107 |
+
"""
|
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():
|
|
|
121 |
|
122 |
# Define the letter types and their corresponding markdown sections
|
123 |
letter_types = {
|
124 |
+
"1οΈβ£ Referral Letters": RL,
|
125 |
+
"2οΈβ£ Medical Certificate Letters": MCL,
|
126 |
+
"3οΈβ£ Prescription Letters": PL,
|
127 |
+
"4οΈβ£ Diagnosis Letters": DL,
|
128 |
+
"5οΈβ£ Treatment Plan Letters": TPL,
|
129 |
+
"6οΈβ£ Surgery Recommendation Letters": SRL,
|
130 |
+
"7οΈβ£ Medical Clearance Letters": MCL,
|
131 |
+
"8οΈβ£ Follow-up Appointment Letters": FAL,
|
132 |
+
"9οΈβ£ Disability Support Letters": DSL,
|
133 |
+
"π Health Education Letters": HEL
|
134 |
}
|
135 |
|
136 |
# Create buttons for each letter type
|