-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi.yaml
More file actions
278 lines (252 loc) · 8.61 KB
/
api.yaml
File metadata and controls
278 lines (252 loc) · 8.61 KB
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
openapi: 3.0.0
info:
title: INDICATE Data Exchange API
version: 1.0.0
description: |
API for exchanging aggregated quality indicator results between
INDICATE data providers and the INDICATE hub.
The API has two operations: one for uploading aggregated quality
indicator results from a data provider to the hub and one for
querying aggregated quality indicator results across all
providers. The second operation is intended for use by data
providers as well as authorized 3rd-party users.
components:
schemas:
# General schemas
IndicatorId:
type: integer
minimum: 2000000101
description: |
The numeric ID of the OMOP Concept assigned by the
INDICATE project for identifying the particular quality
indicator.
ProviderId:
type: string
pattern: '[0-9a-f]{8,8}-[0-9a-f]{4,4}-[0-9a-f]{4,4}-[0-9a-f]{4,4}-[0-9a-f]{8,8}'
description: |
Unique ID of a data provider as a 16-byte UUID rendered as a
36-character string.
# Schemas related to indicator definitions
IndicatorInfo:
type: object
required:
- concept_id
- title
- description
properties:
concept_id:
$ref: '#/components/schemas/IndicatorId'
title:
type: string
description: |
The title of the quality indicator. Can be multiple words.
description:
type: string
description: |
A short description of the quality indicator. Typically a
single paragraph.
# Schemas related to indicator results
AggregationPeriodKind:
type: string
enum:
- daily
- weekly
- monthly
- yearly
description: |
The kind, in particular length, of aggregation period for a
single aggregated quality indicator value.
AggregatedQualityIndicatorValue:
type: object
required:
- aggregation_period_start
- indicator_id
- average_value
- observation_count
properties:
aggregation_period_start:
type: string
format: date-time
description: |
The start point in time of the period to which the
aggregated quality indicator value pertains.
The length or end point of the period is either encoded in
an adjacent property or evident from the context.
indicator_id:
$ref: '#/components/schemas/IndicatorId'
average_value:
type: number
format: double
description: |
The value of the quality indicator for the indicated
period.
The value is a non-negative real number. The value 0
indicates no conformance at all for the period in question
while positive number, typically up to 1, indicate some or
full conformance.
observation_count:
type: integer
minimum: 1
description: |
The number of quality indicator results the data provider
used to produce the aggregated (average) value.
AggregatedQualityIndicatorResult:
description: |
A aggregated quality indicator value with a description of the
aggregation period.
This type can be used when aggregated quality indicator
results are uploaded from a data provider to the hub so that
the provider id is evident from the context.
allOf:
- $ref: '#/components/schemas/AggregatedQualityIndicatorValue'
- type: object
required:
- aggregation_period_kind
properties:
aggregation_period_kind:
$ref: '#/components/schemas/AggregationPeriodKind'
AttributedQualityIndicatorResult:
allOf:
- $ref: '#/components/schemas/AggregatedQualityIndicatorValue'
- type: object
required:
- provider_id
properties:
provider_id:
$ref: '#/components/schemas/ProviderId'
responses:
BadRequest:
description: |
Bad Request - Invalid data or missing required fields
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: Error message
InternalServerError:
description: |
Internal Server Error - Unexpected error
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: Error message
paths:
/indicator-info:
get:
summary: |
Retrieve information such as OMOP Concept ID and a textual
description about all defined quality indicators.
responses:
'200':
description: |
Return to valid query which contains a of information
elements for all defined indicators.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/IndicatorInfo'
'400':
$ref: '#/components/responses/BadRequest'
'500':
$ref: '#/components/responses/InternalServerError'
/results:
get:
summary: |
Retrieve aggregated quality indicator results without
identifying information except pseudonymous data providers
ids.
A data provider should be able to recognize the data it
uploaded earlier based on the provider id.
The request must specify an aggregation kind and only results
aggregated according to the selected aggregation kind will be
returned.
The request can be restricted to a certain time period but the
corresponding parameters are optional. If they are not
supplied, all data is returned.
parameters:
- name: aggregation_kind
in: query
required: true
schema:
$ref: '#/components/schemas/AggregationPeriodKind'
description: |
This required parameter control from which aggregation
kind the returned data is taken.
- name: period_start
in: query
schema:
type: string
format: date-time
- name: period_end
in: query
schema:
type: string
format: date-time
# TODO(moringenj): maybe one more parameter - indicator_id:
responses:
'200':
description: |
Response to valid query which contains the aggregated
quality indicator results for the requested aggregation
kind and time period.
content:
application/json:
# TODO(moringenj): alternative design:
# [
# { "indicator": "q1",
# "providers": [
# { "provider": "p1", "data": [ {"time": ..., "value": ...}, ... ]},
# { "provider": "p2", "data": [ {"time": ..., "value": ...}, ... ]},
# ...
# ]
# },
# ...
# ]
schema:
type: array
items:
$ref: '#/components/schemas/AttributedQualityIndicatorResult'
'400':
$ref: '#/components/responses/BadRequest'
'500':
$ref: '#/components/responses/InternalServerError'
/provider-results:
post:
summary: |
Upload aggregated quality indicator results from one data
provider to the hub.
Each invocation of this operation uploads the entirety of the
aggregated indicator result data that the data provider has
produced so far. The intention is that the hub replaces all
data for that data provider with each invocation of this
operation.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
# TODO(moringenj): should we do this as an parameter with "in: path"?
provider_id:
$ref: '#/components/schemas/ProviderId'
results:
type: array
items:
$ref: '#/components/schemas/AggregatedQualityIndicatorResult'
responses:
'200':
description: Successfully uploaded data
'400':
$ref: '#/components/responses/BadRequest'
'500':
$ref: '#/components/responses/InternalServerError'