-
Notifications
You must be signed in to change notification settings - Fork 0
/
cureSphereAPIconfig.yaml
654 lines (639 loc) · 16.9 KB
/
cureSphereAPIconfig.yaml
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
swagger: '2.0'
info:
title: CureSphere API configuration YAML
version: 1.0.0
description: All of the API functionalities necessary for the implementation of CureShpere.
schemes:
- https
consumes:
- application/x-www-form-urlencoded
- application/json
produces:
- application/json
paths:
/chatbot:
post:
summary: The endpoint for the Natural Language Understanding API.
description: |
This API takes in one or more messages from the client and returns
one or more messages as a response. The API leverages the NLP
backend functionality, paired with state and profile information
and returns a context-aware reply.
tags:
- NLU
operationId: sendMessage
produces:
- application/json
parameters:
- name: body
in: body
required: true
schema:
$ref: '#/definitions/BotRequest'
responses:
'200':
description: A Chatbot response
schema:
$ref: '#/definitions/BotResponse'
'403':
description: Unauthorized
schema:
$ref: '#/definitions/Error'
'500':
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/createPatient:
post:
summary: Create a new patient record
description: Creates a new patient record with the provided information
operationId: createPatient
parameters:
- name: firstName
in: header
description: The first name of the patient
required: true
type: string
- name: lastName
in: header
description: The last name of the patient
required: true
type: string
- name: age
in: header
description: The age of the patient
required: true
type: integer
- name: gender
in: header
description: The gender of the patient
required: true
type: string
- name: insurance_provider
in: header
description: The insurance provider of the patient
required: true
type: string
- name: city
in: header
description: The city of the patient
required: true
type: string
- name: zip_code
in: header
description: The zip code of the patient
required: true
type: string
- name: email
in: header
description: The email address of the patient
required: true
type: string
responses:
'200':
description: Successfully created patient record
schema:
type: object
properties:
user_id:
type: string
firstName:
type: string
lastName:
type: string
age:
type: integer
gender:
type: string
insurance_provider:
type: string
city:
type: string
zip_code:
type: string
email:
type: string
'400':
description: Error in creating patient record
schema:
type: object
properties:
error:
type: string
'500':
description: Internal server error
schema:
type: object
properties:
error:
type: string
/createDoctor:
post:
summary: Register a new doctor record
description: Creates a new doctor record with the provided information
operationId: createDoctor
parameters:
- name: firstName
in: header
description: The first name of the doctor
required: true
type: string
- name: lastName
in: header
description: The last name of the doctor
required: true
type: string
- name: department
in: header
description: The department of the doctor
required: true
type: string
- name: specialties
in: header
description: The specialty of the doctor
required: true
type: array
items:
type: string
format: string
- name: available_days
in: header
description: The available days in the week for the doctor
required: true
type: array
items:
type: string
format: string
- name: available_time_slots
in: header
description: The available time slots of the doctor
required: true
type: array
items:
type: string
format: string
- name: city
in: header
description: The city of the doctor's clinic
required: true
type: string
- name: clinic_zip_code
in: header
description: The zip code of the doctor's clinic
required: true
type: string
- name: email
in: header
description: The email address of the doctor
required: true
type: string
responses:
'200':
description: Successfully registered doctor
schema:
type: object
properties:
user_id:
type: string
firstName:
type: string
lastName:
type: string
department:
type: string
specialty:
type: string
available_days:
type: array
items:
type: string
format: string
available_time_slots:
type: array
items:
type: string
format: date-time
city:
type: string
zip_code:
type: string
email:
type: string
'400':
description: Error in registering doctor
schema:
type: object
properties:
error:
type: string
'500':
description: Internal server error
schema:
type: object
properties:
error:
type: string
/getAppointment:
get:
description: Retrieve the whole records of appointments
operationId: getAppointment
produces:
- application/json
parameters:
- name: email
in: header
description: user email (user id)
required: true
type: string
- name: role
in: header
description: doctor or patient
required: true
type: string
- name: appointment_type
in: header
description: past or current
required: true
type: string
responses:
'200':
description: appointments retrieved successfully
schema:
type: object
properties:
feedback:
type: string
'404':
description: No appointments found
schema:
type: object
properties:
error:
type: string
'500':
description: Internal server error
schema:
type: object
properties:
error:
type: string
/patients/{id}:
get:
summary: Retrieve the patient information
operationId: getPatient
produces:
- application/json
parameters:
- name: id
in: path
description: ID of the patient
required: true
type: string
responses:
'200':
description: Successfully fetched patient record
schema:
type: object
properties:
user_id:
type: string
firstName:
type: string
lastName:
type: string
age:
type: integer
gender:
type: string
insurance_provider:
type: string
city:
type: string
zip_code:
type: string
email:
type: string
'400':
description: Patient ID not found
schema:
type: object
properties:
error:
type: string
'500':
description: Internal server error
schema:
type: object
properties:
error:
type: string
/doctors/{id}:
get:
summary: Retrieve the doctor information
operationId: getDoctor
produces:
- application/json
parameters:
- name: id
in: path
description: ID of the doctor
required: true
type: string
responses:
'200':
description: Successfully fetched doctor
schema:
type: object
properties:
user_id:
type: string
firstName:
type: string
lastName:
type: string
department:
type: string
specialty:
type: string
available_days:
type: array
items:
type: string
format: string
available_time_slots:
type: array
items:
type: string
format: date-time
city:
type: string
zip_code:
type: string
email:
type: string
'400':
description: Doctor ID not found
schema:
type: object
properties:
error:
type: string
'500':
description: Internal server error
schema:
type: object
properties:
error:
type: string
/getMedicineComparison:
get:
description: refresh and get the most updated medicine name that the doctor inputted and then predefined some values in to return the lowest five products with the same name
operationId: getMedicineComparison
parameters:
- name: medicineName
in: header
description: the medicineName
required: true
type: string
responses:
'200':
description: Successfully implemented medicine comparision
schema:
type: object
properties:
appointmentId:
type: string
'400':
description: Error in implementing medicine comparision
schema:
type: object
properties:
error:
type: string
'500':
description: Internal server error
schema:
type: object
properties:
error:
type: string
/doctorInput:
post:
description: submitting medicine, feedback
operationId: doctorInput
parameters:
- name: a_id
in: header
description: the unique appointment Id
required: true
type: string
- name: feedback
in: header
description: feedback
required: true
type: string
- name: medicine
in: header
description: medicine
required: true
type: string
responses:
'200':
description: Successfully submitted medicine and feedback
schema:
type: object
properties:
appointmentId:
type: string
'400':
description: Error in submitting book medicine and feedback
schema:
type: object
properties:
error:
type: string
'500':
description: Internal server error
schema:
type: object
properties:
error:
type: string
/bookAppointment:
post:
description: book appointment of doc and patient
operationId: bookAppointment
parameters:
- name: patientId
in: header
description: the unique patientId
required: true
type: string
- name: doctorId
in: header
description: the unique doctorId
required: true
type: string
- name: Time
in: header
description: the timestamp in time
required: true
type: string
- name: Date
in: header
description: the timestamp in date
required: true
type: string
responses:
'200':
description: Successfully book appointment of doc and patient
schema:
type: object
properties:
appointmentId:
type: string
'400':
description: Error in implementing book appointment of doc and patient
schema:
type: object
properties:
error:
type: string
'500':
description: Internal server error
schema:
type: object
properties:
error:
type: string
/getDoctorAvailability:
get:
description: get availability of doctor
operationId: getDoctorAvailability
parameters:
- name: doctorId
in: header
description: the unique doctorId
required: true
type: string
- name: date
in: header
description: Date in format mm/dd/yyyy
required: true
type: string
responses:
'200':
description: Successfully obtained doctor availability
schema:
type: object
properties:
appointmentId:
type: string
'400':
description: Invalid input, doctor unavailable
schema:
type: object
properties:
error:
type: string
'500':
description: Internal server error
schema:
type: object
properties:
error:
type: string
/login:
post:
summary: Handles the login from frontend
description: Checks patient and doctors table for a matching user
operationId: login
parameters:
- name: username
in: header
description: The username of the frontend user.
required: true
type: string
- name: password
in: header
description: The password of the frontend user.
required: true
type: string
responses:
'200':
description: Successfully found a matching user
schema:
type: object
properties:
user_id:
type: string
'400':
description: Error in finding patient/doctor
schema:
type: object
properties:
error:
type: string
'500':
description: Internal server error
schema:
type: object
properties:
error:
type: string
definitions:
UnstructuredMessage:
type: object
properties:
id:
type: string
text:
type: string
timestamp:
type: string
format: datetime
Message:
type: object
properties:
type:
type: string
unstructured:
$ref: '#/definitions/UnstructuredMessage'
BotRequest:
type: object
properties:
messages:
type: array
items:
$ref: '#/definitions/Message'
BotResponse:
type: object
properties:
messages:
type: array
items:
$ref: '#/definitions/Message'
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
Medicine:
type: object
properties:
name:
type: string
manufacturer:
type: string
strength:
type: string
form:
type: string
Feedback:
type: object
properties:
Text:
type: string