@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.
@@ -1,5 +1,7 @@
1
- import { EnableSignalsResponse, SetSignalsThresholdBody, SignalsAlert, SignalsAlertsQuery, SignalsSettingsPatch, SignalsSettingsResponse, SignalsThreshold, SignalsThresholds } from "../client/signals";
1
+ import { EnableSignalsResponse, SetSignalsThresholdBody, SignalsSettingsPatch, SignalsSettingsResponse, SignalsThreshold, SignalsThresholds } from "../client/signals";
2
2
  import { OvokMutationState, OvokRequestState } from "./api-hooks";
3
+ export { useAcknowledgeSignalsAlert, useSignalsAlert, useSignalsAlerts, } from "./signals-alert-hooks";
4
+ export type { SignalsAlertGrain, SignalsAlertsHookState } from "./signals-alert-hooks";
3
5
  type SetSignalsThresholdParams = {
4
6
  patientId: string;
5
7
  code: string;
@@ -14,22 +16,9 @@ type UpdateSignalsSettingsParams = {
14
16
  patch: SignalsSettingsPatch;
15
17
  reason?: string | null;
16
18
  };
17
- type SignalsAlertsHookQuery = Omit<SignalsAlertsQuery, "cursor">;
18
- export type SignalsAlertsHookState = {
19
- items: SignalsAlert[];
20
- loading: boolean;
21
- error: Error | undefined;
22
- reload: () => void;
23
- hasMore: boolean;
24
- loadMore: () => Promise<void>;
25
- };
26
19
  export declare const useEnableSignalsForPatient: () => OvokMutationState<string, EnableSignalsResponse>;
27
20
  export declare const useSignalsThresholds: (patientId?: string) => OvokRequestState<SignalsThresholds>;
28
21
  export declare const useSetSignalsThreshold: () => OvokMutationState<SetSignalsThresholdParams, SignalsThreshold>;
29
22
  export declare const useRemoveSignalsThreshold: () => OvokMutationState<RemoveSignalsThresholdParams, void>;
30
- export declare const useSignalsAlerts: (query?: SignalsAlertsHookQuery) => SignalsAlertsHookState;
31
- export declare const useSignalsAlert: (episodeId?: string) => OvokRequestState<SignalsAlert>;
32
- export declare const useAcknowledgeSignalsAlert: () => OvokMutationState<string, SignalsAlert>;
33
23
  export declare const useSignalsSettings: () => OvokRequestState<SignalsSettingsResponse>;
34
24
  export declare const useUpdateSignalsSettings: () => OvokMutationState<UpdateSignalsSettingsParams, SignalsSettingsResponse>;
35
- export {};
@@ -34,10 +34,14 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.useUpdateSignalsSettings = exports.useSignalsSettings = exports.useAcknowledgeSignalsAlert = exports.useSignalsAlert = exports.useSignalsAlerts = exports.useRemoveSignalsThreshold = exports.useSetSignalsThreshold = exports.useSignalsThresholds = exports.useEnableSignalsForPatient = void 0;
37
+ exports.useUpdateSignalsSettings = exports.useSignalsSettings = exports.useRemoveSignalsThreshold = exports.useSetSignalsThreshold = exports.useSignalsThresholds = exports.useEnableSignalsForPatient = exports.useSignalsAlerts = exports.useSignalsAlert = exports.useAcknowledgeSignalsAlert = void 0;
38
38
  const React = __importStar(require("react"));
39
39
  const api_hooks_1 = require("./api-hooks");
40
40
  const index_1 = require("./index");
41
+ var signals_alert_hooks_1 = require("./signals-alert-hooks");
42
+ Object.defineProperty(exports, "useAcknowledgeSignalsAlert", { enumerable: true, get: function () { return signals_alert_hooks_1.useAcknowledgeSignalsAlert; } });
43
+ Object.defineProperty(exports, "useSignalsAlert", { enumerable: true, get: function () { return signals_alert_hooks_1.useSignalsAlert; } });
44
+ Object.defineProperty(exports, "useSignalsAlerts", { enumerable: true, get: function () { return signals_alert_hooks_1.useSignalsAlerts; } });
41
45
  const useEnableSignalsForPatient = () => (0, api_hooks_1.useOvokMutation)((client, patientId) => client.enableSignalsForPatient(patientId));
42
46
  exports.useEnableSignalsForPatient = useEnableSignalsForPatient;
43
47
  const useSignalsThresholds = (patientId) => {
@@ -50,99 +54,6 @@ const useSetSignalsThreshold = () => (0, api_hooks_1.useOvokMutation)((client, p
50
54
  exports.useSetSignalsThreshold = useSetSignalsThreshold;
51
55
  const useRemoveSignalsThreshold = () => (0, api_hooks_1.useOvokMutation)((client, params) => client.removeSignalsThreshold(params.patientId, params.code, params.reason));
52
56
  exports.useRemoveSignalsThreshold = useRemoveSignalsThreshold;
53
- const useSignalsAlerts = (query = {}) => {
54
- const client = (0, index_1.useClient)();
55
- const queryKey = JSON.stringify(query);
56
- const querySnapshot = React.useMemo(() => JSON.parse(queryKey), [queryKey]);
57
- const [items, setItems] = React.useState([]);
58
- const [nextCursor, setNextCursor] = React.useState(null);
59
- const [loading, setLoading] = React.useState(true);
60
- const [error, setError] = React.useState();
61
- const [revision, setRevision] = React.useState(0);
62
- const generation = React.useRef(0);
63
- const loadingRef = React.useRef(false);
64
- React.useEffect(() => {
65
- const requestGeneration = generation.current + 1;
66
- generation.current = requestGeneration;
67
- loadingRef.current = true;
68
- setItems([]);
69
- setNextCursor(null);
70
- setError(undefined);
71
- setLoading(true);
72
- client
73
- .listSignalsAlerts(querySnapshot)
74
- .then((page) => {
75
- if (generation.current === requestGeneration) {
76
- setItems(page.items);
77
- setNextCursor(page.nextCursor);
78
- }
79
- })
80
- .catch((reason) => {
81
- if (generation.current === requestGeneration) {
82
- setError(toError(reason));
83
- }
84
- })
85
- .finally(() => {
86
- if (generation.current === requestGeneration) {
87
- loadingRef.current = false;
88
- setLoading(false);
89
- }
90
- });
91
- return () => {
92
- generation.current += 1;
93
- };
94
- }, [client, queryKey, querySnapshot, revision]);
95
- const loadMore = React.useCallback(async () => {
96
- if (nextCursor === null || loadingRef.current) {
97
- return;
98
- }
99
- const requestGeneration = generation.current;
100
- loadingRef.current = true;
101
- setLoading(true);
102
- setError(undefined);
103
- try {
104
- const page = await client.listSignalsAlerts({
105
- ...querySnapshot,
106
- cursor: nextCursor,
107
- });
108
- if (generation.current === requestGeneration) {
109
- setItems((current) => [...current, ...page.items]);
110
- setNextCursor(page.nextCursor);
111
- }
112
- }
113
- catch (reason) {
114
- if (generation.current === requestGeneration) {
115
- setError(toError(reason));
116
- }
117
- }
118
- finally {
119
- if (generation.current === requestGeneration) {
120
- loadingRef.current = false;
121
- setLoading(false);
122
- }
123
- }
124
- }, [client, nextCursor, querySnapshot]);
125
- const reload = React.useCallback(() => {
126
- setRevision((current) => current + 1);
127
- }, []);
128
- return {
129
- items,
130
- loading,
131
- error,
132
- reload,
133
- hasMore: nextCursor !== null,
134
- loadMore,
135
- };
136
- };
137
- exports.useSignalsAlerts = useSignalsAlerts;
138
- const useSignalsAlert = (episodeId) => {
139
- const client = (0, index_1.useClient)();
140
- const load = React.useCallback(() => client.getSignalsAlert(episodeId), [client, episodeId]);
141
- return (0, api_hooks_1.useOvokRequest)(load, episodeId !== undefined);
142
- };
143
- exports.useSignalsAlert = useSignalsAlert;
144
- const useAcknowledgeSignalsAlert = () => (0, api_hooks_1.useOvokMutation)((client, episodeId) => client.acknowledgeSignalsAlert(episodeId));
145
- exports.useAcknowledgeSignalsAlert = useAcknowledgeSignalsAlert;
146
57
  const useSignalsSettings = () => {
147
58
  const client = (0, index_1.useClient)();
148
59
  const load = React.useCallback(() => client.getSignalsSettings(), [client]);
@@ -151,4 +62,3 @@ const useSignalsSettings = () => {
151
62
  exports.useSignalsSettings = useSignalsSettings;
152
63
  const useUpdateSignalsSettings = () => (0, api_hooks_1.useOvokMutation)((client, params) => client.updateSignalsSettings(params.patch, params.reason));
153
64
  exports.useUpdateSignalsSettings = useUpdateSignalsSettings;
154
- const toError = (error) => error instanceof Error ? error : new Error(String(error));
package/dist/index.d.ts CHANGED
@@ -942,7 +942,7 @@ export * from "./conformance/capability";
942
942
  export * from "./client/platform/types";
943
943
  export * from "./client/email";
944
944
  export * from "./client/invites";
945
- export * from "./client/carehub/types";
945
+ export * from "./client/slim/types";
946
946
  export * from "./client/experience/types";
947
947
  export * from "./client/patient/types";
948
948
  export * from "./client/patient-sharing";
package/dist/index.js CHANGED
@@ -63,7 +63,7 @@ __exportStar(require("./conformance/capability"), exports);
63
63
  __exportStar(require("./client/platform/types"), exports);
64
64
  __exportStar(require("./client/email"), exports);
65
65
  __exportStar(require("./client/invites"), exports);
66
- __exportStar(require("./client/carehub/types"), exports);
66
+ __exportStar(require("./client/slim/types"), exports);
67
67
  __exportStar(require("./client/experience/types"), exports);
68
68
  __exportStar(require("./client/patient/types"), exports);
69
69
  __exportStar(require("./client/patient-sharing"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ovok/core",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,71 +0,0 @@
1
- import { Bundle, Resource } from "@medplum/fhirtypes";
2
- import { OvokClient } from "../ovok-client";
3
- import { CarehubAssignDevice, CarehubCreateDevice, CarehubCreateLocation, CarehubCreatePatient, CarehubDevice, CarehubDeviceListItem, CarehubDeviceListQuery, CarehubDeviceTelemetry, CarehubExportPdf, CarehubExportPdfRequest, CarehubLiveQuery, CarehubLiveTelemetry, CarehubLocation, CarehubLocationQuery, CarehubNotification, CarehubNotificationsQuery, CarehubNotificationsResponse, CarehubObservationIds, CarehubPage, CarehubPatient, CarehubPatientListItem, CarehubPatientListQuery, CarehubRecentNotificationsResponse, CarehubSleepStatistics, CarehubThreshold, CarehubTrends, CarehubUpdateDevice, CarehubUpdateLocation, CarehubUpdatePatient, CarehubZone, CarehubZoneDetail } from "./types";
4
- export declare function listCarehubPatients(this: OvokClient, params?: CarehubPatientListQuery): Promise<CarehubPage<CarehubPatientListItem>>;
5
- export declare function getCarehubPatient(this: OvokClient, patientId: string): Promise<CarehubPatient>;
6
- export declare function getCarehubPatientEverything(this: OvokClient, patientId: string): Promise<Bundle<Resource>>;
7
- export declare function getCarehubPatientCurrentVitals(this: OvokClient, patientId: string): Promise<Record<string, unknown>>;
8
- export declare function createCarehubPatient(this: OvokClient, body: CarehubCreatePatient): Promise<CarehubPatient>;
9
- export declare function updateCarehubPatient(this: OvokClient, patientId: string, body: CarehubUpdatePatient): Promise<CarehubPatient>;
10
- export declare function deleteCarehubPatient(this: OvokClient, patientId: string): Promise<void>;
11
- export declare function listCarehubDevices(this: OvokClient, params?: CarehubDeviceListQuery): Promise<CarehubPage<CarehubDeviceListItem>>;
12
- export declare function getCarehubDevice(this: OvokClient, deviceId: string): Promise<CarehubDevice>;
13
- export declare function createCarehubDevice(this: OvokClient, body: CarehubCreateDevice): Promise<CarehubDevice>;
14
- export declare function updateCarehubDevice(this: OvokClient, deviceId: string, body: CarehubUpdateDevice): Promise<CarehubDevice>;
15
- export declare function deleteCarehubDevice(this: OvokClient, deviceId: string): Promise<void>;
16
- export declare function assignCarehubDeviceToProject(this: OvokClient, body: CarehubAssignDevice): Promise<CarehubDevice>;
17
- export declare function listCarehubLiveDevices(this: OvokClient, params?: CarehubLiveQuery): Promise<CarehubPage<Record<string, unknown>>>;
18
- export declare function listCarehubLiveTelemetry(this: OvokClient, params?: CarehubLiveQuery): Promise<CarehubLiveTelemetry>;
19
- export declare function getCarehubDeviceSleepStatus(this: OvokClient, deviceId: string): Promise<Record<string, unknown>>;
20
- export declare function getCarehubDeviceTelemetry(this: OvokClient, deviceId: string): Promise<CarehubDeviceTelemetry>;
21
- export declare function listCarehubEffectiveObservationIds(this: OvokClient): Promise<Record<string, CarehubObservationIds>>;
22
- export declare function listCarehubLastObservationIds(this: OvokClient): Promise<Record<string, CarehubObservationIds>>;
23
- export declare function getCarehubDeviceEffectiveObservationIds(this: OvokClient, deviceId: string): Promise<Omit<CarehubObservationIds, "batch">>;
24
- export declare function getCarehubDeviceLastObservationIds(this: OvokClient, deviceId: string): Promise<CarehubObservationIds>;
25
- export declare function listCarehubNotifications(this: OvokClient, params?: CarehubNotificationsQuery): Promise<CarehubNotificationsResponse>;
26
- export declare function getRecentCarehubNotifications(this: OvokClient, count?: number): Promise<CarehubRecentNotificationsResponse>;
27
- export declare function listCarehubOutOfBedNotifications(this: OvokClient, params?: Omit<CarehubNotificationsQuery, "type">): Promise<CarehubNotificationsResponse>;
28
- export declare function listCarehubMedicalNotifications(this: OvokClient, params?: CarehubNotificationsQuery): Promise<CarehubNotificationsResponse>;
29
- export declare function getRecentCarehubMedicalNotifications(this: OvokClient, count?: number): Promise<CarehubRecentNotificationsResponse>;
30
- export declare function getCarehubMedicalNotification(this: OvokClient, episodeId: string): Promise<CarehubNotification>;
31
- export declare function acknowledgeCarehubMedicalNotification(this: OvokClient, episodeId: string): Promise<CarehubNotification>;
32
- export declare function acknowledgeCarehubNotification(this: OvokClient, notificationId: string): Promise<CarehubNotification>;
33
- export declare function getCarehubThreshold(this: OvokClient): Promise<CarehubThreshold>;
34
- export declare function updateCarehubThreshold(this: OvokClient, body: Record<string, unknown>): Promise<CarehubThreshold>;
35
- export declare function getCarehubPatientThreshold(this: OvokClient, patientId: string): Promise<Record<string, unknown>>;
36
- export declare function updateCarehubPatientThreshold(this: OvokClient, patientId: string, body: Record<string, unknown>): Promise<Record<string, unknown>>;
37
- export declare function getCarehubThresholdV2(this: OvokClient): Promise<Record<string, unknown>>;
38
- export declare function updateCarehubThresholdV2(this: OvokClient, body: Record<string, unknown>): Promise<Record<string, unknown>>;
39
- export declare function getCarehubPatientThresholdV2(this: OvokClient, patientId: string): Promise<Record<string, unknown>>;
40
- export declare function updateCarehubPatientThresholdV2(this: OvokClient, patientId: string, body: Record<string, unknown>): Promise<Record<string, unknown>>;
41
- export declare function getCarehubTrends(this: OvokClient, params: {
42
- patientId: string;
43
- startDate: string;
44
- endDate: string;
45
- graphType: string;
46
- }): Promise<CarehubTrends>;
47
- export declare function getCarehubSleepStatistics(this: OvokClient, params: {
48
- endDate: string;
49
- lastDayCount?: number;
50
- patientId: string;
51
- }): Promise<CarehubSleepStatistics>;
52
- export declare function listCarehubLocations(this: OvokClient, params?: CarehubLocationQuery): Promise<CarehubPage<CarehubLocation>>;
53
- export declare function getCarehubLocation(this: OvokClient, locationId: string): Promise<CarehubLocation>;
54
- export declare function createCarehubLocation(this: OvokClient, body: CarehubCreateLocation): Promise<CarehubLocation>;
55
- export declare function updateCarehubLocation(this: OvokClient, locationId: string, body: CarehubUpdateLocation): Promise<CarehubLocation>;
56
- export declare function deleteCarehubLocation(this: OvokClient, locationId: string): Promise<void>;
57
- export declare function listCarehubZones(this: OvokClient, params?: {
58
- page?: number;
59
- count?: number;
60
- sortBy?: string;
61
- orderBy?: "ASC" | "DESC";
62
- search?: string;
63
- }): Promise<CarehubPage<CarehubZone>>;
64
- export declare function getCarehubZone(this: OvokClient, zoneId: string): Promise<CarehubZoneDetail>;
65
- export declare function getCarehubZoneDeviceCounts(this: OvokClient, params?: {
66
- all?: boolean;
67
- effectiveSleepStatus?: string;
68
- includeUnassigned?: boolean;
69
- includeEmpty?: boolean;
70
- }): Promise<Record<string, unknown>>;
71
- export declare function exportCarehubPatientPdf(this: OvokClient, body: CarehubExportPdfRequest): Promise<CarehubExportPdf>;
@@ -1,205 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listCarehubPatients = listCarehubPatients;
4
- exports.getCarehubPatient = getCarehubPatient;
5
- exports.getCarehubPatientEverything = getCarehubPatientEverything;
6
- exports.getCarehubPatientCurrentVitals = getCarehubPatientCurrentVitals;
7
- exports.createCarehubPatient = createCarehubPatient;
8
- exports.updateCarehubPatient = updateCarehubPatient;
9
- exports.deleteCarehubPatient = deleteCarehubPatient;
10
- exports.listCarehubDevices = listCarehubDevices;
11
- exports.getCarehubDevice = getCarehubDevice;
12
- exports.createCarehubDevice = createCarehubDevice;
13
- exports.updateCarehubDevice = updateCarehubDevice;
14
- exports.deleteCarehubDevice = deleteCarehubDevice;
15
- exports.assignCarehubDeviceToProject = assignCarehubDeviceToProject;
16
- exports.listCarehubLiveDevices = listCarehubLiveDevices;
17
- exports.listCarehubLiveTelemetry = listCarehubLiveTelemetry;
18
- exports.getCarehubDeviceSleepStatus = getCarehubDeviceSleepStatus;
19
- exports.getCarehubDeviceTelemetry = getCarehubDeviceTelemetry;
20
- exports.listCarehubEffectiveObservationIds = listCarehubEffectiveObservationIds;
21
- exports.listCarehubLastObservationIds = listCarehubLastObservationIds;
22
- exports.getCarehubDeviceEffectiveObservationIds = getCarehubDeviceEffectiveObservationIds;
23
- exports.getCarehubDeviceLastObservationIds = getCarehubDeviceLastObservationIds;
24
- exports.listCarehubNotifications = listCarehubNotifications;
25
- exports.getRecentCarehubNotifications = getRecentCarehubNotifications;
26
- exports.listCarehubOutOfBedNotifications = listCarehubOutOfBedNotifications;
27
- exports.listCarehubMedicalNotifications = listCarehubMedicalNotifications;
28
- exports.getRecentCarehubMedicalNotifications = getRecentCarehubMedicalNotifications;
29
- exports.getCarehubMedicalNotification = getCarehubMedicalNotification;
30
- exports.acknowledgeCarehubMedicalNotification = acknowledgeCarehubMedicalNotification;
31
- exports.acknowledgeCarehubNotification = acknowledgeCarehubNotification;
32
- exports.getCarehubThreshold = getCarehubThreshold;
33
- exports.updateCarehubThreshold = updateCarehubThreshold;
34
- exports.getCarehubPatientThreshold = getCarehubPatientThreshold;
35
- exports.updateCarehubPatientThreshold = updateCarehubPatientThreshold;
36
- exports.getCarehubThresholdV2 = getCarehubThresholdV2;
37
- exports.updateCarehubThresholdV2 = updateCarehubThresholdV2;
38
- exports.getCarehubPatientThresholdV2 = getCarehubPatientThresholdV2;
39
- exports.updateCarehubPatientThresholdV2 = updateCarehubPatientThresholdV2;
40
- exports.getCarehubTrends = getCarehubTrends;
41
- exports.getCarehubSleepStatistics = getCarehubSleepStatistics;
42
- exports.listCarehubLocations = listCarehubLocations;
43
- exports.getCarehubLocation = getCarehubLocation;
44
- exports.createCarehubLocation = createCarehubLocation;
45
- exports.updateCarehubLocation = updateCarehubLocation;
46
- exports.deleteCarehubLocation = deleteCarehubLocation;
47
- exports.listCarehubZones = listCarehubZones;
48
- exports.getCarehubZone = getCarehubZone;
49
- exports.getCarehubZoneDeviceCounts = getCarehubZoneDeviceCounts;
50
- exports.exportCarehubPatientPdf = exportCarehubPatientPdf;
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 listCarehubPatients(params = {}) {
63
- return this.get(`/v1/slim/patient${query(params)}`);
64
- }
65
- async function getCarehubPatient(patientId) {
66
- return this.get(`/v1/slim/patient/${segment(patientId)}`);
67
- }
68
- async function getCarehubPatientEverything(patientId) {
69
- return this.get(`/v1/slim/patient/${segment(patientId)}/$everything`);
70
- }
71
- async function getCarehubPatientCurrentVitals(patientId) {
72
- return this.get(`/v1/slim/patient/${segment(patientId)}/current-vitals`);
73
- }
74
- async function createCarehubPatient(body) {
75
- return this.post("/v1/slim/patient", body);
76
- }
77
- async function updateCarehubPatient(patientId, body) {
78
- return (await this.put(`/v1/slim/patient/${segment(patientId)}`, body));
79
- }
80
- async function deleteCarehubPatient(patientId) {
81
- await this.delete(`/v1/slim/patient/${segment(patientId)}`);
82
- }
83
- async function listCarehubDevices(params = {}) {
84
- return this.get(`/v1/slim/device${query(params)}`);
85
- }
86
- async function getCarehubDevice(deviceId) {
87
- return this.get(`/v1/slim/device/${segment(deviceId)}`);
88
- }
89
- async function createCarehubDevice(body) {
90
- return this.post("/v1/slim/device", body);
91
- }
92
- async function updateCarehubDevice(deviceId, body) {
93
- return (await this.put(`/v1/slim/device/${segment(deviceId)}`, body));
94
- }
95
- async function deleteCarehubDevice(deviceId) {
96
- await this.delete(`/v1/slim/device/${segment(deviceId)}`);
97
- }
98
- async function assignCarehubDeviceToProject(body) {
99
- return (await this.put("/v1/slim/device/assign/project", body));
100
- }
101
- async function listCarehubLiveDevices(params = {}) {
102
- return this.get(`/v1/slim/device/live${query(params)}`);
103
- }
104
- async function listCarehubLiveTelemetry(params = {}) {
105
- return this.get(`/v1/slim/device/live/telemetry${query(params)}`);
106
- }
107
- async function getCarehubDeviceSleepStatus(deviceId) {
108
- return this.get(`/v1/slim/device/live/cloudwatch/${segment(deviceId)}`);
109
- }
110
- async function getCarehubDeviceTelemetry(deviceId) {
111
- return this.get(`/v1/slim/telemetry/${segment(deviceId)}`);
112
- }
113
- async function listCarehubEffectiveObservationIds() {
114
- return this.get("/v1/slim/telemetry/effectiveIds");
115
- }
116
- async function listCarehubLastObservationIds() {
117
- return this.get("/v1/slim/telemetry/lastIds");
118
- }
119
- async function getCarehubDeviceEffectiveObservationIds(deviceId) {
120
- return this.get(`/v1/slim/telemetry/${segment(deviceId)}/effectiveIds`);
121
- }
122
- async function getCarehubDeviceLastObservationIds(deviceId) {
123
- return this.get(`/v1/slim/telemetry/${segment(deviceId)}/lastIds`);
124
- }
125
- async function listCarehubNotifications(params = {}) {
126
- return this.get(`/v1/slim/notifications${query(params)}`);
127
- }
128
- async function getRecentCarehubNotifications(count) {
129
- return this.get(`/v1/slim/notifications/recent${query({ count })}`);
130
- }
131
- async function listCarehubOutOfBedNotifications(params = {}) {
132
- return this.get(`/v1/slim/notifications/oob${query(params)}`);
133
- }
134
- async function listCarehubMedicalNotifications(params = {}) {
135
- return this.get(`/v1/slim/notifications/medical${query(params)}`);
136
- }
137
- async function getRecentCarehubMedicalNotifications(count) {
138
- return this.get(`/v1/slim/notifications/recent/medical${query({ count })}`);
139
- }
140
- async function getCarehubMedicalNotification(episodeId) {
141
- return this.get(`/v1/slim/notifications/medical/${segment(episodeId)}`);
142
- }
143
- async function acknowledgeCarehubMedicalNotification(episodeId) {
144
- return this.post(`/v1/slim/notifications/medical/${segment(episodeId)}/ack`);
145
- }
146
- async function acknowledgeCarehubNotification(notificationId) {
147
- return (await this.patch(`/v1/slim/notifications/${segment(notificationId)}/ack`, []));
148
- }
149
- async function getCarehubThreshold() {
150
- return this.get("/v1/slim/threshold");
151
- }
152
- async function updateCarehubThreshold(body) {
153
- return (await this.put("/v1/slim/threshold", body));
154
- }
155
- async function getCarehubPatientThreshold(patientId) {
156
- return this.get(`/v1/slim/threshold/patient/${segment(patientId)}`);
157
- }
158
- async function updateCarehubPatientThreshold(patientId, body) {
159
- return (await this.put(`/v1/slim/threshold/patient/${segment(patientId)}`, body));
160
- }
161
- async function getCarehubThresholdV2() {
162
- return this.get("/v2/slim/threshold");
163
- }
164
- async function updateCarehubThresholdV2(body) {
165
- return (await this.put("/v2/slim/threshold", body));
166
- }
167
- async function getCarehubPatientThresholdV2(patientId) {
168
- return this.get(`/v2/slim/threshold/patient/${segment(patientId)}`);
169
- }
170
- async function updateCarehubPatientThresholdV2(patientId, body) {
171
- return (await this.put(`/v2/slim/threshold/patient/${segment(patientId)}`, body));
172
- }
173
- async function getCarehubTrends(params) {
174
- return this.get(`/v1/slim/trends/graphs${query(params)}`);
175
- }
176
- async function getCarehubSleepStatistics(params) {
177
- return this.get(`/v1/slim/sleep/statistics${query(params)}`);
178
- }
179
- async function listCarehubLocations(params = {}) {
180
- return this.get(`/v1/slim/location${query(params)}`);
181
- }
182
- async function getCarehubLocation(locationId) {
183
- return this.get(`/v1/slim/location/${segment(locationId)}`);
184
- }
185
- async function createCarehubLocation(body) {
186
- return this.post("/v1/slim/location", body);
187
- }
188
- async function updateCarehubLocation(locationId, body) {
189
- return (await this.put(`/v1/slim/location/${segment(locationId)}`, body));
190
- }
191
- async function deleteCarehubLocation(locationId) {
192
- await this.delete(`/v1/slim/location/${segment(locationId)}`);
193
- }
194
- async function listCarehubZones(params = {}) {
195
- return this.get(`/v1/slim/zones${query(params)}`);
196
- }
197
- async function getCarehubZone(zoneId) {
198
- return this.get(`/v1/slim/zones/${segment(zoneId)}`);
199
- }
200
- async function getCarehubZoneDeviceCounts(params = {}) {
201
- return this.get(`/v1/slim/zones/device-counts${query(params)}`);
202
- }
203
- async function exportCarehubPatientPdf(body) {
204
- return this.post("/v1/slim/export/pdf", body);
205
- }
File without changes