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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -2
app.py CHANGED
@@ -19,12 +19,25 @@ def save_data(data):
19
 
20
  # Patient Registration Tab
21
  def registration_interface(name, father_name, age, phone, address, pincode):
22
- patient_id = register_patient(name, father_name, age, phone, address, pincode)
 
 
 
23
  data = load_data()
24
- data[patient_id] = {"name": name, "father_name": father_name, "age": age, "phone": phone, "address": address, "pincode": pincode, "tests": [], "total_cost": 0}
 
 
 
 
 
 
 
 
 
25
  save_data(data)
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)
 
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
26
  data = load_data()
27
+ data[patient_id] = {
28
+ "name": name,
29
+ "father_name": father_name,
30
+ "age": age,
31
+ "phone": phone,
32
+ "address": address,
33
+ "pincode": pincode,
34
+ "tests": [],
35
+ "total_cost": 0
36
+ }
37
  save_data(data)
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)