@ovok/core 0.4.49-dev.494 → 0.4.49-dev.496
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/observation/measurement-fields.d.ts +1 -1
- package/dist/client/observation/methods/observationsToMeasurements.d.ts +1 -1
- package/dist/client/observation/methods/observationsToMeasurements.js +59 -59
- package/dist/client/observation/services/base-observation-service.d.ts +1 -1
- package/dist/client/observation/services/blood-oxygen.d.ts +1 -1
- package/dist/client/observation/services/blood-oxygen.js +7 -7
- package/dist/client/observation/services/blood-pressure.d.ts +1 -1
- package/dist/client/observation/services/blood-pressure.js +16 -16
- package/dist/client/observation/services/component-observation-services.d.ts +1 -1
- package/dist/client/observation/services/component-observation-services.js +3 -3
- package/dist/client/observation/services/creator.d.ts +1 -1
- package/dist/client/observation/services/creator.js +10 -10
- package/dist/client/observation/services/ecg-observation-fragments.d.ts +1 -1
- package/dist/client/observation/services/ecg.d.ts +1 -1
- package/dist/client/observation/services/ecg.js +10 -10
- package/dist/client/observation/services/lipid-panel.d.ts +1 -1
- package/dist/client/observation/services/lipid-panel.js +13 -13
- package/dist/client/observation/services/single-value-services.d.ts +1 -1
- package/dist/client/observation/services/single-value-services.js +19 -19
- package/dist/client/observation/services/step-count.d.ts +1 -1
- package/dist/client/observation/services/step-count.js +5 -5
- package/dist/client/observation/services/uric-acid-service.d.ts +1 -1
- package/dist/client/observation/services/uric-acid-service.js +7 -7
- package/dist/client/offline/offline-measurement-queue.d.ts +1 -2
- package/dist/client/wearables/types.d.ts +5 -0
- package/dist/conformance/capability-requirements.js +1 -1
- package/dist/next/auth/access-token.d.ts +9 -0
- package/dist/next/auth/access-token.js +18 -0
- package/dist/next/auth/client-credentials.d.ts +16 -0
- package/dist/next/auth/client-credentials.js +40 -0
- package/dist/next/auth/credentials.d.ts +5 -0
- package/dist/next/auth/credentials.js +7 -0
- package/dist/next/auth/session-store.d.ts +12 -0
- package/dist/next/auth/session-store.js +33 -0
- package/dist/next/auth/session.d.ts +28 -0
- package/dist/next/auth/session.js +27 -0
- package/dist/next/auth/token-endpoint.d.ts +12 -0
- package/dist/next/auth/token-endpoint.js +28 -0
- package/dist/next/auth/user-session.d.ts +27 -0
- package/dist/next/auth/user-session.js +82 -0
- package/dist/next/config/ovok-config.d.ts +42 -0
- package/dist/next/config/ovok-config.js +2 -0
- package/dist/next/config/settings.d.ts +6 -0
- package/dist/next/config/settings.js +74 -0
- package/dist/next/errors/error-from-response.d.ts +2 -0
- package/dist/next/errors/error-from-response.js +35 -0
- package/dist/next/errors/ovok-errors.d.ts +42 -0
- package/dist/next/errors/ovok-errors.js +74 -0
- package/dist/next/http/http-client.d.ts +35 -0
- package/dist/next/http/http-client.js +113 -0
- package/dist/next/http/retry-after.d.ts +1 -0
- package/dist/next/http/retry-after.js +16 -0
- package/dist/next/http/retry-policy.d.ts +13 -0
- package/dist/next/http/retry-policy.js +27 -0
- package/dist/next/http/transmit.d.ts +14 -0
- package/dist/next/http/transmit.js +57 -0
- package/dist/next/http/url.d.ts +6 -0
- package/dist/next/http/url.js +22 -0
- package/dist/next/index.d.ts +69 -0
- package/dist/next/index.js +33 -0
- package/dist/next/ovok.d.ts +52 -0
- package/dist/next/ovok.js +74 -0
- package/dist/next/paging/bundle-page.d.ts +4 -0
- package/dist/next/paging/bundle-page.js +25 -0
- package/dist/next/paging/cursor-pages.d.ts +7 -0
- package/dist/next/paging/cursor-pages.js +14 -0
- package/dist/next/paging/numbered-pages.d.ts +15 -0
- package/dist/next/paging/numbered-pages.js +20 -0
- package/dist/next/paging/page.d.ts +12 -0
- package/dist/next/paging/page.js +17 -0
- package/dist/next/resources/accounts/accounts-resource.d.ts +8 -0
- package/dist/next/resources/accounts/accounts-resource.js +13 -0
- package/dist/next/resources/ai/ai-chat-resource.d.ts +8 -0
- package/dist/next/resources/ai/ai-chat-resource.js +12 -0
- package/dist/next/resources/ai/ai-resource.d.ts +16 -0
- package/dist/next/resources/ai/ai-resource.js +19 -0
- package/dist/next/resources/ai/chat-messages-resource.d.ts +9 -0
- package/dist/next/resources/ai/chat-messages-resource.js +18 -0
- package/dist/next/resources/ai/chat-sessions-resource.d.ts +14 -0
- package/dist/next/resources/ai/chat-sessions-resource.js +23 -0
- package/dist/next/resources/auth/auth-sessions-resource.d.ts +13 -0
- package/dist/next/resources/auth/auth-sessions-resource.js +25 -0
- package/dist/next/resources/auth/registration.d.ts +35 -0
- package/dist/next/resources/auth/registration.js +24 -0
- package/dist/next/resources/auth/social-login.d.ts +8 -0
- package/dist/next/resources/auth/social-login.js +7 -0
- package/dist/next/resources/auth-resource.d.ts +63 -0
- package/dist/next/resources/auth-resource.js +119 -0
- package/dist/next/resources/bots/bots-resource.d.ts +10 -0
- package/dist/next/resources/bots/bots-resource.js +15 -0
- package/dist/next/resources/cms/cms-delivery.d.ts +22 -0
- package/dist/next/resources/cms/cms-delivery.js +36 -0
- package/dist/next/resources/cms/cms-documents-resource.d.ts +11 -0
- package/dist/next/resources/cms/cms-documents-resource.js +17 -0
- package/dist/next/resources/cms/cms-resource.d.ts +17 -0
- package/dist/next/resources/cms/cms-resource.js +38 -0
- package/dist/next/resources/cms/payload-pages.d.ts +6 -0
- package/dist/next/resources/cms/payload-pages.js +15 -0
- package/dist/next/resources/cms/release-notes-resource.d.ts +10 -0
- package/dist/next/resources/cms/release-notes-resource.js +15 -0
- package/dist/next/resources/cms/translation-tree.d.ts +3 -0
- package/dist/next/resources/cms/translation-tree.js +45 -0
- package/dist/next/resources/consent/consent-resource.d.ts +23 -0
- package/dist/next/resources/consent/consent-resource.js +43 -0
- package/dist/next/resources/content/content-resource.d.ts +19 -0
- package/dist/next/resources/content/content-resource.js +41 -0
- package/dist/next/resources/documents/documents-resource.d.ts +26 -0
- package/dist/next/resources/documents/documents-resource.js +41 -0
- package/dist/next/resources/email/email-resource.d.ts +6 -0
- package/dist/next/resources/email/email-resource.js +10 -0
- package/dist/next/resources/email/email-templates-resource.d.ts +8 -0
- package/dist/next/resources/email/email-templates-resource.js +13 -0
- package/dist/next/resources/fhir-resource.d.ts +28 -0
- package/dist/next/resources/fhir-resource.js +64 -0
- package/dist/next/resources/health-resource.d.ts +17 -0
- package/dist/next/resources/health-resource.js +14 -0
- package/dist/next/resources/invites/invite-flow-resource.d.ts +12 -0
- package/dist/next/resources/invites/invite-flow-resource.js +19 -0
- package/dist/next/resources/invites/invites-resource.d.ts +17 -0
- package/dist/next/resources/invites/invites-resource.js +14 -0
- package/dist/next/resources/localization/i18next-resource.d.ts +10 -0
- package/dist/next/resources/localization/i18next-resource.js +18 -0
- package/dist/next/resources/localization/locales-resource.d.ts +9 -0
- package/dist/next/resources/localization/locales-resource.js +16 -0
- package/dist/next/resources/localization/localizations-resource.d.ts +17 -0
- package/dist/next/resources/localization/localizations-resource.js +27 -0
- package/dist/next/resources/measurements/measurements-resource.d.ts +42 -0
- package/dist/next/resources/measurements/measurements-resource.js +77 -0
- package/dist/next/resources/measurements/observation-builder.d.ts +5 -0
- package/dist/next/resources/measurements/observation-builder.js +57 -0
- package/dist/next/resources/measurements/save-error.d.ts +5 -0
- package/dist/next/resources/measurements/save-error.js +18 -0
- package/dist/next/resources/measurements/signed-in-account.d.ts +11 -0
- package/dist/next/resources/measurements/signed-in-account.js +26 -0
- package/dist/next/resources/patient/fhir-records.d.ts +19 -0
- package/dist/next/resources/patient/fhir-records.js +33 -0
- package/dist/next/resources/patient/patient-resource.d.ts +21 -0
- package/dist/next/resources/patient/patient-resource.js +38 -0
- package/dist/next/resources/projects/project-features-resource.d.ts +9 -0
- package/dist/next/resources/projects/project-features-resource.js +17 -0
- package/dist/next/resources/projects/project-members-resource.d.ts +19 -0
- package/dist/next/resources/projects/project-members-resource.js +25 -0
- package/dist/next/resources/projects/project-settings-resource.d.ts +10 -0
- package/dist/next/resources/projects/project-settings-resource.js +21 -0
- package/dist/next/resources/projects/projects-resource.d.ts +20 -0
- package/dist/next/resources/projects/projects-resource.js +21 -0
- package/dist/next/resources/questionnaires/questionnaires-resource.d.ts +18 -0
- package/dist/next/resources/questionnaires/questionnaires-resource.js +36 -0
- package/dist/next/resources/sharing/sharing-invites-resource.d.ts +9 -0
- package/dist/next/resources/sharing/sharing-invites-resource.js +17 -0
- package/dist/next/resources/sharing/sharing-resource.d.ts +10 -0
- package/dist/next/resources/sharing/sharing-resource.js +14 -0
- package/dist/next/resources/sharing/sharing-settings-resource.d.ts +9 -0
- package/dist/next/resources/sharing/sharing-settings-resource.js +16 -0
- package/dist/next/resources/sharing/sharing-shares-resource.d.ts +9 -0
- package/dist/next/resources/sharing/sharing-shares-resource.js +27 -0
- package/dist/next/resources/signals/signals-gateway-resource.d.ts +14 -0
- package/dist/next/resources/signals/signals-gateway-resource.js +44 -0
- package/dist/next/resources/signals/signals-resource.d.ts +13 -0
- package/dist/next/resources/signals/signals-resource.js +19 -0
- package/dist/next/resources/signals/undeliverable-resource.d.ts +26 -0
- package/dist/next/resources/signals/undeliverable-resource.js +18 -0
- package/dist/next/resources/slim/live-reads.d.ts +12 -0
- package/dist/next/resources/slim/live-reads.js +76 -0
- package/dist/next/resources/slim/slim-alarms-resource.d.ts +13 -0
- package/dist/next/resources/slim/slim-alarms-resource.js +25 -0
- package/dist/next/resources/slim/slim-change-history-resource.d.ts +9 -0
- package/dist/next/resources/slim/slim-change-history-resource.js +19 -0
- package/dist/next/resources/slim/slim-child-projects-resource.d.ts +17 -0
- package/dist/next/resources/slim/slim-child-projects-resource.js +22 -0
- package/dist/next/resources/slim/slim-devices-resource.d.ts +28 -0
- package/dist/next/resources/slim/slim-devices-resource.js +80 -0
- package/dist/next/resources/slim/slim-exports-resource.d.ts +8 -0
- package/dist/next/resources/slim/slim-exports-resource.js +14 -0
- package/dist/next/resources/slim/slim-locations-resource.d.ts +14 -0
- package/dist/next/resources/slim/slim-locations-resource.js +30 -0
- package/dist/next/resources/slim/slim-medical-notifications-resource.d.ts +18 -0
- package/dist/next/resources/slim/slim-medical-notifications-resource.js +46 -0
- package/dist/next/resources/slim/slim-notification-notes-resource.d.ts +12 -0
- package/dist/next/resources/slim/slim-notification-notes-resource.js +34 -0
- package/dist/next/resources/slim/slim-notifications-resource.d.ts +19 -0
- package/dist/next/resources/slim/slim-notifications-resource.js +26 -0
- package/dist/next/resources/slim/slim-organizations-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-organizations-resource.js +25 -0
- package/dist/next/resources/slim/slim-out-of-bed-resource.d.ts +13 -0
- package/dist/next/resources/slim/slim-out-of-bed-resource.js +20 -0
- package/dist/next/resources/slim/slim-paths.d.ts +6 -0
- package/dist/next/resources/slim/slim-paths.js +9 -0
- package/dist/next/resources/slim/slim-patient-thresholds-resource.d.ts +10 -0
- package/dist/next/resources/slim/slim-patient-thresholds-resource.js +20 -0
- package/dist/next/resources/slim/slim-patients-resource.d.ts +20 -0
- package/dist/next/resources/slim/slim-patients-resource.js +39 -0
- package/dist/next/resources/slim/slim-policies-resource.d.ts +12 -0
- package/dist/next/resources/slim/slim-policies-resource.js +29 -0
- package/dist/next/resources/slim/slim-practitioners-resource.d.ts +8 -0
- package/dist/next/resources/slim/slim-practitioners-resource.js +14 -0
- package/dist/next/resources/slim/slim-projects-resource.d.ts +16 -0
- package/dist/next/resources/slim/slim-projects-resource.js +35 -0
- package/dist/next/resources/slim/slim-queries.d.ts +34 -0
- package/dist/next/resources/slim/slim-queries.js +2 -0
- package/dist/next/resources/slim/slim-resource.d.ts +38 -0
- package/dist/next/resources/slim/slim-resource.js +44 -0
- package/dist/next/resources/slim/slim-sleep-resource.d.ts +9 -0
- package/dist/next/resources/slim/slim-sleep-resource.js +15 -0
- package/dist/next/resources/slim/slim-thresholds-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-thresholds-resource.js +18 -0
- package/dist/next/resources/slim/slim-trends-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-trends-resource.js +19 -0
- package/dist/next/resources/slim/slim-users-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-users-resource.js +15 -0
- package/dist/next/resources/slim/slim-zones-resource.d.ts +12 -0
- package/dist/next/resources/slim/slim-zones-resource.js +24 -0
- package/dist/next/resources/video-calls/video-call-access-resource.d.ts +11 -0
- package/dist/next/resources/video-calls/video-call-access-resource.js +19 -0
- package/dist/next/resources/video-calls/video-call-appointments-resource.d.ts +10 -0
- package/dist/next/resources/video-calls/video-call-appointments-resource.js +21 -0
- package/dist/next/resources/video-calls/video-call-emails-resource.d.ts +10 -0
- package/dist/next/resources/video-calls/video-call-emails-resource.js +19 -0
- package/dist/next/resources/video-calls/video-calls-resource.d.ts +14 -0
- package/dist/next/resources/video-calls/video-calls-resource.js +20 -0
- package/dist/next/resources/wearables/wearable-connections-resource.d.ts +12 -0
- package/dist/next/resources/wearables/wearable-connections-resource.js +25 -0
- package/dist/next/resources/wearables/wearable-providers-resource.d.ts +12 -0
- package/dist/next/resources/wearables/wearable-providers-resource.js +27 -0
- package/dist/next/resources/wearables/wearables-resource.d.ts +8 -0
- package/dist/next/resources/wearables/wearables-resource.js +14 -0
- package/dist/next/storage/ovok-storage.d.ts +11 -0
- package/dist/next/storage/ovok-storage.js +19 -0
- package/dist/types/MeasurementTypes.d.ts +5 -0
- package/dist/types/MeasurementTypes.js +21 -0
- package/dist/types/index.d.ts +1 -5
- package/dist/types/index.js +1 -5
- package/next/index.d.ts +1 -0
- package/next/index.js +3 -0
- package/package.json +3 -2
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LiveReads = void 0;
|
|
4
|
+
const SIGNAL_OPTION = "signal";
|
|
5
|
+
const ABORT_ERROR = "AbortError";
|
|
6
|
+
const ABORTED_MESSAGE = "The request was aborted.";
|
|
7
|
+
class SharedRead {
|
|
8
|
+
constructor(load, onDone) {
|
|
9
|
+
this.onDone = onDone;
|
|
10
|
+
this.controller = new AbortController();
|
|
11
|
+
this.subscribers = 0;
|
|
12
|
+
this.pending = true;
|
|
13
|
+
this.result = load(this.controller.signal).finally(() => this.finish());
|
|
14
|
+
this.result.catch(() => undefined);
|
|
15
|
+
}
|
|
16
|
+
join() {
|
|
17
|
+
this.subscribers += 1;
|
|
18
|
+
}
|
|
19
|
+
leave() {
|
|
20
|
+
this.subscribers -= 1;
|
|
21
|
+
const abandoned = this.pending && this.subscribers === 0;
|
|
22
|
+
if (abandoned) {
|
|
23
|
+
this.finish();
|
|
24
|
+
this.controller.abort();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
finish() {
|
|
28
|
+
this.pending = false;
|
|
29
|
+
this.onDone();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** Identical concurrent reads share one request, aborted only once every caller has aborted. */
|
|
33
|
+
class LiveReads {
|
|
34
|
+
constructor(http) {
|
|
35
|
+
this.http = http;
|
|
36
|
+
this.inFlight = new Map();
|
|
37
|
+
}
|
|
38
|
+
get(path, options = {}) {
|
|
39
|
+
const shareable = Object.keys(options).every((key) => key === SIGNAL_OPTION);
|
|
40
|
+
return shareable ? this.share(path, options.signal) : this.http.get(path, options);
|
|
41
|
+
}
|
|
42
|
+
share(path, signal) {
|
|
43
|
+
var _a;
|
|
44
|
+
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
|
45
|
+
return Promise.reject(abortReason(signal));
|
|
46
|
+
}
|
|
47
|
+
return subscribe((_a = this.inFlight.get(path)) !== null && _a !== void 0 ? _a : this.start(path), signal);
|
|
48
|
+
}
|
|
49
|
+
start(path) {
|
|
50
|
+
const read = new SharedRead((signal) => this.http.get(path, { signal }), () => this.forget(path, read));
|
|
51
|
+
this.inFlight.set(path, read);
|
|
52
|
+
return read;
|
|
53
|
+
}
|
|
54
|
+
forget(path, read) {
|
|
55
|
+
if (this.inFlight.get(path) === read) {
|
|
56
|
+
this.inFlight.delete(path);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.LiveReads = LiveReads;
|
|
61
|
+
const subscribe = (read, signal) => new Promise((resolve, reject) => {
|
|
62
|
+
let subscribed = true;
|
|
63
|
+
const settle = (finish) => {
|
|
64
|
+
if (subscribed) {
|
|
65
|
+
subscribed = false;
|
|
66
|
+
signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", onAbort);
|
|
67
|
+
read.leave();
|
|
68
|
+
finish();
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const onAbort = () => settle(() => reject(abortReason(signal)));
|
|
72
|
+
read.join();
|
|
73
|
+
signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", onAbort, { once: true });
|
|
74
|
+
read.result.then((value) => settle(() => resolve(value)), (error) => settle(() => reject(error)));
|
|
75
|
+
});
|
|
76
|
+
const abortReason = (signal) => { var _a; return (_a = signal === null || signal === void 0 ? void 0 : signal.reason) !== null && _a !== void 0 ? _a : Object.assign(new Error(ABORTED_MESSAGE), { name: ABORT_ERROR }); };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SlimAlarmQuery, SlimAlarmsPage, SlimRecentAlarms } from "../../../client/notifications/types";
|
|
2
|
+
import type { SlimNotification } from "../../../client/slim/types";
|
|
3
|
+
import { HttpClient } from "../../http/http-client";
|
|
4
|
+
import { RequestOptions } from "../../http/transmit";
|
|
5
|
+
import { SlimRecentQuery } from "./slim-queries";
|
|
6
|
+
export declare class SlimAlarmsResource {
|
|
7
|
+
private readonly http;
|
|
8
|
+
constructor(http: HttpClient);
|
|
9
|
+
list(params?: SlimAlarmQuery, options?: RequestOptions): Promise<SlimAlarmsPage>;
|
|
10
|
+
recent(params?: SlimRecentQuery, options?: RequestOptions): Promise<SlimRecentAlarms>;
|
|
11
|
+
/** Can take about 12 s; the server makes it safe to repeat, so a 503 is retried. */
|
|
12
|
+
acknowledge(notificationId: string, options?: RequestOptions): Promise<SlimNotification>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlimAlarmsResource = void 0;
|
|
4
|
+
const query_string_1 = require("../../../client/query-string");
|
|
5
|
+
const url_1 = require("../../http/url");
|
|
6
|
+
const slim_paths_1 = require("./slim-paths");
|
|
7
|
+
const ALARMS_PATH = `${slim_paths_1.NOTIFICATIONS_PATH}/alarms`;
|
|
8
|
+
const RECENT_ALARMS_PATH = `${slim_paths_1.RECENT_NOTIFICATIONS_PATH}/alarms`;
|
|
9
|
+
class SlimAlarmsResource {
|
|
10
|
+
constructor(http) {
|
|
11
|
+
this.http = http;
|
|
12
|
+
}
|
|
13
|
+
list(params = {}, options) {
|
|
14
|
+
return this.http.get(`${ALARMS_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
|
|
15
|
+
}
|
|
16
|
+
recent(params = {}, options) {
|
|
17
|
+
return this.http.get(`${RECENT_ALARMS_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
|
|
18
|
+
}
|
|
19
|
+
/** Can take about 12 s; the server makes it safe to repeat, so a 503 is retried. */
|
|
20
|
+
acknowledge(notificationId, options) {
|
|
21
|
+
const path = `${slim_paths_1.NOTIFICATIONS_PATH}/${(0, url_1.pathSegment)(notificationId)}/ack`;
|
|
22
|
+
return this.http.send({ method: "PATCH", path, idempotent: true }, options);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.SlimAlarmsResource = SlimAlarmsResource;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChangeHistoryQuery, ChangeHistoryRow } from "../../../client/change-history/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
import { PagePromise } from "../../paging/page";
|
|
5
|
+
export declare class SlimChangeHistoryResource {
|
|
6
|
+
private readonly http;
|
|
7
|
+
constructor(http: HttpClient);
|
|
8
|
+
list(params?: ChangeHistoryQuery, options?: RequestOptions): PagePromise<ChangeHistoryRow>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlimChangeHistoryResource = void 0;
|
|
4
|
+
const url_1 = require("../../http/url");
|
|
5
|
+
const numbered_pages_1 = require("../../paging/numbered-pages");
|
|
6
|
+
const slim_paths_1 = require("./slim-paths");
|
|
7
|
+
const CHANGE_HISTORY_PATH = `${slim_paths_1.SLIM_PATH}/change-history`;
|
|
8
|
+
const TYPES_LIST_KEY = "types[]";
|
|
9
|
+
class SlimChangeHistoryResource {
|
|
10
|
+
constructor(http) {
|
|
11
|
+
this.http = http;
|
|
12
|
+
}
|
|
13
|
+
list(params = {}, options) {
|
|
14
|
+
return (0, numbered_pages_1.numberedPages)((page) => this.http.get(`${CHANGE_HISTORY_PATH}${changeHistoryQuery({ ...params, page })}`, options), params.page);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.SlimChangeHistoryResource = SlimChangeHistoryResource;
|
|
18
|
+
// The route reads `types[]` as a list; every other list repeats its own key.
|
|
19
|
+
const changeHistoryQuery = ({ types, ...rest }) => (0, url_1.toSearchQuery)({ ...rest, [TYPES_LIST_KEY]: types });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SlimChildProjectInput, SlimProjectRelationshipsV2 } from "../../../client/slim/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
export type SlimChildProjectCreated = {
|
|
5
|
+
projectId: string;
|
|
6
|
+
success: true;
|
|
7
|
+
};
|
|
8
|
+
export type SlimChildProjectDeleted = {
|
|
9
|
+
success: true;
|
|
10
|
+
};
|
|
11
|
+
export declare class SlimChildProjectsResource {
|
|
12
|
+
private readonly http;
|
|
13
|
+
constructor(http: HttpClient);
|
|
14
|
+
list(options?: RequestOptions): Promise<SlimProjectRelationshipsV2>;
|
|
15
|
+
create(body: SlimChildProjectInput, options?: RequestOptions): Promise<SlimChildProjectCreated>;
|
|
16
|
+
delete(subProjectId: string, options?: RequestOptions): Promise<SlimChildProjectDeleted>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlimChildProjectsResource = void 0;
|
|
4
|
+
const url_1 = require("../../http/url");
|
|
5
|
+
const slim_paths_1 = require("./slim-paths");
|
|
6
|
+
const CHILD_PROJECTS_PATH = `${slim_paths_1.PROJECT_PATH}/child`;
|
|
7
|
+
const CHILD_PROJECTS_V2_PATH = `${slim_paths_1.SLIM_V2_PATH}/project/child`;
|
|
8
|
+
class SlimChildProjectsResource {
|
|
9
|
+
constructor(http) {
|
|
10
|
+
this.http = http;
|
|
11
|
+
}
|
|
12
|
+
list(options) {
|
|
13
|
+
return this.http.get(CHILD_PROJECTS_V2_PATH, options);
|
|
14
|
+
}
|
|
15
|
+
create(body, options) {
|
|
16
|
+
return this.http.post(CHILD_PROJECTS_PATH, body, options);
|
|
17
|
+
}
|
|
18
|
+
delete(subProjectId, options) {
|
|
19
|
+
return this.http.delete(`${CHILD_PROJECTS_PATH}/${(0, url_1.pathSegment)(subProjectId)}`, options);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.SlimChildProjectsResource = SlimChildProjectsResource;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SlimAssignDevice, SlimCreateDevice, SlimDevice, SlimDeviceListItem, SlimDeviceListQuery, SlimDeviceTelemetry, SlimLiveQuery, SlimLiveTelemetry, SlimObservationIds, SlimUpdateDevice } from "../../../client/slim/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
import { PagePromise } from "../../paging/page";
|
|
5
|
+
export type SlimLiveDevice = Record<string, unknown>;
|
|
6
|
+
export type SlimDeviceObservationIds = Omit<SlimObservationIds, "batch">;
|
|
7
|
+
export type SlimObservationIdsByDevice = Record<string, SlimObservationIds>;
|
|
8
|
+
export declare class SlimDevicesResource {
|
|
9
|
+
private readonly http;
|
|
10
|
+
private readonly liveReads;
|
|
11
|
+
constructor(http: HttpClient);
|
|
12
|
+
list(params?: SlimDeviceListQuery, options?: RequestOptions): PagePromise<SlimDeviceListItem>;
|
|
13
|
+
retrieve(deviceId: string, options?: RequestOptions): Promise<SlimDevice>;
|
|
14
|
+
/** 409 when another customer holds the serial; 422 when this project already uses it. */
|
|
15
|
+
create(body: SlimCreateDevice, options?: RequestOptions): Promise<SlimDevice>;
|
|
16
|
+
/** Renaming moves the serial: live values return only after a reading under the new serial. */
|
|
17
|
+
update(deviceId: string, body: SlimUpdateDevice, options?: RequestOptions): Promise<SlimDevice>;
|
|
18
|
+
delete(deviceId: string, options?: RequestOptions): Promise<void>;
|
|
19
|
+
assignToProject(body: SlimAssignDevice, options?: RequestOptions): Promise<SlimDevice>;
|
|
20
|
+
live(params?: SlimLiveQuery, options?: RequestOptions): PagePromise<SlimLiveDevice>;
|
|
21
|
+
liveTelemetry(params?: SlimLiveQuery, options?: RequestOptions): Promise<SlimLiveTelemetry>;
|
|
22
|
+
telemetry(deviceId: string, options?: RequestOptions): Promise<SlimDeviceTelemetry>;
|
|
23
|
+
effectiveObservationIds(deviceId: string, options?: RequestOptions): Promise<SlimDeviceObservationIds>;
|
|
24
|
+
effectiveObservationIdsByDevice(options?: RequestOptions): Promise<SlimObservationIdsByDevice>;
|
|
25
|
+
lastObservationIds(deviceId: string, options?: RequestOptions): Promise<SlimObservationIds>;
|
|
26
|
+
lastObservationIdsByDevice(options?: RequestOptions): Promise<SlimObservationIdsByDevice>;
|
|
27
|
+
private readLive;
|
|
28
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlimDevicesResource = void 0;
|
|
4
|
+
const query_string_1 = require("../../../client/query-string");
|
|
5
|
+
const ovok_errors_1 = require("../../errors/ovok-errors");
|
|
6
|
+
const url_1 = require("../../http/url");
|
|
7
|
+
const numbered_pages_1 = require("../../paging/numbered-pages");
|
|
8
|
+
const live_reads_1 = require("./live-reads");
|
|
9
|
+
const slim_paths_1 = require("./slim-paths");
|
|
10
|
+
const DEVICES_PATH = `${slim_paths_1.SLIM_PATH}/device`;
|
|
11
|
+
const ASSIGN_TO_PROJECT_PATH = `${DEVICES_PATH}/assign/project`;
|
|
12
|
+
const LIVE_PATH = `${DEVICES_PATH}/live`;
|
|
13
|
+
const LIVE_TELEMETRY_PATH = `${LIVE_PATH}/telemetry`;
|
|
14
|
+
const TELEMETRY_PATH = `${slim_paths_1.SLIM_PATH}/telemetry`;
|
|
15
|
+
const EFFECTIVE_IDS = "effectiveIds";
|
|
16
|
+
const LAST_IDS = "lastIds";
|
|
17
|
+
const MIN_LIVE_COUNT = 1;
|
|
18
|
+
const MAX_LIVE_COUNT = 100;
|
|
19
|
+
const LIVE_COUNT_MESSAGE = `count must be an integer from ${MIN_LIVE_COUNT} to ${MAX_LIVE_COUNT}.`;
|
|
20
|
+
const devicePath = (deviceId) => `${DEVICES_PATH}/${(0, url_1.pathSegment)(deviceId)}`;
|
|
21
|
+
const telemetryPath = (deviceId) => `${TELEMETRY_PATH}/${(0, url_1.pathSegment)(deviceId)}`;
|
|
22
|
+
class SlimDevicesResource {
|
|
23
|
+
constructor(http) {
|
|
24
|
+
this.http = http;
|
|
25
|
+
this.liveReads = new live_reads_1.LiveReads(http);
|
|
26
|
+
}
|
|
27
|
+
list(params = {}, options) {
|
|
28
|
+
return (0, numbered_pages_1.numberedRoutePages)((path) => this.http.get(path, options), DEVICES_PATH, params);
|
|
29
|
+
}
|
|
30
|
+
retrieve(deviceId, options) {
|
|
31
|
+
return this.http.get(devicePath(deviceId), options);
|
|
32
|
+
}
|
|
33
|
+
/** 409 when another customer holds the serial; 422 when this project already uses it. */
|
|
34
|
+
create(body, options) {
|
|
35
|
+
return this.http.post(DEVICES_PATH, body, options);
|
|
36
|
+
}
|
|
37
|
+
/** Renaming moves the serial: live values return only after a reading under the new serial. */
|
|
38
|
+
update(deviceId, body, options) {
|
|
39
|
+
return this.http.put(devicePath(deviceId), body, options);
|
|
40
|
+
}
|
|
41
|
+
delete(deviceId, options) {
|
|
42
|
+
return this.http.delete(devicePath(deviceId), options);
|
|
43
|
+
}
|
|
44
|
+
assignToProject(body, options) {
|
|
45
|
+
return this.http.put(ASSIGN_TO_PROJECT_PATH, body, options);
|
|
46
|
+
}
|
|
47
|
+
live(params = {}, options) {
|
|
48
|
+
return (0, numbered_pages_1.numberedRoutePages)((path) => this.readLive(path, params, options), LIVE_PATH, params);
|
|
49
|
+
}
|
|
50
|
+
liveTelemetry(params = {}, options) {
|
|
51
|
+
return this.readLive(`${LIVE_TELEMETRY_PATH}${(0, query_string_1.toQueryString)(params)}`, params, options);
|
|
52
|
+
}
|
|
53
|
+
telemetry(deviceId, options) {
|
|
54
|
+
return this.liveReads.get(telemetryPath(deviceId), options);
|
|
55
|
+
}
|
|
56
|
+
effectiveObservationIds(deviceId, options) {
|
|
57
|
+
return this.http.get(`${telemetryPath(deviceId)}/${EFFECTIVE_IDS}`, options);
|
|
58
|
+
}
|
|
59
|
+
effectiveObservationIdsByDevice(options) {
|
|
60
|
+
return this.http.get(`${TELEMETRY_PATH}/${EFFECTIVE_IDS}`, options);
|
|
61
|
+
}
|
|
62
|
+
lastObservationIds(deviceId, options) {
|
|
63
|
+
return this.http.get(`${telemetryPath(deviceId)}/${LAST_IDS}`, options);
|
|
64
|
+
}
|
|
65
|
+
lastObservationIdsByDevice(options) {
|
|
66
|
+
return this.http.get(`${TELEMETRY_PATH}/${LAST_IDS}`, options);
|
|
67
|
+
}
|
|
68
|
+
async readLive(path, params, options) {
|
|
69
|
+
requireLiveCount(params);
|
|
70
|
+
return this.liveReads.get(path, options);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.SlimDevicesResource = SlimDevicesResource;
|
|
74
|
+
const isLiveCount = (count) => count === undefined || (Number.isInteger(count) && count >= MIN_LIVE_COUNT && count <= MAX_LIVE_COUNT);
|
|
75
|
+
const requireLiveCount = ({ count }) => {
|
|
76
|
+
if (isLiveCount(count)) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
throw new ovok_errors_1.OvokValidationError((0, ovok_errors_1.detailsFor)(LIVE_COUNT_MESSAGE));
|
|
80
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SlimExportPdf, SlimExportPdfRequest } from "../../../client/slim/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
export declare class SlimExportsResource {
|
|
5
|
+
private readonly http;
|
|
6
|
+
constructor(http: HttpClient);
|
|
7
|
+
patientPdf(body: SlimExportPdfRequest, options?: RequestOptions): Promise<SlimExportPdf>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlimExportsResource = void 0;
|
|
4
|
+
const slim_paths_1 = require("./slim-paths");
|
|
5
|
+
const PATIENT_PDF_PATH = `${slim_paths_1.SLIM_PATH}/export/pdf`;
|
|
6
|
+
class SlimExportsResource {
|
|
7
|
+
constructor(http) {
|
|
8
|
+
this.http = http;
|
|
9
|
+
}
|
|
10
|
+
patientPdf(body, options) {
|
|
11
|
+
return this.http.post(PATIENT_PDF_PATH, body, options);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.SlimExportsResource = SlimExportsResource;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SlimCreateLocation, SlimLocation, SlimLocationQuery, SlimUpdateLocation } from "../../../client/slim/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
import { PagePromise } from "../../paging/page";
|
|
5
|
+
export declare class SlimLocationsResource {
|
|
6
|
+
private readonly http;
|
|
7
|
+
constructor(http: HttpClient);
|
|
8
|
+
list(params?: SlimLocationQuery, options?: RequestOptions): PagePromise<SlimLocation>;
|
|
9
|
+
retrieve(locationId: string, options?: RequestOptions): Promise<SlimLocation>;
|
|
10
|
+
create(body: SlimCreateLocation, options?: RequestOptions): Promise<SlimLocation>;
|
|
11
|
+
/** A 422 "Device not found" means the requested device is unreadable and nothing was saved. */
|
|
12
|
+
update(locationId: string, body: SlimUpdateLocation, options?: RequestOptions): Promise<SlimLocation>;
|
|
13
|
+
delete(locationId: string, options?: RequestOptions): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlimLocationsResource = void 0;
|
|
4
|
+
const url_1 = require("../../http/url");
|
|
5
|
+
const numbered_pages_1 = require("../../paging/numbered-pages");
|
|
6
|
+
const slim_paths_1 = require("./slim-paths");
|
|
7
|
+
const LOCATIONS_PATH = `${slim_paths_1.SLIM_PATH}/location`;
|
|
8
|
+
const locationPath = (locationId) => `${LOCATIONS_PATH}/${(0, url_1.pathSegment)(locationId)}`;
|
|
9
|
+
class SlimLocationsResource {
|
|
10
|
+
constructor(http) {
|
|
11
|
+
this.http = http;
|
|
12
|
+
}
|
|
13
|
+
list(params = {}, options) {
|
|
14
|
+
return (0, numbered_pages_1.numberedRoutePages)((path) => this.http.get(path, options), LOCATIONS_PATH, params);
|
|
15
|
+
}
|
|
16
|
+
retrieve(locationId, options) {
|
|
17
|
+
return this.http.get(locationPath(locationId), options);
|
|
18
|
+
}
|
|
19
|
+
create(body, options) {
|
|
20
|
+
return this.http.post(LOCATIONS_PATH, body, options);
|
|
21
|
+
}
|
|
22
|
+
/** A 422 "Device not found" means the requested device is unreadable and nothing was saved. */
|
|
23
|
+
update(locationId, body, options) {
|
|
24
|
+
return this.http.put(locationPath(locationId), body, options);
|
|
25
|
+
}
|
|
26
|
+
delete(locationId, options) {
|
|
27
|
+
return this.http.delete(locationPath(locationId), options);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.SlimLocationsResource = SlimLocationsResource;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SlimMedicalNotificationDetail, SlimMedicalNotificationRow, SlimMedicalNotificationsQuery } from "../../../client/notifications/types";
|
|
2
|
+
import type { SlimRecentNotificationsResponse } from "../../../client/slim/types";
|
|
3
|
+
import { HttpClient } from "../../http/http-client";
|
|
4
|
+
import { RequestOptions } from "../../http/transmit";
|
|
5
|
+
import { PagePromise } from "../../paging/page";
|
|
6
|
+
import { SlimRecentQuery } from "./slim-queries";
|
|
7
|
+
export declare class SlimMedicalNotificationsResource {
|
|
8
|
+
private readonly http;
|
|
9
|
+
constructor(http: HttpClient);
|
|
10
|
+
/** `params.cursor` is where the first page starts. */
|
|
11
|
+
list(params?: SlimMedicalNotificationsQuery, options?: RequestOptions): PagePromise<SlimMedicalNotificationRow>;
|
|
12
|
+
/** During a Signals outage this may answer the last good page from up to 10 minutes ago. */
|
|
13
|
+
recent(params?: SlimRecentQuery, options?: RequestOptions): Promise<SlimRecentNotificationsResponse>;
|
|
14
|
+
retrieve(episodeId: string, options?: RequestOptions): Promise<SlimMedicalNotificationDetail>;
|
|
15
|
+
/** Can take about 12 s; the server makes it safe to repeat, so a 503 is retried. */
|
|
16
|
+
acknowledge(episodeId: string, options?: RequestOptions): Promise<SlimMedicalNotificationRow>;
|
|
17
|
+
private page;
|
|
18
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlimMedicalNotificationsResource = void 0;
|
|
4
|
+
const query_string_1 = require("../../../client/query-string");
|
|
5
|
+
const ovok_errors_1 = require("../../errors/ovok-errors");
|
|
6
|
+
const url_1 = require("../../http/url");
|
|
7
|
+
const cursor_pages_1 = require("../../paging/cursor-pages");
|
|
8
|
+
const slim_paths_1 = require("./slim-paths");
|
|
9
|
+
const MEDICAL_PATH = `${slim_paths_1.NOTIFICATIONS_PATH}/medical`;
|
|
10
|
+
const RECENT_MEDICAL_PATH = `${slim_paths_1.RECENT_NOTIFICATIONS_PATH}/medical`;
|
|
11
|
+
const MEDICAL_CODE = /^(?:\d{1,7}-\d|PI)$/;
|
|
12
|
+
const MAX_MEDICAL_CODES = 32;
|
|
13
|
+
const MEDICAL_CODES_MESSAGE = `codes must contain at most ${MAX_MEDICAL_CODES} valid LOINC codes or PI.`;
|
|
14
|
+
const episodePath = (episodeId) => `${MEDICAL_PATH}/${(0, url_1.pathSegment)(episodeId)}`;
|
|
15
|
+
class SlimMedicalNotificationsResource {
|
|
16
|
+
constructor(http) {
|
|
17
|
+
this.http = http;
|
|
18
|
+
}
|
|
19
|
+
/** `params.cursor` is where the first page starts. */
|
|
20
|
+
list(params = {}, options) {
|
|
21
|
+
return (0, cursor_pages_1.cursorPages)((cursor) => this.page({ ...params, cursor: cursor !== null && cursor !== void 0 ? cursor : params.cursor }, options));
|
|
22
|
+
}
|
|
23
|
+
/** During a Signals outage this may answer the last good page from up to 10 minutes ago. */
|
|
24
|
+
recent(params = {}, options) {
|
|
25
|
+
return this.http.get(`${RECENT_MEDICAL_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
|
|
26
|
+
}
|
|
27
|
+
retrieve(episodeId, options) {
|
|
28
|
+
return this.http.get(episodePath(episodeId), options);
|
|
29
|
+
}
|
|
30
|
+
/** Can take about 12 s; the server makes it safe to repeat, so a 503 is retried. */
|
|
31
|
+
acknowledge(episodeId, options) {
|
|
32
|
+
return this.http.send({ method: "POST", path: `${episodePath(episodeId)}/ack`, idempotent: true }, options);
|
|
33
|
+
}
|
|
34
|
+
async page(params, options) {
|
|
35
|
+
requireMedicalCodes(params);
|
|
36
|
+
return this.http.get(`${MEDICAL_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.SlimMedicalNotificationsResource = SlimMedicalNotificationsResource;
|
|
40
|
+
const isMedicalCodeList = (codes) => codes.length > 0 && codes.length <= MAX_MEDICAL_CODES && codes.every((code) => MEDICAL_CODE.test(code));
|
|
41
|
+
const requireMedicalCodes = ({ codes }) => {
|
|
42
|
+
if (codes === undefined || isMedicalCodeList(codes)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
throw new ovok_errors_1.OvokValidationError((0, ovok_errors_1.detailsFor)(MEDICAL_CODES_MESSAGE));
|
|
46
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CreateNotificationNote, NotificationNote, NotificationNotes, NotificationTargetKind, UpdateNotificationNote } from "../../../client/notifications/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
export declare class SlimNotificationNotesResource {
|
|
5
|
+
private readonly http;
|
|
6
|
+
constructor(http: HttpClient);
|
|
7
|
+
list(kind: NotificationTargetKind, targetId: string, options?: RequestOptions): Promise<NotificationNotes>;
|
|
8
|
+
create(body: CreateNotificationNote, options?: RequestOptions): Promise<NotificationNote>;
|
|
9
|
+
update(noteId: string, body: UpdateNotificationNote, options?: RequestOptions): Promise<NotificationNote>;
|
|
10
|
+
patch(noteId: string, body: UpdateNotificationNote, options?: RequestOptions): Promise<NotificationNote>;
|
|
11
|
+
delete(noteId: string, options?: RequestOptions): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlimNotificationNotesResource = void 0;
|
|
4
|
+
const url_1 = require("../../http/url");
|
|
5
|
+
const slim_paths_1 = require("./slim-paths");
|
|
6
|
+
const NOTES_PATH = `${slim_paths_1.NOTIFICATIONS_PATH}/notes`;
|
|
7
|
+
const TARGET_SEGMENT = {
|
|
8
|
+
oob: "oob",
|
|
9
|
+
alarm: "alarms",
|
|
10
|
+
medical: "medical",
|
|
11
|
+
alert: "raw-alerts",
|
|
12
|
+
};
|
|
13
|
+
const notePath = (noteId) => `${NOTES_PATH}/${(0, url_1.pathSegment)(noteId)}`;
|
|
14
|
+
class SlimNotificationNotesResource {
|
|
15
|
+
constructor(http) {
|
|
16
|
+
this.http = http;
|
|
17
|
+
}
|
|
18
|
+
list(kind, targetId, options) {
|
|
19
|
+
return this.http.get(`${slim_paths_1.NOTIFICATIONS_PATH}/${TARGET_SEGMENT[kind]}/${(0, url_1.pathSegment)(targetId)}/notes`, options);
|
|
20
|
+
}
|
|
21
|
+
create(body, options) {
|
|
22
|
+
return this.http.post(NOTES_PATH, body, options);
|
|
23
|
+
}
|
|
24
|
+
update(noteId, body, options) {
|
|
25
|
+
return this.http.put(notePath(noteId), body, options);
|
|
26
|
+
}
|
|
27
|
+
patch(noteId, body, options) {
|
|
28
|
+
return this.http.patch(notePath(noteId), body, options);
|
|
29
|
+
}
|
|
30
|
+
delete(noteId, options) {
|
|
31
|
+
return this.http.delete(notePath(noteId), options);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.SlimNotificationNotesResource = SlimNotificationNotesResource;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SlimNotificationsQuery, SlimNotificationsResponse, SlimRecentNotificationsResponse } from "../../../client/slim/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
import { SlimAlarmsResource } from "./slim-alarms-resource";
|
|
5
|
+
import { SlimMedicalNotificationsResource } from "./slim-medical-notifications-resource";
|
|
6
|
+
import { SlimNotificationNotesResource } from "./slim-notification-notes-resource";
|
|
7
|
+
import { SlimOutOfBedResource } from "./slim-out-of-bed-resource";
|
|
8
|
+
import { SlimRecentQuery } from "./slim-queries";
|
|
9
|
+
export declare class SlimNotificationsResource {
|
|
10
|
+
private readonly http;
|
|
11
|
+
readonly alarms: SlimAlarmsResource;
|
|
12
|
+
readonly outOfBed: SlimOutOfBedResource;
|
|
13
|
+
readonly medical: SlimMedicalNotificationsResource;
|
|
14
|
+
readonly notes: SlimNotificationNotesResource;
|
|
15
|
+
constructor(http: HttpClient);
|
|
16
|
+
/** @deprecated Use outOfBed.list, alarms.list or medical.list. */
|
|
17
|
+
list(params?: SlimNotificationsQuery, options?: RequestOptions): Promise<SlimNotificationsResponse>;
|
|
18
|
+
recent(params?: SlimRecentQuery, options?: RequestOptions): Promise<SlimRecentNotificationsResponse>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlimNotificationsResource = void 0;
|
|
4
|
+
const query_string_1 = require("../../../client/query-string");
|
|
5
|
+
const slim_alarms_resource_1 = require("./slim-alarms-resource");
|
|
6
|
+
const slim_medical_notifications_resource_1 = require("./slim-medical-notifications-resource");
|
|
7
|
+
const slim_notification_notes_resource_1 = require("./slim-notification-notes-resource");
|
|
8
|
+
const slim_out_of_bed_resource_1 = require("./slim-out-of-bed-resource");
|
|
9
|
+
const slim_paths_1 = require("./slim-paths");
|
|
10
|
+
class SlimNotificationsResource {
|
|
11
|
+
constructor(http) {
|
|
12
|
+
this.http = http;
|
|
13
|
+
this.alarms = new slim_alarms_resource_1.SlimAlarmsResource(http);
|
|
14
|
+
this.outOfBed = new slim_out_of_bed_resource_1.SlimOutOfBedResource(http);
|
|
15
|
+
this.medical = new slim_medical_notifications_resource_1.SlimMedicalNotificationsResource(http);
|
|
16
|
+
this.notes = new slim_notification_notes_resource_1.SlimNotificationNotesResource(http);
|
|
17
|
+
}
|
|
18
|
+
/** @deprecated Use outOfBed.list, alarms.list or medical.list. */
|
|
19
|
+
list(params = {}, options) {
|
|
20
|
+
return this.http.get(`${slim_paths_1.NOTIFICATIONS_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
|
|
21
|
+
}
|
|
22
|
+
recent(params = {}, options) {
|
|
23
|
+
return this.http.get(`${slim_paths_1.RECENT_NOTIFICATIONS_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.SlimNotificationsResource = SlimNotificationsResource;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SlimOrganization, SlimOrganizationInput } from "../../../client/slim/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
export declare class SlimOrganizationsResource {
|
|
5
|
+
private readonly http;
|
|
6
|
+
constructor(http: HttpClient);
|
|
7
|
+
retrieve(organizationId: string, options?: RequestOptions): Promise<SlimOrganization>;
|
|
8
|
+
create(body: SlimOrganizationInput, options?: RequestOptions): Promise<SlimOrganization>;
|
|
9
|
+
update(organizationId: string, body: SlimOrganizationInput, options?: RequestOptions): Promise<SlimOrganization>;
|
|
10
|
+
delete(organizationId: string, options?: RequestOptions): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlimOrganizationsResource = void 0;
|
|
4
|
+
const url_1 = require("../../http/url");
|
|
5
|
+
const slim_paths_1 = require("./slim-paths");
|
|
6
|
+
const ORGANIZATIONS_PATH = `${slim_paths_1.SLIM_PATH}/organization`;
|
|
7
|
+
const organizationPath = (organizationId) => `${ORGANIZATIONS_PATH}/${(0, url_1.pathSegment)(organizationId)}`;
|
|
8
|
+
class SlimOrganizationsResource {
|
|
9
|
+
constructor(http) {
|
|
10
|
+
this.http = http;
|
|
11
|
+
}
|
|
12
|
+
retrieve(organizationId, options) {
|
|
13
|
+
return this.http.get(organizationPath(organizationId), options);
|
|
14
|
+
}
|
|
15
|
+
create(body, options) {
|
|
16
|
+
return this.http.post(ORGANIZATIONS_PATH, body, options);
|
|
17
|
+
}
|
|
18
|
+
update(organizationId, body, options) {
|
|
19
|
+
return this.http.put(organizationPath(organizationId), body, options);
|
|
20
|
+
}
|
|
21
|
+
delete(organizationId, options) {
|
|
22
|
+
return this.http.delete(organizationPath(organizationId), options);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.SlimOrganizationsResource = SlimOrganizationsResource;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SlimRecentOutOfBed } from "../../../client/notifications/types";
|
|
2
|
+
import type { SlimNotificationsQuery, SlimNotificationsResponse } from "../../../client/slim/types";
|
|
3
|
+
import { HttpClient } from "../../http/http-client";
|
|
4
|
+
import { RequestOptions } from "../../http/transmit";
|
|
5
|
+
import { SlimRecentQuery } from "./slim-queries";
|
|
6
|
+
export type SlimOutOfBedQuery = Omit<SlimNotificationsQuery, "type">;
|
|
7
|
+
export declare class SlimOutOfBedResource {
|
|
8
|
+
private readonly http;
|
|
9
|
+
constructor(http: HttpClient);
|
|
10
|
+
/** Omitting status lists new and reviewed rows. */
|
|
11
|
+
list(params?: SlimOutOfBedQuery, options?: RequestOptions): Promise<SlimNotificationsResponse>;
|
|
12
|
+
recent(params?: SlimRecentQuery, options?: RequestOptions): Promise<SlimRecentOutOfBed>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlimOutOfBedResource = void 0;
|
|
4
|
+
const query_string_1 = require("../../../client/query-string");
|
|
5
|
+
const slim_paths_1 = require("./slim-paths");
|
|
6
|
+
const OUT_OF_BED_PATH = `${slim_paths_1.NOTIFICATIONS_PATH}/oob`;
|
|
7
|
+
const RECENT_OUT_OF_BED_PATH = `${slim_paths_1.RECENT_NOTIFICATIONS_PATH}/oob`;
|
|
8
|
+
class SlimOutOfBedResource {
|
|
9
|
+
constructor(http) {
|
|
10
|
+
this.http = http;
|
|
11
|
+
}
|
|
12
|
+
/** Omitting status lists new and reviewed rows. */
|
|
13
|
+
list(params = {}, options) {
|
|
14
|
+
return this.http.get(`${OUT_OF_BED_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
|
|
15
|
+
}
|
|
16
|
+
recent(params = {}, options) {
|
|
17
|
+
return this.http.get(`${RECENT_OUT_OF_BED_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.SlimOutOfBedResource = SlimOutOfBedResource;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const SLIM_PATH = "v1/slim";
|
|
2
|
+
export declare const SLIM_V2_PATH = "v2/slim";
|
|
3
|
+
export declare const NOTIFICATIONS_PATH = "v1/slim/notifications";
|
|
4
|
+
export declare const RECENT_NOTIFICATIONS_PATH = "v1/slim/notifications/recent";
|
|
5
|
+
export declare const THRESHOLD_V2_PATH = "v2/slim/threshold";
|
|
6
|
+
export declare const PROJECT_PATH = "v1/slim/project";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PROJECT_PATH = exports.THRESHOLD_V2_PATH = exports.RECENT_NOTIFICATIONS_PATH = exports.NOTIFICATIONS_PATH = exports.SLIM_V2_PATH = exports.SLIM_PATH = void 0;
|
|
4
|
+
exports.SLIM_PATH = "v1/slim";
|
|
5
|
+
exports.SLIM_V2_PATH = "v2/slim";
|
|
6
|
+
exports.NOTIFICATIONS_PATH = `${exports.SLIM_PATH}/notifications`;
|
|
7
|
+
exports.RECENT_NOTIFICATIONS_PATH = `${exports.NOTIFICATIONS_PATH}/recent`;
|
|
8
|
+
exports.THRESHOLD_V2_PATH = `${exports.SLIM_V2_PATH}/threshold`;
|
|
9
|
+
exports.PROJECT_PATH = `${exports.SLIM_PATH}/project`;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SlimPatientThresholdV2, SlimThresholdV2Update } from "../../../client/slim/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
export declare class SlimPatientThresholdsResource {
|
|
5
|
+
private readonly http;
|
|
6
|
+
constructor(http: HttpClient);
|
|
7
|
+
retrieve(patientId: string, options?: RequestOptions): Promise<SlimPatientThresholdV2>;
|
|
8
|
+
/** Never retried: a 409 means another save for this resident is running and nothing changed. */
|
|
9
|
+
update(patientId: string, body: SlimThresholdV2Update, options?: RequestOptions): Promise<SlimPatientThresholdV2>;
|
|
10
|
+
}
|