-
Notifications
You must be signed in to change notification settings - Fork 2
/
queries.qry
47 lines (40 loc) · 1.28 KB
/
queries.qry
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
query SelectPatients {
description: "Select all patients"
statement:
SELECT org.med.chain.Patient
}
query selectPatientById {
description: "Select the patient based on their id"
statement:
SELECT org.med.chain.Patient
WHERE (patientId ==_$atientId)
}
query selectDoctors {
description: "Select all doctors"
statement:
SELECT org.med.chain.Doctor
}
query selectDoctorById {
description: "Select the doctor based on their id"
statement:
SELECT org.med.chain.Doctor
WHERE (doctorId ==_$doctorId)
}
query selectMedicalRecordByDoctorId {
description: "Select the medical records based on the DoctorId"
statement:
SELECT org.med.chain.MedicalRecord
WHERE ((authorized CONTAINS _$doctorId )OR (doctorId ==_$doctorId ))
}
query selectMedicalRecordByPatientId {
description: "Select the medical records based on the PatientId"
statement:
SELECT org.med.chain.MedicalRecord
WHERE ((patientId ==_$patientId ))
}
query selectMedicalRecordByDoctorAndPatientId {
description: "Select the medical records based on the DoctorId and PatientId"
statement:
SELECT org.med.chain.MedicalRecord
WHERE (((authorized CONTAINS _$DoctorId )OR (doctorId ==_$doctorId )) AND patientId == _$patientId)
}