Spaces:
Running
Running
neerajkalyank
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -26,9 +26,9 @@ def registration_interface(name, father_name, age, phone, address, pincode):
|
|
26 |
return f"Patient Registered. Patient ID: {patient_id}"
|
27 |
|
28 |
# Tests Selection Tab
|
29 |
-
def test_interface(
|
30 |
available_tests = get_tests_by_category(categories)
|
31 |
-
return available_tests
|
32 |
|
33 |
def confirm_tests_interface(patient_id, selected_tests):
|
34 |
data = load_data()
|
@@ -59,12 +59,15 @@ with gr.Blocks() as app:
|
|
59 |
|
60 |
with gr.Tab("Tests"):
|
61 |
patient_id_test = gr.Textbox(label="Patient ID")
|
62 |
-
categories = gr.CheckboxGroup(
|
|
|
|
|
|
|
63 |
available_tests = gr.CheckboxGroup(label="Available Tests")
|
64 |
confirm_button = gr.Button("Confirm Tests")
|
65 |
test_output = gr.Textbox(label="Test Selection Output")
|
66 |
|
67 |
-
categories.change(test_interface, categories, available_tests) # Update available tests based on selected categories
|
68 |
confirm_button.click(confirm_tests_interface, [patient_id_test, available_tests], test_output)
|
69 |
|
70 |
with gr.Tab("Billing"):
|
|
|
26 |
return f"Patient Registered. Patient ID: {patient_id}"
|
27 |
|
28 |
# Tests Selection Tab
|
29 |
+
def test_interface(categories):
|
30 |
available_tests = get_tests_by_category(categories)
|
31 |
+
return gr.update(choices=available_tests) # Update dropdown with available tests
|
32 |
|
33 |
def confirm_tests_interface(patient_id, selected_tests):
|
34 |
data = load_data()
|
|
|
59 |
|
60 |
with gr.Tab("Tests"):
|
61 |
patient_id_test = gr.Textbox(label="Patient ID")
|
62 |
+
categories = gr.CheckboxGroup(
|
63 |
+
["Haematology", "Clinical Pathology", "Biochemistry", "Microbiology", "Specific Diseases", "Serology", "Radiology", "Other Diagnostic Tests"],
|
64 |
+
label="Select Test Categories"
|
65 |
+
)
|
66 |
available_tests = gr.CheckboxGroup(label="Available Tests")
|
67 |
confirm_button = gr.Button("Confirm Tests")
|
68 |
test_output = gr.Textbox(label="Test Selection Output")
|
69 |
|
70 |
+
categories.change(test_interface, inputs=categories, outputs=available_tests) # Update available tests based on selected categories
|
71 |
confirm_button.click(confirm_tests_interface, [patient_id_test, available_tests], test_output)
|
72 |
|
73 |
with gr.Tab("Billing"):
|