@ovok/core 0.4.31 → 0.4.32
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/client/ai-fhir/methods/AIFhirResources.d.ts +2 -1
- package/dist/client/ai-fhir/methods/AIFhirResources.js +2 -2
- package/dist/client/auth/methods/appleLogin.d.ts +2 -1
- package/dist/client/auth/methods/appleLogin.js +2 -2
- package/dist/client/auth/methods/changePassword.d.ts +2 -1
- package/dist/client/auth/methods/changePassword.js +2 -2
- package/dist/client/auth/methods/getSessions.d.ts +2 -1
- package/dist/client/auth/methods/getSessions.js +2 -2
- package/dist/client/auth/methods/googleLogin.d.ts +2 -1
- package/dist/client/auth/methods/googleLogin.js +2 -2
- package/dist/client/auth/methods/index.d.ts +1 -0
- package/dist/client/auth/methods/index.js +1 -0
- package/dist/client/auth/methods/login.d.ts +6 -2
- package/dist/client/auth/methods/login.js +60 -44
- package/dist/client/auth/methods/logout.d.ts +2 -1
- package/dist/client/auth/methods/logout.js +2 -2
- package/dist/client/auth/methods/refetchProfile.d.ts +2 -1
- package/dist/client/auth/methods/refetchProfile.js +3 -4
- package/dist/client/auth/methods/register.d.ts +2 -1
- package/dist/client/auth/methods/register.js +2 -2
- package/dist/client/auth/methods/registerPractitioner.d.ts +2 -1
- package/dist/client/auth/methods/registerPractitioner.js +2 -2
- package/dist/client/auth/methods/reloadSession.d.ts +7 -0
- package/dist/client/auth/methods/reloadSession.js +23 -0
- package/dist/client/auth/methods/requestDeleteUser.d.ts +2 -1
- package/dist/client/auth/methods/requestDeleteUser.js +5 -5
- package/dist/client/auth/methods/resetPassword.d.ts +2 -1
- package/dist/client/auth/methods/resetPassword.js +2 -2
- package/dist/client/auth/methods/revokeSessions.d.ts +2 -1
- package/dist/client/auth/methods/revokeSessions.js +2 -2
- package/dist/client/auth/methods/setPasswordFromReset.d.ts +2 -1
- package/dist/client/auth/methods/setPasswordFromReset.js +2 -2
- package/dist/client/auth/types/LoginBody.d.ts +10 -20
- package/dist/client/auth/types/LoginError.d.ts +15 -0
- package/dist/client/auth/types/LoginError.js +15 -0
- package/dist/client/bot/methods/executeBot.d.ts +2 -1
- package/dist/client/bot/methods/executeBot.js +2 -2
- package/dist/client/change-history/methods.d.ts +2 -1
- package/dist/client/change-history/methods.js +2 -2
- package/dist/client/chat/ai/methods/createAiSession.d.ts +2 -1
- package/dist/client/chat/ai/methods/createAiSession.js +2 -2
- package/dist/client/cms/methods.d.ts +6 -5
- package/dist/client/cms/methods.js +10 -10
- package/dist/client/consent/methods.d.ts +5 -4
- package/dist/client/consent/methods.js +8 -8
- package/dist/client/email/methods.d.ts +2 -1
- package/dist/client/email/methods.js +2 -2
- package/dist/client/errors/ovok-error-utils.d.ts +7 -0
- package/dist/client/errors/ovok-error-utils.js +49 -5
- package/dist/client/errors/ovok-error.d.ts +4 -0
- package/dist/client/errors/ovok-error.js +17 -4
- package/dist/client/errors/rate-limit-error.js +5 -3
- package/dist/client/experience/methods.d.ts +32 -31
- package/dist/client/experience/methods.js +62 -62
- package/dist/client/invites/methods.d.ts +6 -5
- package/dist/client/invites/methods.js +11 -11
- package/dist/client/notifications/methods.d.ts +6 -5
- package/dist/client/notifications/methods.js +10 -10
- package/dist/client/notifications/types.d.ts +92 -11
- package/dist/client/observation/methods/getLatestObservationsByCodes.d.ts +2 -1
- package/dist/client/observation/methods/getLatestObservationsByCodes.js +4 -4
- package/dist/client/offline/offline-measurement-queue.d.ts +4 -3
- package/dist/client/offline/offline-measurement-queue.js +6 -6
- package/dist/client/ovok-client.d.ts +9 -7
- package/dist/client/ovok-client.js +148 -22
- package/dist/client/patient/methods.d.ts +24 -23
- package/dist/client/patient/methods.js +49 -49
- package/dist/client/patient-sharing/methods.d.ts +7 -6
- package/dist/client/patient-sharing/methods.js +12 -12
- package/dist/client/platform/methods.d.ts +24 -23
- package/dist/client/platform/methods.js +46 -46
- package/dist/client/questionnaire-response/methods/createQuestionnaireResponseWithObservations.d.ts +2 -1
- package/dist/client/questionnaire-response/methods/createQuestionnaireResponseWithObservations.js +2 -2
- package/dist/client/questionnaire-response/methods/extractQuestionnaireObservations.d.ts +2 -1
- package/dist/client/questionnaire-response/methods/extractQuestionnaireObservations.js +2 -2
- package/dist/client/questionnaire-response/methods/populateQuestionnaire.d.ts +2 -1
- package/dist/client/questionnaire-response/methods/populateQuestionnaire.js +2 -2
- package/dist/client/questionnaire-response/methods/submitQuestionnaireResponse.d.ts +2 -1
- package/dist/client/questionnaire-response/methods/submitQuestionnaireResponse.js +2 -2
- package/dist/client/signals/methods.d.ts +22 -21
- package/dist/client/signals/methods.js +42 -42
- package/dist/client/slim/methods.d.ts +93 -57
- package/dist/client/slim/methods.js +295 -108
- package/dist/client/slim/paging.d.ts +18 -0
- package/dist/client/slim/paging.js +57 -0
- package/dist/client/slim/types.d.ts +370 -3
- package/dist/conformance/api-requirements.js +22 -0
- package/dist/conformance/capability-requirements.js +1 -1
- package/dist/hooks/account-hooks.js +7 -7
- package/dist/hooks/api-hooks.d.ts +5 -2
- package/dist/hooks/api-hooks.js +39 -16
- package/dist/hooks/cms-hooks.js +3 -3
- package/dist/hooks/email-hooks.js +1 -1
- package/dist/hooks/experience-hooks.js +5 -5
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +5 -3
- package/dist/hooks/notification-ack-hooks.d.ts +2 -1
- package/dist/hooks/notification-hooks.d.ts +4 -2
- package/dist/hooks/notification-hooks.js +11 -23
- package/dist/hooks/notification-invalidation.d.ts +3 -2
- package/dist/hooks/notification-invalidation.js +10 -1
- package/dist/hooks/notification-note-hooks.js +3 -3
- package/dist/hooks/observation-hooks.d.ts +5 -1
- package/dist/hooks/observation-hooks.js +6 -6
- package/dist/hooks/patient-hooks.js +18 -18
- package/dist/hooks/patient-sharing-hooks.js +2 -2
- package/dist/hooks/platform-hooks.js +3 -3
- package/dist/hooks/poll-hooks.d.ts +14 -0
- package/dist/hooks/poll-hooks.js +127 -0
- package/dist/hooks/signals-alert-hooks.d.ts +5 -20
- package/dist/hooks/signals-alert-hooks.js +38 -34
- package/dist/hooks/signals-alert-item-hooks.d.ts +19 -0
- package/dist/hooks/signals-alert-item-hooks.js +62 -0
- package/dist/hooks/signals-hooks.js +2 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -1
- package/dist/utils/auth/exchange-code.d.ts +2 -0
- package/dist/utils/auth/exchange-code.js +2 -2
- package/dist/utils/auth/handle-tenant-code.d.ts +1 -1
- package/dist/utils/auth/handle-tenant-code.js +13 -4
- package/dist/utils/auth/start-login.d.ts +3 -1
- package/dist/utils/auth/start-login.js +3 -3
- package/package.json +1 -1
|
@@ -47,6 +47,7 @@ const cmsMethods = __importStar(require("./cms/methods"));
|
|
|
47
47
|
const consentMethods = __importStar(require("./consent/methods"));
|
|
48
48
|
const emailMethods = __importStar(require("./email"));
|
|
49
49
|
const ovok_error_1 = require("./errors/ovok-error");
|
|
50
|
+
const ovok_error_utils_1 = require("./errors/ovok-error-utils");
|
|
50
51
|
const rate_limit_error_1 = require("./errors/rate-limit-error");
|
|
51
52
|
const experienceMethods = __importStar(require("./experience/methods"));
|
|
52
53
|
const inviteMethods = __importStar(require("./invites/methods"));
|
|
@@ -77,6 +78,80 @@ const retryAfterMs = (response) => {
|
|
|
77
78
|
const date = Date.parse(value);
|
|
78
79
|
return Number.isFinite(date) ? Math.max(0, date - Date.now()) : undefined;
|
|
79
80
|
};
|
|
81
|
+
const timeoutError = () => {
|
|
82
|
+
const error = new Error("The request timed out.");
|
|
83
|
+
error.name = "TimeoutError";
|
|
84
|
+
return error;
|
|
85
|
+
};
|
|
86
|
+
const withHttpErrorMetadata = async (response) => {
|
|
87
|
+
var _a, _b;
|
|
88
|
+
if (response.ok || typeof response.clone !== "function") {
|
|
89
|
+
return response;
|
|
90
|
+
}
|
|
91
|
+
let bodyText = "";
|
|
92
|
+
let body;
|
|
93
|
+
try {
|
|
94
|
+
bodyText = await response.clone().text();
|
|
95
|
+
body = JSON.parse(bodyText);
|
|
96
|
+
}
|
|
97
|
+
catch (_c) {
|
|
98
|
+
body = undefined;
|
|
99
|
+
}
|
|
100
|
+
const outcome = body && typeof body === "object" && body.resourceType === "OperationOutcome"
|
|
101
|
+
? body
|
|
102
|
+
: undefined;
|
|
103
|
+
const envelope = body && typeof body === "object" ? body : undefined;
|
|
104
|
+
const nestedError = (envelope === null || envelope === void 0 ? void 0 : envelope.error) && typeof envelope.error === "object"
|
|
105
|
+
? envelope.error
|
|
106
|
+
: undefined;
|
|
107
|
+
const safeResponse = envelope
|
|
108
|
+
? Object.fromEntries(Object.entries(envelope).filter(([key]) => ["code", "error", "message", "requestId", "retryAfterSec", "status", "statusCode", "errors", "missing"].includes(key)))
|
|
109
|
+
: { message: typeof body === "string" ? body : response.statusText };
|
|
110
|
+
const status = response.status;
|
|
111
|
+
const retryAfter = (_a = retryAfterMs(response)) !== null && _a !== void 0 ? _a : (typeof (envelope === null || envelope === void 0 ? void 0 : envelope.retryAfterSec) === "number" ? envelope.retryAfterSec * 1000 : undefined);
|
|
112
|
+
const requestId = (_b = response.headers.get("x-request-id")) !== null && _b !== void 0 ? _b : (typeof (envelope === null || envelope === void 0 ? void 0 : envelope.requestId) === "string" ? envelope.requestId : undefined);
|
|
113
|
+
const message = typeof (envelope === null || envelope === void 0 ? void 0 : envelope.message) === "string"
|
|
114
|
+
? envelope.message
|
|
115
|
+
: typeof (nestedError === null || nestedError === void 0 ? void 0 : nestedError.message) === "string"
|
|
116
|
+
? nestedError.message
|
|
117
|
+
: response.statusText || `HTTP ${status}`;
|
|
118
|
+
const extensions = [];
|
|
119
|
+
const addMetadata = (url, value, kind) => {
|
|
120
|
+
if (value !== undefined) {
|
|
121
|
+
extensions.push({ url, [`value${kind}`]: value });
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
addMetadata("status", status, "Integer");
|
|
125
|
+
addMetadata("requestId", requestId, "String");
|
|
126
|
+
addMetadata("retryAfterMs", retryAfter, "Integer");
|
|
127
|
+
if (!outcome) {
|
|
128
|
+
extensions.push({ url: "response", valueString: JSON.stringify(safeResponse) });
|
|
129
|
+
}
|
|
130
|
+
const enrichedOutcome = outcome !== null && outcome !== void 0 ? outcome : {
|
|
131
|
+
resourceType: "OperationOutcome",
|
|
132
|
+
id: "ovok-http-error",
|
|
133
|
+
issue: [{
|
|
134
|
+
severity: "error",
|
|
135
|
+
code: status === 429 ? "throttled" : "exception",
|
|
136
|
+
details: { text: bodyText || message },
|
|
137
|
+
}],
|
|
138
|
+
};
|
|
139
|
+
const existingExtensions = Array.isArray(enrichedOutcome.extension)
|
|
140
|
+
? enrichedOutcome.extension
|
|
141
|
+
: [];
|
|
142
|
+
enrichedOutcome.extension = [
|
|
143
|
+
...existingExtensions,
|
|
144
|
+
{ url: ovok_error_utils_1.OVOK_HTTP_ERROR_EXTENSION_URL, extension: extensions },
|
|
145
|
+
];
|
|
146
|
+
const headers = new Headers(response.headers);
|
|
147
|
+
headers.delete("content-length");
|
|
148
|
+
headers.set("content-type", "application/fhir+json");
|
|
149
|
+
return new Response(JSON.stringify(enrichedOutcome), {
|
|
150
|
+
status,
|
|
151
|
+
statusText: response.statusText,
|
|
152
|
+
headers,
|
|
153
|
+
});
|
|
154
|
+
};
|
|
80
155
|
const waitForRetry = (milliseconds, signal) => new Promise((resolve, reject) => {
|
|
81
156
|
var _a;
|
|
82
157
|
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
|
@@ -122,6 +197,7 @@ const isNetworkError = (error) => {
|
|
|
122
197
|
}
|
|
123
198
|
return isNetworkError(error.cause);
|
|
124
199
|
};
|
|
200
|
+
const isRetrySafePost = (pathname) => pathname === "/ai/fhir/search";
|
|
125
201
|
class OvokClient extends core_1.MedplumClient {
|
|
126
202
|
/**
|
|
127
203
|
* @param config - The configuration for the client.
|
|
@@ -129,7 +205,10 @@ class OvokClient extends core_1.MedplumClient {
|
|
|
129
205
|
*/
|
|
130
206
|
constructor(config) {
|
|
131
207
|
var _a, _b, _c, _d, _e, _f;
|
|
132
|
-
|
|
208
|
+
if (config.requestTimeoutMs !== undefined && (!Number.isFinite(config.requestTimeoutMs) || config.requestTimeoutMs <= 0)) {
|
|
209
|
+
throw new RangeError("requestTimeoutMs must be a positive finite number.");
|
|
210
|
+
}
|
|
211
|
+
const storage = (_a = config.storage) !== null && _a !== void 0 ? _a : new core_1.ClientStorage(new core_1.MemoryStorage(), config.storagePrefix);
|
|
133
212
|
const fetchImplementation = (_b = config.fetch) !== null && _b !== void 0 ? _b : globalThis.fetch.bind(globalThis);
|
|
134
213
|
const baseUrl = (_c = config.baseUrl) !== null && _c !== void 0 ? _c : "https://api.medplum.com/";
|
|
135
214
|
const normalizedBaseUrl = baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`;
|
|
@@ -151,7 +230,40 @@ class OvokClient extends core_1.MedplumClient {
|
|
|
151
230
|
};
|
|
152
231
|
const fetchOnce = async (url, options) => {
|
|
153
232
|
var _a, _b;
|
|
154
|
-
const
|
|
233
|
+
const requestTimeoutMs = config.requestTimeoutMs;
|
|
234
|
+
let response;
|
|
235
|
+
if (requestTimeoutMs === undefined) {
|
|
236
|
+
response = await fetchImplementation(url, options);
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
const controller = new AbortController();
|
|
240
|
+
const callerSignal = options === null || options === void 0 ? void 0 : options.signal;
|
|
241
|
+
let timedOut = false;
|
|
242
|
+
const abortFromCaller = () => controller.abort(callerSignal === null || callerSignal === void 0 ? void 0 : callerSignal.reason);
|
|
243
|
+
const timeout = setTimeout(() => {
|
|
244
|
+
timedOut = true;
|
|
245
|
+
controller.abort(timeoutError());
|
|
246
|
+
}, requestTimeoutMs);
|
|
247
|
+
if (callerSignal === null || callerSignal === void 0 ? void 0 : callerSignal.aborted) {
|
|
248
|
+
abortFromCaller();
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
callerSignal === null || callerSignal === void 0 ? void 0 : callerSignal.addEventListener("abort", abortFromCaller, { once: true });
|
|
252
|
+
}
|
|
253
|
+
try {
|
|
254
|
+
response = await fetchImplementation(url, { ...options, signal: controller.signal });
|
|
255
|
+
}
|
|
256
|
+
catch (error) {
|
|
257
|
+
if (timedOut) {
|
|
258
|
+
throw timeoutError();
|
|
259
|
+
}
|
|
260
|
+
throw error;
|
|
261
|
+
}
|
|
262
|
+
finally {
|
|
263
|
+
clearTimeout(timeout);
|
|
264
|
+
callerSignal === null || callerSignal === void 0 ? void 0 : callerSignal.removeEventListener("abort", abortFromCaller);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
155
267
|
const requestUrl = new URL(url, normalizedBaseUrl);
|
|
156
268
|
if (isTokenRefresh(url, options)) {
|
|
157
269
|
if (response.status === 400) {
|
|
@@ -190,7 +302,9 @@ class OvokClient extends core_1.MedplumClient {
|
|
|
190
302
|
else if (response.status === 401) {
|
|
191
303
|
unauthenticatedReason = { type: "request-unauthorized", status: 401 };
|
|
192
304
|
}
|
|
193
|
-
return
|
|
305
|
+
return isTokenRefresh(url, options)
|
|
306
|
+
? response
|
|
307
|
+
: withHttpErrorMetadata(response);
|
|
194
308
|
};
|
|
195
309
|
const fetchWithRefreshRetry = async (url, options) => {
|
|
196
310
|
var _a, _b, _c, _d;
|
|
@@ -331,6 +445,13 @@ class OvokClient extends core_1.MedplumClient {
|
|
|
331
445
|
this.clientStorage = storage;
|
|
332
446
|
this.offlineQueueOptions = (_f = config.offlineQueue) !== null && _f !== void 0 ? _f : {};
|
|
333
447
|
}
|
|
448
|
+
post(url, body, contentType, options) {
|
|
449
|
+
const pathname = new URL(url.toString(), this.getBaseUrl()).pathname;
|
|
450
|
+
if (!isRetrySafePost(pathname)) {
|
|
451
|
+
options = { ...options, maxRetries: 0, maxRetryTime: 0 };
|
|
452
|
+
}
|
|
453
|
+
return super.post(url, body, contentType, options);
|
|
454
|
+
}
|
|
334
455
|
/** Lists saved accounts without exposing their access or refresh tokens. */
|
|
335
456
|
getSavedAccounts() {
|
|
336
457
|
var _a, _b;
|
|
@@ -382,7 +503,7 @@ class OvokClient extends core_1.MedplumClient {
|
|
|
382
503
|
* Accounts with an expired server session are removed locally; network and service
|
|
383
504
|
* failures retain the account so it can be removed after connectivity returns.
|
|
384
505
|
*/
|
|
385
|
-
async removeAccount(accountId) {
|
|
506
|
+
async removeAccount(accountId, requestOptions) {
|
|
386
507
|
var _a;
|
|
387
508
|
const login = this.getLogin(accountId);
|
|
388
509
|
if (!login) {
|
|
@@ -392,7 +513,7 @@ class OvokClient extends core_1.MedplumClient {
|
|
|
392
513
|
const previousAccountId = (_a = previousLogin === null || previousLogin === void 0 ? void 0 : previousLogin.profile) === null || _a === void 0 ? void 0 : _a.reference;
|
|
393
514
|
try {
|
|
394
515
|
await this.setActiveLogin(login);
|
|
395
|
-
await this.delete("auth/session/current");
|
|
516
|
+
await this.delete("auth/session/current", ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
396
517
|
}
|
|
397
518
|
catch (error) {
|
|
398
519
|
if (this.getExpiredAccountIds().includes(accountId)) {
|
|
@@ -447,34 +568,34 @@ class OvokClient extends core_1.MedplumClient {
|
|
|
447
568
|
}
|
|
448
569
|
}
|
|
449
570
|
/** Saves a measurement immediately, or durably queues it when the opt-in queue is enabled. */
|
|
450
|
-
async saveMeasurement(params) {
|
|
571
|
+
async saveMeasurement(params, requestOptions) {
|
|
451
572
|
const observations = await this.generateObservationBodiesByMeasurement(params);
|
|
452
|
-
return this.saveObservations(observations);
|
|
573
|
+
return this.saveObservations(observations, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
453
574
|
}
|
|
454
575
|
/** Reads Ovok's composed FHIR and public-route capability statement. */
|
|
455
|
-
async getCapabilityStatement(version = "R4") {
|
|
456
|
-
return this.get(`/fhir/${version}/metadata
|
|
576
|
+
async getCapabilityStatement(version = "R4", requestOptions) {
|
|
577
|
+
return this.get(`/fhir/${version}/metadata`, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
457
578
|
}
|
|
458
579
|
/** Returns the non-FHIR public routes published by the backend statement. */
|
|
459
|
-
async getPublicApiEndpoints(version = "R4") {
|
|
460
|
-
return (0, capability_1.getOvokPublicApiEndpoints)(await this.getCapabilityStatement(version));
|
|
580
|
+
async getPublicApiEndpoints(version = "R4", requestOptions) {
|
|
581
|
+
return (0, capability_1.getOvokPublicApiEndpoints)(await this.getCapabilityStatement(version, ...(requestOptions === undefined ? [] : [requestOptions])));
|
|
461
582
|
}
|
|
462
583
|
/** Saves observations with conditional creates so a retry cannot create a duplicate. */
|
|
463
|
-
async saveObservations(observations) {
|
|
584
|
+
async saveObservations(observations, requestOptions) {
|
|
464
585
|
const linkedObservations = (0, observation_bundle_utils_1.linkObservationMembers)(observations);
|
|
465
586
|
const queue = this.getOfflineMeasurementQueue();
|
|
466
587
|
if (queue) {
|
|
467
|
-
const { id, flush } = await queue.enqueueAndFlush(linkedObservations);
|
|
588
|
+
const { id, flush } = await queue.enqueueAndFlush(linkedObservations, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
468
589
|
const response = flush.responses[id];
|
|
469
590
|
return response
|
|
470
591
|
? { status: "saved", response }
|
|
471
592
|
: { status: "queued", queueId: id };
|
|
472
593
|
}
|
|
473
|
-
const response = await this.executeConditionalObservationCreates(linkedObservations);
|
|
594
|
+
const response = await this.executeConditionalObservationCreates(linkedObservations, requestOptions);
|
|
474
595
|
return { status: "saved", response };
|
|
475
596
|
}
|
|
476
597
|
/** Flushes measurements queued while offline. Call this on connectivity/app-resume events. */
|
|
477
|
-
async flushOfflineMeasurementQueue(options = {}) {
|
|
598
|
+
async flushOfflineMeasurementQueue(options = {}, requestOptions) {
|
|
478
599
|
const queue = this.getOfflineMeasurementQueue();
|
|
479
600
|
if (!queue) {
|
|
480
601
|
return {
|
|
@@ -485,7 +606,7 @@ class OvokClient extends core_1.MedplumClient {
|
|
|
485
606
|
responses: {},
|
|
486
607
|
};
|
|
487
608
|
}
|
|
488
|
-
return queue.flush(options);
|
|
609
|
+
return queue.flush(options, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
489
610
|
}
|
|
490
611
|
getOfflineMeasurementQueue() {
|
|
491
612
|
var _a;
|
|
@@ -495,7 +616,7 @@ class OvokClient extends core_1.MedplumClient {
|
|
|
495
616
|
if (!this.clientStorage || !this.hasExplicitStorageAdapter) {
|
|
496
617
|
throw new Error("Offline measurement queue requires a durable client storage adapter.");
|
|
497
618
|
}
|
|
498
|
-
(_a = this.offlineMeasurementQueue) !== null && _a !== void 0 ? _a : (this.offlineMeasurementQueue = new offline_1.OfflineMeasurementQueue(this.clientStorage, (bundle) => this.executeObservationBundle(bundle), {
|
|
619
|
+
(_a = this.offlineMeasurementQueue) !== null && _a !== void 0 ? _a : (this.offlineMeasurementQueue = new offline_1.OfflineMeasurementQueue(this.clientStorage, (bundle, requestOptions) => this.executeObservationBundle(bundle, ...(requestOptions === undefined ? [] : [requestOptions])), {
|
|
499
620
|
...this.offlineQueueOptions,
|
|
500
621
|
getOwnerKey: () => {
|
|
501
622
|
var _a, _b, _c;
|
|
@@ -521,8 +642,13 @@ class OvokClient extends core_1.MedplumClient {
|
|
|
521
642
|
clear() {
|
|
522
643
|
var _a, _b, _c;
|
|
523
644
|
const storage = this.clientStorage;
|
|
524
|
-
const logins = this.getLogins();
|
|
525
645
|
const activeAccountId = (_b = (_a = this.getActiveLogin()) === null || _a === void 0 ? void 0 : _a.profile) === null || _b === void 0 ? void 0 : _b.reference;
|
|
646
|
+
const logins = this.getLogins().map((login) => {
|
|
647
|
+
var _a;
|
|
648
|
+
return ((_a = login.profile) === null || _a === void 0 ? void 0 : _a.reference) === activeAccountId
|
|
649
|
+
? { ...login, accessToken: "", refreshToken: "" }
|
|
650
|
+
: login;
|
|
651
|
+
});
|
|
526
652
|
const expiredAccountIds = new Set(this.getExpiredAccountIds());
|
|
527
653
|
if (activeAccountId) {
|
|
528
654
|
expiredAccountIds.add(activeAccountId);
|
|
@@ -580,16 +706,16 @@ class OvokClient extends core_1.MedplumClient {
|
|
|
580
706
|
// Keep the saved login available for a later retry if restoration is offline.
|
|
581
707
|
}
|
|
582
708
|
}
|
|
583
|
-
async executeConditionalObservationCreates(observations) {
|
|
709
|
+
async executeConditionalObservationCreates(observations, requestOptions) {
|
|
584
710
|
const entries = observations.map(offline_1.entryForObservation);
|
|
585
711
|
return this.executeObservationBundle({
|
|
586
712
|
resourceType: "Bundle",
|
|
587
713
|
type: "transaction",
|
|
588
714
|
entry: entries,
|
|
589
|
-
});
|
|
715
|
+
}, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
590
716
|
}
|
|
591
|
-
async executeObservationBundle(bundle) {
|
|
592
|
-
const response = await (0, observation_bundle_utils_1.executeObservationBundle)(bundle, (request) => this.executeBatch(request));
|
|
717
|
+
async executeObservationBundle(bundle, requestOptions) {
|
|
718
|
+
const response = await (0, observation_bundle_utils_1.executeObservationBundle)(bundle, (request) => this.executeBatch(request, ...(requestOptions === undefined ? [] : [requestOptions])));
|
|
593
719
|
this.invalidateSearches("Observation");
|
|
594
720
|
return response;
|
|
595
721
|
}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
+
import type { MedplumRequestOptions } from "@medplum/core";
|
|
1
2
|
import { OvokClient } from "../ovok-client";
|
|
2
3
|
import { OvokCurrentPatientProfile, OvokPatientLatestObservationsQuery, OvokPatientObservationBundle, OvokPatientAppointment, OvokPatientCarePlan, OvokPatientDashboard, OvokPatientDashboardQuery, OvokPatientDevice, OvokPatientMeasurement, OvokPatientNotification, OvokPatientQuestionnaire, OvokPatientQuestionnaireResponse, OvokPatientResourceQuery, OvokPatientSchedule, OvokPatientSchedulingQuery, OvokPatientSlot, OvokPatientTelemetryHistory, OvokPatientTelemetryHistoryQuery } from "./types";
|
|
3
|
-
export declare function getCurrentPatientProfile(this: OvokClient): Promise<OvokCurrentPatientProfile>;
|
|
4
|
-
export declare function getPatientLatestObservations(this: OvokClient, params?: OvokPatientLatestObservationsQuery): Promise<OvokPatientObservationBundle>;
|
|
5
|
-
export declare function getPatientDeviceTelemetry(this: OvokClient, deviceId: string): Promise<OvokPatientObservationBundle>;
|
|
6
|
-
export declare function getPatientDeviceTelemetryHistory(this: OvokClient, deviceId: string, params?: OvokPatientTelemetryHistoryQuery): Promise<OvokPatientTelemetryHistory>;
|
|
7
|
-
export declare function listPatientAppointments(this: OvokClient, params?: OvokPatientSchedulingQuery): Promise<OvokPatientAppointment[]>;
|
|
8
|
-
export declare function getPatientAppointment(this: OvokClient, appointmentId: string): Promise<OvokPatientAppointment>;
|
|
9
|
-
export declare function createPatientAppointment(this: OvokClient, appointment: OvokPatientAppointment): Promise<OvokPatientAppointment>;
|
|
10
|
-
export declare function updatePatientAppointment(this: OvokClient, appointment: OvokPatientAppointment): Promise<OvokPatientAppointment>;
|
|
11
|
-
export declare function listPatientSchedules(this: OvokClient, params?: OvokPatientSchedulingQuery): Promise<OvokPatientSchedule[]>;
|
|
12
|
-
export declare function listPatientSlots(this: OvokClient, params?: OvokPatientSchedulingQuery): Promise<OvokPatientSlot[]>;
|
|
13
|
-
export declare function listPatientMeasurementHistory(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientMeasurement[]>;
|
|
14
|
-
export declare function getPatientMeasurement(this: OvokClient, measurementId: string): Promise<OvokPatientMeasurement>;
|
|
15
|
-
export declare function listPatientCarePlans(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientCarePlan[]>;
|
|
16
|
-
export declare function getPatientCarePlan(this: OvokClient, carePlanId: string): Promise<OvokPatientCarePlan>;
|
|
17
|
-
export declare function listPatientQuestionnaires(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientQuestionnaire[]>;
|
|
18
|
-
export declare function getPatientQuestionnaire(this: OvokClient, questionnaireId: string): Promise<OvokPatientQuestionnaire>;
|
|
19
|
-
export declare function listPatientQuestionnaireResponses(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientQuestionnaireResponse[]>;
|
|
20
|
-
export declare function getPatientQuestionnaireResponse(this: OvokClient, questionnaireResponseId: string): Promise<OvokPatientQuestionnaireResponse>;
|
|
21
|
-
export declare function listPatientDevices(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientDevice[]>;
|
|
22
|
-
export declare function getPatientDevice(this: OvokClient, deviceId: string): Promise<OvokPatientDevice>;
|
|
23
|
-
export declare function listPatientNotifications(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientNotification[]>;
|
|
24
|
-
export declare function getPatientNotification(this: OvokClient, notificationId: string): Promise<OvokPatientNotification>;
|
|
25
|
-
export declare function getPatientDashboard(this: OvokClient, params?: OvokPatientDashboardQuery): Promise<OvokPatientDashboard>;
|
|
4
|
+
export declare function getCurrentPatientProfile(this: OvokClient, requestOptions?: MedplumRequestOptions): Promise<OvokCurrentPatientProfile>;
|
|
5
|
+
export declare function getPatientLatestObservations(this: OvokClient, params?: OvokPatientLatestObservationsQuery, requestOptions?: MedplumRequestOptions): Promise<OvokPatientObservationBundle>;
|
|
6
|
+
export declare function getPatientDeviceTelemetry(this: OvokClient, deviceId: string, requestOptions?: MedplumRequestOptions): Promise<OvokPatientObservationBundle>;
|
|
7
|
+
export declare function getPatientDeviceTelemetryHistory(this: OvokClient, deviceId: string, params?: OvokPatientTelemetryHistoryQuery, requestOptions?: MedplumRequestOptions): Promise<OvokPatientTelemetryHistory>;
|
|
8
|
+
export declare function listPatientAppointments(this: OvokClient, params?: OvokPatientSchedulingQuery, requestOptions?: MedplumRequestOptions): Promise<OvokPatientAppointment[]>;
|
|
9
|
+
export declare function getPatientAppointment(this: OvokClient, appointmentId: string, requestOptions?: MedplumRequestOptions): Promise<OvokPatientAppointment>;
|
|
10
|
+
export declare function createPatientAppointment(this: OvokClient, appointment: OvokPatientAppointment, requestOptions?: MedplumRequestOptions): Promise<OvokPatientAppointment>;
|
|
11
|
+
export declare function updatePatientAppointment(this: OvokClient, appointment: OvokPatientAppointment, requestOptions?: MedplumRequestOptions): Promise<OvokPatientAppointment>;
|
|
12
|
+
export declare function listPatientSchedules(this: OvokClient, params?: OvokPatientSchedulingQuery, requestOptions?: MedplumRequestOptions): Promise<OvokPatientSchedule[]>;
|
|
13
|
+
export declare function listPatientSlots(this: OvokClient, params?: OvokPatientSchedulingQuery, requestOptions?: MedplumRequestOptions): Promise<OvokPatientSlot[]>;
|
|
14
|
+
export declare function listPatientMeasurementHistory(this: OvokClient, params?: OvokPatientResourceQuery, requestOptions?: MedplumRequestOptions): Promise<OvokPatientMeasurement[]>;
|
|
15
|
+
export declare function getPatientMeasurement(this: OvokClient, measurementId: string, requestOptions?: MedplumRequestOptions): Promise<OvokPatientMeasurement>;
|
|
16
|
+
export declare function listPatientCarePlans(this: OvokClient, params?: OvokPatientResourceQuery, requestOptions?: MedplumRequestOptions): Promise<OvokPatientCarePlan[]>;
|
|
17
|
+
export declare function getPatientCarePlan(this: OvokClient, carePlanId: string, requestOptions?: MedplumRequestOptions): Promise<OvokPatientCarePlan>;
|
|
18
|
+
export declare function listPatientQuestionnaires(this: OvokClient, params?: OvokPatientResourceQuery, requestOptions?: MedplumRequestOptions): Promise<OvokPatientQuestionnaire[]>;
|
|
19
|
+
export declare function getPatientQuestionnaire(this: OvokClient, questionnaireId: string, requestOptions?: MedplumRequestOptions): Promise<OvokPatientQuestionnaire>;
|
|
20
|
+
export declare function listPatientQuestionnaireResponses(this: OvokClient, params?: OvokPatientResourceQuery, requestOptions?: MedplumRequestOptions): Promise<OvokPatientQuestionnaireResponse[]>;
|
|
21
|
+
export declare function getPatientQuestionnaireResponse(this: OvokClient, questionnaireResponseId: string, requestOptions?: MedplumRequestOptions): Promise<OvokPatientQuestionnaireResponse>;
|
|
22
|
+
export declare function listPatientDevices(this: OvokClient, params?: OvokPatientResourceQuery, requestOptions?: MedplumRequestOptions): Promise<OvokPatientDevice[]>;
|
|
23
|
+
export declare function getPatientDevice(this: OvokClient, deviceId: string, requestOptions?: MedplumRequestOptions): Promise<OvokPatientDevice>;
|
|
24
|
+
export declare function listPatientNotifications(this: OvokClient, params?: OvokPatientResourceQuery, requestOptions?: MedplumRequestOptions): Promise<OvokPatientNotification[]>;
|
|
25
|
+
export declare function getPatientNotification(this: OvokClient, notificationId: string, requestOptions?: MedplumRequestOptions): Promise<OvokPatientNotification>;
|
|
26
|
+
export declare function getPatientDashboard(this: OvokClient, params?: OvokPatientDashboardQuery, requestOptions?: MedplumRequestOptions): Promise<OvokPatientDashboard>;
|
|
@@ -34,94 +34,94 @@ const query = (params) => {
|
|
|
34
34
|
const encoded = values.toString();
|
|
35
35
|
return encoded === "" ? "" : `?${encoded}`;
|
|
36
36
|
};
|
|
37
|
-
async function getCurrentPatientProfile() {
|
|
38
|
-
return this.get("/auth/me");
|
|
37
|
+
async function getCurrentPatientProfile(requestOptions) {
|
|
38
|
+
return this.get("/auth/me", ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
39
39
|
}
|
|
40
|
-
async function getPatientLatestObservations(params = {}) {
|
|
40
|
+
async function getPatientLatestObservations(params = {}, requestOptions) {
|
|
41
41
|
const code = Array.isArray(params.code) ? params.code.join(",") : params.code;
|
|
42
42
|
return this.get(`/fhir/Observation/$lastn${query({
|
|
43
43
|
patient: params.patient,
|
|
44
44
|
max: params.max,
|
|
45
45
|
code,
|
|
46
|
-
})}`, { cache: "no-cache" });
|
|
46
|
+
})}`, { ...{ cache: "no-cache" }, ...requestOptions });
|
|
47
47
|
}
|
|
48
|
-
async function getPatientDeviceTelemetry(deviceId) {
|
|
49
|
-
return this.get(`/fhir/Device/${segment(deviceId)}/telemetry
|
|
48
|
+
async function getPatientDeviceTelemetry(deviceId, requestOptions) {
|
|
49
|
+
return this.get(`/fhir/Device/${segment(deviceId)}/telemetry`, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
50
50
|
}
|
|
51
|
-
async function getPatientDeviceTelemetryHistory(deviceId, params = {}) {
|
|
52
|
-
return this.get(`/fhir/Device/${segment(deviceId)}/telemetry/history${query(params)}
|
|
51
|
+
async function getPatientDeviceTelemetryHistory(deviceId, params = {}, requestOptions) {
|
|
52
|
+
return this.get(`/fhir/Device/${segment(deviceId)}/telemetry/history${query(params)}`, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
53
53
|
}
|
|
54
|
-
async function listPatientAppointments(params = {}) {
|
|
55
|
-
return this.searchResources("Appointment", params);
|
|
54
|
+
async function listPatientAppointments(params = {}, requestOptions) {
|
|
55
|
+
return this.searchResources("Appointment", params, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
56
56
|
}
|
|
57
|
-
async function getPatientAppointment(appointmentId) {
|
|
58
|
-
return this.readResource("Appointment", appointmentId);
|
|
57
|
+
async function getPatientAppointment(appointmentId, requestOptions) {
|
|
58
|
+
return this.readResource("Appointment", appointmentId, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
59
59
|
}
|
|
60
|
-
async function createPatientAppointment(appointment) {
|
|
61
|
-
return this.createResource(appointment);
|
|
60
|
+
async function createPatientAppointment(appointment, requestOptions) {
|
|
61
|
+
return this.createResource(appointment, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
62
62
|
}
|
|
63
|
-
async function updatePatientAppointment(appointment) {
|
|
64
|
-
return this.updateResource(appointment);
|
|
63
|
+
async function updatePatientAppointment(appointment, requestOptions) {
|
|
64
|
+
return this.updateResource(appointment, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
65
65
|
}
|
|
66
|
-
async function listPatientSchedules(params = {}) {
|
|
67
|
-
return this.searchResources("Schedule", params);
|
|
66
|
+
async function listPatientSchedules(params = {}, requestOptions) {
|
|
67
|
+
return this.searchResources("Schedule", params, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
68
68
|
}
|
|
69
|
-
async function listPatientSlots(params = {}) {
|
|
70
|
-
return this.searchResources("Slot", params);
|
|
69
|
+
async function listPatientSlots(params = {}, requestOptions) {
|
|
70
|
+
return this.searchResources("Slot", params, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
71
71
|
}
|
|
72
|
-
async function listPatientMeasurementHistory(params = {}) {
|
|
73
|
-
return (await this.searchResources("Observation", params));
|
|
72
|
+
async function listPatientMeasurementHistory(params = {}, requestOptions) {
|
|
73
|
+
return (await this.searchResources("Observation", params, ...(requestOptions === undefined ? [] : [requestOptions])));
|
|
74
74
|
}
|
|
75
|
-
async function getPatientMeasurement(measurementId) {
|
|
76
|
-
return this.readResource("Observation", measurementId);
|
|
75
|
+
async function getPatientMeasurement(measurementId, requestOptions) {
|
|
76
|
+
return this.readResource("Observation", measurementId, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
77
77
|
}
|
|
78
|
-
async function listPatientCarePlans(params = {}) {
|
|
79
|
-
return (await this.searchResources("CarePlan", params));
|
|
78
|
+
async function listPatientCarePlans(params = {}, requestOptions) {
|
|
79
|
+
return (await this.searchResources("CarePlan", params, ...(requestOptions === undefined ? [] : [requestOptions])));
|
|
80
80
|
}
|
|
81
|
-
async function getPatientCarePlan(carePlanId) {
|
|
82
|
-
return this.readResource("CarePlan", carePlanId);
|
|
81
|
+
async function getPatientCarePlan(carePlanId, requestOptions) {
|
|
82
|
+
return this.readResource("CarePlan", carePlanId, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
83
83
|
}
|
|
84
|
-
async function listPatientQuestionnaires(params = {}) {
|
|
85
|
-
return (await this.searchResources("Questionnaire", params));
|
|
84
|
+
async function listPatientQuestionnaires(params = {}, requestOptions) {
|
|
85
|
+
return (await this.searchResources("Questionnaire", params, ...(requestOptions === undefined ? [] : [requestOptions])));
|
|
86
86
|
}
|
|
87
|
-
async function getPatientQuestionnaire(questionnaireId) {
|
|
88
|
-
return this.readResource("Questionnaire", questionnaireId);
|
|
87
|
+
async function getPatientQuestionnaire(questionnaireId, requestOptions) {
|
|
88
|
+
return this.readResource("Questionnaire", questionnaireId, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
89
89
|
}
|
|
90
|
-
async function listPatientQuestionnaireResponses(params = {}) {
|
|
91
|
-
return (await this.searchResources("QuestionnaireResponse", params));
|
|
90
|
+
async function listPatientQuestionnaireResponses(params = {}, requestOptions) {
|
|
91
|
+
return (await this.searchResources("QuestionnaireResponse", params, ...(requestOptions === undefined ? [] : [requestOptions])));
|
|
92
92
|
}
|
|
93
|
-
async function getPatientQuestionnaireResponse(questionnaireResponseId) {
|
|
94
|
-
return this.readResource("QuestionnaireResponse", questionnaireResponseId);
|
|
93
|
+
async function getPatientQuestionnaireResponse(questionnaireResponseId, requestOptions) {
|
|
94
|
+
return this.readResource("QuestionnaireResponse", questionnaireResponseId, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
95
95
|
}
|
|
96
|
-
async function listPatientDevices(params = {}) {
|
|
97
|
-
return (await this.searchResources("Device", params));
|
|
96
|
+
async function listPatientDevices(params = {}, requestOptions) {
|
|
97
|
+
return (await this.searchResources("Device", params, ...(requestOptions === undefined ? [] : [requestOptions])));
|
|
98
98
|
}
|
|
99
|
-
async function getPatientDevice(deviceId) {
|
|
100
|
-
return this.readResource("Device", deviceId);
|
|
99
|
+
async function getPatientDevice(deviceId, requestOptions) {
|
|
100
|
+
return this.readResource("Device", deviceId, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
101
101
|
}
|
|
102
|
-
async function listPatientNotifications(params = {}) {
|
|
103
|
-
return (await this.searchResources("CommunicationRequest", params));
|
|
102
|
+
async function listPatientNotifications(params = {}, requestOptions) {
|
|
103
|
+
return (await this.searchResources("CommunicationRequest", params, ...(requestOptions === undefined ? [] : [requestOptions])));
|
|
104
104
|
}
|
|
105
|
-
async function getPatientNotification(notificationId) {
|
|
106
|
-
return this.readResource("CommunicationRequest", notificationId);
|
|
105
|
+
async function getPatientNotification(notificationId, requestOptions) {
|
|
106
|
+
return this.readResource("CommunicationRequest", notificationId, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
107
107
|
}
|
|
108
|
-
async function getPatientDashboard(params = {}) {
|
|
108
|
+
async function getPatientDashboard(params = {}, requestOptions) {
|
|
109
109
|
var _a, _b, _c, _d, _e, _f;
|
|
110
|
-
const profile = await this.getCurrentPatientProfile();
|
|
110
|
+
const profile = await this.getCurrentPatientProfile(requestOptions);
|
|
111
111
|
const patient = `Patient/${profile.profile.id}`;
|
|
112
112
|
const latestObservations = await this.getPatientLatestObservations({
|
|
113
113
|
...params.latestObservations,
|
|
114
114
|
patient: (_b = (_a = params.latestObservations) === null || _a === void 0 ? void 0 : _a.patient) !== null && _b !== void 0 ? _b : patient,
|
|
115
|
-
});
|
|
115
|
+
}, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
116
116
|
const [measurementHistory, carePlans] = await Promise.all([
|
|
117
117
|
this.listPatientMeasurementHistory({
|
|
118
118
|
...params.measurementHistory,
|
|
119
119
|
patient: (_d = (_c = params.measurementHistory) === null || _c === void 0 ? void 0 : _c.patient) !== null && _d !== void 0 ? _d : patient,
|
|
120
|
-
}),
|
|
120
|
+
}, ...(requestOptions === undefined ? [] : [requestOptions])),
|
|
121
121
|
this.listPatientCarePlans({
|
|
122
122
|
...params.carePlans,
|
|
123
123
|
patient: (_f = (_e = params.carePlans) === null || _e === void 0 ? void 0 : _e.patient) !== null && _f !== void 0 ? _f : patient,
|
|
124
|
-
}),
|
|
124
|
+
}, ...(requestOptions === undefined ? [] : [requestOptions])),
|
|
125
125
|
]);
|
|
126
126
|
return { carePlans, latestObservations, measurementHistory, profile };
|
|
127
127
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { MedplumRequestOptions } from "@medplum/core";
|
|
1
2
|
import { OvokClient } from "../ovok-client";
|
|
2
3
|
import { CreatePatientSharingInvite, PatientSharingInvite, PatientSharingSettings, PatientSharingShare, PatientSharingShares, RedeemPatientSharingInvite, PatientSharingSettingsUpdate } from "./types";
|
|
3
|
-
export declare function createPatientSharingInvite(this: OvokClient, body: CreatePatientSharingInvite): Promise<PatientSharingInvite>;
|
|
4
|
-
export declare function redeemPatientSharingInvite(this: OvokClient, body: RedeemPatientSharingInvite): Promise<PatientSharingShare>;
|
|
5
|
-
export declare function listPatientSharing(this: OvokClient): Promise<PatientSharingShares>;
|
|
6
|
-
export declare function revokePatientSharing(this: OvokClient, consentId: string): Promise<void>;
|
|
7
|
-
export declare function getPatientSharingSettings(this: OvokClient): Promise<PatientSharingSettings>;
|
|
8
|
-
export declare function updatePatientSharingSettings(this: OvokClient, settings: PatientSharingSettingsUpdate): Promise<PatientSharingSettings>;
|
|
4
|
+
export declare function createPatientSharingInvite(this: OvokClient, body: CreatePatientSharingInvite, requestOptions?: MedplumRequestOptions): Promise<PatientSharingInvite>;
|
|
5
|
+
export declare function redeemPatientSharingInvite(this: OvokClient, body: RedeemPatientSharingInvite, requestOptions?: MedplumRequestOptions): Promise<PatientSharingShare>;
|
|
6
|
+
export declare function listPatientSharing(this: OvokClient, requestOptions?: MedplumRequestOptions): Promise<PatientSharingShares>;
|
|
7
|
+
export declare function revokePatientSharing(this: OvokClient, consentId: string, requestOptions?: MedplumRequestOptions): Promise<void>;
|
|
8
|
+
export declare function getPatientSharingSettings(this: OvokClient, requestOptions?: MedplumRequestOptions): Promise<PatientSharingSettings>;
|
|
9
|
+
export declare function updatePatientSharingSettings(this: OvokClient, settings: PatientSharingSettingsUpdate, requestOptions?: MedplumRequestOptions): Promise<PatientSharingSettings>;
|
|
@@ -7,14 +7,14 @@ exports.revokePatientSharing = revokePatientSharing;
|
|
|
7
7
|
exports.getPatientSharingSettings = getPatientSharingSettings;
|
|
8
8
|
exports.updatePatientSharingSettings = updatePatientSharingSettings;
|
|
9
9
|
const segment = (value) => encodeURIComponent(value);
|
|
10
|
-
function createPatientSharingInvite(body) {
|
|
11
|
-
return this.post("/v1/patient-sharing/invites", body);
|
|
10
|
+
function createPatientSharingInvite(body, requestOptions) {
|
|
11
|
+
return this.post("/v1/patient-sharing/invites", body, undefined, requestOptions);
|
|
12
12
|
}
|
|
13
|
-
function redeemPatientSharingInvite(body) {
|
|
14
|
-
return this.post("/v1/patient-sharing/invites/redeem", body);
|
|
13
|
+
function redeemPatientSharingInvite(body, requestOptions) {
|
|
14
|
+
return this.post("/v1/patient-sharing/invites/redeem", body, undefined, requestOptions);
|
|
15
15
|
}
|
|
16
|
-
function listPatientSharing() {
|
|
17
|
-
return this.get("/v1/patient-sharing/shares").then((shares) => {
|
|
16
|
+
function listPatientSharing(requestOptions) {
|
|
17
|
+
return this.get("/v1/patient-sharing/shares", ...(requestOptions === undefined ? [] : [requestOptions])).then((shares) => {
|
|
18
18
|
var _a;
|
|
19
19
|
return ({
|
|
20
20
|
...shares,
|
|
@@ -22,12 +22,12 @@ function listPatientSharing() {
|
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
async function revokePatientSharing(consentId) {
|
|
26
|
-
await this.delete(`/v1/patient-sharing/shares/${segment(consentId)}
|
|
25
|
+
async function revokePatientSharing(consentId, requestOptions) {
|
|
26
|
+
await this.delete(`/v1/patient-sharing/shares/${segment(consentId)}`, ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
27
27
|
}
|
|
28
|
-
function getPatientSharingSettings() {
|
|
29
|
-
return this.get("/v1/patient-sharing/settings");
|
|
28
|
+
function getPatientSharingSettings(requestOptions) {
|
|
29
|
+
return this.get("/v1/patient-sharing/settings", ...(requestOptions === undefined ? [] : [requestOptions]));
|
|
30
30
|
}
|
|
31
|
-
function updatePatientSharingSettings(settings) {
|
|
32
|
-
return this.put("/v1/patient-sharing/settings", settings);
|
|
31
|
+
function updatePatientSharingSettings(settings, requestOptions) {
|
|
32
|
+
return this.put("/v1/patient-sharing/settings", settings, undefined, requestOptions);
|
|
33
33
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import type { MedplumRequestOptions } from "@medplum/core";
|
|
1
2
|
import { OvokClient } from "../ovok-client";
|
|
2
3
|
import { OvokAccount, OvokAdministeredProject, OvokCreateProject, OvokCreatedProject, OvokI18nDocument, OvokI18nValue, OvokInviteProjectMember, OvokLocalization, OvokLocalizationQuery, OvokLocalizationUpdate, OvokLocales, OvokPage, OvokPatientObservations, OvokProjectFeature, OvokProjectFeatures, OvokProjectMember, OvokProjectMemberResponse, OvokProjectSettings, OvokProjectSettingKey, OvokProjectTextSettingKey, OvokRemoveProjectMemberResponse, OvokUpdateProjectMember } from "./types";
|
|
3
|
-
export declare function getAccounts(this: OvokClient): Promise<OvokAccount[]>;
|
|
4
|
+
export declare function getAccounts(this: OvokClient, requestOptions?: MedplumRequestOptions): Promise<OvokAccount[]>;
|
|
4
5
|
export declare function listAdministeredProjects(this: OvokClient, params?: {
|
|
5
6
|
page?: number;
|
|
6
7
|
count?: number;
|
|
7
|
-
}): Promise<OvokPage<OvokAdministeredProject>>;
|
|
8
|
-
export declare function createProject(this: OvokClient, body: OvokCreateProject): Promise<OvokCreatedProject>;
|
|
9
|
-
export declare function bootstrapProject(this: OvokClient, body: OvokCreateProject): Promise<OvokCreatedProject>;
|
|
10
|
-
export declare function getProjectTenantCode(this: OvokClient): Promise<{
|
|
8
|
+
}, requestOptions?: MedplumRequestOptions): Promise<OvokPage<OvokAdministeredProject>>;
|
|
9
|
+
export declare function createProject(this: OvokClient, body: OvokCreateProject, requestOptions?: MedplumRequestOptions): Promise<OvokCreatedProject>;
|
|
10
|
+
export declare function bootstrapProject(this: OvokClient, body: OvokCreateProject, requestOptions?: MedplumRequestOptions): Promise<OvokCreatedProject>;
|
|
11
|
+
export declare function getProjectTenantCode(this: OvokClient, requestOptions?: MedplumRequestOptions): Promise<{
|
|
11
12
|
tenantCode: string;
|
|
12
13
|
}>;
|
|
13
14
|
export declare function listProjectMembers(this: OvokClient, params?: {
|
|
@@ -16,27 +17,27 @@ export declare function listProjectMembers(this: OvokClient, params?: {
|
|
|
16
17
|
userId?: string;
|
|
17
18
|
page?: number;
|
|
18
19
|
count?: number;
|
|
19
|
-
}): Promise<OvokPage<OvokProjectMember>>;
|
|
20
|
-
export declare function inviteProjectMember(this: OvokClient, body: OvokInviteProjectMember): Promise<OvokProjectMemberResponse>;
|
|
21
|
-
export declare function updateProjectMember(this: OvokClient, membershipId: string, body: OvokUpdateProjectMember): Promise<OvokProjectMemberResponse>;
|
|
22
|
-
export declare function removeProjectMember(this: OvokClient, membershipId: string): Promise<OvokRemoveProjectMemberResponse>;
|
|
23
|
-
export declare function getProjectFeatures(this: OvokClient): Promise<OvokProjectFeatures>;
|
|
24
|
-
export declare function updateProjectFeatures(this: OvokClient, features: OvokProjectFeature[]): Promise<OvokProjectFeatures>;
|
|
25
|
-
export declare function getProjectSettings(this: OvokClient): Promise<OvokProjectSettings>;
|
|
26
|
-
export declare function updateProjectSetting(this: OvokClient, key: OvokProjectSettingKey, enabled: boolean): Promise<OvokProjectSettings>;
|
|
27
|
-
export declare function updateProjectTextSetting(this: OvokClient, key: OvokProjectTextSettingKey, value: string | null): Promise<OvokProjectSettings>;
|
|
28
|
-
export declare function getLocales(this: OvokClient): Promise<OvokLocales>;
|
|
29
|
-
export declare function updateLocales(this: OvokClient, locales: OvokLocales): Promise<OvokLocales>;
|
|
30
|
-
export declare function listLocalizations(this: OvokClient, language: string, params?: OvokLocalizationQuery): Promise<{
|
|
20
|
+
}, requestOptions?: MedplumRequestOptions): Promise<OvokPage<OvokProjectMember>>;
|
|
21
|
+
export declare function inviteProjectMember(this: OvokClient, body: OvokInviteProjectMember, requestOptions?: MedplumRequestOptions): Promise<OvokProjectMemberResponse>;
|
|
22
|
+
export declare function updateProjectMember(this: OvokClient, membershipId: string, body: OvokUpdateProjectMember, requestOptions?: MedplumRequestOptions): Promise<OvokProjectMemberResponse>;
|
|
23
|
+
export declare function removeProjectMember(this: OvokClient, membershipId: string, requestOptions?: MedplumRequestOptions): Promise<OvokRemoveProjectMemberResponse>;
|
|
24
|
+
export declare function getProjectFeatures(this: OvokClient, requestOptions?: MedplumRequestOptions): Promise<OvokProjectFeatures>;
|
|
25
|
+
export declare function updateProjectFeatures(this: OvokClient, features: OvokProjectFeature[], requestOptions?: MedplumRequestOptions): Promise<OvokProjectFeatures>;
|
|
26
|
+
export declare function getProjectSettings(this: OvokClient, requestOptions?: MedplumRequestOptions): Promise<OvokProjectSettings>;
|
|
27
|
+
export declare function updateProjectSetting(this: OvokClient, key: OvokProjectSettingKey, enabled: boolean, requestOptions?: MedplumRequestOptions): Promise<OvokProjectSettings>;
|
|
28
|
+
export declare function updateProjectTextSetting(this: OvokClient, key: OvokProjectTextSettingKey, value: string | null, requestOptions?: MedplumRequestOptions): Promise<OvokProjectSettings>;
|
|
29
|
+
export declare function getLocales(this: OvokClient, requestOptions?: MedplumRequestOptions): Promise<OvokLocales>;
|
|
30
|
+
export declare function updateLocales(this: OvokClient, locales: OvokLocales, requestOptions?: MedplumRequestOptions): Promise<OvokLocales>;
|
|
31
|
+
export declare function listLocalizations(this: OvokClient, language: string, params?: OvokLocalizationQuery, requestOptions?: MedplumRequestOptions): Promise<{
|
|
31
32
|
total: number;
|
|
32
33
|
resources: OvokLocalization[];
|
|
33
34
|
}>;
|
|
34
|
-
export declare function getLocalization(this: OvokClient, language: string, key: string): Promise<OvokLocalization>;
|
|
35
|
-
export declare function updateLocalization(this: OvokClient, language: string, key: string, body: OvokLocalizationUpdate): Promise<OvokLocalization>;
|
|
36
|
-
export declare function deleteLocalization(this: OvokClient, language: string, key: string): Promise<void>;
|
|
37
|
-
export declare function getI18nextDocument(this: OvokClient, language: string): Promise<OvokI18nDocument>;
|
|
38
|
-
export declare function updateI18nextDocument(this: OvokClient, language: string, document: Record<string, OvokI18nValue
|
|
35
|
+
export declare function getLocalization(this: OvokClient, language: string, key: string, requestOptions?: MedplumRequestOptions): Promise<OvokLocalization>;
|
|
36
|
+
export declare function updateLocalization(this: OvokClient, language: string, key: string, body: OvokLocalizationUpdate, requestOptions?: MedplumRequestOptions): Promise<OvokLocalization>;
|
|
37
|
+
export declare function deleteLocalization(this: OvokClient, language: string, key: string, requestOptions?: MedplumRequestOptions): Promise<void>;
|
|
38
|
+
export declare function getI18nextDocument(this: OvokClient, language: string, requestOptions?: MedplumRequestOptions): Promise<OvokI18nDocument>;
|
|
39
|
+
export declare function updateI18nextDocument(this: OvokClient, language: string, document: Record<string, OvokI18nValue>, requestOptions?: MedplumRequestOptions): Promise<void>;
|
|
39
40
|
export declare function getPatientLastObservations(this: OvokClient, patientId: string, params: {
|
|
40
41
|
code: string;
|
|
41
42
|
max?: number;
|
|
42
|
-
}): Promise<OvokPatientObservations>;
|
|
43
|
+
}, requestOptions?: MedplumRequestOptions): Promise<OvokPatientObservations>;
|