@ovok/core 0.4.6 → 0.4.8

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.
@@ -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
+ }
@@ -1,18 +1,18 @@
1
- export type CarehubPage<T> = {
1
+ export type SlimPage<T> = {
2
2
  total: number;
3
3
  page: number;
4
4
  count: number;
5
5
  resources: T[];
6
6
  };
7
- export type CarehubResidentState = "active" | "archived" | "discharged" | "discharged-recent";
8
- export type CarehubHumanName = {
7
+ export type SlimResidentState = "active" | "archived" | "discharged" | "discharged-recent";
8
+ export type SlimHumanName = {
9
9
  use: "official" | "nickname" | "maiden";
10
10
  given?: string[];
11
11
  family?: string;
12
12
  };
13
- export type CarehubPatient = {
13
+ export type SlimPatient = {
14
14
  id: string;
15
- name: CarehubHumanName[];
15
+ name: SlimHumanName[];
16
16
  gender?: "male" | "female" | "other" | "unknown";
17
17
  birthDate?: string;
18
18
  deviceId: string | null;
@@ -21,15 +21,15 @@ export type CarehubPatient = {
21
21
  floor?: string;
22
22
  room?: string;
23
23
  bed?: string;
24
- residentState: CarehubResidentState;
24
+ residentState: SlimResidentState;
25
25
  admissionDate?: string;
26
26
  dischargeDate?: string;
27
27
  };
28
- export type CarehubPatientListItem = {
28
+ export type SlimPatientListItem = {
29
29
  id: string;
30
30
  name: string;
31
31
  nickname: string | null;
32
- residentState: CarehubResidentState;
32
+ residentState: SlimResidentState;
33
33
  admissionDate: string | null;
34
34
  dischargeDate: string | null;
35
35
  organizationId: string | null;
@@ -41,21 +41,21 @@ export type CarehubPatientListItem = {
41
41
  medicalSettings: string | null;
42
42
  bedActivitySettings: string | null;
43
43
  };
44
- export type CarehubPatientListQuery = {
44
+ export type SlimPatientListQuery = {
45
45
  page?: number;
46
46
  count?: number;
47
47
  sortBy?: string;
48
48
  orderBy?: "ASC" | "DESC";
49
49
  search?: string;
50
- residentState?: CarehubResidentState | "all";
50
+ residentState?: SlimResidentState | "all";
51
51
  includeDischargedRecent?: boolean;
52
52
  organizationId?: string;
53
53
  hasDevice?: boolean;
54
54
  medicalSettings?: string;
55
55
  bedActivitySettings?: string;
56
56
  };
57
- export type CarehubCreatePatient = {
58
- name: CarehubHumanName[];
57
+ export type SlimCreatePatient = {
58
+ name: SlimHumanName[];
59
59
  gender?: "male" | "female" | "other" | "unknown";
60
60
  birthDate?: string;
61
61
  deviceId?: string | null;
@@ -63,11 +63,11 @@ export type CarehubCreatePatient = {
63
63
  locationId?: string;
64
64
  admissionDate?: string;
65
65
  };
66
- export type CarehubUpdatePatient = Partial<CarehubCreatePatient> & {
67
- residentState?: CarehubResidentState;
66
+ export type SlimUpdatePatient = Partial<SlimCreatePatient> & {
67
+ residentState?: SlimResidentState;
68
68
  dischargeDate?: string;
69
69
  };
70
- export type CarehubDevice = {
70
+ export type SlimDevice = {
71
71
  name: string;
72
72
  status?: "active" | "inactive" | "entered-in-error" | "unknown";
73
73
  statusReason: Array<{
@@ -85,7 +85,7 @@ export type CarehubDevice = {
85
85
  room?: string;
86
86
  bed?: string;
87
87
  };
88
- export type CarehubDeviceListItem = {
88
+ export type SlimDeviceListItem = {
89
89
  id: string;
90
90
  name: string;
91
91
  thingsboardId?: string;
@@ -99,7 +99,7 @@ export type CarehubDeviceListItem = {
99
99
  lastActivityTime?: string | null;
100
100
  createdAt?: string | null;
101
101
  };
102
- export type CarehubDeviceListQuery = {
102
+ export type SlimDeviceListQuery = {
103
103
  page?: number;
104
104
  count?: number;
105
105
  sortBy?: string;
@@ -111,32 +111,32 @@ export type CarehubDeviceListQuery = {
111
111
  patientId?: string;
112
112
  active?: boolean;
113
113
  };
114
- export type CarehubCreateDevice = {
114
+ export type SlimCreateDevice = {
115
115
  name: string;
116
116
  thingsboardId?: string;
117
117
  organizationId?: string;
118
118
  locationId?: string;
119
119
  patientId?: string;
120
120
  };
121
- export type CarehubUpdateDevice = {
121
+ export type SlimUpdateDevice = {
122
122
  name: string;
123
123
  thingsboardId?: string;
124
124
  organizationId?: string | null;
125
125
  locationId?: string | null;
126
126
  patientId?: string | null;
127
127
  };
128
- export type CarehubAssignDevice = {
128
+ export type SlimAssignDevice = {
129
129
  deviceId: string;
130
130
  projectId: string;
131
131
  locationId?: string;
132
132
  };
133
- export type CarehubTelemetryValue = {
133
+ export type SlimTelemetryValue = {
134
134
  value: string | number | boolean | null;
135
135
  ts: number | null;
136
136
  };
137
- export type CarehubTelemetrySummary = Record<string, CarehubTelemetryValue>;
138
- export type CarehubAlertSummary = Record<string, unknown>;
139
- export type CarehubLiveQuery = {
137
+ export type SlimTelemetrySummary = Record<string, SlimTelemetryValue>;
138
+ export type SlimAlertSummary = Record<string, unknown>;
139
+ export type SlimLiveQuery = {
140
140
  page?: number;
141
141
  count?: number;
142
142
  sortBy?: string;
@@ -145,36 +145,36 @@ export type CarehubLiveQuery = {
145
145
  deviceId?: string;
146
146
  organizationId?: string;
147
147
  effectiveSleepStatus?: string;
148
- residentState?: CarehubResidentState;
148
+ residentState?: SlimResidentState;
149
149
  includeUnassigned?: boolean;
150
150
  };
151
- export type CarehubLiveTelemetry = {
151
+ export type SlimLiveTelemetry = {
152
152
  total: number;
153
153
  page: number;
154
154
  count: number;
155
- telemetry: Record<string, CarehubTelemetrySummary>;
156
- alerts: Record<string, CarehubAlertSummary>;
155
+ telemetry: Record<string, SlimTelemetrySummary>;
156
+ alerts: Record<string, SlimAlertSummary>;
157
157
  };
158
- export type CarehubDeviceTelemetry = {
158
+ export type SlimDeviceTelemetry = {
159
159
  deviceId: string;
160
- telemetry?: CarehubTelemetrySummary;
161
- alerts?: CarehubAlertSummary;
160
+ telemetry?: SlimTelemetrySummary;
161
+ alerts?: SlimAlertSummary;
162
162
  };
163
- export type CarehubObservationIds = {
163
+ export type SlimObservationIds = {
164
164
  heartRate: string | null;
165
165
  respiratoryRate: string | null;
166
166
  sleepStatus: string | null;
167
167
  presenceStatus: string | null;
168
168
  batch?: string | null;
169
169
  };
170
- export type CarehubNotification = {
170
+ export type SlimNotification = {
171
171
  commId: string;
172
172
  status: string;
173
173
  authoredOn: string;
174
174
  type: string;
175
175
  [key: string]: unknown;
176
176
  };
177
- export type CarehubNotificationsQuery = {
177
+ export type SlimNotificationsQuery = {
178
178
  patient?: string;
179
179
  device?: string;
180
180
  status?: string;
@@ -185,26 +185,26 @@ export type CarehubNotificationsQuery = {
185
185
  page?: number;
186
186
  count?: number;
187
187
  };
188
- export type CarehubNotificationsResponse = CarehubPage<CarehubNotification> & {
188
+ export type SlimNotificationsResponse = SlimPage<SlimNotification> & {
189
189
  truncated: {
190
190
  reason: "result-cap" | "scan-budget";
191
191
  limit: number;
192
192
  } | null;
193
193
  };
194
- export type CarehubRecentNotificationsResponse = {
195
- recent: CarehubNotification[];
194
+ export type SlimRecentNotificationsResponse = {
195
+ recent: SlimNotification[];
196
196
  total: number;
197
197
  warm: boolean;
198
198
  source: "redis" | "medplum";
199
199
  };
200
- export type CarehubThreshold = {
200
+ export type SlimThreshold = {
201
201
  id?: string;
202
202
  projectId?: string;
203
203
  status: "active" | "retired";
204
204
  date?: string;
205
205
  settings: Record<string, unknown>;
206
206
  };
207
- export type CarehubTrendPoint = {
207
+ export type SlimTrendPoint = {
208
208
  timestamp: string;
209
209
  timestampMs: number;
210
210
  data: number | null;
@@ -221,17 +221,17 @@ export type CarehubTrendPoint = {
221
221
  deviceModel?: string;
222
222
  deviceId?: string;
223
223
  };
224
- export type CarehubTrends = {
225
- heartRate?: Record<string, CarehubTrendPoint[]>;
226
- respiratoryRate?: Record<string, CarehubTrendPoint[]>;
224
+ export type SlimTrends = {
225
+ heartRate?: Record<string, SlimTrendPoint[]>;
226
+ respiratoryRate?: Record<string, SlimTrendPoint[]>;
227
227
  };
228
- export type CarehubSleepMetric = {
228
+ export type SlimSleepMetric = {
229
229
  current: number | string | null;
230
230
  average: number | string | null;
231
231
  diff: number | null;
232
232
  };
233
- export type CarehubSleepStatistics = Record<string, Record<string, CarehubSleepMetric>>;
234
- export type CarehubLocation = {
233
+ export type SlimSleepStatistics = Record<string, Record<string, SlimSleepMetric>>;
234
+ export type SlimLocation = {
235
235
  id: string;
236
236
  name: string;
237
237
  floor?: string;
@@ -244,7 +244,7 @@ export type CarehubLocation = {
244
244
  deviceId?: string;
245
245
  patientId?: string;
246
246
  };
247
- export type CarehubLocationQuery = {
247
+ export type SlimLocationQuery = {
248
248
  search?: string;
249
249
  floor?: string;
250
250
  room?: string;
@@ -254,19 +254,19 @@ export type CarehubLocationQuery = {
254
254
  page?: number;
255
255
  count?: number;
256
256
  };
257
- export type CarehubCreateLocation = {
257
+ export type SlimCreateLocation = {
258
258
  name: string;
259
259
  floor?: string;
260
260
  room?: string;
261
261
  bed?: string;
262
262
  organizationId?: string;
263
263
  };
264
- export type CarehubUpdateLocation = CarehubCreateLocation & {
264
+ export type SlimUpdateLocation = SlimCreateLocation & {
265
265
  organizationId?: string | null;
266
266
  deviceId?: string | null;
267
267
  patientId?: string;
268
268
  };
269
- export type CarehubZone = {
269
+ export type SlimZone = {
270
270
  zoneId: string;
271
271
  zoneName: string;
272
272
  deviceCount: number;
@@ -274,7 +274,7 @@ export type CarehubZone = {
274
274
  activeDeviceCount: number;
275
275
  inactiveDeviceCount: number;
276
276
  };
277
- export type CarehubZoneDetail = {
277
+ export type SlimZoneDetail = {
278
278
  id: string;
279
279
  name: string;
280
280
  locations: Array<{
@@ -293,13 +293,13 @@ export type CarehubZoneDetail = {
293
293
  }>;
294
294
  }>;
295
295
  };
296
- export type CarehubExportPdf = {
296
+ export type SlimExportPdf = {
297
297
  documentReference: Record<string, unknown>;
298
298
  binary: Record<string, unknown>;
299
299
  downloadUrl: string;
300
300
  expiresAt?: string;
301
301
  };
302
- export type CarehubExportPdfRequest = {
302
+ export type SlimExportPdfRequest = {
303
303
  code: string;
304
304
  mailTo?: string[];
305
305
  timeZone?: string;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -57,6 +57,8 @@ exports.OVOK_CORE_API_REQUIREMENTS = {
57
57
  { method: "GET", path: "/cms/:type/:language/:key", group: "Content" },
58
58
  { method: "DELETE", path: "/cms/:type/:language/:key", group: "Content" },
59
59
  { method: "GET", path: "/cms/:type/:language", group: "Content" },
60
+ { method: "GET", path: "/v1/public/cms/collections/:collection/items", group: "Cms" },
61
+ { method: "GET", path: "/v1/public/cms/collections/:collection/items/:slug", group: "Cms" },
60
62
  { method: "GET", path: "/video-call/livekit/access-permission/:appointmentId", group: "Video" },
61
63
  { method: "POST", path: "/video-call/livekit/guest-access/:appointmentId", group: "Video" },
62
64
  { method: "POST", path: "/video-call/livekit/user-access/:appointmentId", group: "Video" },
@@ -48,7 +48,7 @@ exports.OVOK_CORE_REQUIREMENTS = {
48
48
  description: "The FHIR surface a server must provide for the @ovok/core client library's own methods to function.",
49
49
  software: {
50
50
  name: "@ovok/core",
51
- version: "0.4.6",
51
+ version: "0.4.8",
52
52
  },
53
53
  fhirVersion: "4.0.1",
54
54
  format: ["json"],
@@ -1,7 +1,7 @@
1
1
  import { CapabilityStatement } from "@medplum/fhirtypes";
2
- import { CarehubDeviceListItem, CarehubDeviceListQuery, CarehubDeviceTelemetry, CarehubNotificationsQuery, CarehubNotificationsResponse, CarehubPage, CarehubPatientListItem, CarehubPatientListQuery, CarehubRecentNotificationsResponse } from "../client/carehub/types";
3
2
  import { OvokClient, OvokFhirVersion } from "../client/ovok-client";
4
3
  import { OvokAdministeredProject, OvokProjectFeatures, OvokProjectSettings } from "../client/platform/types";
4
+ import { SlimDeviceListItem, SlimDeviceListQuery, SlimDeviceTelemetry, SlimNotificationsQuery, SlimNotificationsResponse, SlimPage, SlimPatientListItem, SlimPatientListQuery, SlimRecentNotificationsResponse } from "../client/slim/types";
5
5
  import { OvokPublicApiEndpoint } from "../conformance/capability";
6
6
  export type OvokRequestState<T> = {
7
7
  data: T | undefined;
@@ -29,11 +29,11 @@ export declare const usePublicApiEndpoints: (version?: OvokFhirVersion) => OvokR
29
29
  export declare const useAdministeredProjects: (params?: {
30
30
  page?: number;
31
31
  count?: number;
32
- }) => OvokRequestState<CarehubPage<OvokAdministeredProject>>;
32
+ }) => OvokRequestState<SlimPage<OvokAdministeredProject>>;
33
33
  export declare const useProjectSettings: () => OvokRequestState<OvokProjectSettings>;
34
34
  export declare const useProjectFeatures: () => OvokRequestState<OvokProjectFeatures>;
35
- export declare const useCarehubPatients: (params?: CarehubPatientListQuery) => OvokRequestState<CarehubPage<CarehubPatientListItem>>;
36
- export declare const useCarehubDevices: (params?: CarehubDeviceListQuery) => OvokRequestState<CarehubPage<CarehubDeviceListItem>>;
37
- export declare const useCarehubDeviceTelemetry: (deviceId?: string) => OvokRequestState<CarehubDeviceTelemetry>;
38
- export declare const useCarehubNotifications: (params?: CarehubNotificationsQuery) => OvokRequestState<CarehubNotificationsResponse>;
39
- export declare const useRecentCarehubNotifications: (count?: number) => OvokRequestState<CarehubRecentNotificationsResponse>;
35
+ export declare const useSlimPatients: (params?: SlimPatientListQuery) => OvokRequestState<SlimPage<SlimPatientListItem>>;
36
+ export declare const useSlimDevices: (params?: SlimDeviceListQuery) => OvokRequestState<SlimPage<SlimDeviceListItem>>;
37
+ export declare const useSlimDeviceTelemetry: (deviceId?: string) => OvokRequestState<SlimDeviceTelemetry>;
38
+ export declare const useSlimNotifications: (params?: SlimNotificationsQuery) => OvokRequestState<SlimNotificationsResponse>;
39
+ export declare const useRecentSlimNotifications: (count?: number) => OvokRequestState<SlimRecentNotificationsResponse>;
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.useRecentCarehubNotifications = exports.useCarehubNotifications = exports.useCarehubDeviceTelemetry = exports.useCarehubDevices = exports.useCarehubPatients = exports.useProjectFeatures = exports.useProjectSettings = exports.useAdministeredProjects = exports.usePublicApiEndpoints = exports.useCapabilityStatement = void 0;
37
+ exports.useRecentSlimNotifications = exports.useSlimNotifications = exports.useSlimDeviceTelemetry = exports.useSlimDevices = exports.useSlimPatients = exports.useProjectFeatures = exports.useProjectSettings = exports.useAdministeredProjects = exports.usePublicApiEndpoints = exports.useCapabilityStatement = void 0;
38
38
  exports.useOvokRequest = useOvokRequest;
39
39
  exports.useOvokMutation = useOvokMutation;
40
40
  const React = __importStar(require("react"));
@@ -142,38 +142,38 @@ const useProjectFeatures = () => {
142
142
  return useOvokRequest(load);
143
143
  };
144
144
  exports.useProjectFeatures = useProjectFeatures;
145
- const useCarehubPatients = (params = {}) => {
145
+ const useSlimPatients = (params = {}) => {
146
146
  const client = (0, index_1.useClient)();
147
147
  const serialized = JSON.stringify(params);
148
- const load = React.useCallback(() => client.listCarehubPatients(params), [client, serialized]);
148
+ const load = React.useCallback(() => client.listSlimPatients(params), [client, serialized]);
149
149
  return useOvokRequest(load);
150
150
  };
151
- exports.useCarehubPatients = useCarehubPatients;
152
- const useCarehubDevices = (params = {}) => {
151
+ exports.useSlimPatients = useSlimPatients;
152
+ const useSlimDevices = (params = {}) => {
153
153
  const client = (0, index_1.useClient)();
154
154
  const serialized = JSON.stringify(params);
155
- const load = React.useCallback(() => client.listCarehubDevices(params), [client, serialized]);
155
+ const load = React.useCallback(() => client.listSlimDevices(params), [client, serialized]);
156
156
  return useOvokRequest(load);
157
157
  };
158
- exports.useCarehubDevices = useCarehubDevices;
159
- const useCarehubDeviceTelemetry = (deviceId) => {
158
+ exports.useSlimDevices = useSlimDevices;
159
+ const useSlimDeviceTelemetry = (deviceId) => {
160
160
  const client = (0, index_1.useClient)();
161
161
  const load = React.useCallback(() => deviceId
162
- ? client.getCarehubDeviceTelemetry(deviceId)
162
+ ? client.getSlimDeviceTelemetry(deviceId)
163
163
  : Promise.reject(new Error("deviceId is required")), [client, deviceId]);
164
164
  return useOvokRequest(load, deviceId !== undefined);
165
165
  };
166
- exports.useCarehubDeviceTelemetry = useCarehubDeviceTelemetry;
167
- const useCarehubNotifications = (params = {}) => {
166
+ exports.useSlimDeviceTelemetry = useSlimDeviceTelemetry;
167
+ const useSlimNotifications = (params = {}) => {
168
168
  const client = (0, index_1.useClient)();
169
169
  const serialized = JSON.stringify(params);
170
- const load = React.useCallback(() => client.listCarehubNotifications(params), [client, serialized]);
170
+ const load = React.useCallback(() => client.listSlimNotifications(params), [client, serialized]);
171
171
  return useOvokRequest(load);
172
172
  };
173
- exports.useCarehubNotifications = useCarehubNotifications;
174
- const useRecentCarehubNotifications = (count) => {
173
+ exports.useSlimNotifications = useSlimNotifications;
174
+ const useRecentSlimNotifications = (count) => {
175
175
  const client = (0, index_1.useClient)();
176
- const load = React.useCallback(() => client.getRecentCarehubNotifications(count), [client, count]);
176
+ const load = React.useCallback(() => client.getRecentSlimNotifications(count), [client, count]);
177
177
  return useOvokRequest(load);
178
178
  };
179
- exports.useRecentCarehubNotifications = useRecentCarehubNotifications;
179
+ exports.useRecentSlimNotifications = useRecentSlimNotifications;
@@ -0,0 +1,13 @@
1
+ import { OvokCmsDocument, OvokCmsListOptions, OvokCmsOptions, OvokCmsPage } from "../client/cms";
2
+ import { OvokRequestState } from "./api-hooks";
3
+ /**
4
+ * A published CMS document by slug, in `options.locale` or else the runtime's
5
+ * language. Waits while `slug` is empty; a new CMS locale reads it again.
6
+ */
7
+ export declare const useCmsDocument: <T extends object = OvokCmsDocument>(collection: string, slug: string | undefined, options?: OvokCmsOptions) => OvokRequestState<T>;
8
+ /** A page of a CMS collection, in `options.locale` or else the runtime's language. */
9
+ export declare const useCmsDocuments: <T extends object = OvokCmsDocument>(collection: string, options?: OvokCmsListOptions) => OvokRequestState<OvokCmsPage<T>>;
10
+ /** A legal page by slug; with `tenantCode`, readable before sign-in. */
11
+ export declare const useLegalPage: (slug: string | undefined, options?: OvokCmsOptions) => OvokRequestState<OvokCmsDocument>;
12
+ /** Release notes, newest first unless `sort` says otherwise. Needs a session. */
13
+ export declare const useReleaseNotes: (options?: OvokCmsListOptions) => OvokRequestState<OvokCmsPage>;