Spaces:
Sleeping
Sleeping
Create view_consultations.py
Browse files- view_consultations.py +19 -0
view_consultations.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import pandas as pd
|
| 3 |
+
|
| 4 |
+
# Hard-coded file path for consultation data
|
| 5 |
+
consultation_file_path = "consultations.csv"
|
| 6 |
+
|
| 7 |
+
# Function to view consultations
|
| 8 |
+
def view_consultations():
|
| 9 |
+
df = pd.read_csv(consultation_file_path)
|
| 10 |
+
return df
|
| 11 |
+
|
| 12 |
+
app = gr.Blocks()
|
| 13 |
+
|
| 14 |
+
with app:
|
| 15 |
+
with gr.Tab("View Consultations"):
|
| 16 |
+
consultations_data = gr.DataFrame(headers=["Patient ID", "Patient Name", "Height", "Weight", "Diastolic BP", "Systolic BP", "Temperature", "Complaints", "Prescription", "Lab Investigations", "Revisit Date", "Revisit Time"])
|
| 17 |
+
gr.Button("Load Consultations").click(view_consultations, outputs=consultations_data)
|
| 18 |
+
|
| 19 |
+
app.launch()
|