neerajkalyank commited on
Commit
d19864a
1 Parent(s): 2f8aad9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import gradio as gr
2
  import json
 
3
  from patient_registration import register_patient
4
  from test_selection import select_tests, get_tests_by_category
5
  from billing import fetch_billing
@@ -19,7 +20,9 @@ def save_data(data):
19
 
20
  # Patient Registration Tab
21
  def registration_interface(name, father_name, age, phone, address, pincode):
22
- # Ensure 'phone' is a string to avoid indexing issues
 
 
23
  patient_id = f"{today.year}{today.month:02d}{today.day:02d}{str(phone)[-5:]}"
24
 
25
  # Proceed with the rest of the function
@@ -38,6 +41,7 @@ def registration_interface(name, father_name, age, phone, address, pincode):
38
  return f"Patient Registered. Patient ID: {patient_id}"
39
 
40
 
 
41
  # Tests Selection Tab
42
  def test_interface(categories):
43
  available_tests = get_tests_by_category(categories)
 
1
  import gradio as gr
2
  import json
3
+ from datetime import datetime
4
  from patient_registration import register_patient
5
  from test_selection import select_tests, get_tests_by_category
6
  from billing import fetch_billing
 
20
 
21
  # Patient Registration Tab
22
  def registration_interface(name, father_name, age, phone, address, pincode):
23
+ # Get today's date
24
+ today = datetime.now()
25
+ # Generate patient ID with last 5 digits of the phone number
26
  patient_id = f"{today.year}{today.month:02d}{today.day:02d}{str(phone)[-5:]}"
27
 
28
  # Proceed with the rest of the function
 
41
  return f"Patient Registered. Patient ID: {patient_id}"
42
 
43
 
44
+
45
  # Tests Selection Tab
46
  def test_interface(categories):
47
  available_tests = get_tests_by_category(categories)