-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexemplu.py
72 lines (61 loc) · 1.85 KB
/
exemplu.py
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import requests
url = "http://localhost:8081/mds/api/user"
url1 = "http://localhost:8081/mds/api/patient"
#createPacientAccount, createDoctorAccount, authenticate sunt la url
#getDoctorsBySpecialization, requestAppointment sunt la url1
data_register_patient_example = {
"function": "createPacientAccount",
"parameters": {
"first_name": "Johnny",
"last_name": "Doe",
"email": "[email protected]",
"password": "password123",
"phone": "1234567890",
"medical_history": "None",
"allergies": "Peanuts",
"blood_type": "O+"
}
}
# Definirea datelor pentru funcția createDoctorAccount
data_register_doctor_example = {
"function": "createDoctorAccount",
"parameters": {
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"password": "secure_password",
"phone": "+123456789",
"specialization": "Cardiology",
"description": "Experienced cardiologist",
"office_id": 1
}
}
data_authenticate_example = {
"function": "authenticate",
"parameters": {
"email": "[email protected]",
"password": "password1234"
}
}
data_getDoctorsBySpecialization_example = {
"function": "getDoctorsBySpecialization",
"parameters": {
"specialization": "Pediatrie"
}
}
data_requestAppointment_example = {
"function": "requestAppointment",
"parameters": {
"patient_id": "16",
"specialization": "Pediatrie",
"date_string": "2026 12 30 15:30",
"notes": "va fi super"
}
}
#posting example
response = requests.post(url1, json=data_requestAppointment_example)
if response.status_code == 200:
response_data = response.json()
print("Response:", response_data)
else:
print("Failed to execute function, status code:", response.status_code)