-
Notifications
You must be signed in to change notification settings - Fork 0
/
API_specification.yaml
919 lines (910 loc) · 32.1 KB
/
API_specification.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
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
swagger: "2.0"
info:
description: "The goal of the component consists in filtering blueprints and raking them, based on the application developer requirements. Source code in [github](https://github.com/DITAS-Project/data-utility-resolution-engine)"
version: "0.0.1"
title: "Data Utility Resolution Engine"
license:
name: "Apache License 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "TBD"
basePath: "/"
schemes:
- "http"
paths:
/v1/filterBlueprints:
post:
summary: "Ranks and filters abstract blueprints based on application requirements"
description: "The only API of this method filters a list of blueprints (input) that are complaint with the application requirements (input), and ranks them."
consumes:
- "application/json; charset=utf-8"
produces:
- "application/json; charset=utf-8"
parameters:
- in: "body"
name: "Input"
description: "Application requirements and list of VDC blueprints. Both imput marged in the same body because at most 1 body parameter can be defined. [Click here for more info](https://github.com/swagger-api/swagger-editor/issues/889)"
required: true
schema:
$ref: "#/definitions/input"
responses:
200:
description: "Filtered Blueprints"
schema:
$ref: '#/definitions/output'
/api/filterBlueprints:
post:
summary: "Ranks and filters abstract blueprints based on application requirements"
description: "The only API of this method filters a list of blueprints (input) that are complaint with the application requirements (input), and ranks them."
consumes:
- "application/json; charset=utf-8"
produces:
- "application/json; charset=utf-8"
parameters:
- in: "body"
name: "Input"
description: "Application requirements and list of VDC blueprints. Both imput marged in the same body because at most 1 body parameter can be defined. [Click here for more info](https://github.com/swagger-api/swagger-editor/issues/889)"
required: true
schema:
$ref: "#/definitions/input"
responses:
200:
description: "Filtered Blueprints"
schema:
$ref: '#/definitions/output'
deprecated: true
definitions:
applicationRequirements:
description: "JSON document conforming to application requirements definitions as in https://github.com/DITAS-Project/ApplicationRequirement"
type: "object"
example:
applicationType: Other
functionalRequirements:
methodTags:
- ask_ICCS_must_match_getAllValuesForBloodTestComponent
vdcTags:
- ask_ICCS_must_match_getAllValuesForBloodTestComponent
schema:
attributes:
- SSN
- component
attributes:
dataUtility:
- id: availability_99
description: Availability 99
type: Availability
properties:
availability:
unit: percentage
minimum: 99
- id: responseTime_1
description: ResponseTime 1
type: ResponseTime
properties:
responseTime:
maximum: 1
unit: second
- id: timeliness_06
description: Timeliness 0.6
type: Timeliness
properties:
timeliness:
maximum: 0.6
unit: NONE
security:
- id: encryptionAES_128
description: Encryption AES 128
type: TransportEncryption
properties:
protocol:
unit: enum
value: TLS
algorithm:
unit: enum
value: AES
keyLength:
unit: number
minimum: 128
- id: tracing_1
description: Tracing
type: Tracing
properties:
level:
unit: enum
value: datasource
sampleRate:
unit: percentage
value: 1
instrumentation:
unit: enum
value: VDC
- id: aclRoleBasedReadOnly
description: ACL rolebased readOnly
type: ACL
properties:
protocol:
unit: enum
value: username/password
credentials:
unit: list
value:
- doctor_er_id
privacy: []
goalTrees:
dataUtility:
type: AND
children:
- type: AND
children:
- type: OR
leaves:
- id: serviceAvailable
description: Service available
weight: 1
attributes:
- availability_99
- type: OR
leaves:
- id: fastDataProcess
description: Fast data process
weight: 1
attributes:
- responseTime_1
- type: AND
leaves:
- id: timeliness
description: Timeliness
weight: 1
attributes:
- timeliness_06
security:
type: AND
children:
- type: AND
leaves:
- id: storageEncryption
description: Storage encryption
weight: 1
attributes:
- encryptionAES_128
leaves:
- id: accessControl
description: Access control
weight: 1
attributes:
- aclRoleBasedReadOnly
- id: tracing
description: Tracing and monitoring
weight: 1
attributes:
- tracing_1
blueprint:
description: "JSON document conforming to abstract blueprint definitions as in https://github.com/DITAS-Project/blueprint"
type: "object"
example:
INTERNAL_STRUCTURE:
Overview:
name: osr_hospital_vdc
description: This VDC provides information about biographical data and blood tests of the patients of Ospedale San Raffaele in Milan
tags:
- method_id: getPatientBiographicalData
tags:
- OSR
- patient
- hospital
- biographical
- profile
- method_id: getLastValuesForBloodTest
tags:
- OSR
- patient
- hospital
- blood
- test
- method_id: getAllValuesForBloodTestComponent
tags:
- OSR
- patient
- hospital
- blood
- test
- component
- method_id: getBloodTestComponentAverage
tags:
- OSR
- patient
- hospital
- blood
- test
- component
- age-range
- research
- pseudonymization
- anonymization
- GDPR-compliance
Data_Sources:
- id: bloodTestSource
description: Minio source containing blood tests for the hospital patients
class: object storage
type: Minio
parameters:
spark_hadoop_fs_s3a_endpoint: 'http://MINIO:9000'
spark_hadoop_fs_s3a_access_key: ACCESS_KEY
spark_hadoop_fs_s3a_secret_key: SECRET_KEY
spark_hadoop_fs_s3a_path_style_access: 'true'
spark_hadoop_fs_s3a_impl: org.apache.hadoop.fs.s3a.S3AFileSystem
s3_filename: 's3a://ditas.ehealth-sample/ditas-blood-tests.parquet'
schema: {}
- id: patientBiographicalData
description: Relational database containing biographical data for the hospital patients
class: relational database
type: MySQL
parameters:
ip: BIO_HOST
port: '3306'
user: BIO_USER
password: BIO_PASSWORD
schema:
type: object
properties:
addressCity:
type: string
addressRoad:
type: string
addressRoadNumber:
type: integer
addressPostalCode:
type: integer
addressTelephoneNumber:
type: integer
birthCity:
type: string
nationality:
type: string
job:
type: string
schoolYears:
type: integer
birthDate:
type: date
gender:
type: string
name:
type: string
patientId:
type: string
socialId:
type: string
surname:
type: string
familyDoctorId:
type: string
Flow:
platform: Spark
parameters:
spark_master: 'spark://SPARK:7077'
spark_app_name: PatientBloodTestsVDC
spark_jars: 'mysql-connector-java-5.1.45/mysql-connector-java-5.1.45-bin.jar,hadoop-aws-3.0.0.jar,aws-java-sdk-bundle-1.11.271.jar'
Testing_Output_Data:
- method_id: getPatientBiographicalData
zip_data: 'http://localhost:8080'
- method_id: getLastValuesForBloodTest
zip_data: 'http://localhost:8080'
- method_id: getAllValuesForBloodTestComponent
zip_data: 'http://localhost:8080'
- method_id: getBloodTestComponentAverage
zip_data: 'http://localhost:8080'
DATA_MANAGEMENT:
- method_id: getPatientBiographicalData
attributes:
dataUtility:
- id: availability_90
description: Availability 90
type: Availability
properties:
availability:
unit: percentage
minimum: 90
- id: responseTime_1
description: ResponseTime 1
type: ResponseTime
properties:
responseTime:
maximum: 1
unit: second
- id: timeliness_06
description: Timeliness 0.6
type: Timeliness
properties:
timeliness:
maximum: 0.6
unit: NONE
security:
- id: encryption_AES128
description: Encryption AES 128
type: TransportEncryption
properties:
protocol:
unit: enum
value: TLS
algorithm:
unit: enum
value: AES
keyLength:
unit: number
value: 128
- id: tracing_1
description: Tracing 1
type: Tracing
properties:
level:
unit: enum
value: datasource
sampleRate:
unit: percentage
value: 1
instrumentation:
unit: enum
value: VDC
- id: acl_userPW_doctor
description: ACL username/password doctor_er_id
type: ACL
properties:
protocol:
unit: enum
value: username/password
credentials:
unit: list
value:
- doctor_er_id
privacy: []
- method_id: getLastValuesForBloodTest
attributes:
dataUtility:
- id: availability_90
description: Availability 90
type: Availability
properties:
availability:
unit: percentage
minimum: 90
- id: responseTime_1
description: ResponseTime 1
type: ResponseTime
properties:
responseTime:
maximum: 1
unit: second
- id: timeliness_06
description: Timeliness 0.6
type: Timeliness
properties:
timeliness:
maximum: 0.6
unit: NONE
security:
- id: encryption_AES128
description: Encryption AES 128
type: TransportEncryption
properties:
protocol:
unit: enum
value: TLS
algorithm:
unit: enum
value: AES
keyLength:
unit: number
value: 128
- id: tracing_1
description: Tracing 1
type: Tracing
properties:
level:
unit: enum
value: datasource
sampleRate:
unit: percentage
value: 1
instrumentation:
unit: enum
value: VDC
- id: acl_userPW_doctor
description: ACL username/password doctor_er_id
type: ACL
properties:
protocol:
unit: enum
value: username/password
credentials:
unit: list
value:
- doctor_er_id
privacy: []
- method_id: getAllValuesForBloodTestComponent
attributes:
dataUtility:
- id: availability_90
description: Availability 90
type: Availability
properties:
availability:
unit: percentage
minimum: 90
- id: responseTime_1
description: ResponseTime 1
type: ResponseTime
properties:
responseTime:
maximum: 1
unit: second
- id: timeliness_06
description: Timeliness 0.6
type: Timeliness
properties:
timeliness:
maximum: 0.6
unit: NONE
security:
- id: encryption_AES128
description: Encryption AES 128
type: TransportEncryption
properties:
protocol:
unit: enum
value: TLS
algorithm:
unit: enum
value: AES
keyLength:
unit: number
value: 128
- id: tracing_1
description: Tracing 1
type: Tracing
properties:
level:
unit: enum
value: datasource
sampleRate:
unit: percentage
value: 1
instrumentation:
unit: enum
value: VDC
- id: acl_userPW_doctor
description: ACL username/password doctor_er_id
type: ACL
properties:
protocol:
unit: enum
value: username/password
credentials:
unit: list
value:
- doctor_er_id
privacy: []
- method_id: getBloodTestComponentAverage
attributes:
dataUtility:
- id: volume_9500
description: volume 9500
type: Volume
properties:
volume:
value: 9500
unit: tuple
- id: accuracy_07
description: Accuracy
type: Accuracy
properties:
accuracy:
minimum: 0.7
unit: none
- id: processCompleteness_8
description: Process completeness 8
type: Process completeness
properties:
completeness:
minimum: 8
unit: percentage
- id: scaleUpMemory
description: scale-up memory
type: Scale-up
properties:
ramGain:
unit: percentage
value: 150
ramLimit:
unit: percentage
value: 99
- id: scaleUpSpace
description: scale-up space
type: Scale-up
properties:
spaceGain:
unit: percentage
value: 150
spaceLimit:
unit: percentage
value: 99
security:
- id: encryption_AES128
description: Encryption AES 128
type: TransportEncryption
properties:
protocol:
unit: enum
value: TLS
algorithm:
unit: enum
value: AES
keyLength:
unit: number
value: 128
- id: tracing_1
description: Tracing 1
type: Tracing
properties:
level:
unit: enum
value: datasource
sampleRate:
unit: percentage
value: 1
instrumentation:
unit: enum
value: VDC
- id: acl_userPW_researcher
description: ACL username/password researcher_id
type: ACL
properties:
protocol:
unit: enum
value: username/password
credentials:
unit: list
value:
- researcher_id
privacy:
- id: purposeControl_research
description: PurposeControl research
type: PurposeControl
properties:
availablePurpose:
unit: list
value:
- research
- medical research
- nutritional research
allowedGuarantor:
unit: list
value:
- d63d0e21fdc05f618d55ef306c54af82
ABSTRACT_PROPERTIES: []
COOKBOOK_APPENDIX: {}
EXPOSED_API:
openapi: 3.0.1
info:
title: CAF API
version: 0.0.1
paths:
'/patient/{SSN}':
get:
summary: Get patient's biographical data
description: 'This method returns the biographical data for the specified patient (identified via SSN), to be used by medical doctors'
operationId: getPatientBiographicalData
parameters:
- name: SSN
in: path
description: SSN of the patient
required: true
schema:
type: string
responses:
'200':
description: Biographical data of the patient
content:
application/json:
schema:
type: object
properties:
SSN:
type: string
name:
type: string
surname:
type: string
gender:
type: string
birthDate:
type: string
addressCity:
type: string
addressRoad:
type: string
addressRoadNumber:
type: integer
addressPostalCode:
type: integer
telephoneNumber:
type: integer
birthCity:
type: string
nationality:
type: string
job:
type: string
schoolYears:
type: integer
familyDoctorId:
type: string
_links:
type: object
properties:
self:
type: object
properties:
href:
type: string
required:
- href
blood-test-summary:
type: object
properties:
href:
type: string
required:
- href
required:
- self
- blood-test-summary
required:
- patientId
- SSN
- name
- surname
- gender
- birthDate
- addressCity
- addressRoad
- addressRoadNumber
- addressPostalCode
- telephoneNumber
- birthCity
- nationality
- job
- schoolYears
- familyDoctorId
- _links
'404':
description: Patient not found
x-data-sources:
- patientBiographicalData
'/patient/{SSN}/blood-test/summary':
get:
summary: Get patient's latest values for all measured components
description: 'This method returns the latest values of all the blood test components measured on a patient (identified by his SSN), to be used by medical doctors'
operationId: getLastValuesForBloodTest
parameters:
- name: SSN
in: path
description: SSN of the patient
required: true
schema:
type: string
responses:
'200':
description: Latest values of all blood test components measured on the patient
content:
application/json:
schema:
type: object
properties:
components:
type: array
items:
type: object
properties:
date:
type: string
name:
type: string
value:
type: object
required:
- date
- name
- value
_links:
type: object
properties:
self:
type: object
properties:
href:
type: string
required:
- href
patient:
type: object
properties:
href:
type: string
required:
- href
timeseries:
type: object
properties:
templated:
type: boolean
default: true
href:
type: string
default: '/patient/some-SSN/blood-test/component/{name}'
required:
- href
- templated
required:
- self
- patient
- timeseries
required:
- components
- _links
'404':
description: Patient not found
x-data-sources:
- bloodTestSource
- patientBiographicalData
'/patient/{SSN}/blood-test/component/{component}':
get:
summary: Get timeseries of patient's blood test component
description: 'This method returns the collected values for a specific blood test component of a patient (identified by his SSN), to be used by medical doctors'
operationId: getAllValuesForBloodTestComponent
parameters:
- name: SSN
in: path
description: SSN of the patient
required: true
schema:
type: string
- name: component
in: path
description: Blood test component for which the values are requested
required: true
schema:
type: string
responses:
'200':
description: Values for the specified blood test component in the patient's blood tests
content:
application/json:
schema:
type: object
properties:
series:
type: array
items:
type: object
properties:
date:
type: string
value:
type: object
required:
- date
- value
_links:
type: object
properties:
self:
type: object
properties:
href:
type: string
required:
- href
patient:
type: object
properties:
href:
type: string
required:
- href
required:
- self
- patient
required:
- series
- _links
'404':
description: Patient not found
x-data-sources:
- bloodTestSource
- patientBiographicalData
'/blood-test/component/{component}/average/{startAgeRange}-{endAgeRange}':
get:
summary: Get average of component over an age range
description: 'This method returns the average value for a specific blood test component in a specific age range, to be used by researchers. Since data are for researchers, patients'' identifiers and quasi-identifiers won''t be returned, making the output of this method anonymized.'
operationId: getBloodTestComponentAverage
parameters:
- name: component
in: path
description: Blood test component for which the last value is requested
required: true
schema:
type: string
- name: startAgeRange
in: path
description: Start age in age range
required: true
schema:
type: number
- name: endAgeRange
in: path
description: End age in age range
required: true
schema:
type: number
responses:
'200':
description: Average value for the specified component in the selected age range
content:
application/json:
schema:
type: object
properties:
value:
type: number
_links:
type: object
properties:
self:
type: object
properties:
href:
type: string
required:
- href
required:
- self
required:
- value
- _links
'404':
description: Component never measured
x-data-sources:
- bloodTestSource
- patientBiographicalData
candidates:
properties:
blueprint:
$ref: "#/definitions/blueprint"
methodNames:
type: "array"
items:
type: "string"
example: "getAllValuesForBloodTestComponent"
input:
properties:
applicationRequirements:
$ref: "#/definitions/applicationRequirements"
candidates:
type: "array"
items:
$ref: "#/definitions/candidates"
output:
type: "array"
items:
properties:
blueprint:
$ref: "#/definitions/blueprint"
score:
type: number
format: double
minimum: 0
maximum: 1
methodNames:
type: "array"
items:
type: "string"