Update app.py
Browse files
app.py
CHANGED
@@ -130,7 +130,7 @@ def display_goal_summary(goal_summary):
|
|
130 |
# Medication Selection with Collapsible Categories
|
131 |
def select_medications():
|
132 |
st.subheader("Select Medications to Display")
|
133 |
-
show_all = st.checkbox("Show All Medications")
|
134 |
|
135 |
selected_medications = []
|
136 |
if not show_all:
|
@@ -157,7 +157,8 @@ def select_medications():
|
|
157 |
for category, medications in categories.items():
|
158 |
with st.expander(category):
|
159 |
for med in medications:
|
160 |
-
|
|
|
161 |
selected_medications.append(med)
|
162 |
else:
|
163 |
# Include all medications if "Show All" is selected
|
@@ -172,7 +173,6 @@ def select_medications():
|
|
172 |
|
173 |
return selected_medications
|
174 |
|
175 |
-
|
176 |
# Streamlit UI
|
177 |
# Main function
|
178 |
def main():
|
|
|
130 |
# Medication Selection with Collapsible Categories
|
131 |
def select_medications():
|
132 |
st.subheader("Select Medications to Display")
|
133 |
+
show_all = st.checkbox("Show All Medications", key="show_all")
|
134 |
|
135 |
selected_medications = []
|
136 |
if not show_all:
|
|
|
157 |
for category, medications in categories.items():
|
158 |
with st.expander(category):
|
159 |
for med in medications:
|
160 |
+
# Use a unique key for each checkbox
|
161 |
+
if st.checkbox(med, key=f"{category}_{med}"):
|
162 |
selected_medications.append(med)
|
163 |
else:
|
164 |
# Include all medications if "Show All" is selected
|
|
|
173 |
|
174 |
return selected_medications
|
175 |
|
|
|
176 |
# Streamlit UI
|
177 |
# Main function
|
178 |
def main():
|