awacke1 commited on
Commit
91273a0
Β·
1 Parent(s): fc88306

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -32
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": "### 🀝 Referral Letters",
123
- "2️⃣ Medical Certificate Letters": "### πŸ“œ Medical Certificate Letters",
124
- "3️⃣ Prescription Letters": "### πŸ’Š Prescription Letters",
125
- "4️⃣ Diagnosis Letters": "### πŸ”¬ Diagnosis Letters",
126
- "5️⃣ Treatment Plan Letters": "### 🩹 Treatment Plan Letters",
127
- "6️⃣ Surgery Recommendation Letters": "### πŸ₯ Surgery Recommendation Letters",
128
- "7️⃣ Medical Clearance Letters": "### πŸƒβ€β™‚οΈ Medical Clearance Letters",
129
- "8️⃣ Follow-up Appointment Letters": "### πŸ“… Follow-up Appointment Letters",
130
- "9️⃣ Disability Support Letters": "### β™Ώ Disability Support Letters",
131
- "πŸ”Ÿ Health Education Letters": "### 🍎 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