netflypsb commited on
Commit
415a9d1
·
verified ·
1 Parent(s): b947257

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -6,11 +6,11 @@ from datetime import datetime
6
 
7
  # Function to load patient data
8
  def load_data():
9
- return pd.read_csv('patient_data.csv')
10
 
11
  # Function to save patient data
12
  def save_data(df):
13
- df.to_csv('patient_data.csv', index=False)
14
 
15
  # Load the existing data
16
  df = load_data()
@@ -97,7 +97,7 @@ elif choice == "Add New Patient":
97
  'blood_pressure': None,
98
  'blood_glucose': None
99
  }
100
- df = df.append(new_patient_data, ignore_index=True)
101
  save_data(df)
102
  st.success("New patient added successfully!")
103
 
@@ -129,7 +129,15 @@ elif choice == "Add New Visit":
129
  'heart_rate': heart_rate,
130
  'blood_pressure': blood_pressure,
131
  'blood_glucose': glucose,
 
 
 
 
 
 
 
132
  }
133
- df = df.append(new_visit_data, ignore_index=True)
134
  save_data(df)
135
  st.success("New visit added successfully!")
 
 
6
 
7
  # Function to load patient data
8
  def load_data():
9
+ return pd.read_csv('patient_data_extended.csv')
10
 
11
  # Function to save patient data
12
  def save_data(df):
13
+ df.to_csv('patient_data_extended.csv', index=False)
14
 
15
  # Load the existing data
16
  df = load_data()
 
97
  'blood_pressure': None,
98
  'blood_glucose': None
99
  }
100
+ df = pd.concat([df, pd.DataFrame([new_patient_data])], ignore_index=True)
101
  save_data(df)
102
  st.success("New patient added successfully!")
103
 
 
129
  'heart_rate': heart_rate,
130
  'blood_pressure': blood_pressure,
131
  'blood_glucose': glucose,
132
+ 'temperature': temperature,
133
+ 'medical_complaints': medical_complaints,
134
+ 'symptoms': symptoms,
135
+ 'physical_examination': physical_examination,
136
+ 'diagnosis': diagnosis,
137
+ 'extra_notes': extra_notes,
138
+ 'treatment': treatment
139
  }
140
+ df = pd.concat([df, pd.DataFrame([new_visit_data])], ignore_index=True)
141
  save_data(df)
142
  st.success("New visit added successfully!")
143
+