Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -47,20 +47,6 @@ if uploaded_file:
|
|
47 |
ax[1, 1].set_title("Hemoglobin")
|
48 |
st.pyplot(fig)
|
49 |
|
50 |
-
# Dropdown menu of previous visits
|
51 |
-
st.header("Previous Visits")
|
52 |
-
visit_date = st.selectbox("Select Visit Date", patient_data['Visit Date'].dt.strftime('%Y-%m-%d').unique())
|
53 |
-
visit_data = patient_data[patient_data['Visit Date'] == pd.to_datetime(visit_date)]
|
54 |
-
st.write(f"**Complaint:** {visit_data.iloc[0]['Complaint']}")
|
55 |
-
st.write(f"**Physical Examination:** {visit_data.iloc[0]['Physical Examination']}")
|
56 |
-
st.write(f"**Systolic BP:** {visit_data.iloc[0]['Systolic BP']}")
|
57 |
-
st.write(f"**Diastolic BP:** {visit_data.iloc[0]['Diastolic BP']}")
|
58 |
-
st.write(f"**Temperature:** {visit_data.iloc[0]['Temperature']}")
|
59 |
-
st.write(f"**Glucose:** {visit_data.iloc[0]['Glucose']}")
|
60 |
-
st.write(f"**Cholesterol:** {visit_data.iloc[0]['Cholesterol']}")
|
61 |
-
st.write(f"**Hemoglobin:** {visit_data.iloc[0]['Hemoglobin']}")
|
62 |
-
st.write(f"**Other Notes:** {visit_data.iloc[0]['Other Notes']}")
|
63 |
-
|
64 |
# Current visit input
|
65 |
st.header("Current Visit")
|
66 |
with st.form("current_visit_form"):
|
@@ -99,6 +85,24 @@ if uploaded_file:
|
|
99 |
df.to_csv(uploaded_file, index=False)
|
100 |
st.success("New visit entry added successfully!")
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
elif action == "Create New Patient":
|
103 |
st.header("Create New Patient Account")
|
104 |
with st.form("new_patient_form"):
|
|
|
47 |
ax[1, 1].set_title("Hemoglobin")
|
48 |
st.pyplot(fig)
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
# Current visit input
|
51 |
st.header("Current Visit")
|
52 |
with st.form("current_visit_form"):
|
|
|
85 |
df.to_csv(uploaded_file, index=False)
|
86 |
st.success("New visit entry added successfully!")
|
87 |
|
88 |
+
# Reload data
|
89 |
+
df = load_data(uploaded_file)
|
90 |
+
patient_data = df[df['Patient ID'] == patient_id]
|
91 |
+
|
92 |
+
# Dropdown menu of previous visits
|
93 |
+
st.header("Previous Visits")
|
94 |
+
visit_date = st.selectbox("Select Visit Date", patient_data['Visit Date'].dt.strftime('%Y-%m-%d').unique())
|
95 |
+
visit_data = patient_data[patient_data['Visit Date'] == pd.to_datetime(visit_date)]
|
96 |
+
st.write(f"**Complaint:** {visit_data.iloc[0]['Complaint']}")
|
97 |
+
st.write(f"**Physical Examination:** {visit_data.iloc[0]['Physical Examination']}")
|
98 |
+
st.write(f"**Systolic BP:** {visit_data.iloc[0]['Systolic BP']}")
|
99 |
+
st.write(f"**Diastolic BP:** {visit_data.iloc[0]['Diastolic BP']}")
|
100 |
+
st.write(f"**Temperature:** {visit_data.iloc[0]['Temperature']}")
|
101 |
+
st.write(f"**Glucose:** {visit_data.iloc[0]['Glucose']}")
|
102 |
+
st.write(f"**Cholesterol:** {visit_data.iloc[0]['Cholesterol']}")
|
103 |
+
st.write(f"**Hemoglobin:** {visit_data.iloc[0]['Hemoglobin']}")
|
104 |
+
st.write(f"**Other Notes:** {visit_data.iloc[0]['Other Notes']}")
|
105 |
+
|
106 |
elif action == "Create New Patient":
|
107 |
st.header("Create New Patient Account")
|
108 |
with st.form("new_patient_form"):
|