@ovok/core 0.4.5 → 0.4.7

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/README.md CHANGED
@@ -16,7 +16,7 @@ Core TypeScript SDK for healthcare applications. Provides authentication, AI-FHI
16
16
  - 📥 Opt-in durable offline measurement queue with idempotent retries
17
17
  - 🧭 Runtime discovery of the backend FHIR and public API capabilities
18
18
  - 🧩 Typed accounts, projects, localization, and patient-observation APIs
19
- - 🏥 Typed CareHub patient, device, telemetry, notification, and monitoring APIs
19
+ - 🏥 Typed Slim patient, device, telemetry, notification, and monitoring APIs
20
20
  - 🚨 Typed Signals thresholds, alerts, and project settings APIs
21
21
 
22
22
  ## Installation
@@ -265,6 +265,15 @@ const acked = await client.acknowledgeSignalsRawAlert(alert.id);
265
265
  // acked.acknowledgedAt and acked.acknowledgedActor record when and by whom.
266
266
  ```
267
267
 
268
+ The alert hooks take the same switch: `episodes` is optional and defaults to episodes, so existing
269
+ calls are unchanged; `episodes: false` reads and acknowledges raw alerts, typed as `SignalsRawAlert`.
270
+
271
+ ```tsx
272
+ const worklist = useSignalsAlerts({ episodes: false, acknowledged: false, codes: ["8867-4"] });
273
+ const one = useSignalsAlert(alertId, { episodes: false });
274
+ const { mutate: acknowledge } = useAcknowledgeSignalsAlert({ episodes: false });
275
+ ```
276
+
268
277
  Each `SignalsRawAlert` carries Signals' own `id`, `createdAt` and `resolvedAt`. `status` is Signals'
269
278
  state of the reading: `ACTIVE` while it breaches, `RESOLVED` once it recovered or the alert was
270
279
  acknowledged. An alert stays open for the practitioner until it is acknowledged, so list the
@@ -286,20 +295,20 @@ caller's project and the residents their access policy allows: an alert outside
286
295
  404, and acknowledging needs `signals_alerts:update` and update access to the resident (403 when the
287
296
  caller can only read them).
288
297
 
289
- ## CareHub APIs
298
+ ## Slim APIs
290
299
 
291
- CareHub methods cover the verified `/v1/slim/*` and `/v2/slim/*` application routes for
300
+ Slim methods cover the verified `/v1/slim/*` and `/v2/slim/*` application routes for
292
301
  patients, devices, telemetry, notifications, thresholds, trends, sleep, locations, zones, and
293
- PDF export. These routes require the backend's bearer session and CareHub permissions.
302
+ PDF export. These routes require the backend's bearer session and Slim permissions.
294
303
 
295
304
  ```typescript
296
- const residents = await client.listCarehubPatients({ residentState: "active" });
297
- const devices = await client.listCarehubDevices({ active: true });
298
- const telemetry = await client.getCarehubDeviceTelemetry(deviceId);
299
- const alerts = await client.listCarehubMedicalNotifications({ count: 25 });
305
+ const residents = await client.listSlimPatients({ residentState: "active" });
306
+ const devices = await client.listSlimDevices({ active: true });
307
+ const telemetry = await client.getSlimDeviceTelemetry(deviceId);
308
+ const alerts = await client.listSlimMedicalNotifications({ count: 25 });
300
309
  ```
301
310
 
302
- CareHub is intentionally represented as typed application APIs rather than changing the FHIR
311
+ Slim is intentionally represented as typed application APIs rather than changing the FHIR
303
312
  observation save/offline behavior used by native integrations.
304
313
 
305
314
  ## Application APIs
@@ -329,12 +338,12 @@ download elements; the backend remains responsible for authorization and signed
329
338
  ## React hooks
330
339
 
331
340
  The package exports additive hooks for capability discovery, project configuration, patient profile
332
- and health data, questionnaires, scheduling resources, CareHub lists, telemetry, notifications,
341
+ and health data, questionnaires, scheduling resources, Slim lists, telemetry, notifications,
333
342
  documents, content, video consultations, and localization. Every request hook returns `data`,
334
343
  `loading`, `error`, and `reload`; mutations expose `data`, `loading`, `error`, `mutate`, and `reset`.
335
344
 
336
345
  ```tsx
337
- const { data: patients, loading, error } = useCarehubPatients({
346
+ const { data: patients, loading, error } = useSlimPatients({
338
347
  residentState: "active",
339
348
  });
340
349
 
@@ -485,7 +494,7 @@ changing only practitioner sharing, send the current `enabled` value too.
485
494
  turning it off does not revoke existing shares. A project admin can toggle it
486
495
  through `PUT /v1/patient-sharing/settings`; concurrent settings changes return
487
496
  409 and should be reloaded, and non-admins receive 403. Do not enable it for a project
488
- whose practitioners use the Carehub dashboard. Map the email templates
497
+ whose practitioners use the Slim dashboard. Map the email templates
489
498
  `PATIENT_INVITE`, `PATIENT_ASSIGNMENT_REQUEST`,
490
499
  `PRACTITIONER_INVITED_BY_PATIENT`, and `PRACTITIONER_PATIENT_SHARED` before
491
500
  turning the feature on; an unmapped email can still produce the uniform 202
@@ -4,7 +4,6 @@ import { OvokPublicApiEndpoint } from "../conformance/capability";
4
4
  import * as aiFhirMethods from "./ai-fhir/methods";
5
5
  import * as authMethods from "./auth/methods";
6
6
  import * as botMethods from "./bot/methods";
7
- import * as carehubMethods from "./carehub/methods";
8
7
  import * as aiMethods from "./chat/ai/methods";
9
8
  import * as emailMethods from "./email";
10
9
  import * as experienceMethods from "./experience/methods";
@@ -17,6 +16,7 @@ import * as patientSharingMethods from "./patient-sharing/methods";
17
16
  import * as platformMethods from "./platform/methods";
18
17
  import * as questionnaireResponseMethods from "./questionnaire-response/methods";
19
18
  import * as signalsMethods from "./signals/methods";
19
+ import * as slimMethods from "./slim/methods";
20
20
  export declare const MAX_CONDITIONAL_OBSERVATION_ENTRIES = 8;
21
21
  export { MAX_OBSERVATION_BUNDLE_BYTES } from "./observation/observation-bundle-utils";
22
22
  export type SaveObservationsResult = {
@@ -62,7 +62,7 @@ export declare class OvokClient extends MedplumClient {
62
62
  */
63
63
  getSubscriptionManager(): SubscriptionManager;
64
64
  }
65
- type Methods = typeof authMethods & typeof observationMethods & typeof questionnaireResponseMethods & typeof aiMethods & typeof aiFhirMethods & typeof botMethods & typeof carehubMethods & typeof emailMethods & typeof platformMethods & typeof experienceMethods & typeof inviteMethods & typeof patientMethods & typeof patientSharingMethods & typeof signalsMethods;
65
+ type Methods = typeof authMethods & typeof observationMethods & typeof questionnaireResponseMethods & typeof aiMethods & typeof aiFhirMethods & typeof botMethods & typeof slimMethods & typeof emailMethods & typeof platformMethods & typeof experienceMethods & typeof inviteMethods & typeof patientMethods & typeof patientSharingMethods & typeof signalsMethods;
66
66
  type Omitted<T> = Omit<T, "executeBot">;
67
67
  declare module "./ovok-client" {
68
68
  interface OvokClient extends Omitted<Methods> {
@@ -40,7 +40,6 @@ const capability_1 = require("../conformance/capability");
40
40
  const aiFhirMethods = __importStar(require("./ai-fhir/methods"));
41
41
  const authMethods = __importStar(require("./auth/methods"));
42
42
  const botMethods = __importStar(require("./bot/methods"));
43
- const carehubMethods = __importStar(require("./carehub/methods"));
44
43
  const aiMethods = __importStar(require("./chat/ai/methods"));
45
44
  const emailMethods = __importStar(require("./email"));
46
45
  const rate_limit_error_1 = require("./errors/rate-limit-error");
@@ -55,6 +54,7 @@ const platformMethods = __importStar(require("./platform/methods"));
55
54
  const questionnaireResponseMethods = __importStar(require("./questionnaire-response/methods"));
56
55
  const errors_1 = require("./signals/errors");
57
56
  const signalsMethods = __importStar(require("./signals/methods"));
57
+ const slimMethods = __importStar(require("./slim/methods"));
58
58
  exports.MAX_CONDITIONAL_OBSERVATION_ENTRIES = 8;
59
59
  var observation_bundle_utils_2 = require("./observation/observation-bundle-utils");
60
60
  Object.defineProperty(exports, "MAX_OBSERVATION_BUNDLE_BYTES", { enumerable: true, get: function () { return observation_bundle_utils_2.MAX_OBSERVATION_BUNDLE_BYTES; } });
@@ -74,7 +74,7 @@ class OvokClient extends core_1.MedplumClient {
74
74
  this.bindMethods(aiMethods);
75
75
  this.bindMethods(aiFhirMethods);
76
76
  this.bindMethods(botMethods);
77
- this.bindMethods(carehubMethods);
77
+ this.bindMethods(slimMethods);
78
78
  this.bindMethods(emailMethods);
79
79
  this.bindMethods(platformMethods);
80
80
  this.bindMethods(experienceMethods);
@@ -0,0 +1,71 @@
1
+ import { Bundle, Resource } from "@medplum/fhirtypes";
2
+ import { OvokClient } from "../ovok-client";
3
+ import { SlimAssignDevice, SlimCreateDevice, SlimCreateLocation, SlimCreatePatient, SlimDevice, SlimDeviceListItem, SlimDeviceListQuery, SlimDeviceTelemetry, SlimExportPdf, SlimExportPdfRequest, SlimLiveQuery, SlimLiveTelemetry, SlimLocation, SlimLocationQuery, SlimNotification, SlimNotificationsQuery, SlimNotificationsResponse, SlimObservationIds, SlimPage, SlimPatient, SlimPatientListItem, SlimPatientListQuery, SlimRecentNotificationsResponse, SlimSleepStatistics, SlimThreshold, SlimTrends, SlimUpdateDevice, SlimUpdateLocation, SlimUpdatePatient, SlimZone, SlimZoneDetail } from "./types";
4
+ export declare function listSlimPatients(this: OvokClient, params?: SlimPatientListQuery): Promise<SlimPage<SlimPatientListItem>>;
5
+ export declare function getSlimPatient(this: OvokClient, patientId: string): Promise<SlimPatient>;
6
+ export declare function getSlimPatientEverything(this: OvokClient, patientId: string): Promise<Bundle<Resource>>;
7
+ export declare function getSlimPatientCurrentVitals(this: OvokClient, patientId: string): Promise<Record<string, unknown>>;
8
+ export declare function createSlimPatient(this: OvokClient, body: SlimCreatePatient): Promise<SlimPatient>;
9
+ export declare function updateSlimPatient(this: OvokClient, patientId: string, body: SlimUpdatePatient): Promise<SlimPatient>;
10
+ export declare function deleteSlimPatient(this: OvokClient, patientId: string): Promise<void>;
11
+ export declare function listSlimDevices(this: OvokClient, params?: SlimDeviceListQuery): Promise<SlimPage<SlimDeviceListItem>>;
12
+ export declare function getSlimDevice(this: OvokClient, deviceId: string): Promise<SlimDevice>;
13
+ export declare function createSlimDevice(this: OvokClient, body: SlimCreateDevice): Promise<SlimDevice>;
14
+ export declare function updateSlimDevice(this: OvokClient, deviceId: string, body: SlimUpdateDevice): Promise<SlimDevice>;
15
+ export declare function deleteSlimDevice(this: OvokClient, deviceId: string): Promise<void>;
16
+ export declare function assignSlimDeviceToProject(this: OvokClient, body: SlimAssignDevice): Promise<SlimDevice>;
17
+ export declare function listSlimLiveDevices(this: OvokClient, params?: SlimLiveQuery): Promise<SlimPage<Record<string, unknown>>>;
18
+ export declare function listSlimLiveTelemetry(this: OvokClient, params?: SlimLiveQuery): Promise<SlimLiveTelemetry>;
19
+ export declare function getSlimDeviceSleepStatus(this: OvokClient, deviceId: string): Promise<Record<string, unknown>>;
20
+ export declare function getSlimDeviceTelemetry(this: OvokClient, deviceId: string): Promise<SlimDeviceTelemetry>;
21
+ export declare function listSlimEffectiveObservationIds(this: OvokClient): Promise<Record<string, SlimObservationIds>>;
22
+ export declare function listSlimLastObservationIds(this: OvokClient): Promise<Record<string, SlimObservationIds>>;
23
+ export declare function getSlimDeviceEffectiveObservationIds(this: OvokClient, deviceId: string): Promise<Omit<SlimObservationIds, "batch">>;
24
+ export declare function getSlimDeviceLastObservationIds(this: OvokClient, deviceId: string): Promise<SlimObservationIds>;
25
+ export declare function listSlimNotifications(this: OvokClient, params?: SlimNotificationsQuery): Promise<SlimNotificationsResponse>;
26
+ export declare function getRecentSlimNotifications(this: OvokClient, count?: number): Promise<SlimRecentNotificationsResponse>;
27
+ export declare function listSlimOutOfBedNotifications(this: OvokClient, params?: Omit<SlimNotificationsQuery, "type">): Promise<SlimNotificationsResponse>;
28
+ export declare function listSlimMedicalNotifications(this: OvokClient, params?: SlimNotificationsQuery): Promise<SlimNotificationsResponse>;
29
+ export declare function getRecentSlimMedicalNotifications(this: OvokClient, count?: number): Promise<SlimRecentNotificationsResponse>;
30
+ export declare function getSlimMedicalNotification(this: OvokClient, episodeId: string): Promise<SlimNotification>;
31
+ export declare function acknowledgeSlimMedicalNotification(this: OvokClient, episodeId: string): Promise<SlimNotification>;
32
+ export declare function acknowledgeSlimNotification(this: OvokClient, notificationId: string): Promise<SlimNotification>;
33
+ export declare function getSlimThreshold(this: OvokClient): Promise<SlimThreshold>;
34
+ export declare function updateSlimThreshold(this: OvokClient, body: Record<string, unknown>): Promise<SlimThreshold>;
35
+ export declare function getSlimPatientThreshold(this: OvokClient, patientId: string): Promise<Record<string, unknown>>;
36
+ export declare function updateSlimPatientThreshold(this: OvokClient, patientId: string, body: Record<string, unknown>): Promise<Record<string, unknown>>;
37
+ export declare function getSlimThresholdV2(this: OvokClient): Promise<Record<string, unknown>>;
38
+ export declare function updateSlimThresholdV2(this: OvokClient, body: Record<string, unknown>): Promise<Record<string, unknown>>;
39
+ export declare function getSlimPatientThresholdV2(this: OvokClient, patientId: string): Promise<Record<string, unknown>>;
40
+ export declare function updateSlimPatientThresholdV2(this: OvokClient, patientId: string, body: Record<string, unknown>): Promise<Record<string, unknown>>;
41
+ export declare function getSlimTrends(this: OvokClient, params: {
42
+ patientId: string;
43
+ startDate: string;
44
+ endDate: string;
45
+ graphType: string;
46
+ }): Promise<SlimTrends>;
47
+ export declare function getSlimSleepStatistics(this: OvokClient, params: {
48
+ endDate: string;
49
+ lastDayCount?: number;
50
+ patientId: string;
51
+ }): Promise<SlimSleepStatistics>;
52
+ export declare function listSlimLocations(this: OvokClient, params?: SlimLocationQuery): Promise<SlimPage<SlimLocation>>;
53
+ export declare function getSlimLocation(this: OvokClient, locationId: string): Promise<SlimLocation>;
54
+ export declare function createSlimLocation(this: OvokClient, body: SlimCreateLocation): Promise<SlimLocation>;
55
+ export declare function updateSlimLocation(this: OvokClient, locationId: string, body: SlimUpdateLocation): Promise<SlimLocation>;
56
+ export declare function deleteSlimLocation(this: OvokClient, locationId: string): Promise<void>;
57
+ export declare function listSlimZones(this: OvokClient, params?: {
58
+ page?: number;
59
+ count?: number;
60
+ sortBy?: string;
61
+ orderBy?: "ASC" | "DESC";
62
+ search?: string;
63
+ }): Promise<SlimPage<SlimZone>>;
64
+ export declare function getSlimZone(this: OvokClient, zoneId: string): Promise<SlimZoneDetail>;
65
+ export declare function getSlimZoneDeviceCounts(this: OvokClient, params?: {
66
+ all?: boolean;
67
+ effectiveSleepStatus?: string;
68
+ includeUnassigned?: boolean;
69
+ includeEmpty?: boolean;
70
+ }): Promise<Record<string, unknown>>;
71
+ export declare function exportSlimPatientPdf(this: OvokClient, body: SlimExportPdfRequest): Promise<SlimExportPdf>;
@@ -0,0 +1,205 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listSlimPatients = listSlimPatients;
4
+ exports.getSlimPatient = getSlimPatient;
5
+ exports.getSlimPatientEverything = getSlimPatientEverything;
6
+ exports.getSlimPatientCurrentVitals = getSlimPatientCurrentVitals;
7
+ exports.createSlimPatient = createSlimPatient;
8
+ exports.updateSlimPatient = updateSlimPatient;
9
+ exports.deleteSlimPatient = deleteSlimPatient;
10
+ exports.listSlimDevices = listSlimDevices;
11
+ exports.getSlimDevice = getSlimDevice;
12
+ exports.createSlimDevice = createSlimDevice;
13
+ exports.updateSlimDevice = updateSlimDevice;
14
+ exports.deleteSlimDevice = deleteSlimDevice;
15
+ exports.assignSlimDeviceToProject = assignSlimDeviceToProject;
16
+ exports.listSlimLiveDevices = listSlimLiveDevices;
17
+ exports.listSlimLiveTelemetry = listSlimLiveTelemetry;
18
+ exports.getSlimDeviceSleepStatus = getSlimDeviceSleepStatus;
19
+ exports.getSlimDeviceTelemetry = getSlimDeviceTelemetry;
20
+ exports.listSlimEffectiveObservationIds = listSlimEffectiveObservationIds;
21
+ exports.listSlimLastObservationIds = listSlimLastObservationIds;
22
+ exports.getSlimDeviceEffectiveObservationIds = getSlimDeviceEffectiveObservationIds;
23
+ exports.getSlimDeviceLastObservationIds = getSlimDeviceLastObservationIds;
24
+ exports.listSlimNotifications = listSlimNotifications;
25
+ exports.getRecentSlimNotifications = getRecentSlimNotifications;
26
+ exports.listSlimOutOfBedNotifications = listSlimOutOfBedNotifications;
27
+ exports.listSlimMedicalNotifications = listSlimMedicalNotifications;
28
+ exports.getRecentSlimMedicalNotifications = getRecentSlimMedicalNotifications;
29
+ exports.getSlimMedicalNotification = getSlimMedicalNotification;
30
+ exports.acknowledgeSlimMedicalNotification = acknowledgeSlimMedicalNotification;
31
+ exports.acknowledgeSlimNotification = acknowledgeSlimNotification;
32
+ exports.getSlimThreshold = getSlimThreshold;
33
+ exports.updateSlimThreshold = updateSlimThreshold;
34
+ exports.getSlimPatientThreshold = getSlimPatientThreshold;
35
+ exports.updateSlimPatientThreshold = updateSlimPatientThreshold;
36
+ exports.getSlimThresholdV2 = getSlimThresholdV2;
37
+ exports.updateSlimThresholdV2 = updateSlimThresholdV2;
38
+ exports.getSlimPatientThresholdV2 = getSlimPatientThresholdV2;
39
+ exports.updateSlimPatientThresholdV2 = updateSlimPatientThresholdV2;
40
+ exports.getSlimTrends = getSlimTrends;
41
+ exports.getSlimSleepStatistics = getSlimSleepStatistics;
42
+ exports.listSlimLocations = listSlimLocations;
43
+ exports.getSlimLocation = getSlimLocation;
44
+ exports.createSlimLocation = createSlimLocation;
45
+ exports.updateSlimLocation = updateSlimLocation;
46
+ exports.deleteSlimLocation = deleteSlimLocation;
47
+ exports.listSlimZones = listSlimZones;
48
+ exports.getSlimZone = getSlimZone;
49
+ exports.getSlimZoneDeviceCounts = getSlimZoneDeviceCounts;
50
+ exports.exportSlimPatientPdf = exportSlimPatientPdf;
51
+ const query = (params) => {
52
+ const values = new URLSearchParams();
53
+ for (const [key, value] of Object.entries(params)) {
54
+ if (value !== undefined) {
55
+ values.set(key, String(value));
56
+ }
57
+ }
58
+ const encoded = values.toString();
59
+ return encoded === "" ? "" : `?${encoded}`;
60
+ };
61
+ const segment = (value) => encodeURIComponent(value);
62
+ async function listSlimPatients(params = {}) {
63
+ return this.get(`/v1/slim/patient${query(params)}`);
64
+ }
65
+ async function getSlimPatient(patientId) {
66
+ return this.get(`/v1/slim/patient/${segment(patientId)}`);
67
+ }
68
+ async function getSlimPatientEverything(patientId) {
69
+ return this.get(`/v1/slim/patient/${segment(patientId)}/$everything`);
70
+ }
71
+ async function getSlimPatientCurrentVitals(patientId) {
72
+ return this.get(`/v1/slim/patient/${segment(patientId)}/current-vitals`);
73
+ }
74
+ async function createSlimPatient(body) {
75
+ return this.post("/v1/slim/patient", body);
76
+ }
77
+ async function updateSlimPatient(patientId, body) {
78
+ return (await this.put(`/v1/slim/patient/${segment(patientId)}`, body));
79
+ }
80
+ async function deleteSlimPatient(patientId) {
81
+ await this.delete(`/v1/slim/patient/${segment(patientId)}`);
82
+ }
83
+ async function listSlimDevices(params = {}) {
84
+ return this.get(`/v1/slim/device${query(params)}`);
85
+ }
86
+ async function getSlimDevice(deviceId) {
87
+ return this.get(`/v1/slim/device/${segment(deviceId)}`);
88
+ }
89
+ async function createSlimDevice(body) {
90
+ return this.post("/v1/slim/device", body);
91
+ }
92
+ async function updateSlimDevice(deviceId, body) {
93
+ return (await this.put(`/v1/slim/device/${segment(deviceId)}`, body));
94
+ }
95
+ async function deleteSlimDevice(deviceId) {
96
+ await this.delete(`/v1/slim/device/${segment(deviceId)}`);
97
+ }
98
+ async function assignSlimDeviceToProject(body) {
99
+ return (await this.put("/v1/slim/device/assign/project", body));
100
+ }
101
+ async function listSlimLiveDevices(params = {}) {
102
+ return this.get(`/v1/slim/device/live${query(params)}`);
103
+ }
104
+ async function listSlimLiveTelemetry(params = {}) {
105
+ return this.get(`/v1/slim/device/live/telemetry${query(params)}`);
106
+ }
107
+ async function getSlimDeviceSleepStatus(deviceId) {
108
+ return this.get(`/v1/slim/device/live/cloudwatch/${segment(deviceId)}`);
109
+ }
110
+ async function getSlimDeviceTelemetry(deviceId) {
111
+ return this.get(`/v1/slim/telemetry/${segment(deviceId)}`);
112
+ }
113
+ async function listSlimEffectiveObservationIds() {
114
+ return this.get("/v1/slim/telemetry/effectiveIds");
115
+ }
116
+ async function listSlimLastObservationIds() {
117
+ return this.get("/v1/slim/telemetry/lastIds");
118
+ }
119
+ async function getSlimDeviceEffectiveObservationIds(deviceId) {
120
+ return this.get(`/v1/slim/telemetry/${segment(deviceId)}/effectiveIds`);
121
+ }
122
+ async function getSlimDeviceLastObservationIds(deviceId) {
123
+ return this.get(`/v1/slim/telemetry/${segment(deviceId)}/lastIds`);
124
+ }
125
+ async function listSlimNotifications(params = {}) {
126
+ return this.get(`/v1/slim/notifications${query(params)}`);
127
+ }
128
+ async function getRecentSlimNotifications(count) {
129
+ return this.get(`/v1/slim/notifications/recent${query({ count })}`);
130
+ }
131
+ async function listSlimOutOfBedNotifications(params = {}) {
132
+ return this.get(`/v1/slim/notifications/oob${query(params)}`);
133
+ }
134
+ async function listSlimMedicalNotifications(params = {}) {
135
+ return this.get(`/v1/slim/notifications/medical${query(params)}`);
136
+ }
137
+ async function getRecentSlimMedicalNotifications(count) {
138
+ return this.get(`/v1/slim/notifications/recent/medical${query({ count })}`);
139
+ }
140
+ async function getSlimMedicalNotification(episodeId) {
141
+ return this.get(`/v1/slim/notifications/medical/${segment(episodeId)}`);
142
+ }
143
+ async function acknowledgeSlimMedicalNotification(episodeId) {
144
+ return this.post(`/v1/slim/notifications/medical/${segment(episodeId)}/ack`);
145
+ }
146
+ async function acknowledgeSlimNotification(notificationId) {
147
+ return (await this.patch(`/v1/slim/notifications/${segment(notificationId)}/ack`, []));
148
+ }
149
+ async function getSlimThreshold() {
150
+ return this.get("/v1/slim/threshold");
151
+ }
152
+ async function updateSlimThreshold(body) {
153
+ return (await this.put("/v1/slim/threshold", body));
154
+ }
155
+ async function getSlimPatientThreshold(patientId) {
156
+ return this.get(`/v1/slim/threshold/patient/${segment(patientId)}`);
157
+ }
158
+ async function updateSlimPatientThreshold(patientId, body) {
159
+ return (await this.put(`/v1/slim/threshold/patient/${segment(patientId)}`, body));
160
+ }
161
+ async function getSlimThresholdV2() {
162
+ return this.get("/v2/slim/threshold");
163
+ }
164
+ async function updateSlimThresholdV2(body) {
165
+ return (await this.put("/v2/slim/threshold", body));
166
+ }
167
+ async function getSlimPatientThresholdV2(patientId) {
168
+ return this.get(`/v2/slim/threshold/patient/${segment(patientId)}`);
169
+ }
170
+ async function updateSlimPatientThresholdV2(patientId, body) {
171
+ return (await this.put(`/v2/slim/threshold/patient/${segment(patientId)}`, body));
172
+ }
173
+ async function getSlimTrends(params) {
174
+ return this.get(`/v1/slim/trends/graphs${query(params)}`);
175
+ }
176
+ async function getSlimSleepStatistics(params) {
177
+ return this.get(`/v1/slim/sleep/statistics${query(params)}`);
178
+ }
179
+ async function listSlimLocations(params = {}) {
180
+ return this.get(`/v1/slim/location${query(params)}`);
181
+ }
182
+ async function getSlimLocation(locationId) {
183
+ return this.get(`/v1/slim/location/${segment(locationId)}`);
184
+ }
185
+ async function createSlimLocation(body) {
186
+ return this.post("/v1/slim/location", body);
187
+ }
188
+ async function updateSlimLocation(locationId, body) {
189
+ return (await this.put(`/v1/slim/location/${segment(locationId)}`, body));
190
+ }
191
+ async function deleteSlimLocation(locationId) {
192
+ await this.delete(`/v1/slim/location/${segment(locationId)}`);
193
+ }
194
+ async function listSlimZones(params = {}) {
195
+ return this.get(`/v1/slim/zones${query(params)}`);
196
+ }
197
+ async function getSlimZone(zoneId) {
198
+ return this.get(`/v1/slim/zones/${segment(zoneId)}`);
199
+ }
200
+ async function getSlimZoneDeviceCounts(params = {}) {
201
+ return this.get(`/v1/slim/zones/device-counts${query(params)}`);
202
+ }
203
+ async function exportSlimPatientPdf(body) {
204
+ return this.post("/v1/slim/export/pdf", body);
205
+ }