forked from thehyve/transmart-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
1776 lines (1712 loc) · 49.8 KB
/
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
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
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright 2017, tranSMART Foundation, Inc.
swagger: '2.0'
info:
version: 17.1.0
title: Transmart
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
description: |
# OAuth2
All calls need an Authorization header. https://wiki.transmartfoundation.org/display/transmartwiki/RESTful+API
```
Authorization:Bearer {token}
```
# Constraints
Constraints are used to build queries and are required in the `v2` API. They consist of a `Type` and that type's specific arguments. The implementation is in [Constraint.groovy](../transmart-core-db/src/main/groovy/org/transmartproject/db/multidimquery/query/Constraint.groovy).
## Combinations (And/Or)
Most often a combination of constraints is needed to get the right result. This can be done by the constraints with type "and" and "or".
They take a list `args` with constraints. All args will be evaluated together on each observation. So an 'and' operator with a `patient_set` and a `concept` will return all observations for the given concept linked to the patient set.
However an `and` constraint with two ConceptConstraints will evaluate to an empty result, as no observation can have two concepts. This is also true even if nested with a different combination because constraints do not know scope.
(There is also a constraint with type "combination" on which the And and Or constraints are built. It does not provide any functionality not provided by And and Or constraints, and it should be considered deprecated for direct usage.)
Example:
```json
{"type": "and",
"args": [
{"type": "patient_set", "patientIds": -62},
{"type": "concept", "path":" \\Public Studies\\EHR\\Vital Signs\\Heart Rate\\"}
]
}
```
```json
{"type": "or",
"args": [
{"type": "concept", "path":" \\Public Studies\\EHR\\Vital Signs\\Blood Pressure\\"}
{"type": "concept", "path":" \\Public Studies\\EHR\\Vital Signs\\Heart Rate\\"}
]
}
```
## StudyName
Evaluate if an observation is part of a particular study
Example:
```json
{
"type": "study_name",
"studyId": "EHR"
}
```
## Concept
Evaluate if an observation is of a particular Concept. Either by `path` or `conceptCode`.
```json
{
"type": "concept",
"path": "\\Public Studies\\EHR\\Vital Signs\\Heart Rate\\",
"conceptCode": "HR"
}
```
## Value
Evaluate if the value of an observation is within the given parameters. It needs a `valueType`, `operator` and `value`.
`valueType`: [\"NUMERIC\", \"STRING\"]
`operator`: [<, >, =, !=, <=, >=, in, like, contains]
Example:
```json
{
"type": "value",
"valueType": "NUMERIC",
"operator": "=", "value": 176
}
```
## Field
Evaluate if a specific field of an observation is within the given parameters. it needs a `field`, `operator` and `value`.
`operator`: [<, >, =, !=, <=, >=, in, like, contains]
Example:
```json
{
"type": "field",
"field": {
"dimension": "patient",
"fieldName": "age",
"type": "NUMERIC"
},
"operator": "!=",
"value": 100
}
```
## Time
Evaluate if an observation is within the specified time period. It needs a `field` the type of which needs to be `DATE`. It needs a time relevant `operator` and a list of `values`.
The list must hold one date for the before(<-) and after(->) operator. It must hold two dates for the between(<-->) operator. If the given date field for an observation is empty, the observation will be ignored.
`operator`: ["<-", "->", "<-->"]
Example:
```json
{
"type": "time",
"field": {
"dimension": "start time",
"fieldName": "startDate",
"type": "DATE"
},
"operator": "->",
"values": ["2016-01-01T00:00:00Z"]
}
```
## PatientSet
Evaluate if an observation is liked to a patient in the set. It needs either a `patientSetId` or a list of `patientIds`.
Example:
```json
{
"type": "patient_set",
"patientSetId": 28820,
"patientIds": [-62, -63]
}
```
## SubSelection
Create a subselection of patients, visits, or another dimension element, and then select all observations for these dimension elements.
Example: Select all observations for patients who have a certain diagnosis.
```json
{
"type": "subselection",
"dimension": "patient",
"constraint": {
"type": "and",
"args": [{
"type": "concept",
"path": "\\Public Studies\\EHR\\Diagnosis\\",
"conceptCode": "DIAG"
}, {
"type": "value",
"valueType": "STRING",
"operator": "=",
"value": "My eye hurts"
}]
}
}
```
## Temporal
Evaluate if an observation happened before or after an event. It needs an `operator` and an `event`. Any constraint can be used as an event. Most likely a combination.
`operator`: ["<-", "->", "exists"]
Example:
```json
{
"type": "temporal",
"operator": "exists",
"event": {
"type": "value",
"valueType": "NUMERIC",
"operator": "=",
"value": 60
}
}
```
## Null
Evaluate if an specific field of an observation is null. It needs a field.
Example:
```json
{
"type": "null",
"field":{
"dimension": "end time",
"fieldName": "endDate",
"type": "DATE"
}
}
```
## Modifier
Evaluate if an observation is linked to the specified modifier. Optionally if that modifier has the specific value. It must have a `path`, `dimensionName` or `modifierCode` and may have `values` in the form of a ValueConstraint.
Example:
```json
{
"type": "modifier",
"modifierCode": "TNS:SMPL",
"path": "\\Public Studies\\TUMOR_NORMAL_SAMPLES\\Sample Type\\",
"dimensionName": "sample_type",
"values": {
"type": "value",
"valueType": "STRING",
"operator": "=",
"value": "Tumor"
}
}
```
## Negation
Evaluate if for an observation the given `arg` is false. `arg` is a constraint.
Example:
```json
{
"type": "negation",
"arg": {
"type": "patient_set",
"patientIds": [-62,-52,-42]
}
}
```
returns all observations not linked to patient with id -62, -52 or -42
## Biomarker
Used to filter high dimensional observations. It needs a 'biomarkerType' and a 'params' object. It can only be used
when retrieving high dimensional data, and if so needs to be specified in a separate url parameter
`biomarker_constraint`.
`biomarkerType`: `["transcripts", "genes"]`.
Example:
```json
{
"type": "biomarker",
"biomarkerType": "genes",
"params": {
"names": ["TP53"]
}
}
```
## True
**!!WARNING!!** Use mainly for testing.
The most basic of constraints. Evaluates to true for all observations. This returns all observations the requesting user has access to.
Example:
```json
{
"type": "true"
}
```
# Response types
#### application/json
All calls support json. however this might not always be the best option. You will find schemas for the responses in this documentation.
#### `application/hal+json`
Only the tree_node endpoint supports the application/hal+json format.
#### `application/x-protobuf`
Calls that return observations support protobuf as a more efficient binary format. The description of the protobuf object can be found in [observations.proto](../transmart-rest-api/src/protobuf/v2/observations.proto). Information on [google protobuf](https://developers.google.com/protocol-buffers/).
schemes:
- http
- https
consumes:
- application/json
produces:
- application/json
securityDefinitions:
oauth:
type: oauth2
flow: implicit
authorizationUrl: '/oauth/authorize?response_type=token&client_id={client_id}&redirect_uri={redirect}'
scopes:
basic: to be able to interact with transmart REST-API
security:
- oauth:
- basic
paths:
/versions:
get:
description: |
Gets all available API versions and prefixes. The API version is separate from the version of transmart itself.
The API version follows semantic versioning: major versions can be incompatible, but minor version upgrades should be compatible with previous versions within the same major version. Patch versions are not used at the moment. The rest api can support multiple major versions at the same time using different prefixes.
The default settings expose this endpoint without any authentication requirements, as the version info may be needed to select an authentication method, however clients should be prepared to only be able to see the supported major versions without authentication. In that case the innermost dictionary in the response json will only contain "id", "prefix" and "major" keys.
Development and preview releases may also contain version tags, e.g. the version leading up to the development of 2.1 can be called 2.1-dev. Such tagged releases also support separate feature revisions. See `transmart-rest-api/grails-app/controllers/org/transmartproject/rest/VersionController.groovy` for details about that.
responses:
200:
description: |
Successful response. Example:
`{ "versions": {
"v2": {
"id": "v2",
"prefix": "/v2",
"version: "2.1",
"major": 2,
"minor": 1
}
} }`'
schema:
type: object
properties:
versions:
type: object
properties:
version ids:
$ref: "#/definitions/version"
/versions/{id}:
get:
description: |
Gets information about the version if available. This returns the same information as `/versions`, but only for a single version.
parameters:
- name: id
in: path
description: |
id of the version to fetch. Example: `GET /versions/v1`.
required: true
type: string
responses:
200:
description: Successful response.
schema:
$ref: "#/definitions/version"
404:
description: Version not available.
/v1/studies:
get:
description: |
Gets all `Study` objects.
tags:
- v1
responses:
200:
description: Successful response
schema:
type: object
properties:
studies:
type: array
items:
$ref: "#/definitions/jsonStudy"
/v1/studies (hal+json):
get:
description: |
Gets all `Study` objects.
produces:
- application/hal+json
tags:
- v1
responses:
200:
description: Successful response
schema:
$ref: "#/definitions/hal+jsonStudies"
/v1/studies/{studyid}:
get:
description: |
Gets a `Study` objects.
tags:
- v1
parameters:
- name: studyid
in: path
description: studyid to fetch
required: true
type: string
responses:
200:
description: Successful response
schema:
$ref: "#/definitions/jsonStudy"
/v1/studies/{studyid}/concepts:
get:
parameters:
- name: studyid
in: path
description: Study ID of the study for which concepts will be fetched
required: true
type: string
description: |
Gets all `concepts` for a study.
tags:
- v1
responses:
200:
description: Successful response
schema:
type: object
properties:
ontology_terms:
type: array
items:
$ref: "#/definitions/ontologyTerm"
/v1/studies/{studyid}/concepts/{conceptPath}:
get:
parameters:
- name: studyid
in: path
description: Study ID of the study for which concepts will be fetched
required: true
type: string
- name: conceptPath
in: path
description: Concept path for which info will be fetched
required: true
type: string
description: |
Gets a `concept` objects.
tags:
- v1
responses:
200:
description: Successful response
schema:
$ref: "#/definitions/ontologyTerm"
/v1/studies/{studyid}/subjects:
get:
parameters:
- name: studyid
in: path
description: Study ID of the study for which concepts will be fetched
required: true
type: string
description: |
Gets all `subjects` for a study.
tags:
- v1
responses:
200:
description: Successful response
schema:
type: object
properties:
subjects:
type: array
items:
$ref: '#/definitions/patient'
/v1/studies/{studyid}/subjects/{subjectid}:
get:
parameters:
- name: studyid
in: path
description: Study ID of the study for which concepts will be fetched
required: true
type: string
- name: subjectid
in: path
description: Subject ID of the subject which will be fetched
required: true
type: string
description: |
Gets a `subject` objects.
tags:
- v1
responses:
200:
description: Successful response
schema:
$ref: '#/definitions/patient'
/v1/studies/{studyid}/concepts/{conceptPath}/subjects:
get:
parameters:
- name: studyid
in: path
description: Study ID of the study for which concepts will be fetched
required: true
type: string
- name: conceptPath
in: path
description: Concept path for which info will be fetched
required: true
type: string
description: |
Gets all `subjects` for a given study and concept.
tags:
- v1
responses:
200:
description: Successful response
schema:
type: object
properties:
subjects:
type: array
items:
$ref: '#/definitions/patient'
/v1/studies/{studyid}/observations:
get:
parameters:
- name: studyid
in: path
description: Study ID of the study for which concepts will be fetched.
required: true
type: string
description: |
Gets all `observations` for a study.
tags:
- v1
responses:
200:
description: Successful response
schema:
type: array
items:
$ref: '#/definitions/v1observation'
/v1/observations:
get:
tags:
- v1
responses:
200:
description: Successful response
schema:
type: array
items:
$ref: '#/definitions/v1observation'
/v1/studies/{studyId}/concepts/{conceptPath}/observations:
get:
parameters:
- name: studyId
in: path
description: Study ID of the study for which concepts will be fetched
required: true
type: string
- name: conceptPath
in: path
description: Concept path
required: true
type: string
tags:
- v1
responses:
200:
description: Successful response
schema:
type: array
items:
$ref: '#/definitions/v1observation'
/v1/patient_sets/:
post:
parameters:
- name: i2b2query_xml
in: body
description: 'Body should be a query definition in a subset of the i2b2 XML schema.'
required: true
schema:
type: string
tags:
- v1
responses:
201:
description: Successful response
get:
tags:
- v1
responses:
200:
description: Successfull response
/v1/patient_sets/{resultInstanceId}:
get:
parameters:
- name: resultInstanceId
in: path
description: ID of the patient set, called resultInstance ID because internally it refers to the result of a query
required: true
type: string
tags:
- v1
responses:
200:
description: Successfull response
/v1/studies/{studyId}/concepts/{conceptPath}/highdim:
get:
parameters:
- name: studyId
in: path
description: Study ID of the study for which concepts will be fetched
required: true
type: string
- name: conceptPath
in: path
description: Concept path
required: true
type: string
- name: dataType
in: query
description: Data Type constraint
required: false
type: string
- name: projection
in: query
description: Projection applied to the HDD
required: false
type: string
- name: assayConstraints
in: query
description: Assay Constraints
required: false
type: string
- name: dataConstraints
in: query
description: Data constraint
required: false
type: string
tags:
- v1
responses:
200:
description: Successful response
/v2/studies:
get:
description: |
Gets all studies accessible by the user.
tags:
- v2
produces:
- application/json
responses:
200:
description: |
Returns a list of studies
schema:
type: object
properties:
studies:
type: array
items:
$ref: '#/definitions/v2Study'
/v2/studies/{id}:
get:
description: |
Gets the study with id `id`.
tags:
- v2
parameters:
- name: id
in: path
description: id of the study to fetch
required: true
type: string
responses:
200:
description: |
Returns one study
schema:
$ref: "#/definitions/v2Study"
404:
description: |
Study not found
/v2/studyId/{studyId}:
get:
description: |
Gets the study with study id `id`.
tags:
- v2
parameters:
- name: studyId
in: path
description: the study id of the study to fetch
required: true
type: string
responses:
200:
description: |
Returns one study
schema:
$ref: "#/definitions/v2Study"
404:
description: |
Study not found
/v2/supported_fields:
get:
description: |
Gets all supported dimension fields. These are the fields that can be used in field constraints.
tags:
- v2
responses:
200:
description: |
Returns a list of supported fields
schema:
type: array
items:
type: object
properties:
dimension:
type: string
fieldName:
type: string
type:
type: string
/v2/observations:
get:
description: |
Gets all observations that satisfy the given constaint. Only observations the calling user has access to are returned. Empty and null values are returned but have no value property
tags:
- v2
produces:
- application/json
- application/x-protobuf
parameters:
- name: type
required: true
in: query
description: 'specifies the type of the data you want to retrieve. For clinical data specify `clinical`,
for high dimensional data specify the data type or use `autodetect`. If you use `autodetect` the
constraints must be such that only a single type of high dimensional data matches.'
type: string
- name: constraint
required: true
in: query
description: 'json that specifies the constraint. Example: `{"type":"study_name", "studyId":"EHR"}` or
`{"type":"concept","path":"\\Public Studies\\CLINICAL_TRIAL_HIGHDIM\\High Dimensional data\\Expression Lung\\"}`.'
type: string
- name: biomarker_constraint
required: false
in: query
description: 'json that describes the biomarker. The only valid type is the ''biomarker'' constraint Example:
`{"type":"biomarker", "biomarkerType":"genes","params":{"names":["TP53"]}}`.'
type: string
- name: projection
required: false
in: query
description: 'The projection. Only used with high dimensional data Example: `all_data`, `zscore`,
`log_intensity`. Default: `all_data`.'
type: string
responses:
200:
description: |
Dimensions are described in the `header`. The order in which they appear in the header, determines the order in which they appear in the `cells` and footer. The value in the `dimensionIndexes` corresponds to the values in the `footer`.
schema:
$ref: '#/definitions/observations'
post:
description: |
Works the same as GET, but with support for longer constraints. Use this, if the total length of the URL may be longer than the maximum length.
tags:
- v2
consumes:
- application/json
produces:
- application/json
- application/x-protobuf
parameters:
- name: type
required: true
in: body
description: see GET parameters
type: string
- name: constraint
required: true
in: body
description: see GET parameters
type: string
- name: biomarker_constraint
required: false
in: body
description: see GET parameters
type: string
- name: projection
required: false
in: body
description: see GET parameters
type: string
responses:
200:
description: |
Dimensions are described in the `header`. The order in which they appear in the header, determines the order in which they appear in the `cells` and footer. The value in the `dimensionIndexes` corresponds to the values in the `footer`.
schema:
$ref: '#/definitions/observations'
/v2/observations/aggregate:
get:
description: |
Calculates and returns an aggregate value. Supported aggregate types are 'min', 'max', 'average', 'count', and
'values'. The first three require numeric variables, the last one categorical variables.
tags:
- v2
parameters:
- name: constraint
required: true
in: query
description: 'json that specifies the constraint. Example: `{"type":"concept","path":"\\Public Studies\\EHR\\Vital Signs\\Heart Rate\\"}`.'
type: string
- name: type
required: true
in: query
description: |
'min', 'max', 'average', 'count', or 'values'. This parameter can be specified multiple times to retrieve
multiple aggregates at once. The 'values' aggregate cannot be combined with the numeric aggregate types.
type: string
responses:
200:
description: 'return the result in a json object. Example: `{min: 56}`.'
schema:
type: object
description: 'only the value of the requested aggregate type will be present.'
properties:
min:
type: number
max:
type: number
average:
type: number
values:
type: array
items:
type: string
description: A list of the distinct values for categorical variables
post:
description: |
Works the same as GET, but with support for longer constraints. Use this, if the total length of the URL may be longer than the maximum length.
tags:
- v2
consumes:
- application/json
parameters:
- name: constraint
required: true
in: body
description: see GET parameters
type: string
- name: type
required: true
in: body
description: see GET parameters. Can be either a string or an array of strings.
type: string
responses:
200:
description: 'return the result in a json object. Example: `{min: 56}`.'
schema:
type: object
description: 'only the value of the requested aggregate type will be present.'
properties:
min:
type: number
max:
type: number
average:
type: number
/v2/observations/count:
get:
description: |
Counts the number of observations that satisfy the given constraint.
tags:
- v2
parameters:
- name: constraint
required: true
in: query
description: 'json that specifies the constraint. Example: `{"type":"concept","path":"\\Public Studies\\EHR\\Vital Signs\\Heart Rate\\"}`.'
type: string
responses:
200:
description: 'Return the result as a json object. Example: `{count: 56}`.'
schema:
type: object
properties:
count:
type: integer
post:
description: |
Works the same as GET, but with support for longer constraints. Use this, if the total length of the URL may be longer than the maximum length.
tags:
- v2
consumes:
- application/json
parameters:
- name: constraint
required: true
in: body
description: see GET parameters
type: string
responses:
200:
description: 'Return the result as a json object. Example: `{count: 56}`.'
schema:
type: object
properties:
count:
type: integer
/v2/patients:
get:
description: |
Gets all patients that have an observation that satisfy the given constaint. Only patients that the calling user has access to are returned.
tags:
- v2
parameters:
- name: constraint
required: true
in: query
description: 'json that specifies the constraint. Example: `{"type":"study_name","studyId":"EHR"}`.'
type: string
responses:
200:
description: OK
schema:
type: object
properties:
patients:
type: array
items:
$ref: '#/definitions/patient'
post:
description: |
Works the same as GET, but with support for longer constraints. Use this, if the total length of the URL may be longer than the maximum length.
tags:
- v2
consumes:
- application/json
parameters:
- name: constraint
required: true
in: body
description: see GET parameters
type: string
responses:
200:
description: OK
schema:
type: object
properties:
patients:
type: array
items:
$ref: '#/definitions/patient'
/v2/patients/{id}:
get:
description: |
Gets one patient object.
tags:
- v2
parameters:
- name: id
in: path
description: id to fetch
required: true
type: string
responses:
200:
description: |
Returns one patient
schema:
$ref: '#/definitions/patient'
/v2/patient_sets:
get:
tags:
- v2
responses:
200:
description: |
Gets all patient_sets accessible by the user.
schema:
$ref: '#/definitions/patient_set'
post:
description: |
creates a patient set with all patients that have an observation that satisfies the constaint given in the body. The set will only have patients the calling user access to. The constraint used to create the set will be stored in a database.
tags:
- v2
parameters:
- name: name
required: true
in: query
type: string
- name: constraint
description: 'json that specifies the constraint. Example: `{"type":"study_name","studyId":"EHR"}`.'
in: body
required: true
schema:
type: string
responses:
200:
description: |
an object with the created patient_set or error.
schema:
$ref: '#/definitions/patient_set'
/v2/patient_sets/{resultInstanceId}:
get:
parameters:
- name: resultInstanceId
in: path
description: |
ID of the patient set, called resultInstance ID because internally it refers to the result of a query
required: true
type: string
tags:
- v2
responses:
200:
description: |
Returns one patient_set.
schema:
$ref: '#/definitions/patient_set'
/v2/tree_nodes:
get: