forked from cds-hooks/api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cds-hooks.yaml
235 lines (221 loc) · 5.23 KB
/
cds-hooks.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
swagger: '2.0'
################################################################################
# API Information #
################################################################################
info:
version: '1.0'
title: CDS Hooks REST API
host: cds-service-example.herokuapp.com
schemes:
- https
consumes:
- application/json
produces:
- application/json
################################################################################
# Paths #
################################################################################
paths:
/cds-services:
get:
description: Get a description of all CDS services offered by this CDS Provider
responses:
200:
description: Success (includes CDS service metadata)
schema:
$ref: '#/definitions/CDS%20Service%20Information'
/cds-services/{id}:
post:
description: Invoke a CDS service offered by this CDS Provider
parameters:
- name: id
in: path
description: The id of this CDS service
required: true
type: string
- name: request
in: body
description: Body of CDS service request
required: true
schema:
$ref: '#/definitions/CDS%20Request'
responses:
200:
description: Success (includes CDS Cards)
schema:
$ref: '#/definitions/CDS%20Response'
################################################################################
# Definitions #
################################################################################
definitions:
CDS Service Information:
type: object
properties:
services:
type: array
items:
$ref: '#/definitions/CDS%20Service'
CDS Service:
type: object
required:
- id
- hook
- description
properties:
id:
type: string
description: short id for this service, unique with the CDS Provider (will be used in URL paths)
hook:
type: string
description: The hook this service should be invoked on.
title:
type: string
description: Human-readable name for the CDS Service (e.g. "CMS Drug Pricing Service")
description:
type: string
description: Longer-form description of what the service offers
prefetch:
$ref: '#/definitions/Prefetch'
CDS Request:
type: object
required:
- hook
- hookInstance
- context
properties:
hook:
type: string
description: The hook that triggered this CDS Service call.
hookInstance:
type: string
format: uuid
fhirServer:
type: string
format: url
fhirAuthorization:
$ref: '#/definitions/FHIR%20Authorization'
context:
type: object
prefetch:
type: object
FHIR Authorization:
type: object
required:
- access_token
- token_type
- expires_in
- scope
- subject
properties:
access_token:
type: string
token_type:
type: string
enum:
- Bearer
expires_in:
type: integer
scope:
type: string
subject:
type: string
CDS Response:
type: object
required:
- cards
properties:
cards:
type: array
items:
$ref: '#/definitions/Card'
Card:
type: object
required:
- summary
- indicator
- source
properties:
summary:
type: string
detail:
type: string
indicator:
type: string
enum:
- info
- warning
- critical
source:
$ref: '#/definitions/Source'
suggestions:
type: array
items:
$ref: '#/definitions/Suggestion'
selectionBehavior:
type: string
enum:
- at-most-one
links:
type: array
items:
$ref: '#/definitions/Link'
Source:
type: object
required:
- label
properties:
label:
type: string
url:
type: string
format: url
icon:
type: string
format: url
Link:
type: object
properties:
label:
type: string
url:
type: string
format: url
type:
type: string
appContext:
type: string
Suggestion:
type: object
required:
- label
properties:
label:
type: string
uuid:
type: string
format: uuid
actions:
type: array
items:
$ref: '#/definitions/Action'
Action:
type: object
required:
- type
- description
properties:
type:
type: string
enum:
- create
- update
- delete
description:
type: string
resource:
type: object
Prefetch:
type: object
description: queries that the CDS Service would like the CDS Client to execute before every call
additionalProperties:
type: string