Spaces:
Runtime error
Runtime error
import streamlit as st | |
# Set the page configuration to use the full width of the screen | |
st.set_page_config(layout="wide") | |
CODELICENSING = (""" | |
1. π Simplified Synopsis | |
* π Ideal Open Source Code Copyright License | |
* βοΈ Navigating Copyright Infringement and Licensing Disagreements | |
2. π₯ Alternative Healthcare Terminology Options | |
1. π International Classification of Diseases (ICD) | |
* π’ Managed by the World Health Organization (WHO) | |
2. π Systematized Nomenclature of Medicine - Clinical Terms (SNOMED CT) | |
* π’ Managed by SNOMED International | |
3. π¬ Logical Observation Identifiers Names and Codes (LOINC) | |
* π’ Managed by the Regenstrief Institute | |
3. π Resources | |
* π AMA, WHO, SNOMED International, and Regenstrief Institute Websites | |
* π Legal Journals | |
* π Wikipedia (verify information with primary and authoritative sources) | |
4. π‘ Recommendation | |
* π Consult Legal Professionals | |
* π₯ Consult Healthcare Organizations | |
* π Consult Authoritative Sources for Comprehensive and Current Information | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Open Source Medical Software Resources</title> | |
</head> | |
<body> | |
<h1>Open Source Medical Software Resources</h1> | |
<ul> | |
<li><a href="https://en.wikipedia.org/wiki/World_Health_Organization" target="_blank">World Health Organization (WHO)</a></li> | |
<li><a href="https://en.wikipedia.org/wiki/International_Classification_of_Diseases" target="_blank">International Classification of Diseases (ICD)</a></li> | |
<li><a href="https://en.wikipedia.org/wiki/SNOMED_CT" target="_blank">Systematized Nomenclature of Medicine - Clinical Terms (SNOMED CT)</a></li> | |
<li><a href="https://en.wikipedia.org/wiki/LOINC" target="_blank">Logical Observation Identifiers Names and Codes (LOINC)</a></li> | |
<li><a href="https://en.wikipedia.org/wiki/Regenstrief_Institute" target="_blank">Regenstrief Institute</a></li> | |
</ul> | |
<h2>Sample License File</h2> | |
<pre> | |
MIT License | |
Copyright (c) 2023 Aaron Wacker | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all | |
copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
SOFTWARE. | |
</pre> | |
</body> | |
</html> | |
import streamlit as st | |
st.title('Open Source Medical Software Resources') | |
""") | |
st.markdown(""" | |
π [World Health Organization (WHO)](https://en.wikipedia.org/wiki/World_Health_Organization) | |
π [International Classification of Diseases (ICD)](https://en.wikipedia.org/wiki/International_Classification_of_Diseases) | |
π [Systematized Nomenclature of Medicine - Clinical Terms (SNOMED CT)](https://en.wikipedia.org/wiki/SNOMED_CT) | |
π¬ [Logical Observation Identifiers Names and Codes (LOINC)](https://en.wikipedia.org/wiki/LOINC) | |
π’ [Regenstrief Institute](https://en.wikipedia.org/wiki/Regenstrief_Institute) | |
""") | |
st.header('Sample License File') | |
#st.code( | |
st.markdown(""" | |
MIT License | |
Copyright (c) 2023 Aaron Wacker | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all | |
copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
SOFTWARE. | |
, language='') | |
""") | |
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) | |