netflypsb commited on
Commit
e3f7da8
·
verified ·
1 Parent(s): 6052b4c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -17
app.py CHANGED
@@ -89,18 +89,19 @@ if uploaded_file:
89
  buffer = io.StringIO()
90
  df.to_csv(buffer, index=False)
91
  buffer.seek(0)
92
-
93
- st.download_button(
94
- label="Download Updated Data",
95
- data=buffer,
96
- file_name="updated_patient_data.csv",
97
- mime="text/csv"
98
- )
99
  st.success("New visit entry added successfully!")
100
 
101
- # Reload data
102
- df = load_data(buffer)
103
- patient_data = df[df['Patient ID'] == patient_id]
 
 
 
 
 
 
 
 
104
 
105
  # Dropdown menu of previous visits
106
  st.header("Previous Visits")
@@ -153,11 +154,12 @@ if uploaded_file:
153
  buffer = io.StringIO()
154
  df.to_csv(buffer, index=False)
155
  buffer.seek(0)
156
-
157
- st.download_button(
158
- label="Download Updated Data",
159
- data=buffer,
160
- file_name="updated_patient_data.csv",
161
- mime="text/csv"
162
- )
163
  st.success("New patient account created successfully!")
 
 
 
 
 
 
 
 
 
89
  buffer = io.StringIO()
90
  df.to_csv(buffer, index=False)
91
  buffer.seek(0)
 
 
 
 
 
 
 
92
  st.success("New visit entry added successfully!")
93
 
94
+ # Download button (moved outside the form)
95
+ st.download_button(
96
+ label="Download Updated Data",
97
+ data=buffer,
98
+ file_name="updated_patient_data.csv",
99
+ mime="text/csv"
100
+ )
101
+
102
+ # Reload data
103
+ df = load_data(io.StringIO(buffer.getvalue()))
104
+ patient_data = df[df['Patient ID'] == patient_id]
105
 
106
  # Dropdown menu of previous visits
107
  st.header("Previous Visits")
 
154
  buffer = io.StringIO()
155
  df.to_csv(buffer, index=False)
156
  buffer.seek(0)
 
 
 
 
 
 
 
157
  st.success("New patient account created successfully!")
158
+
159
+ # Download button (moved outside the form)
160
+ st.download_button(
161
+ label="Download Updated Data",
162
+ data=buffer,
163
+ file_name="updated_patient_data.csv",
164
+ mime="text/csv"
165
+ )