Streamlit-AI-Letter-UI / backupapp.py
awacke1's picture
Create backupapp.py
e3284e4
import streamlit as st
# Set the page configuration to use the full width of the screen
st.set_page_config(layout="wide")
educationTopics = """
### Education Answers, Keywords and Ideal Answers to Common Questions
| Emoji | Question | Keywords | Ideal Answer |
|-------|----------|----------|--------------|
| 🦠 | **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) |
| 😷 | **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) |
| πŸ₯ | **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) |
| πŸ’‰ | **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) |
| 🍎 | **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) |
| πŸ’Š | **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) |
| πŸ‹οΈ | **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) |
| πŸ˜” | **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)) |
| πŸ’° | **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) |
| 🩺 | **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) |
"""
st.markdown(educationTopics)
GALMIO=("""
| πŸ₯ **Letter Type** | πŸ“ **Definition** | πŸ“‹ **Data Fields** |
|-----------------------|-----------------------------------------|-----------------------------|
| 1️⃣ Referral Letters | 🀝 Letters asking for more help or treatment | πŸ“„ Patient info, Referral details |
| 2️⃣ Medical Certificate Letters | πŸ’Ό Letters about a patient's health problem or limits | πŸ“„ Patient info, Health problem details |
| 3️⃣ Prescription Letters | πŸ’Š Letters allowing medicine | πŸ“„ Patient info, Medicine details |
| 4️⃣ Diagnosis Letters | πŸ”Ž Letters explaining a patient's health problem | πŸ“„ Patient info, Health problem details |
| 5️⃣ Treatment Plan Letters | πŸš‘ Letters with a plan for getting better | πŸ“„ Patient info, Treatment details |
| 6️⃣ Surgery Recommendation Letters | πŸ₯ Letters saying a patient needs surgery | πŸ“„ Patient info, Surgery details |
| 7️⃣ Medical Clearance Letters | πŸƒ Letters saying a patient can do activities | πŸ“„ Patient info, Activity details |
| 8️⃣ Follow-up Appointment Letters | πŸ“… Letters reminding about appointments | πŸ“„ Patient info, Appointment details |
| 9️⃣ Disability Support Letters | β™Ώ Letters about a patient's disability | πŸ“„ Patient info, Disability details |
| πŸ”Ÿ Health Education Letters | 🍎 Letters teaching about health | πŸ“„ Patient info, Education topic |
""")
RL="""
### 🀝 Referral Letters
| **Referral Letter** | πŸ“ **First** | πŸ“ **Middle** | πŸ“ **Last** |
|---------------------|------------------------------------|---------------------------------------|--------------------------------------|
| πŸ“¨ 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 πŸ—‚οΈ |
| | - 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 πŸ’Š |
"""
MCL="""
### πŸ“œ Medical Certificate Letters
| **Medical Certificate Letter** | πŸ“ **First** | πŸ“ **Middle** | πŸ“ **Last** |
|--------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
| πŸ“¨ 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 πŸš«πŸš— |
| | - 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 πŸ›‹οΈ |
"""
PL="""
### πŸ’Š Prescription Letters
| **Prescription Letter** | πŸ“ **First** | πŸ“ **Middle** | πŸ“ **Last** |
|-------------------------|------------------------------------|---------------------------------------|--------------------------------------|
| πŸ“¨ 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 🚫 |
| | - 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 🚫 |
"""
DL="""
### πŸ”¬ Diagnosis Letters
| **Diagnosis Letter** | πŸ“ **First** | πŸ“ **Middle** | πŸ“ **Last** |
|----------------------|------------------------------------|---------------------------------------|--------------------------------------|
| πŸ“¨ 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 πŸ“† |
| | - 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 πŸ‘©β€βš•οΈ |
"""
TPL="""
### 🩹 Treatment Plan Letters
| **Treatment Plan Letter** | πŸ“ **First** | πŸ“ **Middle** | πŸ“ **Last** |
|---------------------------|------------------------------------|---------------------------------------|--------------------------------------|
| πŸ“¨ 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 πŸ“† |
| | - 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 ☎️ |
"""
SRL="""
### πŸ₯ Surgery Recommendation Letters
| **Surgery Recommendation Letter** | πŸ“ **First** | πŸ“ **Middle** | πŸ“ **Last** |
|-----------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
| πŸ“¨ 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 πŸš«βš•οΈ |
| | - Recommend an angiography for Mrs. Taylor πŸ’“ | - Mrs. Taylor needs angiography to locate any arterial blockages 🩺 | - Provide details on necessary pre and post-hospitalization guidance πŸ₯ |
"""
MCL2="""
### πŸƒβ€β™‚οΈ Medical Clearance Letters
| **Medical Clearance Letters** | πŸ“ **First** | πŸ“ **Middle** | πŸ“ **Last** |
|-------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
| πŸ“¨ 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 πŸ“ˆ |
| | - 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 🚫❀️ |
"""
FAL="""
### πŸ“… Follow-up Appointment Letters
| **Follow-up Appointment Letters** | πŸ“ **First** | πŸ“ **Middle** | πŸ“ **Last** |
|-----------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
| πŸ“¨ 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 ☎️ |
| | - 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 βœ‰οΈ |
"""
DSL="""
### β™Ώ Disability Support Letters
| **Disability Support Letters** | πŸ“ **First** | πŸ“ **Middle** | πŸ“ **Last** |
|--------------------------------|------------------------------------|---------------------------------------|--------------------------------------|
| πŸ“¨ 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 πŸ› οΈ |
| | - 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 πŸ“ |
"""
HEL="""
### 🍎 Health Education Letters
| **Health Education Letters** | πŸ“ **First** | πŸ“ **Middle** | πŸ“ **Last** |
|------------------------------|---------------------------------|------------------------------------|-----------------------------------|
| 🍎 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 πŸ“š |
| | - 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 πŸ—“οΈ |
"""
def generate_letter_menu_ui():
st.markdown("""## Generative AI Letters for Managing Information Overload (GAL-MIO) - πŸ₯ Letter Type Selection""")
# Define the letter types and their corresponding markdown sections
letter_types = {
"1️⃣ Referral Letters": RL,
"2️⃣ Medical Certificate Letters": MCL,
"3️⃣ Prescription Letters": PL,
"4️⃣ Diagnosis Letters": DL,
"5️⃣ Treatment Plan Letters": TPL,
"6️⃣ Surgery Recommendation Letters": SRL,
"7️⃣ Medical Clearance Letters": MCL2,
"8️⃣ Follow-up Appointment Letters": FAL,
"9️⃣ Disability Support Letters": DSL,
"πŸ”Ÿ Health Education Letters": HEL
}
# Create buttons for each letter type
for letter_type, section in letter_types.items():
if st.button(letter_type):
# Display the selected section of the markdown content
st.markdown(section, unsafe_allow_html=True)
# Run the Streamlit UI function
generate_letter_menu_ui()
st.markdown(GALMIO)