-
Notifications
You must be signed in to change notification settings - Fork 0
/
Hospital.proto
79 lines (74 loc) · 1.66 KB
/
Hospital.proto
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
72
73
74
75
76
77
78
79
syntax = "proto3";
option java_multiple_files = true;
option java_package = "agh.sr.zad4.gen";
package hospital;
// BASIC
message Patient {
string PESEL = 1;
string name = 2;
repeated Examination examinations = 3;
}
message Examination {
string PESEL = 1;
int32 doctorId = 2;
string dateDoctor = 3;
string dateLab = 4;
repeated Parameter parameters = 5;
enum StatusCode {
PENDING = 0;
DONE = 1;
}
StatusCode statusCode = 6;
}
message Parameter {
string name = 1;
string unit = 2;
float value = 3;
float minValue = 4;
float maxValue = 5;
}
message PatientPESEL {
string PESEL = 1;
}
message Empty {
}
// RESPONSES
message SimpleResponse {
enum StatusCode {
OK = 0;
ERROR = 1;
}
StatusCode statusCode = 1;
string msg = 2;
}
message Examinations {
enum StatusCode {
FOUND = 0;
NOT_FOUND = 1;
}
StatusCode statusCode = 1;
Patient patient = 2;
Examination examination = 3;
}
message Patients {
enum StatusCode {
FOUND = 0;
NOT_FOUND = 1;
}
StatusCode statusCode = 1;
Patient patient = 2;
}
// SERVICES
service PatientSerice {
rpc findPatient (PatientPESEL) returns (stream Examinations);
}
service DoctorService {
rpc findPatients (Empty) returns (stream Patients);
rpc findExaminations (PatientPESEL) returns (stream Examinations);
rpc findExaminationsAll (Empty) returns (stream Examinations);
rpc createPatient (Patient) returns (SimpleResponse);
rpc orderExamination (Examination) returns (SimpleResponse);
}
service LabService {
rpc AddExamination (Empty) returns (SimpleResponse);
}