@clinia/context-engine-js 0.5.0 → 0.6.0-rc.1

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.
@@ -17,6 +17,15 @@ export type IngestStats = components["schemas"]["IngestStats"];
17
17
  export type IngestExecutionList = components["schemas"]["IngestExecutionList"];
18
18
  export type IngestExecutionListItem = components["schemas"]["IngestExecutionListItem"];
19
19
  export type IngestExecutionDetail = components["schemas"]["IngestExecutionDetail"];
20
+ export type Ingestion = components["schemas"]["Ingestion"];
21
+ export type IngestionSource = components["schemas"]["IngestionSource"];
22
+ export type IngestionStatus = components["schemas"]["IngestionStatus"];
23
+ export type IngestionStaged = components["schemas"]["IngestionStaged"];
24
+ export type IngestionIntake = components["schemas"]["IngestionIntake"];
25
+ export type IngestionItemOutcome = components["schemas"]["IngestionItemOutcome"];
26
+ export type IngestionIgnoreReason = components["schemas"]["IngestionIgnoreReason"];
27
+ export type IngestFhirBody = components["schemas"]["IngestFhirBody"];
28
+ export type IngestionList = components["schemas"]["IngestionList"];
20
29
  export type Session = components["schemas"]["Session"];
21
30
  export type AppendMessagesBody = components["schemas"]["AppendMessagesBody"];
22
31
  export type SessionMemoryList = components["schemas"]["SessionMemoryList"];
@@ -24,3 +33,8 @@ export type SessionMemory = components["schemas"]["SessionMemory"];
24
33
  export type IngestSessionBody = components["schemas"]["IngestSessionBody"];
25
34
  export type BrowseResult = components["schemas"]["BrowseResult"];
26
35
  export type ReadResponse = components["schemas"]["ReadResponse"];
36
+ export type Node = components["schemas"]["Node"];
37
+ export type NodeList = components["schemas"]["NodeList"];
38
+ export type Edge = components["schemas"]["Edge"];
39
+ export type NodeRef = components["schemas"]["NodeRef"];
40
+ export type EdgeList = components["schemas"]["EdgeList"];
@@ -0,0 +1,293 @@
1
+ import type { HttpClient } from "../http-client";
2
+ import type { operations } from "../generated/context-engine";
3
+ export declare class GraphResource {
4
+ #private;
5
+ constructor(http: HttpClient);
6
+ listNodes(patientId: string, type: "extracted_fact" | "fact" | "extracted_narrative" | "narrative_passage" | "narrative" | "learned_memory" | "extracted_clinical_event", params?: {
7
+ query?: {
8
+ page?: number;
9
+ perPage?: number;
10
+ };
11
+ }): Promise<import("openapi-fetch").FetchResponse<{
12
+ parameters: {
13
+ query?: {
14
+ page?: number | null;
15
+ perPage?: number;
16
+ };
17
+ header?: never;
18
+ path: {
19
+ patientId: string;
20
+ type: "extracted_fact" | "fact" | "extracted_narrative" | "narrative_passage" | "narrative" | "learned_memory" | "extracted_clinical_event";
21
+ };
22
+ cookie?: never;
23
+ };
24
+ requestBody?: never;
25
+ responses: {
26
+ 200: {
27
+ headers: {
28
+ [name: string]: unknown;
29
+ };
30
+ content: {
31
+ "application/json": import("..").components["schemas"]["NodeList"];
32
+ };
33
+ };
34
+ 404: {
35
+ headers: {
36
+ [name: string]: unknown;
37
+ };
38
+ content: {
39
+ "application/json": import("..").components["schemas"]["ApiError"];
40
+ };
41
+ };
42
+ };
43
+ }, {
44
+ params: {
45
+ query?: {
46
+ page?: number;
47
+ perPage?: number;
48
+ } | undefined;
49
+ path: {
50
+ patientId: string;
51
+ type: "extracted_fact" | "fact" | "extracted_narrative" | "narrative_passage" | "narrative" | "learned_memory" | "extracted_clinical_event";
52
+ };
53
+ };
54
+ }, `${string}/${string}`>>;
55
+ listEdges(patientId: string, type: "resolution_decision" | "resolves_to" | "chunked_into", params?: {
56
+ query?: {
57
+ page?: number;
58
+ perPage?: number;
59
+ touching?: string | string[];
60
+ };
61
+ }): Promise<import("openapi-fetch").FetchResponse<{
62
+ parameters: {
63
+ query?: {
64
+ page?: number | null;
65
+ perPage?: number;
66
+ touching?: string | string[];
67
+ };
68
+ header?: never;
69
+ path: {
70
+ patientId: string;
71
+ type: "resolution_decision" | "resolves_to" | "chunked_into";
72
+ };
73
+ cookie?: never;
74
+ };
75
+ requestBody?: never;
76
+ responses: {
77
+ 200: {
78
+ headers: {
79
+ [name: string]: unknown;
80
+ };
81
+ content: {
82
+ "application/json": import("..").components["schemas"]["EdgeList"];
83
+ };
84
+ };
85
+ 404: {
86
+ headers: {
87
+ [name: string]: unknown;
88
+ };
89
+ content: {
90
+ "application/json": import("..").components["schemas"]["ApiError"];
91
+ };
92
+ };
93
+ };
94
+ }, {
95
+ params: {
96
+ query?: {
97
+ page?: number;
98
+ perPage?: number;
99
+ touching?: string | string[];
100
+ } | undefined;
101
+ path: {
102
+ patientId: string;
103
+ type: "resolution_decision" | "resolves_to" | "chunked_into";
104
+ };
105
+ };
106
+ }, `${string}/${string}`>>;
107
+ getNode(patientId: string, type: "extracted_fact" | "fact" | "extracted_narrative" | "narrative_passage" | "narrative" | "learned_memory" | "extracted_clinical_event", nodeId: string): Promise<import("openapi-fetch").FetchResponse<{
108
+ parameters: {
109
+ query?: never;
110
+ header?: never;
111
+ path: {
112
+ patientId: string;
113
+ type: "extracted_fact" | "fact" | "extracted_narrative" | "narrative_passage" | "narrative" | "learned_memory" | "extracted_clinical_event";
114
+ nodeId: string;
115
+ };
116
+ cookie?: never;
117
+ };
118
+ requestBody?: never;
119
+ responses: {
120
+ 200: {
121
+ headers: {
122
+ [name: string]: unknown;
123
+ };
124
+ content: {
125
+ "application/json": import("..").components["schemas"]["Node"];
126
+ };
127
+ };
128
+ 400: {
129
+ headers: {
130
+ [name: string]: unknown;
131
+ };
132
+ content: {
133
+ "application/json": import("..").components["schemas"]["ApiError"];
134
+ };
135
+ };
136
+ 404: {
137
+ headers: {
138
+ [name: string]: unknown;
139
+ };
140
+ content: {
141
+ "application/json": import("..").components["schemas"]["ApiError"];
142
+ };
143
+ };
144
+ };
145
+ }, {
146
+ params: {
147
+ path: {
148
+ patientId: string;
149
+ type: "extracted_fact" | "fact" | "extracted_narrative" | "narrative_passage" | "narrative" | "learned_memory" | "extracted_clinical_event";
150
+ nodeId: string;
151
+ };
152
+ };
153
+ }, `${string}/${string}`>>;
154
+ getEdge(patientId: string, type: "resolution_decision" | "resolves_to" | "chunked_into", edgeId: string): Promise<import("openapi-fetch").FetchResponse<{
155
+ parameters: {
156
+ query?: never;
157
+ header?: never;
158
+ path: {
159
+ patientId: string;
160
+ type: "resolution_decision" | "resolves_to" | "chunked_into";
161
+ edgeId: string;
162
+ };
163
+ cookie?: never;
164
+ };
165
+ requestBody?: never;
166
+ responses: {
167
+ 200: {
168
+ headers: {
169
+ [name: string]: unknown;
170
+ };
171
+ content: {
172
+ "application/json": import("..").components["schemas"]["Edge"];
173
+ };
174
+ };
175
+ 400: {
176
+ headers: {
177
+ [name: string]: unknown;
178
+ };
179
+ content: {
180
+ "application/json": import("..").components["schemas"]["ApiError"];
181
+ };
182
+ };
183
+ 404: {
184
+ headers: {
185
+ [name: string]: unknown;
186
+ };
187
+ content: {
188
+ "application/json": import("..").components["schemas"]["ApiError"];
189
+ };
190
+ };
191
+ };
192
+ }, {
193
+ params: {
194
+ path: {
195
+ patientId: string;
196
+ type: "resolution_decision" | "resolves_to" | "chunked_into";
197
+ edgeId: string;
198
+ };
199
+ };
200
+ }, `${string}/${string}`>>;
201
+ queryNodes(patientId: string, type: "extracted_fact" | "fact" | "extracted_narrative" | "narrative_passage" | "narrative" | "learned_memory" | "extracted_clinical_event", body: NonNullable<operations["query-nodes"]["requestBody"]>["content"]["application/json"]): Promise<import("openapi-fetch").FetchResponse<{
202
+ parameters: {
203
+ query?: never;
204
+ header?: never;
205
+ path: {
206
+ patientId: string;
207
+ type: "extracted_fact" | "fact" | "extracted_narrative" | "narrative_passage" | "narrative" | "learned_memory" | "extracted_clinical_event";
208
+ };
209
+ cookie?: never;
210
+ };
211
+ requestBody: {
212
+ content: {
213
+ "application/json": {
214
+ page?: number | null;
215
+ perPage?: number;
216
+ sort?: "effectiveStart";
217
+ order?: "asc" | "desc";
218
+ filter?: {
219
+ id?: {
220
+ eq: string;
221
+ } | {
222
+ any: string[];
223
+ };
224
+ type?: {
225
+ eq: "condition" | "medication" | "allergy" | "family_history" | "social_history" | "immunization" | "device" | "demographic" | "insurance" | "directive";
226
+ } | {
227
+ any: ("condition" | "medication" | "allergy" | "family_history" | "social_history" | "immunization" | "device" | "demographic" | "insurance" | "directive")[];
228
+ };
229
+ };
230
+ };
231
+ };
232
+ };
233
+ responses: {
234
+ 200: {
235
+ headers: {
236
+ [name: string]: unknown;
237
+ };
238
+ content: {
239
+ "application/json": import("..").components["schemas"]["NodeList"];
240
+ };
241
+ };
242
+ 400: {
243
+ headers: {
244
+ [name: string]: unknown;
245
+ };
246
+ content: {
247
+ "application/json": import("..").components["schemas"]["ApiError"];
248
+ };
249
+ };
250
+ 404: {
251
+ headers: {
252
+ [name: string]: unknown;
253
+ };
254
+ content: {
255
+ "application/json": import("..").components["schemas"]["ApiError"];
256
+ };
257
+ };
258
+ 501: {
259
+ headers: {
260
+ [name: string]: unknown;
261
+ };
262
+ content: {
263
+ "application/json": import("..").components["schemas"]["ApiError"];
264
+ };
265
+ };
266
+ };
267
+ }, {
268
+ params: {
269
+ path: {
270
+ patientId: string;
271
+ type: "extracted_fact" | "fact" | "extracted_narrative" | "narrative_passage" | "narrative" | "learned_memory" | "extracted_clinical_event";
272
+ };
273
+ };
274
+ body: {
275
+ page?: number | null;
276
+ perPage?: number;
277
+ sort?: "effectiveStart";
278
+ order?: "asc" | "desc";
279
+ filter?: {
280
+ id?: {
281
+ eq: string;
282
+ } | {
283
+ any: string[];
284
+ };
285
+ type?: {
286
+ eq: "condition" | "medication" | "allergy" | "family_history" | "social_history" | "immunization" | "device" | "demographic" | "insurance" | "directive";
287
+ } | {
288
+ any: ("condition" | "medication" | "allergy" | "family_history" | "social_history" | "immunization" | "device" | "demographic" | "insurance" | "directive")[];
289
+ };
290
+ };
291
+ };
292
+ }, `${string}/${string}`>>;
293
+ }
@@ -3,3 +3,4 @@ export { PatientsResource } from "./patients";
3
3
  export { IngestResource } from "./ingest";
4
4
  export { SessionsResource } from "./sessions";
5
5
  export { VFSResource } from "./vfs";
6
+ export { GraphResource } from "./graph";
@@ -1,6 +1,6 @@
1
1
  import type { HttpClient } from "../http-client";
2
2
  import type { operations } from "../generated/context-engine";
3
- import type { IngestDocumentBody, IngestBatchBody } from "../generated/types";
3
+ import type { IngestDocumentBody, IngestBatchBody, IngestFhirBody } from "../generated/types";
4
4
  export declare class IngestResource {
5
5
  #private;
6
6
  constructor(http: HttpClient);
@@ -43,6 +43,54 @@ export declare class IngestResource {
43
43
  };
44
44
  };
45
45
  }, `${string}/${string}`>>;
46
+ listIngestions(patientId: string, params?: {
47
+ query?: {
48
+ page?: number;
49
+ perPage?: number;
50
+ sort?: "receivedAt";
51
+ order?: "asc" | "desc";
52
+ status?: ("pending" | "processing" | "succeeded" | "partial" | "failed")[];
53
+ };
54
+ }): Promise<import("openapi-fetch").FetchResponse<{
55
+ parameters: {
56
+ query?: {
57
+ page?: number | null;
58
+ perPage?: number;
59
+ sort?: "receivedAt";
60
+ order?: "asc" | "desc";
61
+ status?: (import("..").components["schemas"]["IngestionStatus"] & unknown)[];
62
+ };
63
+ header?: never;
64
+ path: {
65
+ patientId: string;
66
+ };
67
+ cookie?: never;
68
+ };
69
+ requestBody?: never;
70
+ responses: {
71
+ 200: {
72
+ headers: {
73
+ [name: string]: unknown;
74
+ };
75
+ content: {
76
+ "application/json": import("..").components["schemas"]["IngestionList"];
77
+ };
78
+ };
79
+ };
80
+ }, {
81
+ params: {
82
+ query?: {
83
+ page?: number;
84
+ perPage?: number;
85
+ sort?: "receivedAt";
86
+ order?: "asc" | "desc";
87
+ status?: ("pending" | "processing" | "succeeded" | "partial" | "failed")[];
88
+ } | undefined;
89
+ path: {
90
+ patientId: string;
91
+ };
92
+ };
93
+ }, `${string}/${string}`>>;
46
94
  getIngestStatus(patientId: string): Promise<import("openapi-fetch").FetchResponse<{
47
95
  parameters: {
48
96
  query?: never;
@@ -107,6 +155,43 @@ export declare class IngestResource {
107
155
  };
108
156
  };
109
157
  }, `${string}/${string}`>>;
158
+ getIngestion(patientId: string, ingestionId: string): Promise<import("openapi-fetch").FetchResponse<{
159
+ parameters: {
160
+ query?: never;
161
+ header?: never;
162
+ path: {
163
+ patientId: string;
164
+ ingestionId: string;
165
+ };
166
+ cookie?: never;
167
+ };
168
+ requestBody?: never;
169
+ responses: {
170
+ 200: {
171
+ headers: {
172
+ [name: string]: unknown;
173
+ };
174
+ content: {
175
+ "application/json": import("..").components["schemas"]["Ingestion"];
176
+ };
177
+ };
178
+ 404: {
179
+ headers: {
180
+ [name: string]: unknown;
181
+ };
182
+ content: {
183
+ "application/json": import("..").components["schemas"]["ApiError"];
184
+ };
185
+ };
186
+ };
187
+ }, {
188
+ params: {
189
+ path: {
190
+ patientId: string;
191
+ ingestionId: string;
192
+ };
193
+ };
194
+ }, `${string}/${string}`>>;
110
195
  ingestFhir(patientId: string, body: NonNullable<operations["ingest-fhir"]["requestBody"]>["content"]["application/json"], params?: {
111
196
  query?: {
112
197
  wait?: number;
@@ -216,7 +301,7 @@ export declare class IngestResource {
216
301
  };
217
302
  };
218
303
  body: string;
219
- bodySerializer: (b: BodyInit) => BodyInit;
304
+ bodySerializer: (b: unknown) => string;
220
305
  headers: {
221
306
  "Content-Type": string;
222
307
  };
@@ -320,4 +405,189 @@ export declare class IngestResource {
320
405
  documents?: import("..").components["schemas"]["IngestDocumentBody"][];
321
406
  };
322
407
  }, `${string}/${string}`>>;
408
+ ingestFhirR4(patientId: string, body: IngestFhirBody): Promise<import("openapi-fetch").FetchResponse<{
409
+ parameters: {
410
+ query?: never;
411
+ header?: never;
412
+ path: {
413
+ patientId: string;
414
+ };
415
+ cookie?: never;
416
+ };
417
+ requestBody: {
418
+ content: {
419
+ "application/json": import("..").components["schemas"]["IngestFhirBody"];
420
+ };
421
+ };
422
+ responses: {
423
+ 202: {
424
+ headers: {
425
+ [name: string]: unknown;
426
+ };
427
+ content: {
428
+ "application/json": import("..").components["schemas"]["Ingestion"];
429
+ };
430
+ };
431
+ 400: {
432
+ headers: {
433
+ [name: string]: unknown;
434
+ };
435
+ content: {
436
+ "application/json": import("..").components["schemas"]["ApiError"];
437
+ };
438
+ };
439
+ 404: {
440
+ headers: {
441
+ [name: string]: unknown;
442
+ };
443
+ content: {
444
+ "application/json": import("..").components["schemas"]["ApiError"];
445
+ };
446
+ };
447
+ 422: {
448
+ headers: {
449
+ [name: string]: unknown;
450
+ };
451
+ content: {
452
+ "application/json": import("..").components["schemas"]["ApiError"];
453
+ };
454
+ };
455
+ };
456
+ }, {
457
+ params: {
458
+ path: {
459
+ patientId: string;
460
+ };
461
+ };
462
+ body: {
463
+ resourceType: string;
464
+ entry?: unknown[];
465
+ } & {
466
+ [key: string]: unknown;
467
+ };
468
+ }, `${string}/${string}`>>;
469
+ ingestFhirR5(patientId: string, body: IngestFhirBody): Promise<import("openapi-fetch").FetchResponse<{
470
+ parameters: {
471
+ query?: never;
472
+ header?: never;
473
+ path: {
474
+ patientId: string;
475
+ };
476
+ cookie?: never;
477
+ };
478
+ requestBody: {
479
+ content: {
480
+ "application/json": import("..").components["schemas"]["IngestFhirBody"];
481
+ };
482
+ };
483
+ responses: {
484
+ 202: {
485
+ headers: {
486
+ [name: string]: unknown;
487
+ };
488
+ content: {
489
+ "application/json": import("..").components["schemas"]["Ingestion"];
490
+ };
491
+ };
492
+ 400: {
493
+ headers: {
494
+ [name: string]: unknown;
495
+ };
496
+ content: {
497
+ "application/json": import("..").components["schemas"]["ApiError"];
498
+ };
499
+ };
500
+ 404: {
501
+ headers: {
502
+ [name: string]: unknown;
503
+ };
504
+ content: {
505
+ "application/json": import("..").components["schemas"]["ApiError"];
506
+ };
507
+ };
508
+ 422: {
509
+ headers: {
510
+ [name: string]: unknown;
511
+ };
512
+ content: {
513
+ "application/json": import("..").components["schemas"]["ApiError"];
514
+ };
515
+ };
516
+ };
517
+ }, {
518
+ params: {
519
+ path: {
520
+ patientId: string;
521
+ };
522
+ };
523
+ body: {
524
+ resourceType: string;
525
+ entry?: unknown[];
526
+ } & {
527
+ [key: string]: unknown;
528
+ };
529
+ }, `${string}/${string}`>>;
530
+ ingestCdaR2(patientId: string, body: NonNullable<operations["ingest-cda-r2"]["requestBody"]>["content"]["application/cda+xml"]): Promise<import("openapi-fetch").FetchResponse<{
531
+ parameters: {
532
+ query?: never;
533
+ header?: never;
534
+ path: {
535
+ patientId: string;
536
+ };
537
+ cookie?: never;
538
+ };
539
+ requestBody: {
540
+ content: {
541
+ "application/cda+xml": string;
542
+ "multipart/form-data": {
543
+ documents?: string[];
544
+ };
545
+ };
546
+ };
547
+ responses: {
548
+ 202: {
549
+ headers: {
550
+ [name: string]: unknown;
551
+ };
552
+ content: {
553
+ "application/json": import("..").components["schemas"]["Ingestion"];
554
+ };
555
+ };
556
+ 400: {
557
+ headers: {
558
+ [name: string]: unknown;
559
+ };
560
+ content: {
561
+ "application/json": import("..").components["schemas"]["ApiError"];
562
+ };
563
+ };
564
+ 404: {
565
+ headers: {
566
+ [name: string]: unknown;
567
+ };
568
+ content: {
569
+ "application/json": import("..").components["schemas"]["ApiError"];
570
+ };
571
+ };
572
+ 422: {
573
+ headers: {
574
+ [name: string]: unknown;
575
+ };
576
+ content: {
577
+ "application/json": import("..").components["schemas"]["ApiError"];
578
+ };
579
+ };
580
+ };
581
+ }, {
582
+ params: {
583
+ path: {
584
+ patientId: string;
585
+ };
586
+ };
587
+ body: string;
588
+ bodySerializer: (b: unknown) => string;
589
+ headers: {
590
+ "Content-Type": string;
591
+ };
592
+ }, `${string}/${string}`>>;
323
593
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clinia/context-engine-js",
3
- "version": "0.5.0",
3
+ "version": "0.6.0-rc.1",
4
4
  "description": "TypeScript client for the Clinia Context Engine",
5
5
  "keywords": [
6
6
  "clinia",