-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPhenomicsLibraryAPI-1.0.0-swagger.yaml
585 lines (585 loc) · 16.1 KB
/
PhenomicsLibraryAPI-1.0.0-swagger.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
openapi: 3.0.0
info:
version: 1.0.0
title: HDR UK's Phenomics Library API
description: HDR UK's Phenomics Library API Design Document
termsOfService: https://www.phenomicslibrary.com/terms-of-use
contact:
name: Shahzad Mumtaz
url: https://www.phenomicslibrary.com
email: shahzadmumtaz22@gmail.com
license:
name: Phenomics Library Licence
url: https://www.phenomicslibrary.com
servers:
- url: https://dev.phenomicslibrary.com/v1
description: Development server
- url: https://prod.phenomicslibrary.com/v1
description: Production server
tags:
- name: Phenomics
description: All operations about Phenotype definitions
- name: User
description: All User management operations
paths:
/phenotypes:
get:
tags:
- Phenomics
summary: List Phenotypes
description: Returns information about all the phenotype definitions in the library
operationId: list-phenotypes
parameters:
- name: limit
in: query
description: The number of phenotypes returned
schema:
type: integer
minimum: 1
maximum: 20
example: 2
- name: offset
in: query
description: The pages to return phenotypes information
schema:
type: integer
minimum: 1
maximum: 20
example: 2
responses:
200:
description: Successful pull of phenotype information
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Phenotype'
application/xml:
schema:
type: array
items:
$ref: '#/components/schemas/Phenotype'
400:
description: A bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
404:
description: The specified resource was not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
post:
tags:
- Phenomics
summary: Create Phenotype
description: Creates a new phenotype in the library
operationId: create-phenotype
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Phenotype'
application/xml:
schema:
$ref: '#/components/schemas/Phenotype'
responses:
200:
description: Succesfully added new phenotype data
/phenotypes/search:
get:
tags:
- Phenomics
summary: Search Phenotypes
description: This helps in returning all the phenotypes that matches search string in the contents of the phenotypes stored in knowledge base
operationId: search-phenotype
parameters:
- name: q
in: query
description: a search string that searches for all the phenotypes contents that matches a given search string
required: true
schema:
type: string
example: Heart
responses:
200:
description: successful retrieval of a phenotype
content:
application/json:
schema:
$ref: '#/components/schemas/SearchResults'
application/xml:
schema:
$ref: '#/components/schemas/SearchResults'
400:
description: A bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
404:
description: The specified resource was not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/phenotypes/{id}:
get:
tags:
- Phenomics
summary: Get Phenotype
description: Gets information about specific phenotype
operationId: get-phenotype
parameters:
- in: path
name: id
required: true
description: The ID of the phenotype
schema:
type: string
example: null
responses:
200:
description: successful retrieval of a phenotype
content:
application/json:
schema:
$ref: '#/components/schemas/Phenotype'
application/xml:
schema:
$ref: '#/components/schemas/Phenotype'
400:
description: A bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
404:
description: The specified resource was not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
put:
tags:
- Phenomics
summary: Update Phenotype
description: Updats a specific phenotype from library
operationId: update-phenotype
parameters:
- in: path
name: id
required: true
description: The ID of the phenotype
schema:
type: string
example:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Phenotype'
application/xml:
schema:
$ref: '#/components/schemas/Phenotype'
responses:
200:
description: Phenotype updated or created
delete:
tags:
- Phenomics
summary: Delete Phenotype
description: Removes a specific phenotype from library
operationId: delete-phenotype
parameters:
- in: path
name: id
required: true
description: The ID of the phenotype
schema:
type: string
example:
responses:
202:
description: successful removal of a phenotype
400:
description: A bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
404:
description: The specified resource was not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/user:
post:
tags:
- User
summary: Create User
description: Creates a user account for using Phenomics library.
operationId: create-User
responses:
default:
description: User account created successfully
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/User'
description: Created user object
required: true
/user/login:
get:
tags:
- User
summary: Logs user into the system
description: logs in user into the Phenomics Library
operationId: login-User
parameters:
- name: username
in: query
description: The user name for login
required: true
schema:
type: string
- name: password
in: query
description: The password for login
required: true
schema:
type: string
responses:
'200':
description: successful logged into Phenomics Library
content:
application/json:
schema:
type: string
application/xml:
schema:
type: string
'400':
description: Invalid username/password given
/user/logout:
get:
tags:
- User
summary: Logs out current logged in user session of Phenomics Library
description: logs out user from Phenomics Library
operationId: logout-User
responses:
'200':
description: successfully logged out from Phenomics Library
'/user/{username}':
get:
tags:
- User
summary: Get user details by user name
description: Gives user derails for a given user name
operationId: get-UserByName
parameters:
- name: username
in: path
description: The name that needs to be fetched.
required: true
schema:
type: string
responses:
'200':
description: successfully retrieved user details
content:
application/json:
schema:
$ref: '#/components/schemas/User'
application/xml:
schema:
$ref: '#/components/schemas/User'
'400':
description: Invalid username supplied
'404':
description: User not found
put:
tags:
- User
summary: Updated user details
description: This will allow to update details of the user and applicable to only the logged in user.
operationId: update-User
parameters:
- name: username
in: path
description: name that need to be updated
required: true
schema:
type: string
responses:
'400':
description: Invalid user supplied
'404':
description: User not found
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/User'
description: Updated user object
required: true
delete:
tags:
- User
summary: Deletes a user
description: This will allow to detele the user account and this can only be done by the logged in user.
operationId: delete-User
parameters:
- name: username
in: path
description: The name that needs to be deleted
required: true
schema:
type: string
responses:
'400':
description: Invalid username supplied
'404':
description: User not found
components:
schemas:
SearchResults:
description: Array of phenotypes that matches the search string in the contents of the phenotypes library
type: object
properties:
count:
type: integer
message:
type: string
results:
type: array
items:
$ref: '#/components/schemas/Phenotype'
Phenotype:
description: Model having phenotype information
type: object
allOf:
- $ref: '#/components/schemas/PhenotypeMetadata'
- $ref: '#/components/schemas/PhenotypeContent'
x-examples: {}
PhenotypeMetadata:
description: Model having metadata information of a phenotype
type: object
properties:
id:
$ref: '#/components/schemas/shortuuid'
title:
type: string
example: Abdominal Hernia
name:
type: string
example: Abdominal Hernia
type:
type: string
example: Disease or Syndrome
group:
type: string
example: Digestive
datamodalities:
type: array
items:
type: string
dataSources:
type: array
items:
type: string
example: [Clinical Practice Research Datalink GOLD, Hospital Episode Statistics APC for CPRD GOLD]
clinicalTerminologies:
type: array
items:
type: string
example: [OPCS-4, Read Version 2, ICD-10]
validation:
type: array
items:
type: string
example:
- cross-source
codeListSummary:
type: array
items:
type: string
example:
- kuan_hernia_abdo_UmxTP7n8pMNA9ykfrhp5hZ_Read2.csv
- kuan_h hernia_abdo_UmxTP7n8pMNA9ykfrhp5hZ_ICD10.csv
- kuan_hernia_abdo_UmxTP7n8pMNA9ykfrhp5hZ_OPCS4.csv
validEventDataRange:
type: string
example: '01/01/1999 - 01/07/2016'
sex:
type: array
items:
type: string
example: [Female, Male]
author:
type: array
items:
type: string
example:
- Kuan V
- Denaxas S
- Gonzalez-Izquierdo A
- Direk K
- Bhatti O
- Husain S
- Sutaria S
- Hingorani M
- Nitsch D
- Parisinos C
- Lumbers T
- Mathur R
- Sofat R
- Casas JP
- Wong I
- Hamingway H
- Hingorani A
publication:
type: array
items:
type: string
example: 'Kuan V., Denaxas S., Gonzalez-Izquierdo A. et al. A chronological map of 308 physical and mental health conditions from 4 million individuals in the National Health Service. The Lancet Digital Health - DOI: 10.1016/S2589-7500(19)30012-3'
status:
type: string
example: FINAL
date:
type: string
example: 2019/05/20
modifiedDate:
type: string
example: 2019/05/20
version:
type: integer
example: 1
provenance:
type: string
format: url
remarks:
type: string
required:
- name
- id
- type
- author
- status
- version
shortuuid:
type: string
title: shortuuid
pattern: '^([23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz])+'
PhenotypeContent:
description: Model having a phenotype content
type: object
properties:
sectionTitle:
type: string
example:
sectionDescription:
type: string
subSectionDescription:
type: string
codeLists:
type: array
items:
$ref: '#/components/schemas/CodeLists'
implementation:
$ref: '#/components/schemas/Implementation'
publications:
type: array
items:
$ref: '#/components/schemas/Publication'
CodeLists:
description: Model having code list content
type: object
properties:
title:
type: string
example: Primary Care
typedescription:
type: string
example: null
data:
type: array
items:
$ref: '#/components/schemas/CodeListTable'
CodeListTable:
description: Model having a codelist data table
type: object
properties:
title:
type: string
tableDescription:
type: string
fieldNames:
type: array
items:
type: string
tableData:
type: array
items:
type: array
items:
type: string
Implementation:
description: Model having implementation details
type: object
properties:
title:
type: string
description:
type: string
linktocode:
type: string
format: url
Publication:
description: Model having publications details
type: object
properties:
reference:
type: string
linktoaccess:
type: string
format: url
Error:
type: object
properties:
code:
type: string
message:
type: string
required:
- code
- message
User:
type: object
properties:
id:
type: integer
format: int64
username:
type: string
firstName:
type: string
lastName:
type: string
email:
type: string
password:
type: string
phone:
type: string
userStatus:
type: integer
format: int32
description: User Status