@medplum/fhir-router 2.0.21 → 2.0.22
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/dist/cjs/index.cjs +201 -40
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.min.cjs +1 -1
- package/dist/cjs/index.min.cjs.map +1 -1
- package/dist/esm/index.min.mjs +1 -1
- package/dist/esm/index.min.mjs.map +1 -1
- package/dist/esm/index.mjs +202 -41
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/batch.d.ts +0 -1
- package/dist/types/fhirrouter.d.ts +6 -1
- package/dist/types/graphql.d.ts +6 -2
- package/dist/types/repo.d.ts +0 -15
- package/package.json +1 -1
package/dist/types/batch.d.ts
CHANGED
|
@@ -10,8 +10,13 @@ export type FhirRequest = {
|
|
|
10
10
|
};
|
|
11
11
|
export type FhirResponse = [OperationOutcome] | [OperationOutcome, Resource];
|
|
12
12
|
export type FhirRouteHandler = (req: FhirRequest, repo: FhirRepository, router: FhirRouter) => Promise<FhirResponse>;
|
|
13
|
+
interface FhirOptions {
|
|
14
|
+
introspectionEnabled?: boolean;
|
|
15
|
+
}
|
|
13
16
|
export declare class FhirRouter {
|
|
14
17
|
readonly router: Router<FhirRouteHandler>;
|
|
15
|
-
|
|
18
|
+
readonly options: FhirOptions;
|
|
19
|
+
constructor(options?: {});
|
|
16
20
|
handleRequest(req: FhirRequest, repo: FhirRepository): Promise<FhirResponse>;
|
|
17
21
|
}
|
|
22
|
+
export {};
|
package/dist/types/graphql.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { GraphQLSchema } from 'graphql';
|
|
2
|
-
import { FhirRequest, FhirResponse } from './fhirrouter';
|
|
2
|
+
import { FhirRequest, FhirResponse, FhirRouter } from './fhirrouter';
|
|
3
3
|
import { FhirRepository } from './repo';
|
|
4
4
|
/**
|
|
5
5
|
* Handles FHIR GraphQL requests.
|
|
6
6
|
*
|
|
7
7
|
* See: https://www.hl7.org/fhir/graphql.html
|
|
8
|
+
* @param req The request details.
|
|
9
|
+
* @param repo The current user FHIR repository.
|
|
10
|
+
* @param router The router for router options.
|
|
11
|
+
* @returns The response.
|
|
8
12
|
*/
|
|
9
|
-
export declare function graphqlHandler(req: FhirRequest, repo: FhirRepository): Promise<FhirResponse>;
|
|
13
|
+
export declare function graphqlHandler(req: FhirRequest, repo: FhirRepository, router: FhirRouter): Promise<FhirResponse>;
|
|
10
14
|
export declare function getRootSchema(): GraphQLSchema;
|
package/dist/types/repo.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export interface FhirRepository {
|
|
|
14
14
|
* Creates a FHIR resource.
|
|
15
15
|
*
|
|
16
16
|
* See: https://www.hl7.org/fhir/http.html#create
|
|
17
|
-
*
|
|
18
17
|
* @param resource The FHIR resource to create.
|
|
19
18
|
* @returns The created resource.
|
|
20
19
|
*/
|
|
@@ -23,7 +22,6 @@ export interface FhirRepository {
|
|
|
23
22
|
* Reads a FHIR resource by ID.
|
|
24
23
|
*
|
|
25
24
|
* See: https://www.hl7.org/fhir/http.html#read
|
|
26
|
-
*
|
|
27
25
|
* @param resourceType The FHIR resource type.
|
|
28
26
|
* @param id The FHIR resource ID.
|
|
29
27
|
* @returns The FHIR resource.
|
|
@@ -33,7 +31,6 @@ export interface FhirRepository {
|
|
|
33
31
|
* Reads a FHIR resource by reference.
|
|
34
32
|
*
|
|
35
33
|
* See: https://www.hl7.org/fhir/http.html#read
|
|
36
|
-
*
|
|
37
34
|
* @param reference The FHIR reference.
|
|
38
35
|
* @returns The FHIR resource.
|
|
39
36
|
*/
|
|
@@ -42,7 +39,6 @@ export interface FhirRepository {
|
|
|
42
39
|
* Reads a collection of FHIR resources by reference.
|
|
43
40
|
*
|
|
44
41
|
* See: https://www.hl7.org/fhir/http.html#read
|
|
45
|
-
*
|
|
46
42
|
* @param references The FHIR references.
|
|
47
43
|
* @returns The FHIR resources.
|
|
48
44
|
*/
|
|
@@ -53,7 +49,6 @@ export interface FhirRepository {
|
|
|
53
49
|
* Results are sorted with oldest versions last
|
|
54
50
|
*
|
|
55
51
|
* See: https://www.hl7.org/fhir/http.html#history
|
|
56
|
-
*
|
|
57
52
|
* @param resourceType The FHIR resource type.
|
|
58
53
|
* @param id The FHIR resource ID.
|
|
59
54
|
* @returns Operation outcome and a history bundle.
|
|
@@ -63,7 +58,6 @@ export interface FhirRepository {
|
|
|
63
58
|
* Reads a FHIR resource version.
|
|
64
59
|
*
|
|
65
60
|
* See: https://www.hl7.org/fhir/http.html#vread
|
|
66
|
-
*
|
|
67
61
|
* @param resourceType The FHIR resource type.
|
|
68
62
|
* @param id The FHIR resource ID.
|
|
69
63
|
* @param vid The FHIR resource version ID.
|
|
@@ -73,7 +67,6 @@ export interface FhirRepository {
|
|
|
73
67
|
* Updates a FHIR resource.
|
|
74
68
|
*
|
|
75
69
|
* See: https://www.hl7.org/fhir/http.html#update
|
|
76
|
-
*
|
|
77
70
|
* @param resource The FHIR resource to update.
|
|
78
71
|
* @returns The updated resource.
|
|
79
72
|
*/
|
|
@@ -82,7 +75,6 @@ export interface FhirRepository {
|
|
|
82
75
|
* Deletes a FHIR resource.
|
|
83
76
|
*
|
|
84
77
|
* See: https://www.hl7.org/fhir/http.html#delete
|
|
85
|
-
*
|
|
86
78
|
* @param resourceType The FHIR resource type.
|
|
87
79
|
* @param id The FHIR resource ID.
|
|
88
80
|
*/
|
|
@@ -91,7 +83,6 @@ export interface FhirRepository {
|
|
|
91
83
|
* Patches a FHIR resource.
|
|
92
84
|
*
|
|
93
85
|
* See: https://www.hl7.org/fhir/http.html#patch
|
|
94
|
-
*
|
|
95
86
|
* @param resourceType The FHIR resource type.
|
|
96
87
|
* @param id The FHIR resource ID.
|
|
97
88
|
* @param patch The JSONPatch operations.
|
|
@@ -102,7 +93,6 @@ export interface FhirRepository {
|
|
|
102
93
|
* Searches for FHIR resources.
|
|
103
94
|
*
|
|
104
95
|
* See: https://www.hl7.org/fhir/http.html#search
|
|
105
|
-
*
|
|
106
96
|
* @param searchRequest The FHIR search request.
|
|
107
97
|
* @returns The search results.
|
|
108
98
|
*/
|
|
@@ -115,7 +105,6 @@ export interface FhirRepository {
|
|
|
115
105
|
* The return value is the resource, if available; otherwise, undefined.
|
|
116
106
|
*
|
|
117
107
|
* See FHIR search for full details: https://www.hl7.org/fhir/search.html
|
|
118
|
-
*
|
|
119
108
|
* @param searchRequest The FHIR search request.
|
|
120
109
|
* @returns Promise to the first search result or undefined.
|
|
121
110
|
*/
|
|
@@ -128,7 +117,6 @@ export interface FhirRepository {
|
|
|
128
117
|
* The return value is an array of resources.
|
|
129
118
|
*
|
|
130
119
|
* See FHIR search for full details: https://www.hl7.org/fhir/search.html
|
|
131
|
-
*
|
|
132
120
|
* @param searchRequest The FHIR search request.
|
|
133
121
|
* @returns Promise to the array of search results.
|
|
134
122
|
*/
|
|
@@ -139,7 +127,6 @@ export declare abstract class BaseRepository {
|
|
|
139
127
|
* Searches for FHIR resources.
|
|
140
128
|
*
|
|
141
129
|
* See: https://www.hl7.org/fhir/http.html#search
|
|
142
|
-
*
|
|
143
130
|
* @param searchRequest The FHIR search request.
|
|
144
131
|
* @returns The search results.
|
|
145
132
|
*/
|
|
@@ -152,7 +139,6 @@ export declare abstract class BaseRepository {
|
|
|
152
139
|
* The return value is the resource, if available; otherwise, undefined.
|
|
153
140
|
*
|
|
154
141
|
* See FHIR search for full details: https://www.hl7.org/fhir/search.html
|
|
155
|
-
*
|
|
156
142
|
* @param searchRequest The FHIR search request.
|
|
157
143
|
* @returns Promise to the first search result or undefined.
|
|
158
144
|
*/
|
|
@@ -165,7 +151,6 @@ export declare abstract class BaseRepository {
|
|
|
165
151
|
* The return value is an array of resources.
|
|
166
152
|
*
|
|
167
153
|
* See FHIR search for full details: https://www.hl7.org/fhir/search.html
|
|
168
|
-
*
|
|
169
154
|
* @param searchRequest The FHIR search request.
|
|
170
155
|
* @returns Promise to the array of search results.
|
|
171
156
|
*/
|