@anybio/govern 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/README.md +115 -30
- package/dist/adapters-DBLr_Frn.d.cts +39 -0
- package/dist/adapters-DBLr_Frn.d.ts +39 -0
- package/dist/chunk-3JV2R5IW.js +64 -0
- package/dist/chunk-CPNPQMEU.js +1860 -0
- package/dist/chunk-I5XIXB5M.cjs +1910 -0
- package/dist/chunk-XZHZBIZA.cjs +72 -0
- package/dist/cli.js +465 -115
- package/dist/{client-CU46a__g.d.cts → client-BeyMec7E.d.cts} +870 -152
- package/dist/{client-CU46a__g.d.ts → client-BeyMec7E.d.ts} +870 -152
- package/dist/index.cjs +165 -1536
- package/dist/index.d.cts +49 -7
- package/dist/index.d.ts +49 -7
- package/dist/index.js +1 -1503
- package/dist/langchain.cjs +65 -1501
- package/dist/langchain.d.cts +154 -17
- package/dist/langchain.d.ts +154 -17
- package/dist/langchain.js +59 -1495
- package/dist/vercel-ai.cjs +106 -1526
- package/dist/vercel-ai.d.cts +129 -8
- package/dist/vercel-ai.d.ts +129 -8
- package/dist/vercel-ai.js +100 -1520
- package/package.json +22 -21
- package/spec/README.md +17 -0
- package/spec/openapi.json +752 -158
package/spec/openapi.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "AnyBio Govern API",
|
|
5
5
|
"version": "1.0.0",
|
|
6
|
-
"description": "The Govern surface of the AnyBio API. Generated from the AnyBio Govern API specification, 2026-
|
|
6
|
+
"description": "The Govern surface of the AnyBio API. Generated from the AnyBio Govern API specification, 2026-11-19."
|
|
7
7
|
},
|
|
8
8
|
"servers": [
|
|
9
9
|
{
|
|
@@ -20,22 +20,43 @@
|
|
|
20
20
|
"/api/v1/govern/applications": {
|
|
21
21
|
"get": {
|
|
22
22
|
"operationId": "list_applications",
|
|
23
|
+
"parameters": [
|
|
24
|
+
{
|
|
25
|
+
"description": "List this project's applications only. It must be a live project of the organization in this environment. Omit it for every project's.",
|
|
26
|
+
"in": "header",
|
|
27
|
+
"name": "X-Project-Id",
|
|
28
|
+
"required": false,
|
|
29
|
+
"schema": {
|
|
30
|
+
"format": "int32",
|
|
31
|
+
"type": [
|
|
32
|
+
"integer",
|
|
33
|
+
"null"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
],
|
|
23
38
|
"responses": {
|
|
24
39
|
"200": {
|
|
25
40
|
"content": {
|
|
26
41
|
"application/json": {
|
|
27
42
|
"schema": {
|
|
28
43
|
"items": {
|
|
29
|
-
"$ref": "#/components/schemas/
|
|
44
|
+
"$ref": "#/components/schemas/ApplicationListItemDto"
|
|
30
45
|
},
|
|
31
46
|
"type": "array"
|
|
32
47
|
}
|
|
33
48
|
}
|
|
34
49
|
},
|
|
35
|
-
"description": "Applications in the caller's organization and environment"
|
|
50
|
+
"description": "Applications in the caller's organization and environment, each with its decision activity; under a project, that project's only"
|
|
51
|
+
},
|
|
52
|
+
"400": {
|
|
53
|
+
"description": "`X-Project-Id` is not one positive project id (`code: invalid_project_id`), or a `project_id` or `project_key` query parameter was sent (`code: project_field_removed`)"
|
|
36
54
|
},
|
|
37
55
|
"403": {
|
|
38
|
-
"description": "Requires
|
|
56
|
+
"description": "Requires a signed-in member of the organization or an Admin developer key"
|
|
57
|
+
},
|
|
58
|
+
"404": {
|
|
59
|
+
"description": "The request's project is not a live project of this organization in this environment (`code: project_not_in_scope`)"
|
|
39
60
|
}
|
|
40
61
|
},
|
|
41
62
|
"security": [
|
|
@@ -51,7 +72,23 @@
|
|
|
51
72
|
]
|
|
52
73
|
},
|
|
53
74
|
"post": {
|
|
75
|
+
"description": "The application belongs to the request's project: the project selected in\nthe console, or the key's own project. The body names no project; one that\nstill sends `project_id` is refused with `code: project_field_removed`. A\nrequest with no project is refused with `code: project_required`, so every\napplication has a project from the moment it exists.",
|
|
54
76
|
"operationId": "create_application",
|
|
77
|
+
"parameters": [
|
|
78
|
+
{
|
|
79
|
+
"description": "The project the application belongs to, for a signed-in console session. It must be a live project of the organization in this environment. A request with no project is refused with `code: project_required`.",
|
|
80
|
+
"in": "header",
|
|
81
|
+
"name": "X-Project-Id",
|
|
82
|
+
"required": false,
|
|
83
|
+
"schema": {
|
|
84
|
+
"format": "int32",
|
|
85
|
+
"type": [
|
|
86
|
+
"integer",
|
|
87
|
+
"null"
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
],
|
|
55
92
|
"requestBody": {
|
|
56
93
|
"content": {
|
|
57
94
|
"application/json": {
|
|
@@ -71,13 +108,16 @@
|
|
|
71
108
|
}
|
|
72
109
|
}
|
|
73
110
|
},
|
|
74
|
-
"description": "Application created; the key secret appears only here"
|
|
111
|
+
"description": "Application created in the request's project; the key secret appears only here"
|
|
75
112
|
},
|
|
76
113
|
"400": {
|
|
77
|
-
"description": "Invalid name, channel
|
|
114
|
+
"description": "Invalid name, channel or webhook URL; `code: project_field_removed`, the body names a project; or `code: project_required`, the request has no project"
|
|
78
115
|
},
|
|
79
116
|
"403": {
|
|
80
|
-
"description": "Requires an organization admin session or an Admin developer key"
|
|
117
|
+
"description": "Requires an organization admin session or an Admin developer key; or `code: channel_project_console_only`, a key named a `channel_policies` project"
|
|
118
|
+
},
|
|
119
|
+
"404": {
|
|
120
|
+
"description": "The request's project, or a `channel_policies` project, is not a live project of this organization in this environment"
|
|
81
121
|
},
|
|
82
122
|
"409": {
|
|
83
123
|
"description": "An application with this name already exists in this environment"
|
|
@@ -110,6 +150,19 @@
|
|
|
110
150
|
"format": "uuid",
|
|
111
151
|
"type": "string"
|
|
112
152
|
}
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"description": "The console's selected project. An application of another project answers as one that does not exist.",
|
|
156
|
+
"in": "header",
|
|
157
|
+
"name": "X-Project-Id",
|
|
158
|
+
"required": false,
|
|
159
|
+
"schema": {
|
|
160
|
+
"format": "int32",
|
|
161
|
+
"type": [
|
|
162
|
+
"integer",
|
|
163
|
+
"null"
|
|
164
|
+
]
|
|
165
|
+
}
|
|
113
166
|
}
|
|
114
167
|
],
|
|
115
168
|
"responses": {
|
|
@@ -121,10 +174,13 @@
|
|
|
121
174
|
}
|
|
122
175
|
}
|
|
123
176
|
},
|
|
124
|
-
"description": ""
|
|
177
|
+
"description": "OK"
|
|
178
|
+
},
|
|
179
|
+
"403": {
|
|
180
|
+
"description": "Requires a signed-in member of the organization or an Admin developer key"
|
|
125
181
|
},
|
|
126
182
|
"404": {
|
|
127
|
-
"description": "No such application in this organization and environment"
|
|
183
|
+
"description": "No such application in this organization and environment, or an application of another project (for a credential, and for the console with `X-Project-Id`), which answers the same"
|
|
128
184
|
}
|
|
129
185
|
},
|
|
130
186
|
"security": [
|
|
@@ -151,6 +207,19 @@
|
|
|
151
207
|
"format": "uuid",
|
|
152
208
|
"type": "string"
|
|
153
209
|
}
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"description": "The console's selected project. An application of another project answers as one that does not exist.",
|
|
213
|
+
"in": "header",
|
|
214
|
+
"name": "X-Project-Id",
|
|
215
|
+
"required": false,
|
|
216
|
+
"schema": {
|
|
217
|
+
"format": "int32",
|
|
218
|
+
"type": [
|
|
219
|
+
"integer",
|
|
220
|
+
"null"
|
|
221
|
+
]
|
|
222
|
+
}
|
|
154
223
|
}
|
|
155
224
|
],
|
|
156
225
|
"requestBody": {
|
|
@@ -172,13 +241,16 @@
|
|
|
172
241
|
}
|
|
173
242
|
}
|
|
174
243
|
},
|
|
175
|
-
"description": ""
|
|
244
|
+
"description": "OK"
|
|
176
245
|
},
|
|
177
246
|
"400": {
|
|
178
|
-
"description": "Invalid name, channel
|
|
247
|
+
"description": "Invalid name, channel or webhook URL; or `code: project_field_removed`, the body names a project (an application does not move between projects)"
|
|
248
|
+
},
|
|
249
|
+
"403": {
|
|
250
|
+
"description": "`code: channel_project_console_only`: a key's write would change a `channel_policies` project"
|
|
179
251
|
},
|
|
180
252
|
"404": {
|
|
181
|
-
"description": "No such application in this organization and environment"
|
|
253
|
+
"description": "No such application in this organization and environment, or an application of another project (for a credential, and for the console with `X-Project-Id`), which answers the same, or a `channel_policies` project is not a live project of this organization in this environment"
|
|
182
254
|
},
|
|
183
255
|
"409": {
|
|
184
256
|
"description": "An application with this name already exists in this environment"
|
|
@@ -211,6 +283,19 @@
|
|
|
211
283
|
"format": "uuid",
|
|
212
284
|
"type": "string"
|
|
213
285
|
}
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"description": "The console's selected project. An application of another project answers as one that does not exist.",
|
|
289
|
+
"in": "header",
|
|
290
|
+
"name": "X-Project-Id",
|
|
291
|
+
"required": false,
|
|
292
|
+
"schema": {
|
|
293
|
+
"format": "int32",
|
|
294
|
+
"type": [
|
|
295
|
+
"integer",
|
|
296
|
+
"null"
|
|
297
|
+
]
|
|
298
|
+
}
|
|
214
299
|
}
|
|
215
300
|
],
|
|
216
301
|
"responses": {
|
|
@@ -228,7 +313,7 @@
|
|
|
228
313
|
"description": "Key metadata, newest first; never a secret"
|
|
229
314
|
},
|
|
230
315
|
"404": {
|
|
231
|
-
"description": "No such application in this organization and environment"
|
|
316
|
+
"description": "No such application in this organization and environment, or an application of another project (for a credential, and for the console with `X-Project-Id`), which answers the same"
|
|
232
317
|
}
|
|
233
318
|
},
|
|
234
319
|
"security": [
|
|
@@ -257,6 +342,19 @@
|
|
|
257
342
|
"format": "uuid",
|
|
258
343
|
"type": "string"
|
|
259
344
|
}
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"description": "The console's selected project. An application of another project answers as one that does not exist.",
|
|
348
|
+
"in": "header",
|
|
349
|
+
"name": "X-Project-Id",
|
|
350
|
+
"required": false,
|
|
351
|
+
"schema": {
|
|
352
|
+
"format": "int32",
|
|
353
|
+
"type": [
|
|
354
|
+
"integer",
|
|
355
|
+
"null"
|
|
356
|
+
]
|
|
357
|
+
}
|
|
260
358
|
}
|
|
261
359
|
],
|
|
262
360
|
"requestBody": {
|
|
@@ -285,7 +383,7 @@
|
|
|
285
383
|
"description": "overlap_seconds out of range"
|
|
286
384
|
},
|
|
287
385
|
"404": {
|
|
288
|
-
"description": "No such application in this organization and environment"
|
|
386
|
+
"description": "No such application in this organization and environment, or an application of another project (for a credential, and for the console with `X-Project-Id`), which answers the same"
|
|
289
387
|
}
|
|
290
388
|
},
|
|
291
389
|
"security": [
|
|
@@ -316,6 +414,19 @@
|
|
|
316
414
|
"type": "string"
|
|
317
415
|
}
|
|
318
416
|
},
|
|
417
|
+
{
|
|
418
|
+
"description": "The console's selected project. An application of another project answers as one that does not exist.",
|
|
419
|
+
"in": "header",
|
|
420
|
+
"name": "X-Project-Id",
|
|
421
|
+
"required": false,
|
|
422
|
+
"schema": {
|
|
423
|
+
"format": "int32",
|
|
424
|
+
"type": [
|
|
425
|
+
"integer",
|
|
426
|
+
"null"
|
|
427
|
+
]
|
|
428
|
+
}
|
|
429
|
+
},
|
|
319
430
|
{
|
|
320
431
|
"description": "Inclusive start, RFC 3339; default fourteen days before `to`",
|
|
321
432
|
"in": "query",
|
|
@@ -344,13 +455,16 @@
|
|
|
344
455
|
}
|
|
345
456
|
}
|
|
346
457
|
},
|
|
347
|
-
"description": ""
|
|
458
|
+
"description": "OK"
|
|
348
459
|
},
|
|
349
460
|
"400": {
|
|
350
461
|
"description": "Window empty, inverted or longer than the maximum"
|
|
351
462
|
},
|
|
463
|
+
"403": {
|
|
464
|
+
"description": "Requires a signed-in member of the organization or an Admin developer key"
|
|
465
|
+
},
|
|
352
466
|
"404": {
|
|
353
|
-
"description": "No such application in this organization and environment"
|
|
467
|
+
"description": "No such application in this organization and environment, or an application of another project (for a credential, and for the console with `X-Project-Id`), which answers the same"
|
|
354
468
|
}
|
|
355
469
|
},
|
|
356
470
|
"security": [
|
|
@@ -381,6 +495,19 @@
|
|
|
381
495
|
"type": "string"
|
|
382
496
|
}
|
|
383
497
|
},
|
|
498
|
+
{
|
|
499
|
+
"description": "The console's selected project. An application of another project answers as one that does not exist.",
|
|
500
|
+
"in": "header",
|
|
501
|
+
"name": "X-Project-Id",
|
|
502
|
+
"required": false,
|
|
503
|
+
"schema": {
|
|
504
|
+
"format": "int32",
|
|
505
|
+
"type": [
|
|
506
|
+
"integer",
|
|
507
|
+
"null"
|
|
508
|
+
]
|
|
509
|
+
}
|
|
510
|
+
},
|
|
384
511
|
{
|
|
385
512
|
"description": "Inclusive start, RFC 3339; default fourteen days before `to`",
|
|
386
513
|
"in": "query",
|
|
@@ -411,10 +538,10 @@
|
|
|
411
538
|
"description": "Window empty, inverted or longer than the maximum"
|
|
412
539
|
},
|
|
413
540
|
"403": {
|
|
414
|
-
"description": "Requires
|
|
541
|
+
"description": "Requires a signed-in member of the organization or an Admin developer key"
|
|
415
542
|
},
|
|
416
543
|
"404": {
|
|
417
|
-
"description": "No such application in this organization and environment"
|
|
544
|
+
"description": "No such application in this organization and environment, or an application of another project (for a credential, and for the console with `X-Project-Id`), which answers the same"
|
|
418
545
|
}
|
|
419
546
|
},
|
|
420
547
|
"security": [
|
|
@@ -445,6 +572,19 @@
|
|
|
445
572
|
"type": "string"
|
|
446
573
|
}
|
|
447
574
|
},
|
|
575
|
+
{
|
|
576
|
+
"description": "The console's selected project. An application of another project answers as one that does not exist.",
|
|
577
|
+
"in": "header",
|
|
578
|
+
"name": "X-Project-Id",
|
|
579
|
+
"required": false,
|
|
580
|
+
"schema": {
|
|
581
|
+
"format": "int32",
|
|
582
|
+
"type": [
|
|
583
|
+
"integer",
|
|
584
|
+
"null"
|
|
585
|
+
]
|
|
586
|
+
}
|
|
587
|
+
},
|
|
448
588
|
{
|
|
449
589
|
"description": "Inclusive start, RFC 3339; default fourteen days before `to`",
|
|
450
590
|
"in": "query",
|
|
@@ -475,10 +615,10 @@
|
|
|
475
615
|
"description": "Window empty, inverted or longer than the maximum"
|
|
476
616
|
},
|
|
477
617
|
"403": {
|
|
478
|
-
"description": "Requires
|
|
618
|
+
"description": "Requires a signed-in member of the organization or an Admin developer key"
|
|
479
619
|
},
|
|
480
620
|
"404": {
|
|
481
|
-
"description": "No such application in this organization and environment"
|
|
621
|
+
"description": "No such application in this organization and environment, or an application of another project (for a credential, and for the console with `X-Project-Id`), which answers the same"
|
|
482
622
|
}
|
|
483
623
|
},
|
|
484
624
|
"security": [
|
|
@@ -508,6 +648,19 @@
|
|
|
508
648
|
"format": "uuid",
|
|
509
649
|
"type": "string"
|
|
510
650
|
}
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"description": "The console's selected project. An application of another project answers as one that does not exist.",
|
|
654
|
+
"in": "header",
|
|
655
|
+
"name": "X-Project-Id",
|
|
656
|
+
"required": false,
|
|
657
|
+
"schema": {
|
|
658
|
+
"format": "int32",
|
|
659
|
+
"type": [
|
|
660
|
+
"integer",
|
|
661
|
+
"null"
|
|
662
|
+
]
|
|
663
|
+
}
|
|
511
664
|
}
|
|
512
665
|
],
|
|
513
666
|
"responses": {
|
|
@@ -519,10 +672,10 @@
|
|
|
519
672
|
}
|
|
520
673
|
}
|
|
521
674
|
},
|
|
522
|
-
"description": ""
|
|
675
|
+
"description": "OK"
|
|
523
676
|
},
|
|
524
677
|
"404": {
|
|
525
|
-
"description": "No such application in this organization and environment"
|
|
678
|
+
"description": "No such application in this organization and environment, or an application of another project (for a credential, and for the console with `X-Project-Id`), which answers the same"
|
|
526
679
|
}
|
|
527
680
|
},
|
|
528
681
|
"security": [
|
|
@@ -552,6 +705,19 @@
|
|
|
552
705
|
"format": "uuid",
|
|
553
706
|
"type": "string"
|
|
554
707
|
}
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
"description": "The console's selected project. An application of another project answers as one that does not exist.",
|
|
711
|
+
"in": "header",
|
|
712
|
+
"name": "X-Project-Id",
|
|
713
|
+
"required": false,
|
|
714
|
+
"schema": {
|
|
715
|
+
"format": "int32",
|
|
716
|
+
"type": [
|
|
717
|
+
"integer",
|
|
718
|
+
"null"
|
|
719
|
+
]
|
|
720
|
+
}
|
|
555
721
|
}
|
|
556
722
|
],
|
|
557
723
|
"responses": {
|
|
@@ -569,7 +735,7 @@
|
|
|
569
735
|
"description": "Requires an organization admin session or an Admin developer key"
|
|
570
736
|
},
|
|
571
737
|
"404": {
|
|
572
|
-
"description": "No such application in this organization and environment"
|
|
738
|
+
"description": "No such application in this organization and environment, or an application of another project (for a credential, and for the console with `X-Project-Id`), which answers the same"
|
|
573
739
|
}
|
|
574
740
|
},
|
|
575
741
|
"security": [
|
|
@@ -610,7 +776,7 @@
|
|
|
610
776
|
}
|
|
611
777
|
}
|
|
612
778
|
},
|
|
613
|
-
"description": ""
|
|
779
|
+
"description": "OK"
|
|
614
780
|
},
|
|
615
781
|
"403": {
|
|
616
782
|
"description": "Not an application key"
|
|
@@ -664,7 +830,7 @@
|
|
|
664
830
|
}
|
|
665
831
|
}
|
|
666
832
|
},
|
|
667
|
-
"description": "The same
|
|
833
|
+
"description": "The same event was already recorded"
|
|
668
834
|
},
|
|
669
835
|
"201": {
|
|
670
836
|
"content": {
|
|
@@ -674,10 +840,10 @@
|
|
|
674
840
|
}
|
|
675
841
|
}
|
|
676
842
|
},
|
|
677
|
-
"description": "
|
|
843
|
+
"description": "Event recorded"
|
|
678
844
|
},
|
|
679
845
|
"400": {
|
|
680
|
-
"description": "
|
|
846
|
+
"description": "`superseded` sent by a caller; a hash missing on released or delivered, sent on another kind, or not 64 hex characters; a blank, oversized or control-character delivery_ref or reason"
|
|
681
847
|
},
|
|
682
848
|
"403": {
|
|
683
849
|
"description": "Not an application key"
|
|
@@ -686,7 +852,10 @@
|
|
|
686
852
|
"description": "No such decision for this application"
|
|
687
853
|
},
|
|
688
854
|
"409": {
|
|
689
|
-
"description": "A different
|
|
855
|
+
"description": "A different event of this kind is already recorded"
|
|
856
|
+
},
|
|
857
|
+
"422": {
|
|
858
|
+
"description": "An unknown kind, or a body that is not the request shape"
|
|
690
859
|
}
|
|
691
860
|
},
|
|
692
861
|
"security": [
|
|
@@ -694,7 +863,7 @@
|
|
|
694
863
|
"bearer_token": []
|
|
695
864
|
}
|
|
696
865
|
],
|
|
697
|
-
"summary": "
|
|
866
|
+
"summary": "Record an outcome event for a decision: `released`, `delivered`,\n`discarded` or `failed`. One event per kind per decision, `failed`\nexcepted: a replay that says the same thing is `200`, a different event of\na kind already recorded is `409`.",
|
|
698
867
|
"tags": [
|
|
699
868
|
"Govern"
|
|
700
869
|
]
|
|
@@ -791,10 +960,16 @@
|
|
|
791
960
|
"description": "Accepted (observe); evaluated off the request path, poll the decision id"
|
|
792
961
|
},
|
|
793
962
|
"400": {
|
|
794
|
-
"description": "Invalid identifiers, content, metadata
|
|
963
|
+
"description": "Invalid identifiers, content, metadata or `turn_ref`, an audience not allowed on the channel, a `retry_of` that names no retryable decision of this conversation or names one for another `patient_ref`, or a `supersedes` over 8 ids, naming a decision twice, naming the `retry_of` decision, or naming a decision of another application, conversation or `patient_ref`"
|
|
795
964
|
},
|
|
796
965
|
"403": {
|
|
797
966
|
"description": "Not an application key, or a key not bound to the named application"
|
|
967
|
+
},
|
|
968
|
+
"409": {
|
|
969
|
+
"description": "A `retry_of` that was already retried, or that names a turn that was retryable until a reviewer released or rejected it, another turn named it in `supersedes`, or a `delivered` event was reported on it; a `supersedes` naming an enforce decision still being decided, a decision that was delivered, one a reviewer released or rejected, or one another turn already superseded"
|
|
970
|
+
},
|
|
971
|
+
"422": {
|
|
972
|
+
"description": "A body that does not match the schema: an unknown channel or audience token, a missing or mistyped field. A field the schema does not name is ignored, not refused: check the spelling of `retry_of`, `turn_ref` and `supersedes`"
|
|
798
973
|
}
|
|
799
974
|
},
|
|
800
975
|
"security": [
|
|
@@ -876,6 +1051,19 @@
|
|
|
876
1051
|
"minimum": 0,
|
|
877
1052
|
"type": "integer"
|
|
878
1053
|
}
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
"description": "List the hand-offs of this project's applications only; a staff `application_id` of another project lists nothing. Omit it for every project's.",
|
|
1057
|
+
"in": "header",
|
|
1058
|
+
"name": "X-Project-Id",
|
|
1059
|
+
"required": false,
|
|
1060
|
+
"schema": {
|
|
1061
|
+
"format": "int32",
|
|
1062
|
+
"type": [
|
|
1063
|
+
"integer",
|
|
1064
|
+
"null"
|
|
1065
|
+
]
|
|
1066
|
+
}
|
|
879
1067
|
}
|
|
880
1068
|
],
|
|
881
1069
|
"responses": {
|
|
@@ -887,10 +1075,16 @@
|
|
|
887
1075
|
}
|
|
888
1076
|
}
|
|
889
1077
|
},
|
|
890
|
-
"description": ""
|
|
1078
|
+
"description": "OK"
|
|
1079
|
+
},
|
|
1080
|
+
"400": {
|
|
1081
|
+
"description": "A `project_id` or `project_key` query parameter (`code: project_field_removed`), or a malformed `X-Project-Id` (`code: invalid_project_id`)"
|
|
891
1082
|
},
|
|
892
1083
|
"403": {
|
|
893
1084
|
"description": "Not an application key or a staff session of the organization"
|
|
1085
|
+
},
|
|
1086
|
+
"404": {
|
|
1087
|
+
"description": "`X-Project-Id` names no live project of this organization and environment (`code: project_not_in_scope`)"
|
|
894
1088
|
}
|
|
895
1089
|
},
|
|
896
1090
|
"security": [
|
|
@@ -920,6 +1114,19 @@
|
|
|
920
1114
|
"format": "uuid",
|
|
921
1115
|
"type": "string"
|
|
922
1116
|
}
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
"description": "The console's selected project. A hand-off of another project's application answers as one that does not exist.",
|
|
1120
|
+
"in": "header",
|
|
1121
|
+
"name": "X-Project-Id",
|
|
1122
|
+
"required": false,
|
|
1123
|
+
"schema": {
|
|
1124
|
+
"format": "int32",
|
|
1125
|
+
"type": [
|
|
1126
|
+
"integer",
|
|
1127
|
+
"null"
|
|
1128
|
+
]
|
|
1129
|
+
}
|
|
923
1130
|
}
|
|
924
1131
|
],
|
|
925
1132
|
"responses": {
|
|
@@ -931,13 +1138,13 @@
|
|
|
931
1138
|
}
|
|
932
1139
|
}
|
|
933
1140
|
},
|
|
934
|
-
"description": ""
|
|
1141
|
+
"description": "OK"
|
|
935
1142
|
},
|
|
936
1143
|
"403": {
|
|
937
1144
|
"description": "Not an application key or a staff session of the organization"
|
|
938
1145
|
},
|
|
939
1146
|
"404": {
|
|
940
|
-
"description": "No such external hand-off in this organization and environment"
|
|
1147
|
+
"description": "No such external hand-off in this organization and environment, or, for staff, one of another project's application"
|
|
941
1148
|
}
|
|
942
1149
|
},
|
|
943
1150
|
"security": [
|
|
@@ -967,6 +1174,19 @@
|
|
|
967
1174
|
"format": "uuid",
|
|
968
1175
|
"type": "string"
|
|
969
1176
|
}
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
"description": "The console's selected project. A hand-off of another project's application answers as one that does not exist.",
|
|
1180
|
+
"in": "header",
|
|
1181
|
+
"name": "X-Project-Id",
|
|
1182
|
+
"required": false,
|
|
1183
|
+
"schema": {
|
|
1184
|
+
"format": "int32",
|
|
1185
|
+
"type": [
|
|
1186
|
+
"integer",
|
|
1187
|
+
"null"
|
|
1188
|
+
]
|
|
1189
|
+
}
|
|
970
1190
|
}
|
|
971
1191
|
],
|
|
972
1192
|
"requestBody": {
|
|
@@ -988,13 +1208,13 @@
|
|
|
988
1208
|
}
|
|
989
1209
|
}
|
|
990
1210
|
},
|
|
991
|
-
"description": ""
|
|
1211
|
+
"description": "OK"
|
|
992
1212
|
},
|
|
993
1213
|
"403": {
|
|
994
1214
|
"description": "Staff only, and only staff the routing names"
|
|
995
1215
|
},
|
|
996
1216
|
"404": {
|
|
997
|
-
"description": ""
|
|
1217
|
+
"description": "Not Found"
|
|
998
1218
|
},
|
|
999
1219
|
"409": {
|
|
1000
1220
|
"description": "The hand-off changed; refresh before acting"
|
|
@@ -1024,6 +1244,19 @@
|
|
|
1024
1244
|
"format": "uuid",
|
|
1025
1245
|
"type": "string"
|
|
1026
1246
|
}
|
|
1247
|
+
},
|
|
1248
|
+
{
|
|
1249
|
+
"description": "The console's selected project. A hand-off of another project's application answers as one that does not exist.",
|
|
1250
|
+
"in": "header",
|
|
1251
|
+
"name": "X-Project-Id",
|
|
1252
|
+
"required": false,
|
|
1253
|
+
"schema": {
|
|
1254
|
+
"format": "int32",
|
|
1255
|
+
"type": [
|
|
1256
|
+
"integer",
|
|
1257
|
+
"null"
|
|
1258
|
+
]
|
|
1259
|
+
}
|
|
1027
1260
|
}
|
|
1028
1261
|
],
|
|
1029
1262
|
"requestBody": {
|
|
@@ -1045,19 +1278,19 @@
|
|
|
1045
1278
|
}
|
|
1046
1279
|
}
|
|
1047
1280
|
},
|
|
1048
|
-
"description": ""
|
|
1281
|
+
"description": "OK"
|
|
1049
1282
|
},
|
|
1050
1283
|
"400": {
|
|
1051
1284
|
"description": "Missing outcome, note, or next due time"
|
|
1052
1285
|
},
|
|
1053
1286
|
"403": {
|
|
1054
|
-
"description": ""
|
|
1287
|
+
"description": "Forbidden"
|
|
1055
1288
|
},
|
|
1056
1289
|
"404": {
|
|
1057
|
-
"description": ""
|
|
1290
|
+
"description": "Not Found"
|
|
1058
1291
|
},
|
|
1059
1292
|
"409": {
|
|
1060
|
-
"description": ""
|
|
1293
|
+
"description": "Conflict"
|
|
1061
1294
|
}
|
|
1062
1295
|
},
|
|
1063
1296
|
"security": [
|
|
@@ -1084,6 +1317,19 @@
|
|
|
1084
1317
|
"format": "uuid",
|
|
1085
1318
|
"type": "string"
|
|
1086
1319
|
}
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
"description": "The console's selected project. A hand-off of another project's application answers as one that does not exist.",
|
|
1323
|
+
"in": "header",
|
|
1324
|
+
"name": "X-Project-Id",
|
|
1325
|
+
"required": false,
|
|
1326
|
+
"schema": {
|
|
1327
|
+
"format": "int32",
|
|
1328
|
+
"type": [
|
|
1329
|
+
"integer",
|
|
1330
|
+
"null"
|
|
1331
|
+
]
|
|
1332
|
+
}
|
|
1087
1333
|
}
|
|
1088
1334
|
],
|
|
1089
1335
|
"requestBody": {
|
|
@@ -1105,19 +1351,19 @@
|
|
|
1105
1351
|
}
|
|
1106
1352
|
}
|
|
1107
1353
|
},
|
|
1108
|
-
"description": ""
|
|
1354
|
+
"description": "OK"
|
|
1109
1355
|
},
|
|
1110
1356
|
"400": {
|
|
1111
|
-
"description": ""
|
|
1357
|
+
"description": "Bad Request"
|
|
1112
1358
|
},
|
|
1113
1359
|
"403": {
|
|
1114
|
-
"description": ""
|
|
1360
|
+
"description": "Forbidden"
|
|
1115
1361
|
},
|
|
1116
1362
|
"404": {
|
|
1117
|
-
"description": ""
|
|
1363
|
+
"description": "Not Found"
|
|
1118
1364
|
},
|
|
1119
1365
|
"409": {
|
|
1120
|
-
"description": ""
|
|
1366
|
+
"description": "Conflict"
|
|
1121
1367
|
}
|
|
1122
1368
|
},
|
|
1123
1369
|
"security": [
|
|
@@ -1144,6 +1390,19 @@
|
|
|
1144
1390
|
"format": "uuid",
|
|
1145
1391
|
"type": "string"
|
|
1146
1392
|
}
|
|
1393
|
+
},
|
|
1394
|
+
{
|
|
1395
|
+
"description": "The console's selected project. A hand-off of another project's application answers as one that does not exist.",
|
|
1396
|
+
"in": "header",
|
|
1397
|
+
"name": "X-Project-Id",
|
|
1398
|
+
"required": false,
|
|
1399
|
+
"schema": {
|
|
1400
|
+
"format": "int32",
|
|
1401
|
+
"type": [
|
|
1402
|
+
"integer",
|
|
1403
|
+
"null"
|
|
1404
|
+
]
|
|
1405
|
+
}
|
|
1147
1406
|
}
|
|
1148
1407
|
],
|
|
1149
1408
|
"requestBody": {
|
|
@@ -1165,19 +1424,19 @@
|
|
|
1165
1424
|
}
|
|
1166
1425
|
}
|
|
1167
1426
|
},
|
|
1168
|
-
"description": ""
|
|
1427
|
+
"description": "OK"
|
|
1169
1428
|
},
|
|
1170
1429
|
"400": {
|
|
1171
|
-
"description": ""
|
|
1430
|
+
"description": "Bad Request"
|
|
1172
1431
|
},
|
|
1173
1432
|
"403": {
|
|
1174
|
-
"description": ""
|
|
1433
|
+
"description": "Forbidden"
|
|
1175
1434
|
},
|
|
1176
1435
|
"404": {
|
|
1177
|
-
"description": ""
|
|
1436
|
+
"description": "Not Found"
|
|
1178
1437
|
},
|
|
1179
1438
|
"409": {
|
|
1180
|
-
"description": ""
|
|
1439
|
+
"description": "Conflict"
|
|
1181
1440
|
}
|
|
1182
1441
|
},
|
|
1183
1442
|
"security": [
|
|
@@ -1300,7 +1559,7 @@
|
|
|
1300
1559
|
}
|
|
1301
1560
|
}
|
|
1302
1561
|
},
|
|
1303
|
-
"description": ""
|
|
1562
|
+
"description": "OK"
|
|
1304
1563
|
},
|
|
1305
1564
|
"400": {
|
|
1306
1565
|
"description": "Invalid patient reference"
|
|
@@ -1396,7 +1655,7 @@
|
|
|
1396
1655
|
}
|
|
1397
1656
|
}
|
|
1398
1657
|
},
|
|
1399
|
-
"description": ""
|
|
1658
|
+
"description": "OK"
|
|
1400
1659
|
},
|
|
1401
1660
|
"403": {
|
|
1402
1661
|
"description": "Not an application key"
|
|
@@ -1443,7 +1702,7 @@
|
|
|
1443
1702
|
}
|
|
1444
1703
|
}
|
|
1445
1704
|
},
|
|
1446
|
-
"description": ""
|
|
1705
|
+
"description": "OK"
|
|
1447
1706
|
},
|
|
1448
1707
|
"403": {
|
|
1449
1708
|
"description": "Not an application key"
|
|
@@ -1509,7 +1768,7 @@
|
|
|
1509
1768
|
}
|
|
1510
1769
|
}
|
|
1511
1770
|
},
|
|
1512
|
-
"description": ""
|
|
1771
|
+
"description": "OK"
|
|
1513
1772
|
},
|
|
1514
1773
|
"403": {
|
|
1515
1774
|
"description": "Not an application key"
|
|
@@ -1561,12 +1820,12 @@
|
|
|
1561
1820
|
},
|
|
1562
1821
|
"frequency_cap": {
|
|
1563
1822
|
"oneOf": [
|
|
1564
|
-
{
|
|
1565
|
-
"type": "null"
|
|
1566
|
-
},
|
|
1567
1823
|
{
|
|
1568
1824
|
"$ref": "#/components/schemas/FrequencyCap",
|
|
1569
1825
|
"description": "The per-patient message cap per fixed window, if any."
|
|
1826
|
+
},
|
|
1827
|
+
{
|
|
1828
|
+
"type": "null"
|
|
1570
1829
|
}
|
|
1571
1830
|
]
|
|
1572
1831
|
},
|
|
@@ -1577,11 +1836,11 @@
|
|
|
1577
1836
|
"handoff_routing": {
|
|
1578
1837
|
"oneOf": [
|
|
1579
1838
|
{
|
|
1580
|
-
"
|
|
1839
|
+
"$ref": "#/components/schemas/RoutingPolicy",
|
|
1840
|
+
"description": "The routing hand-offs opened for this application's patients are given;\n`null` opens them on the organization's default queue."
|
|
1581
1841
|
},
|
|
1582
1842
|
{
|
|
1583
|
-
"
|
|
1584
|
-
"description": "The routing hand-offs opened for this application's patients are given; `null` opens them on the organization's default queue."
|
|
1843
|
+
"type": "null"
|
|
1585
1844
|
}
|
|
1586
1845
|
]
|
|
1587
1846
|
},
|
|
@@ -1597,7 +1856,7 @@
|
|
|
1597
1856
|
"type": "integer"
|
|
1598
1857
|
},
|
|
1599
1858
|
"project_id": {
|
|
1600
|
-
"description": "
|
|
1859
|
+
"description": "The project the application belongs to, set when it is created. Its\nactive policy decides the application's turns, else the environment's\ndefault policy. `null` only for an older application in an environment\nthat had no project to give it.",
|
|
1601
1860
|
"format": "int32",
|
|
1602
1861
|
"type": [
|
|
1603
1862
|
"integer",
|
|
@@ -1701,6 +1960,35 @@
|
|
|
1701
1960
|
],
|
|
1702
1961
|
"type": "object"
|
|
1703
1962
|
},
|
|
1963
|
+
"ApplicationListItemDto": {
|
|
1964
|
+
"allOf": [
|
|
1965
|
+
{
|
|
1966
|
+
"$ref": "#/components/schemas/ApplicationDto"
|
|
1967
|
+
},
|
|
1968
|
+
{
|
|
1969
|
+
"properties": {
|
|
1970
|
+
"decisions_7d": {
|
|
1971
|
+
"description": "Decision records in the trailing seven days, every mode, status and\ndecision value counted. A retried turn counts once. Equals the observe\nreport's `totals.decisions` over the same seven days.",
|
|
1972
|
+
"format": "int64",
|
|
1973
|
+
"type": "integer"
|
|
1974
|
+
},
|
|
1975
|
+
"last_decision_at": {
|
|
1976
|
+
"description": "When the application's most recent decision record was made (for a\ntranscript turn, when the turn was sent). `null` when it has none.",
|
|
1977
|
+
"format": "date-time",
|
|
1978
|
+
"type": [
|
|
1979
|
+
"string",
|
|
1980
|
+
"null"
|
|
1981
|
+
]
|
|
1982
|
+
}
|
|
1983
|
+
},
|
|
1984
|
+
"required": [
|
|
1985
|
+
"decisions_7d"
|
|
1986
|
+
],
|
|
1987
|
+
"type": "object"
|
|
1988
|
+
}
|
|
1989
|
+
],
|
|
1990
|
+
"description": "One item of the applications list: the application, and its decision\nactivity. Counts and a time only; no decision content."
|
|
1991
|
+
},
|
|
1704
1992
|
"CareHandoff": {
|
|
1705
1993
|
"properties": {
|
|
1706
1994
|
"application_id": {
|
|
@@ -1780,6 +2068,10 @@
|
|
|
1780
2068
|
"format": "uuid",
|
|
1781
2069
|
"type": "string"
|
|
1782
2070
|
},
|
|
2071
|
+
"kind": {
|
|
2072
|
+
"description": "What the item is for. `general` is the messaging and follow-up item\nevery automated source joins; staff-opened and discharge items carry\ntheir own kind. A patient has at most one active item of each kind.",
|
|
2073
|
+
"type": "string"
|
|
2074
|
+
},
|
|
1783
2075
|
"organization_id": {
|
|
1784
2076
|
"format": "int32",
|
|
1785
2077
|
"type": "integer"
|
|
@@ -1795,6 +2087,14 @@
|
|
|
1795
2087
|
"description": "Whether this item also pauses automated messaging to its subject. `automation_resumed_at == null` alone says only that a person owns the item (one per patient, whichever kind it is). Automation is paused while `automation_resumed_at == null && pauses_automation`. A red flag, an exhausted budget, a missing policy, an unknown wire outcome and the Govern route-to-human path all pause; an item that only owes a patient a reply does not.",
|
|
1796
2088
|
"type": "boolean"
|
|
1797
2089
|
},
|
|
2090
|
+
"project_id": {
|
|
2091
|
+
"description": "The project of the episode the hand-off was opened from. Null for a\nhand-off opened without an episode, and for one about an application's\npatient.",
|
|
2092
|
+
"format": "int32",
|
|
2093
|
+
"type": [
|
|
2094
|
+
"integer",
|
|
2095
|
+
"null"
|
|
2096
|
+
]
|
|
2097
|
+
},
|
|
1798
2098
|
"queue_label": {
|
|
1799
2099
|
"type": "string"
|
|
1800
2100
|
},
|
|
@@ -1824,10 +2124,10 @@
|
|
|
1824
2124
|
"routing_snapshot": {
|
|
1825
2125
|
"oneOf": [
|
|
1826
2126
|
{
|
|
1827
|
-
"
|
|
2127
|
+
"$ref": "#/components/schemas/Value"
|
|
1828
2128
|
},
|
|
1829
2129
|
{
|
|
1830
|
-
"
|
|
2130
|
+
"type": "null"
|
|
1831
2131
|
}
|
|
1832
2132
|
]
|
|
1833
2133
|
},
|
|
@@ -1856,6 +2156,7 @@
|
|
|
1856
2156
|
"organization_id",
|
|
1857
2157
|
"environment_id",
|
|
1858
2158
|
"reason",
|
|
2159
|
+
"kind",
|
|
1859
2160
|
"state",
|
|
1860
2161
|
"queue_label",
|
|
1861
2162
|
"pauses_automation",
|
|
@@ -1906,6 +2207,14 @@
|
|
|
1906
2207
|
"format": "int32",
|
|
1907
2208
|
"type": "integer"
|
|
1908
2209
|
},
|
|
2210
|
+
"project_id": {
|
|
2211
|
+
"description": "The project of the event's hand-off.",
|
|
2212
|
+
"format": "int32",
|
|
2213
|
+
"type": [
|
|
2214
|
+
"integer",
|
|
2215
|
+
"null"
|
|
2216
|
+
]
|
|
2217
|
+
},
|
|
1909
2218
|
"source_key": {
|
|
1910
2219
|
"type": "string"
|
|
1911
2220
|
}
|
|
@@ -1946,15 +2255,15 @@
|
|
|
1946
2255
|
"mode": {
|
|
1947
2256
|
"oneOf": [
|
|
1948
2257
|
{
|
|
1949
|
-
"
|
|
2258
|
+
"$ref": "#/components/schemas/GovernMode"
|
|
1950
2259
|
},
|
|
1951
2260
|
{
|
|
1952
|
-
"
|
|
2261
|
+
"type": "null"
|
|
1953
2262
|
}
|
|
1954
2263
|
]
|
|
1955
2264
|
},
|
|
1956
2265
|
"project_id": {
|
|
1957
|
-
"description": "The project whose active policy decides this channel; `null` means the\napplication's `
|
|
2266
|
+
"description": "The project whose active policy decides this channel; `null` means the\napplication's own project. A policy belongs to one environment, so this\nmust be a live project of the organization in the application's\nenvironment; any other is a `404`. Set from the console only: a request\nmade with a key may send back the value already stored, and may not\nchange it.",
|
|
1958
2267
|
"format": "int32",
|
|
1959
2268
|
"type": [
|
|
1960
2269
|
"integer",
|
|
@@ -1971,6 +2280,47 @@
|
|
|
1971
2280
|
},
|
|
1972
2281
|
"type": "object"
|
|
1973
2282
|
},
|
|
2283
|
+
"ClaimMatch": {
|
|
2284
|
+
"description": "One term the gate matched in the evaluated text.\n\nThe evaluated text is the submitted content with leading and trailing\ncharacters of the Unicode `White_Space` property removed (not the set\nJavaScript's `trim` removes). Wherever a response carries that text, index\nit rather than re-trimming. One entry per occurrence: a phrase that appears\ntwice is two matches with two ranges.",
|
|
2285
|
+
"properties": {
|
|
2286
|
+
"list": {
|
|
2287
|
+
"$ref": "#/components/schemas/MatchList",
|
|
2288
|
+
"description": "The vocabulary the entry belongs to."
|
|
2289
|
+
},
|
|
2290
|
+
"phrase": {
|
|
2291
|
+
"description": "The policy entry that matched, as stored (lower-case). The matched\ntext itself is at `range`, and may differ in case, inflection,\nhyphenation or apostrophe.",
|
|
2292
|
+
"type": "string"
|
|
2293
|
+
},
|
|
2294
|
+
"range": {
|
|
2295
|
+
"oneOf": [
|
|
2296
|
+
{
|
|
2297
|
+
"$ref": "#/components/schemas/MatchRange",
|
|
2298
|
+
"description": "Where the match sits in the evaluated text. Present on every `term`\nmatch; a client renders a message-level flag when it is absent."
|
|
2299
|
+
},
|
|
2300
|
+
{
|
|
2301
|
+
"type": "null"
|
|
2302
|
+
}
|
|
2303
|
+
]
|
|
2304
|
+
},
|
|
2305
|
+
"reason": {
|
|
2306
|
+
"description": "The policy author's reason for the entry; null when it has none.",
|
|
2307
|
+
"type": [
|
|
2308
|
+
"string",
|
|
2309
|
+
"null"
|
|
2310
|
+
]
|
|
2311
|
+
},
|
|
2312
|
+
"source": {
|
|
2313
|
+
"$ref": "#/components/schemas/MatchSource",
|
|
2314
|
+
"description": "How the match was found."
|
|
2315
|
+
}
|
|
2316
|
+
},
|
|
2317
|
+
"required": [
|
|
2318
|
+
"phrase",
|
|
2319
|
+
"list",
|
|
2320
|
+
"source"
|
|
2321
|
+
],
|
|
2322
|
+
"type": "object"
|
|
2323
|
+
},
|
|
1974
2324
|
"ConsentRequest": {
|
|
1975
2325
|
"description": "`POST /api/v1/govern/patients/consent`. The reference travels in the body,\nnever in a path, so it is never in a request log.",
|
|
1976
2326
|
"properties": {
|
|
@@ -1985,10 +2335,10 @@
|
|
|
1985
2335
|
"channel": {
|
|
1986
2336
|
"oneOf": [
|
|
1987
2337
|
{
|
|
1988
|
-
"
|
|
2338
|
+
"$ref": "#/components/schemas/GovernChannel"
|
|
1989
2339
|
},
|
|
1990
2340
|
{
|
|
1991
|
-
"
|
|
2341
|
+
"type": "null"
|
|
1992
2342
|
}
|
|
1993
2343
|
]
|
|
1994
2344
|
},
|
|
@@ -2040,7 +2390,7 @@
|
|
|
2040
2390
|
"type": "object"
|
|
2041
2391
|
},
|
|
2042
2392
|
"Counts": {
|
|
2043
|
-
"description": "Counts keyed by the raw gate decision (`allow`, `
|
|
2393
|
+
"description": "Counts keyed by the raw gate decision (`allow`, `flag`,\n`block_and_review`, `policy_missing`, `unavailable`; `rewrite` for turns\nrecorded before `flag` replaced it) for observe turns, and\nby the binding answer (`allow`, `hold`, `block`) for enforce turns. An\nobserve `flag` (or `rewrite`) for a clinician audience is counted as\n`flagged` instead: the clinician would have received the draft with its\nmatches.",
|
|
2044
2394
|
"properties": {
|
|
2045
2395
|
"enforced": {
|
|
2046
2396
|
"additionalProperties": {
|
|
@@ -2070,6 +2420,7 @@
|
|
|
2070
2420
|
"type": "object"
|
|
2071
2421
|
},
|
|
2072
2422
|
"CreateApplicationRequest": {
|
|
2423
|
+
"description": "A new application. It belongs to the request's project, which the body\ndoes not name: the project selected in the console, or the key's own\nproject. That project's active policy, else the environment's default\npolicy, decides the application's turns.",
|
|
2073
2424
|
"properties": {
|
|
2074
2425
|
"channel_policies": {
|
|
2075
2426
|
"additionalProperties": {
|
|
@@ -2086,45 +2437,38 @@
|
|
|
2086
2437
|
"default_mode": {
|
|
2087
2438
|
"oneOf": [
|
|
2088
2439
|
{
|
|
2089
|
-
"
|
|
2440
|
+
"$ref": "#/components/schemas/GovernMode"
|
|
2090
2441
|
},
|
|
2091
2442
|
{
|
|
2092
|
-
"
|
|
2443
|
+
"type": "null"
|
|
2093
2444
|
}
|
|
2094
2445
|
]
|
|
2095
2446
|
},
|
|
2096
2447
|
"frequency_cap": {
|
|
2097
2448
|
"oneOf": [
|
|
2098
2449
|
{
|
|
2099
|
-
"
|
|
2450
|
+
"$ref": "#/components/schemas/FrequencyCap",
|
|
2451
|
+
"description": "The per-patient message cap per fixed window; none by default."
|
|
2100
2452
|
},
|
|
2101
2453
|
{
|
|
2102
|
-
"
|
|
2103
|
-
"description": "The per-patient message cap per fixed window; none by\ndefault."
|
|
2454
|
+
"type": "null"
|
|
2104
2455
|
}
|
|
2105
2456
|
]
|
|
2106
2457
|
},
|
|
2107
2458
|
"handoff_routing": {
|
|
2108
2459
|
"oneOf": [
|
|
2109
2460
|
{
|
|
2110
|
-
"
|
|
2461
|
+
"$ref": "#/components/schemas/RoutingPolicy",
|
|
2462
|
+
"description": "The routing a hand-off opened for this application's patients is given:\nqueue label, primary and backup staff, response and\nescalation seconds. Staff must be members of the organization."
|
|
2111
2463
|
},
|
|
2112
2464
|
{
|
|
2113
|
-
"
|
|
2114
|
-
"description": "The routing a hand-off opened for this application's patients is given: queue label, primary and backup staff, response and\nescalation seconds. Staff must be members of the organization."
|
|
2465
|
+
"type": "null"
|
|
2115
2466
|
}
|
|
2116
2467
|
]
|
|
2117
2468
|
},
|
|
2118
2469
|
"name": {
|
|
2119
2470
|
"type": "string"
|
|
2120
2471
|
},
|
|
2121
|
-
"project_id": {
|
|
2122
|
-
"format": "int32",
|
|
2123
|
-
"type": [
|
|
2124
|
-
"integer",
|
|
2125
|
-
"null"
|
|
2126
|
-
]
|
|
2127
|
-
},
|
|
2128
2472
|
"red_flag_categories": {
|
|
2129
2473
|
"description": "The red-flag categories the inbound screen runs with (`cardiac`,\n`respiratory`, `neuro_stroke`, `self_harm`). Default: all four.",
|
|
2130
2474
|
"items": {
|
|
@@ -2214,7 +2558,7 @@
|
|
|
2214
2558
|
]
|
|
2215
2559
|
},
|
|
2216
2560
|
"deliverable_content": {
|
|
2217
|
-
"description": "Clinician audience only: the
|
|
2561
|
+
"description": "Clinician audience only, on a `flagged` decision: the draft as\nevaluated, which is what to deliver. The service never rewrites a\ndraft, so this is your own content, trimmed. Never present for a\npatient audience.",
|
|
2218
2562
|
"type": [
|
|
2219
2563
|
"string",
|
|
2220
2564
|
"null"
|
|
@@ -2229,14 +2573,18 @@
|
|
|
2229
2573
|
"disclosure_required": {
|
|
2230
2574
|
"type": "boolean"
|
|
2231
2575
|
},
|
|
2576
|
+
"flagged": {
|
|
2577
|
+
"description": "The draft was delivered with flags: `allow` for a clinician audience\nunder a policy whose outcome is `flag`. Deliver the draft unchanged and\nshow the reader `matches`. `false` for a clean `allow` and for every\n`hold` and `block`.",
|
|
2578
|
+
"type": "boolean"
|
|
2579
|
+
},
|
|
2232
2580
|
"handoff": {
|
|
2233
2581
|
"oneOf": [
|
|
2234
|
-
{
|
|
2235
|
-
"type": "null"
|
|
2236
|
-
},
|
|
2237
2582
|
{
|
|
2238
2583
|
"$ref": "#/components/schemas/HandoffRef",
|
|
2239
2584
|
"description": "The hand-off this decision opened or joined, with its current state."
|
|
2585
|
+
},
|
|
2586
|
+
{
|
|
2587
|
+
"type": "null"
|
|
2240
2588
|
}
|
|
2241
2589
|
]
|
|
2242
2590
|
},
|
|
@@ -2247,6 +2595,13 @@
|
|
|
2247
2595
|
},
|
|
2248
2596
|
"type": "array"
|
|
2249
2597
|
},
|
|
2598
|
+
"matches": {
|
|
2599
|
+
"description": "Each term behind a violation, positioned in the evaluated text. One\nentry per occurrence, in reading order. Each carries the policy entry\n(`phrase`), the list it belongs to, the policy author's `reason` (null\nwhen the entry has none), how it was found (`source`; always `term`\ntoday) and `range`, the span in UTF-16 code units with `end` exclusive.\n\nThe evaluated text is the `content` you sent with leading and trailing\ncharacters of the Unicode `White_Space` property removed. That is not\nwhat JavaScript's `String.prototype.trim` removes (it also removes\nU+FEFF and keeps U+0085), so do not re-trim to find it: when\n`deliverable_content` is present it is exactly the evaluated text, and\n`deliverable_content.slice(range.start, range.end)` is the matched\ntext. Render a message-level flag for a match with no `range`. Empty on\ndecisions recorded before matches were.",
|
|
2600
|
+
"items": {
|
|
2601
|
+
"$ref": "#/components/schemas/ClaimMatch"
|
|
2602
|
+
},
|
|
2603
|
+
"type": "array"
|
|
2604
|
+
},
|
|
2250
2605
|
"mode": {
|
|
2251
2606
|
"$ref": "#/components/schemas/GovernMode"
|
|
2252
2607
|
},
|
|
@@ -2266,21 +2621,21 @@
|
|
|
2266
2621
|
"outcome": {
|
|
2267
2622
|
"oneOf": [
|
|
2268
2623
|
{
|
|
2269
|
-
"
|
|
2624
|
+
"$ref": "#/components/schemas/OutcomeView",
|
|
2625
|
+
"description": "What became of the reply: the outcome events on record, in the order\nthey were recorded, and the `state` they add up to (`delivered`, else\n`superseded`, else `discarded`, else `failed`, else `released`). Null\nuntil the first event. `superseded` is recorded by the service when a\nlater turn names this decision in `supersedes` or retries it."
|
|
2270
2626
|
},
|
|
2271
2627
|
{
|
|
2272
|
-
"
|
|
2273
|
-
"description": "What the customer reported delivering, once it has."
|
|
2628
|
+
"type": "null"
|
|
2274
2629
|
}
|
|
2275
2630
|
]
|
|
2276
2631
|
},
|
|
2277
2632
|
"policy": {
|
|
2278
2633
|
"oneOf": [
|
|
2279
2634
|
{
|
|
2280
|
-
"
|
|
2635
|
+
"$ref": "#/components/schemas/PolicyRef"
|
|
2281
2636
|
},
|
|
2282
2637
|
{
|
|
2283
|
-
"
|
|
2638
|
+
"type": "null"
|
|
2284
2639
|
}
|
|
2285
2640
|
]
|
|
2286
2641
|
},
|
|
@@ -2303,13 +2658,25 @@
|
|
|
2303
2658
|
"null"
|
|
2304
2659
|
]
|
|
2305
2660
|
},
|
|
2661
|
+
"retry_of": {
|
|
2662
|
+
"description": "The decision this turn retries, when it is a retry. Null otherwise.",
|
|
2663
|
+
"format": "uuid",
|
|
2664
|
+
"type": [
|
|
2665
|
+
"string",
|
|
2666
|
+
"null"
|
|
2667
|
+
]
|
|
2668
|
+
},
|
|
2669
|
+
"retryable": {
|
|
2670
|
+
"description": "Your application may write ONE new draft for this turn and evaluate\nit with `retry_of` set to this `decision_id`.\n\n`true` only when this turn was stopped in enforce mode, for a patient,\nbecause of the draft's own content (the `reasons` name a clinical\nclaim the program may not make, or a missing disclaimer), the stop\nclass is `uncertain`, the policy does not review every send, and the\nhold is still pending. It is `false` for a `never_sendable` stop, for\nevery stop about the patient rather than the draft (an opt-out, a\nconsent, a frequency cap, a missing disclosure), for a missing policy,\nfor a turn that is itself a retry at the platform's limit, for a turn\nwhose inbound routed the patient to a person, and once a reviewer has\nacted. Add the `reasons` and the policy's rules to your\nmodel's instructions; this service never writes the new draft.",
|
|
2671
|
+
"type": "boolean"
|
|
2672
|
+
},
|
|
2306
2673
|
"review_state": {
|
|
2307
2674
|
"oneOf": [
|
|
2308
2675
|
{
|
|
2309
|
-
"
|
|
2676
|
+
"$ref": "#/components/schemas/ReviewState"
|
|
2310
2677
|
},
|
|
2311
2678
|
{
|
|
2312
|
-
"
|
|
2679
|
+
"type": "null"
|
|
2313
2680
|
}
|
|
2314
2681
|
]
|
|
2315
2682
|
},
|
|
@@ -2335,6 +2702,10 @@
|
|
|
2335
2702
|
"description": "Send your holding line to this patient now.\n\nThis turn was stopped and the patient is waiting on a reply that is not coming, so the application sends the fixed text its clinical owner wrote: a person will reply, when, and what to do if it is urgent. **The contract says when, never what**: the text is the application's own, it is never model-written, and this service does not send it on the application's behalf.\n\n`false` whenever another send would be the wrong thing rather than merely unnecessary: an opt-out, a missing or revoked consent, and a frequency cap each stop the turn because this patient should not be messaged, and a holding line is a message. It is also `false` in observe, where nothing was stopped and the caller was told to deliver.\n\nOne per stopped turn: each `evaluate` is one turn, so a second stopped draft in the same conversation is a second turn with its own answer.",
|
|
2336
2703
|
"type": "boolean"
|
|
2337
2704
|
},
|
|
2705
|
+
"show_hold_text": {
|
|
2706
|
+
"description": "Show your hold text in place of the stopped draft.\n\n`true` when this turn was stopped (`hold` or `block` in enforce, not\nreleased or rejected) and: the audience is `patient` and the channel is\nin-session (`web_chat`, `app_message`, `voice`), where the patient is\nwaiting for the reply, whatever stopped the turn; or the audience is\n`patient`, the channel is outbound (`sms`, `email`) and\n`send_holding_line` is `true`; or the audience is `clinician`.\n\n`false` on an outbound channel when no holding line is owed (send\nnothing), on every `allow`, once a reviewer has released or rejected\nthe hold, once a retry of this turn or a turn that supersedes it has\nbeen accepted (that turn's own field answers), and always in observe.\nOn a `retryable` turn, evaluate the retry first and show the hold text\nonly if the retry is stopped too. On an in-session channel the hold\ntext is the one reply: do not send a separate holding line there.",
|
|
2707
|
+
"type": "boolean"
|
|
2708
|
+
},
|
|
2338
2709
|
"status": {
|
|
2339
2710
|
"$ref": "#/components/schemas/DecisionStatus"
|
|
2340
2711
|
},
|
|
@@ -2345,9 +2716,32 @@
|
|
|
2345
2716
|
"null"
|
|
2346
2717
|
]
|
|
2347
2718
|
},
|
|
2719
|
+
"superseded_by": {
|
|
2720
|
+
"description": "The decision that replaced this one: the turn that named it in\n`supersedes`, or its retry. Null while nothing has replaced it. Read\nfrom the `superseded` event in `outcome`.",
|
|
2721
|
+
"format": "uuid",
|
|
2722
|
+
"type": [
|
|
2723
|
+
"string",
|
|
2724
|
+
"null"
|
|
2725
|
+
]
|
|
2726
|
+
},
|
|
2727
|
+
"supersedes": {
|
|
2728
|
+
"description": "The decisions this turn named in `supersedes` and replaced, in\nascending id order. Empty when it named none. The decision a retry\nreplaced is `retry_of`, not listed here.",
|
|
2729
|
+
"items": {
|
|
2730
|
+
"format": "uuid",
|
|
2731
|
+
"type": "string"
|
|
2732
|
+
},
|
|
2733
|
+
"type": "array"
|
|
2734
|
+
},
|
|
2348
2735
|
"turn_id": {
|
|
2349
2736
|
"type": "string"
|
|
2350
2737
|
},
|
|
2738
|
+
"turn_ref": {
|
|
2739
|
+
"description": "Your reference for the patient turn, as sent on `evaluate` (or, on a\nretry sent without one, the reference of the decision it retries).\nNull when none was sent.",
|
|
2740
|
+
"type": [
|
|
2741
|
+
"string",
|
|
2742
|
+
"null"
|
|
2743
|
+
]
|
|
2744
|
+
},
|
|
2351
2745
|
"webhook_deliveries": {
|
|
2352
2746
|
"description": "The signed webhook deliveries about this decision: the\nlog, never the body.",
|
|
2353
2747
|
"items": {
|
|
@@ -2356,7 +2750,7 @@
|
|
|
2356
2750
|
"type": "array"
|
|
2357
2751
|
},
|
|
2358
2752
|
"would_have": {
|
|
2359
|
-
"description": "Observe: the raw gate decision (`allow` | `
|
|
2753
|
+
"description": "Observe: the raw gate decision (`allow` | `flag` | `block_and_review`\n| `policy_missing`) or `unavailable`. Null in enforce. Decisions\nrecorded before `flag` replaced `rewrite` keep `rewrite`.",
|
|
2360
2754
|
"type": [
|
|
2361
2755
|
"string",
|
|
2362
2756
|
"null"
|
|
@@ -2377,8 +2771,13 @@
|
|
|
2377
2771
|
"turn_id",
|
|
2378
2772
|
"reasons",
|
|
2379
2773
|
"detected_claims",
|
|
2774
|
+
"matches",
|
|
2775
|
+
"flagged",
|
|
2380
2776
|
"disclosure_required",
|
|
2381
2777
|
"send_holding_line",
|
|
2778
|
+
"show_hold_text",
|
|
2779
|
+
"retryable",
|
|
2780
|
+
"supersedes",
|
|
2382
2781
|
"route_to_human",
|
|
2383
2782
|
"would_have_routed",
|
|
2384
2783
|
"inbound_flags",
|
|
@@ -2442,6 +2841,7 @@
|
|
|
2442
2841
|
"type": "object"
|
|
2443
2842
|
},
|
|
2444
2843
|
"EvaluateRequest": {
|
|
2844
|
+
"description": "One turn to evaluate. A field this schema does not name is ignored, not\nrefused, so a misspelled `retry_of`, `turn_ref` or `supersedes` is a turn\nthat retries, groups and supersedes nothing.",
|
|
2445
2845
|
"properties": {
|
|
2446
2846
|
"application_id": {
|
|
2447
2847
|
"description": "Optional; when present it must be the application the key is bound to.",
|
|
@@ -2467,21 +2867,21 @@
|
|
|
2467
2867
|
"disclosure": {
|
|
2468
2868
|
"oneOf": [
|
|
2469
2869
|
{
|
|
2470
|
-
"
|
|
2870
|
+
"$ref": "#/components/schemas/DisclosureAttachment"
|
|
2471
2871
|
},
|
|
2472
2872
|
{
|
|
2473
|
-
"
|
|
2873
|
+
"type": "null"
|
|
2474
2874
|
}
|
|
2475
2875
|
]
|
|
2476
2876
|
},
|
|
2477
2877
|
"inbound": {
|
|
2478
2878
|
"oneOf": [
|
|
2479
|
-
{
|
|
2480
|
-
"type": "null"
|
|
2481
|
-
},
|
|
2482
2879
|
{
|
|
2483
2880
|
"$ref": "#/components/schemas/InboundMessage",
|
|
2484
2881
|
"description": "The patient's message this turn answers. Screened by the\ndeterministic red-flag floor with the application's categories; a\nmatch routes the patient to a person. Requires `patient_ref`."
|
|
2882
|
+
},
|
|
2883
|
+
{
|
|
2884
|
+
"type": "null"
|
|
2485
2885
|
}
|
|
2486
2886
|
]
|
|
2487
2887
|
},
|
|
@@ -2490,12 +2890,12 @@
|
|
|
2490
2890
|
},
|
|
2491
2891
|
"mode_hint": {
|
|
2492
2892
|
"oneOf": [
|
|
2493
|
-
{
|
|
2494
|
-
"type": "null"
|
|
2495
|
-
},
|
|
2496
2893
|
{
|
|
2497
2894
|
"$ref": "#/components/schemas/GovernMode",
|
|
2498
2895
|
"description": "Advisory. The application's configured mode decides; a hint that\ndisagrees is ignored."
|
|
2896
|
+
},
|
|
2897
|
+
{
|
|
2898
|
+
"type": "null"
|
|
2499
2899
|
}
|
|
2500
2900
|
]
|
|
2501
2901
|
},
|
|
@@ -2520,9 +2920,35 @@
|
|
|
2520
2920
|
"null"
|
|
2521
2921
|
]
|
|
2522
2922
|
},
|
|
2923
|
+
"retry_of": {
|
|
2924
|
+
"description": "The decision this turn retries: a new draft written because that\ndecision came back `retryable`. It must name a decision of this\napplication and this conversation whose view says `retryable: true`,\nand that has not been retried already; anything else is refused with\n`400`, except `409` for a second retry of the same decision and for a\nturn that was retryable until a reviewer released or rejected it, or\nuntil another turn named it in `supersedes`. Two requests for one retry\nunder one `turn_id` record it once: the second is answered as a replay.\nThe new draft is judged exactly as any other turn. Send it with a NEW\n`turn_id`. When the retry is `allow`, the hand-off the stopped turn\nopened is resolved with the disposition `resolved_by_retry`, provided\nthat turn opened it, nothing else has joined it and nobody has claimed\nit or acted on it.",
|
|
2925
|
+
"format": "uuid",
|
|
2926
|
+
"type": [
|
|
2927
|
+
"string",
|
|
2928
|
+
"null"
|
|
2929
|
+
]
|
|
2930
|
+
},
|
|
2931
|
+
"supersedes": {
|
|
2932
|
+
"description": "The decisions this turn replaces, at most 8: earlier attempts at the\nsame patient turn that were never heard (a speculative reply the voice\nplatform discarded). Each must be a decision of this application and\nthis conversation, named once, and not the decision in `retry_of`\n(`400` otherwise). An enforce decision still being decided, a decision\nwith a `delivered` event, one a reviewer released or rejected, or one\nanother turn already superseded is a `409`. In the same step as this\nturn is recorded, each named decision leaves the review queue if it was\nheld, and its outcome records a `superseded` event naming this\ndecision. When this turn is `allow`, the hand-off a named stopped turn\nopened is resolved with the disposition `resolved_by_supersession`\n(`resolved_by_retry` when the turn in `retry_of` shares it), on the\nconditions a retry's is; otherwise it stays open with a note naming\nthis decision. A replay of this `turn_id` returns the stored decision\nand applies nothing again.",
|
|
2933
|
+
"items": {
|
|
2934
|
+
"format": "uuid",
|
|
2935
|
+
"type": "string"
|
|
2936
|
+
},
|
|
2937
|
+
"type": [
|
|
2938
|
+
"array",
|
|
2939
|
+
"null"
|
|
2940
|
+
]
|
|
2941
|
+
},
|
|
2523
2942
|
"turn_id": {
|
|
2524
2943
|
"description": "The idempotency key per application: a replay returns the stored\ndecision. Must not start with `govern:`, which is reserved for the\nrows the platform writes.",
|
|
2525
2944
|
"type": "string"
|
|
2945
|
+
},
|
|
2946
|
+
"turn_ref": {
|
|
2947
|
+
"description": "Your stable reference for the patient turn this draft answers: the\nsame value on every speculative re-send and retry of that turn, so the\nattempts can be grouped. At most 128 printable characters. A retry\nsent without one takes the reference of the decision it retries.\nStored as sent; never evaluated.",
|
|
2948
|
+
"type": [
|
|
2949
|
+
"string",
|
|
2950
|
+
"null"
|
|
2951
|
+
]
|
|
2526
2952
|
}
|
|
2527
2953
|
},
|
|
2528
2954
|
"required": [
|
|
@@ -2796,7 +3222,7 @@
|
|
|
2796
3222
|
"type": "string"
|
|
2797
3223
|
},
|
|
2798
3224
|
"pauses_automation": {
|
|
2799
|
-
"description": "Whether this hand-off also pauses automated messaging to the subject
|
|
3225
|
+
"description": "Whether this hand-off also pauses automated messaging to the subject.\n`automation_resumed_at == null` says a person owns it;\nthis says whether the application should stop sending meanwhile. The\ntwo are read together: still paused is\n`automation_resumed_at == null && pauses_automation`.",
|
|
2800
3226
|
"type": "boolean"
|
|
2801
3227
|
},
|
|
2802
3228
|
"queue_label": {
|
|
@@ -2860,6 +3286,42 @@
|
|
|
2860
3286
|
],
|
|
2861
3287
|
"type": "object"
|
|
2862
3288
|
},
|
|
3289
|
+
"MatchList": {
|
|
3290
|
+
"description": "Which vocabulary a match came from.",
|
|
3291
|
+
"enum": [
|
|
3292
|
+
"prohibited_claims",
|
|
3293
|
+
"requires_disclaimer_for",
|
|
3294
|
+
"wellness_clinical_terms",
|
|
3295
|
+
"medication_instructions"
|
|
3296
|
+
],
|
|
3297
|
+
"type": "string"
|
|
3298
|
+
},
|
|
3299
|
+
"MatchRange": {
|
|
3300
|
+
"description": "Where a match sits in the evaluated text, in UTF-16 code units (the unit\nof JavaScript string indices). `start` is inclusive and `end` exclusive, so\n`text.slice(start, end)` is the matched span.",
|
|
3301
|
+
"properties": {
|
|
3302
|
+
"end": {
|
|
3303
|
+
"minimum": 0,
|
|
3304
|
+
"type": "integer"
|
|
3305
|
+
},
|
|
3306
|
+
"start": {
|
|
3307
|
+
"minimum": 0,
|
|
3308
|
+
"type": "integer"
|
|
3309
|
+
}
|
|
3310
|
+
},
|
|
3311
|
+
"required": [
|
|
3312
|
+
"start",
|
|
3313
|
+
"end"
|
|
3314
|
+
],
|
|
3315
|
+
"type": "object"
|
|
3316
|
+
},
|
|
3317
|
+
"MatchSource": {
|
|
3318
|
+
"description": "How a match was found.",
|
|
3319
|
+
"enum": [
|
|
3320
|
+
"term",
|
|
3321
|
+
"semantic"
|
|
3322
|
+
],
|
|
3323
|
+
"type": "string"
|
|
3324
|
+
},
|
|
2863
3325
|
"MintedKeyDto": {
|
|
2864
3326
|
"allOf": [
|
|
2865
3327
|
{
|
|
@@ -2957,6 +3419,12 @@
|
|
|
2957
3419
|
},
|
|
2958
3420
|
"type": "array"
|
|
2959
3421
|
},
|
|
3422
|
+
"by_stop_class": {
|
|
3423
|
+
"items": {
|
|
3424
|
+
"$ref": "#/components/schemas/StopClassBreakdown"
|
|
3425
|
+
},
|
|
3426
|
+
"type": "array"
|
|
3427
|
+
},
|
|
2960
3428
|
"from": {
|
|
2961
3429
|
"format": "date-time",
|
|
2962
3430
|
"type": "string"
|
|
@@ -2980,6 +3448,7 @@
|
|
|
2980
3448
|
"by_policy",
|
|
2981
3449
|
"by_channel",
|
|
2982
3450
|
"by_model",
|
|
3451
|
+
"by_stop_class",
|
|
2983
3452
|
"rates"
|
|
2984
3453
|
],
|
|
2985
3454
|
"type": "object"
|
|
@@ -2999,10 +3468,10 @@
|
|
|
2999
3468
|
"channel": {
|
|
3000
3469
|
"oneOf": [
|
|
3001
3470
|
{
|
|
3002
|
-
"
|
|
3471
|
+
"$ref": "#/components/schemas/GovernChannel"
|
|
3003
3472
|
},
|
|
3004
3473
|
{
|
|
3005
|
-
"
|
|
3474
|
+
"type": "null"
|
|
3006
3475
|
}
|
|
3007
3476
|
]
|
|
3008
3477
|
},
|
|
@@ -3019,25 +3488,54 @@
|
|
|
3019
3488
|
],
|
|
3020
3489
|
"type": "object"
|
|
3021
3490
|
},
|
|
3022
|
-
"
|
|
3491
|
+
"OutcomeEvent": {
|
|
3492
|
+
"description": "One event in a decision's outcome trail.",
|
|
3023
3493
|
"properties": {
|
|
3024
|
-
"
|
|
3025
|
-
"description": "
|
|
3026
|
-
"type": "boolean"
|
|
3027
|
-
},
|
|
3028
|
-
"delivered_at": {
|
|
3494
|
+
"at": {
|
|
3495
|
+
"description": "When it happened, as the writer said.",
|
|
3029
3496
|
"format": "date-time",
|
|
3030
3497
|
"type": "string"
|
|
3031
3498
|
},
|
|
3032
|
-
"
|
|
3033
|
-
"description": "SHA-256
|
|
3499
|
+
"content_hash": {
|
|
3500
|
+
"description": "SHA-256 hex of the text; on `released` and `delivered` only.",
|
|
3034
3501
|
"type": [
|
|
3035
3502
|
"string",
|
|
3036
3503
|
"null"
|
|
3037
3504
|
]
|
|
3038
3505
|
},
|
|
3039
3506
|
"delivery_ref": {
|
|
3040
|
-
"
|
|
3507
|
+
"type": [
|
|
3508
|
+
"string",
|
|
3509
|
+
"null"
|
|
3510
|
+
]
|
|
3511
|
+
},
|
|
3512
|
+
"hash_matches_release": {
|
|
3513
|
+
"description": "Whether `content_hash` matches the content the record says was\ndeliverable. `null` with no hash, or when there was nothing to compare\nagainst. Computed when the event is recorded; a later release does not\nchange it.",
|
|
3514
|
+
"type": [
|
|
3515
|
+
"boolean",
|
|
3516
|
+
"null"
|
|
3517
|
+
]
|
|
3518
|
+
},
|
|
3519
|
+
"kind": {
|
|
3520
|
+
"$ref": "#/components/schemas/OutcomeKind"
|
|
3521
|
+
},
|
|
3522
|
+
"reason": {
|
|
3523
|
+
"type": [
|
|
3524
|
+
"string",
|
|
3525
|
+
"null"
|
|
3526
|
+
]
|
|
3527
|
+
},
|
|
3528
|
+
"recorded_at": {
|
|
3529
|
+
"description": "When the service recorded it.",
|
|
3530
|
+
"format": "date-time",
|
|
3531
|
+
"type": "string"
|
|
3532
|
+
},
|
|
3533
|
+
"source": {
|
|
3534
|
+
"$ref": "#/components/schemas/OutcomeSource"
|
|
3535
|
+
},
|
|
3536
|
+
"superseded_by": {
|
|
3537
|
+
"description": "The decision that replaced this one; on `superseded` only.",
|
|
3538
|
+
"format": "uuid",
|
|
3041
3539
|
"type": [
|
|
3042
3540
|
"string",
|
|
3043
3541
|
"null"
|
|
@@ -3045,48 +3543,90 @@
|
|
|
3045
3543
|
}
|
|
3046
3544
|
},
|
|
3047
3545
|
"required": [
|
|
3048
|
-
"
|
|
3049
|
-
"
|
|
3546
|
+
"kind",
|
|
3547
|
+
"source",
|
|
3548
|
+
"at",
|
|
3549
|
+
"recorded_at"
|
|
3050
3550
|
],
|
|
3051
3551
|
"type": "object"
|
|
3052
3552
|
},
|
|
3053
|
-
"
|
|
3553
|
+
"OutcomeKind": {
|
|
3554
|
+
"description": "What happened to a decision's reply: the kind of an event, and, for the\ntrail as a whole, its derived `state`.",
|
|
3555
|
+
"enum": [
|
|
3556
|
+
"released",
|
|
3557
|
+
"delivered",
|
|
3558
|
+
"discarded",
|
|
3559
|
+
"superseded",
|
|
3560
|
+
"failed"
|
|
3561
|
+
],
|
|
3562
|
+
"type": "string"
|
|
3563
|
+
},
|
|
3564
|
+
"OutcomeRequest": {
|
|
3054
3565
|
"properties": {
|
|
3055
|
-
"
|
|
3056
|
-
"
|
|
3057
|
-
},
|
|
3058
|
-
"delivered_at": {
|
|
3566
|
+
"at": {
|
|
3567
|
+
"description": "When it happened.",
|
|
3059
3568
|
"format": "date-time",
|
|
3060
3569
|
"type": "string"
|
|
3061
3570
|
},
|
|
3062
|
-
"
|
|
3571
|
+
"content_hash": {
|
|
3572
|
+
"description": "SHA-256, hex, of the UTF-8 text released or delivered. Required for\n`released` and `delivered`; refused on any other kind.",
|
|
3063
3573
|
"type": [
|
|
3064
3574
|
"string",
|
|
3065
3575
|
"null"
|
|
3066
3576
|
]
|
|
3067
3577
|
},
|
|
3068
3578
|
"delivery_ref": {
|
|
3579
|
+
"description": "Your own reference for the delivery (a message id, a row id).",
|
|
3069
3580
|
"type": [
|
|
3070
3581
|
"string",
|
|
3071
3582
|
"null"
|
|
3072
3583
|
]
|
|
3073
3584
|
},
|
|
3074
|
-
"
|
|
3075
|
-
"
|
|
3585
|
+
"kind": {
|
|
3586
|
+
"$ref": "#/components/schemas/OutcomeKind",
|
|
3587
|
+
"description": "`released`, `delivered`, `discarded` or `failed`. `superseded` is\nreserved for the service and refused here."
|
|
3588
|
+
},
|
|
3589
|
+
"reason": {
|
|
3590
|
+
"description": "A short reason code, for example why a reply was discarded or why an\nattempt failed. Never message text.",
|
|
3076
3591
|
"type": [
|
|
3077
|
-
"
|
|
3592
|
+
"string",
|
|
3078
3593
|
"null"
|
|
3079
3594
|
]
|
|
3595
|
+
}
|
|
3596
|
+
},
|
|
3597
|
+
"required": [
|
|
3598
|
+
"kind",
|
|
3599
|
+
"at"
|
|
3600
|
+
],
|
|
3601
|
+
"type": "object"
|
|
3602
|
+
},
|
|
3603
|
+
"OutcomeSource": {
|
|
3604
|
+
"description": "Who wrote an event.",
|
|
3605
|
+
"enum": [
|
|
3606
|
+
"caller",
|
|
3607
|
+
"retry",
|
|
3608
|
+
"supersedes",
|
|
3609
|
+
"channel"
|
|
3610
|
+
],
|
|
3611
|
+
"type": "string"
|
|
3612
|
+
},
|
|
3613
|
+
"OutcomeView": {
|
|
3614
|
+
"description": "A decision's outcome: the state its events add up to, and the events in\nthe order they were recorded.",
|
|
3615
|
+
"properties": {
|
|
3616
|
+
"events": {
|
|
3617
|
+
"items": {
|
|
3618
|
+
"$ref": "#/components/schemas/OutcomeEvent"
|
|
3619
|
+
},
|
|
3620
|
+
"type": "array"
|
|
3080
3621
|
},
|
|
3081
|
-
"
|
|
3082
|
-
"
|
|
3083
|
-
"
|
|
3622
|
+
"state": {
|
|
3623
|
+
"$ref": "#/components/schemas/OutcomeKind",
|
|
3624
|
+
"description": "The kind that decides where the outcome stands, derived from the\nevents and never stored: `delivered` if a delivered event exists, else\n`superseded`, else `discarded`, else `failed`, else `released`."
|
|
3084
3625
|
}
|
|
3085
3626
|
},
|
|
3086
3627
|
"required": [
|
|
3087
|
-
"
|
|
3088
|
-
"
|
|
3089
|
-
"recorded_at"
|
|
3628
|
+
"state",
|
|
3629
|
+
"events"
|
|
3090
3630
|
],
|
|
3091
3631
|
"type": "object"
|
|
3092
3632
|
},
|
|
@@ -3108,32 +3648,32 @@
|
|
|
3108
3648
|
"default_mode": {
|
|
3109
3649
|
"oneOf": [
|
|
3110
3650
|
{
|
|
3111
|
-
"
|
|
3651
|
+
"$ref": "#/components/schemas/GovernMode"
|
|
3112
3652
|
},
|
|
3113
3653
|
{
|
|
3114
|
-
"
|
|
3654
|
+
"type": "null"
|
|
3115
3655
|
}
|
|
3116
3656
|
]
|
|
3117
3657
|
},
|
|
3118
3658
|
"frequency_cap": {
|
|
3119
3659
|
"oneOf": [
|
|
3120
3660
|
{
|
|
3121
|
-
"
|
|
3661
|
+
"$ref": "#/components/schemas/FrequencyCap",
|
|
3662
|
+
"description": "`null` removes the cap; omit to leave it unchanged."
|
|
3122
3663
|
},
|
|
3123
3664
|
{
|
|
3124
|
-
"
|
|
3125
|
-
"description": "`null` removes the cap."
|
|
3665
|
+
"type": "null"
|
|
3126
3666
|
}
|
|
3127
3667
|
]
|
|
3128
3668
|
},
|
|
3129
3669
|
"handoff_routing": {
|
|
3130
3670
|
"oneOf": [
|
|
3131
|
-
{
|
|
3132
|
-
"type": "null"
|
|
3133
|
-
},
|
|
3134
3671
|
{
|
|
3135
3672
|
"$ref": "#/components/schemas/RoutingPolicy",
|
|
3136
3673
|
"description": "`null` clears the routing; hand-offs then open with the\norganization's default queue and no deadlines."
|
|
3674
|
+
},
|
|
3675
|
+
{
|
|
3676
|
+
"type": "null"
|
|
3137
3677
|
}
|
|
3138
3678
|
]
|
|
3139
3679
|
},
|
|
@@ -3143,14 +3683,6 @@
|
|
|
3143
3683
|
"null"
|
|
3144
3684
|
]
|
|
3145
3685
|
},
|
|
3146
|
-
"project_id": {
|
|
3147
|
-
"description": "`null` clears the project scope back to the organization policy.",
|
|
3148
|
-
"format": "int32",
|
|
3149
|
-
"type": [
|
|
3150
|
-
"integer",
|
|
3151
|
-
"null"
|
|
3152
|
-
]
|
|
3153
|
-
},
|
|
3154
3686
|
"red_flag_categories": {
|
|
3155
3687
|
"description": "Replaces the whole list when present; must not be empty.",
|
|
3156
3688
|
"items": {
|
|
@@ -3253,10 +3785,10 @@
|
|
|
3253
3785
|
"frequency": {
|
|
3254
3786
|
"oneOf": [
|
|
3255
3787
|
{
|
|
3256
|
-
"
|
|
3788
|
+
"$ref": "#/components/schemas/FrequencyView"
|
|
3257
3789
|
},
|
|
3258
3790
|
{
|
|
3259
|
-
"
|
|
3791
|
+
"type": "null"
|
|
3260
3792
|
}
|
|
3261
3793
|
]
|
|
3262
3794
|
},
|
|
@@ -3374,9 +3906,26 @@
|
|
|
3374
3906
|
"type": "object"
|
|
3375
3907
|
},
|
|
3376
3908
|
"Rates": {
|
|
3377
|
-
"description": "Fractions in `[0, 1]`, never percentages
|
|
3909
|
+
"description": "Fractions in `[0, 1]`, never percentages. Each is `null` when its\ndenominator is zero.",
|
|
3378
3910
|
"properties": {
|
|
3379
3911
|
"enforced_held": {
|
|
3912
|
+
"description": "The share of answered enforce turns whose answer was not `allow`, over\n`totals.answered_enforce`. Turns the gate did not answer are on\nneither side of it.",
|
|
3913
|
+
"format": "double",
|
|
3914
|
+
"type": [
|
|
3915
|
+
"number",
|
|
3916
|
+
"null"
|
|
3917
|
+
]
|
|
3918
|
+
},
|
|
3919
|
+
"unanswered": {
|
|
3920
|
+
"description": "The share of every record in the window that the gate did not answer:\n`totals.unavailable` over `totals.decisions`.",
|
|
3921
|
+
"format": "double",
|
|
3922
|
+
"type": [
|
|
3923
|
+
"number",
|
|
3924
|
+
"null"
|
|
3925
|
+
]
|
|
3926
|
+
},
|
|
3927
|
+
"would_have_flagged": {
|
|
3928
|
+
"description": "The share of answered observe turns that would have been delivered\nwith flags: a `flag` for a clinician audience, over\n`totals.answered_observe`.",
|
|
3380
3929
|
"format": "double",
|
|
3381
3930
|
"type": [
|
|
3382
3931
|
"number",
|
|
@@ -3384,6 +3933,7 @@
|
|
|
3384
3933
|
]
|
|
3385
3934
|
},
|
|
3386
3935
|
"would_have_withheld": {
|
|
3936
|
+
"description": "The share of answered observe turns whose would-have answer was not\n`allow`, over `totals.answered_observe`. Turns the gate did not answer\nare on neither side of it. A `flag` for a clinician audience is not\nwithheld (the clinician receives the draft with its matches) and is\ncounted in `would_have_flagged` instead; a `flag` for a patient is\nwithheld.",
|
|
3387
3937
|
"format": "double",
|
|
3388
3938
|
"type": [
|
|
3389
3939
|
"number",
|
|
@@ -3549,8 +4099,37 @@
|
|
|
3549
4099
|
],
|
|
3550
4100
|
"type": "object"
|
|
3551
4101
|
},
|
|
4102
|
+
"StopClassBreakdown": {
|
|
4103
|
+
"allOf": [
|
|
4104
|
+
{
|
|
4105
|
+
"$ref": "#/components/schemas/Counts"
|
|
4106
|
+
},
|
|
4107
|
+
{
|
|
4108
|
+
"properties": {
|
|
4109
|
+
"stop_class": {
|
|
4110
|
+
"type": [
|
|
4111
|
+
"string",
|
|
4112
|
+
"null"
|
|
4113
|
+
]
|
|
4114
|
+
}
|
|
4115
|
+
},
|
|
4116
|
+
"type": "object"
|
|
4117
|
+
}
|
|
4118
|
+
],
|
|
4119
|
+
"description": "The same counts, per stop class: `never_sendable` or `uncertain` for the\nturns that were stopped (in observe, that would have been stopped), and a\nbucket with a null class for the turns that were not, or not yet answered."
|
|
4120
|
+
},
|
|
3552
4121
|
"Totals": {
|
|
3553
4122
|
"properties": {
|
|
4123
|
+
"answered_enforce": {
|
|
4124
|
+
"description": "Enforce records the gate answered: neither pending nor unavailable.\nThe denominator of `rates.enforced_held`.",
|
|
4125
|
+
"format": "int64",
|
|
4126
|
+
"type": "integer"
|
|
4127
|
+
},
|
|
4128
|
+
"answered_observe": {
|
|
4129
|
+
"description": "Observe records the gate answered: neither pending nor unavailable.\nThe denominator of `rates.would_have_withheld`.",
|
|
4130
|
+
"format": "int64",
|
|
4131
|
+
"type": "integer"
|
|
4132
|
+
},
|
|
3554
4133
|
"decisions": {
|
|
3555
4134
|
"description": "Every decision record in the window, any mode or status.",
|
|
3556
4135
|
"format": "int64",
|
|
@@ -3574,6 +4153,17 @@
|
|
|
3574
4153
|
"type": "integer"
|
|
3575
4154
|
},
|
|
3576
4155
|
"unavailable": {
|
|
4156
|
+
"description": "Records the gate did not answer, in either mode. The caller received\nits mode's fallback; these records are in neither rate.",
|
|
4157
|
+
"format": "int64",
|
|
4158
|
+
"type": "integer"
|
|
4159
|
+
},
|
|
4160
|
+
"would_have_flagged": {
|
|
4161
|
+
"description": "Answered observe records that would have been delivered to a\nclinician with flags: the numerator of `rates.would_have_flagged`.",
|
|
4162
|
+
"format": "int64",
|
|
4163
|
+
"type": "integer"
|
|
4164
|
+
},
|
|
4165
|
+
"would_have_withheld": {
|
|
4166
|
+
"description": "Answered observe records whose would-have answer withheld the draft:\nthe numerator of `rates.would_have_withheld`.",
|
|
3577
4167
|
"format": "int64",
|
|
3578
4168
|
"type": "integer"
|
|
3579
4169
|
}
|
|
@@ -3584,7 +4174,11 @@
|
|
|
3584
4174
|
"enforce",
|
|
3585
4175
|
"pending",
|
|
3586
4176
|
"unavailable",
|
|
3587
|
-
"transcript"
|
|
4177
|
+
"transcript",
|
|
4178
|
+
"answered_observe",
|
|
4179
|
+
"answered_enforce",
|
|
4180
|
+
"would_have_withheld",
|
|
4181
|
+
"would_have_flagged"
|
|
3588
4182
|
],
|
|
3589
4183
|
"type": "object"
|
|
3590
4184
|
},
|
|
@@ -3692,7 +4286,7 @@
|
|
|
3692
4286
|
"format": "int64",
|
|
3693
4287
|
"type": "integer"
|
|
3694
4288
|
},
|
|
3695
|
-
"description": "Raw gate decisions over the evaluated turns that are decided:\n`allow`, `rewrite
|
|
4289
|
+
"description": "Raw gate decisions over the evaluated turns that are decided:\n`allow`, `flag` (`rewrite` before it replaced it), `block_and_review`, `policy_missing`,\n`unavailable`.",
|
|
3696
4290
|
"propertyNames": {
|
|
3697
4291
|
"type": "string"
|
|
3698
4292
|
},
|
|
@@ -3785,21 +4379,21 @@
|
|
|
3785
4379
|
"decision_status": {
|
|
3786
4380
|
"oneOf": [
|
|
3787
4381
|
{
|
|
3788
|
-
"
|
|
4382
|
+
"$ref": "#/components/schemas/DecisionStatus"
|
|
3789
4383
|
},
|
|
3790
4384
|
{
|
|
3791
|
-
"
|
|
4385
|
+
"type": "null"
|
|
3792
4386
|
}
|
|
3793
4387
|
]
|
|
3794
4388
|
},
|
|
3795
4389
|
"disposition": {
|
|
3796
4390
|
"oneOf": [
|
|
3797
|
-
{
|
|
3798
|
-
"type": "null"
|
|
3799
|
-
},
|
|
3800
4391
|
{
|
|
3801
4392
|
"$ref": "#/components/schemas/TurnDisposition",
|
|
3802
4393
|
"description": "Absent until the turn is processed."
|
|
4394
|
+
},
|
|
4395
|
+
{
|
|
4396
|
+
"type": "null"
|
|
3803
4397
|
}
|
|
3804
4398
|
]
|
|
3805
4399
|
},
|