File size: 814 Bytes
31bd06f
dbaff95
f8e4f5e
 
 
 
 
dbaff95
 
 
 
 
 
 
 
31bd06f
f8e4f5e
dbaff95
 
36eef5c
dbaff95
36eef5c
dbaff95
 
 
 
31bd06f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from test_selection import TEST_PRICES

def fetch_billing(patient_id, data):
    if patient_id not in data:
        return "Invalid Patient ID. Please check the ID."

    patient_data = data[patient_id]
    tests_with_prices = []
    
    for category, tests in TEST_PRICES.items():
        for test in patient_data["tests"]:
            if test in tests:
                price = tests[test]
                tests_with_prices.append(f"- {test}: ₹{price}")
    
    test_list = "\n".join(tests_with_prices)
    total_cost = patient_data["total_cost"]

    billing_info = (
        f"Patient ID: {patient_id}\n"
        f"Patient: {patient_data['name']}\n"
        f"Phone Number: {patient_data['phone']}\n"
        f"Tests:\n{test_list}\n"
        f"Total Bill: ₹{total_cost}"
    )
    return billing_info