@ovok/core 0.3.6 → 0.3.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,6 +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
20
 
20
21
  ## Installation
21
22
 
@@ -72,6 +73,22 @@ const locales = await client.getLocales();
72
73
  All methods preserve the backend HTTP verbs and return the backend response shapes. Billing is
73
74
  not included until Ovok publishes a supported billing contract.
74
75
 
76
+ ## CareHub APIs
77
+
78
+ CareHub methods cover the verified `/v1/carehub/*` and `/v2/carehub/*` application routes for
79
+ patients, devices, telemetry, notifications, thresholds, trends, sleep, locations, zones, and
80
+ PDF export. These routes require the backend's bearer session and CareHub permissions.
81
+
82
+ ```typescript
83
+ const residents = await client.listCarehubPatients({ residentState: "active" });
84
+ const devices = await client.listCarehubDevices({ active: true });
85
+ const telemetry = await client.getCarehubDeviceTelemetry(deviceId);
86
+ const alerts = await client.listCarehubMedicalNotifications({ count: 25 });
87
+ ```
88
+
89
+ CareHub is intentionally represented as typed application APIs rather than changing the FHIR
90
+ observation save/offline behavior used by native integrations.
91
+
75
92
  ## Offline measurements
76
93
 
77
94
  Pass a durable Medplum storage adapter and opt in to queue measurements while offline:
@@ -0,0 +1,71 @@
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>;
@@ -0,0 +1,205 @@
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/carehub/patient${query(params)}`);
64
+ }
65
+ async function getCarehubPatient(patientId) {
66
+ return this.get(`/v1/carehub/patient/${segment(patientId)}`);
67
+ }
68
+ async function getCarehubPatientEverything(patientId) {
69
+ return this.get(`/v1/carehub/patient/${segment(patientId)}/$everything`);
70
+ }
71
+ async function getCarehubPatientCurrentVitals(patientId) {
72
+ return this.get(`/v1/carehub/patient/${segment(patientId)}/current-vitals`);
73
+ }
74
+ async function createCarehubPatient(body) {
75
+ return this.post("/v1/carehub/patient", body);
76
+ }
77
+ async function updateCarehubPatient(patientId, body) {
78
+ return (await this.put(`/v1/carehub/patient/${segment(patientId)}`, body));
79
+ }
80
+ async function deleteCarehubPatient(patientId) {
81
+ await this.delete(`/v1/carehub/patient/${segment(patientId)}`);
82
+ }
83
+ async function listCarehubDevices(params = {}) {
84
+ return this.get(`/v1/carehub/device${query(params)}`);
85
+ }
86
+ async function getCarehubDevice(deviceId) {
87
+ return this.get(`/v1/carehub/device/${segment(deviceId)}`);
88
+ }
89
+ async function createCarehubDevice(body) {
90
+ return this.post("/v1/carehub/device", body);
91
+ }
92
+ async function updateCarehubDevice(deviceId, body) {
93
+ return (await this.put(`/v1/carehub/device/${segment(deviceId)}`, body));
94
+ }
95
+ async function deleteCarehubDevice(deviceId) {
96
+ await this.delete(`/v1/carehub/device/${segment(deviceId)}`);
97
+ }
98
+ async function assignCarehubDeviceToProject(body) {
99
+ return (await this.put("/v1/carehub/device/assign/project", body));
100
+ }
101
+ async function listCarehubLiveDevices(params = {}) {
102
+ return this.get(`/v1/carehub/device/live${query(params)}`);
103
+ }
104
+ async function listCarehubLiveTelemetry(params = {}) {
105
+ return this.get(`/v1/carehub/device/live/telemetry${query(params)}`);
106
+ }
107
+ async function getCarehubDeviceSleepStatus(deviceId) {
108
+ return this.get(`/v1/carehub/device/live/cloudwatch/${segment(deviceId)}`);
109
+ }
110
+ async function getCarehubDeviceTelemetry(deviceId) {
111
+ return this.get(`/v1/carehub/telemetry/${segment(deviceId)}`);
112
+ }
113
+ async function listCarehubEffectiveObservationIds() {
114
+ return this.get("/v1/carehub/telemetry/effectiveIds");
115
+ }
116
+ async function listCarehubLastObservationIds() {
117
+ return this.get("/v1/carehub/telemetry/lastIds");
118
+ }
119
+ async function getCarehubDeviceEffectiveObservationIds(deviceId) {
120
+ return this.get(`/v1/carehub/telemetry/${segment(deviceId)}/effectiveIds`);
121
+ }
122
+ async function getCarehubDeviceLastObservationIds(deviceId) {
123
+ return this.get(`/v1/carehub/telemetry/${segment(deviceId)}/lastIds`);
124
+ }
125
+ async function listCarehubNotifications(params = {}) {
126
+ return this.get(`/v1/carehub/notifications${query(params)}`);
127
+ }
128
+ async function getRecentCarehubNotifications(count) {
129
+ return this.get(`/v1/carehub/notifications/recent${query({ count })}`);
130
+ }
131
+ async function listCarehubOutOfBedNotifications(params = {}) {
132
+ return this.get(`/v1/carehub/notifications/oob${query(params)}`);
133
+ }
134
+ async function listCarehubMedicalNotifications(params = {}) {
135
+ return this.get(`/v1/carehub/notifications/medical${query(params)}`);
136
+ }
137
+ async function getRecentCarehubMedicalNotifications(count) {
138
+ return this.get(`/v1/carehub/notifications/recent/medical${query({ count })}`);
139
+ }
140
+ async function getCarehubMedicalNotification(episodeId) {
141
+ return this.get(`/v1/carehub/notifications/medical/${segment(episodeId)}`);
142
+ }
143
+ async function acknowledgeCarehubMedicalNotification(episodeId) {
144
+ return this.post(`/v1/carehub/notifications/medical/${segment(episodeId)}/ack`);
145
+ }
146
+ async function acknowledgeCarehubNotification(notificationId) {
147
+ return (await this.patch(`/v1/carehub/notifications/${segment(notificationId)}/ack`, []));
148
+ }
149
+ async function getCarehubThreshold() {
150
+ return this.get("/v1/carehub/threshold");
151
+ }
152
+ async function updateCarehubThreshold(body) {
153
+ return (await this.put("/v1/carehub/threshold", body));
154
+ }
155
+ async function getCarehubPatientThreshold(patientId) {
156
+ return this.get(`/v1/carehub/threshold/patient/${segment(patientId)}`);
157
+ }
158
+ async function updateCarehubPatientThreshold(patientId, body) {
159
+ return (await this.put(`/v1/carehub/threshold/patient/${segment(patientId)}`, body));
160
+ }
161
+ async function getCarehubThresholdV2() {
162
+ return this.get("/v2/carehub/threshold");
163
+ }
164
+ async function updateCarehubThresholdV2(body) {
165
+ return (await this.put("/v2/carehub/threshold", body));
166
+ }
167
+ async function getCarehubPatientThresholdV2(patientId) {
168
+ return this.get(`/v2/carehub/threshold/patient/${segment(patientId)}`);
169
+ }
170
+ async function updateCarehubPatientThresholdV2(patientId, body) {
171
+ return (await this.put(`/v2/carehub/threshold/patient/${segment(patientId)}`, body));
172
+ }
173
+ async function getCarehubTrends(params) {
174
+ return this.get(`/v1/carehub/trends/graphs${query(params)}`);
175
+ }
176
+ async function getCarehubSleepStatistics(params) {
177
+ return this.get(`/v1/carehub/sleep/statistics${query(params)}`);
178
+ }
179
+ async function listCarehubLocations(params = {}) {
180
+ return this.get(`/v1/carehub/location${query(params)}`);
181
+ }
182
+ async function getCarehubLocation(locationId) {
183
+ return this.get(`/v1/carehub/location/${segment(locationId)}`);
184
+ }
185
+ async function createCarehubLocation(body) {
186
+ return this.post("/v1/carehub/location", body);
187
+ }
188
+ async function updateCarehubLocation(locationId, body) {
189
+ return (await this.put(`/v1/carehub/location/${segment(locationId)}`, body));
190
+ }
191
+ async function deleteCarehubLocation(locationId) {
192
+ await this.delete(`/v1/carehub/location/${segment(locationId)}`);
193
+ }
194
+ async function listCarehubZones(params = {}) {
195
+ return this.get(`/v1/carehub/zones${query(params)}`);
196
+ }
197
+ async function getCarehubZone(zoneId) {
198
+ return this.get(`/v1/carehub/zones/${segment(zoneId)}`);
199
+ }
200
+ async function getCarehubZoneDeviceCounts(params = {}) {
201
+ return this.get(`/v1/carehub/zones/device-counts${query(params)}`);
202
+ }
203
+ async function exportCarehubPatientPdf(body) {
204
+ return this.post("/v1/carehub/export/pdf", body);
205
+ }
@@ -0,0 +1,312 @@
1
+ export type CarehubPage<T> = {
2
+ total: number;
3
+ page: number;
4
+ count: number;
5
+ resources: T[];
6
+ };
7
+ export type CarehubResidentState = "active" | "archived" | "discharged" | "discharged-recent";
8
+ export type CarehubHumanName = {
9
+ use: "official" | "nickname" | "maiden";
10
+ given?: string[];
11
+ family?: string;
12
+ };
13
+ export type CarehubPatient = {
14
+ id: string;
15
+ name: CarehubHumanName[];
16
+ gender?: "male" | "female" | "other" | "unknown";
17
+ birthDate?: string;
18
+ deviceId: string | null;
19
+ organizationId?: string;
20
+ locationId?: string;
21
+ floor?: string;
22
+ room?: string;
23
+ bed?: string;
24
+ residentState: CarehubResidentState;
25
+ admissionDate?: string;
26
+ dischargeDate?: string;
27
+ };
28
+ export type CarehubPatientListItem = {
29
+ id: string;
30
+ name: string;
31
+ nickname: string | null;
32
+ residentState: CarehubResidentState;
33
+ admissionDate: string | null;
34
+ dischargeDate: string | null;
35
+ organizationId: string | null;
36
+ organizationName: string | null;
37
+ locationId: string | null;
38
+ locationName: string | null;
39
+ deviceId: string | null;
40
+ deviceName: string | null;
41
+ medicalSettings: string | null;
42
+ bedActivitySettings: string | null;
43
+ };
44
+ export type CarehubPatientListQuery = {
45
+ page?: number;
46
+ count?: number;
47
+ sortBy?: string;
48
+ orderBy?: "ASC" | "DESC";
49
+ search?: string;
50
+ residentState?: CarehubResidentState | "all";
51
+ includeDischargedRecent?: boolean;
52
+ organizationId?: string;
53
+ hasDevice?: boolean;
54
+ medicalSettings?: string;
55
+ bedActivitySettings?: string;
56
+ };
57
+ export type CarehubCreatePatient = {
58
+ name: CarehubHumanName[];
59
+ gender?: "male" | "female" | "other" | "unknown";
60
+ birthDate?: string;
61
+ deviceId?: string | null;
62
+ organizationId?: string;
63
+ locationId?: string;
64
+ admissionDate?: string;
65
+ };
66
+ export type CarehubUpdatePatient = Partial<CarehubCreatePatient> & {
67
+ residentState?: CarehubResidentState;
68
+ dischargeDate?: string;
69
+ };
70
+ export type CarehubDevice = {
71
+ name: string;
72
+ status?: "active" | "inactive" | "entered-in-error" | "unknown";
73
+ statusReason: Array<{
74
+ code: string;
75
+ display: string | null;
76
+ }>;
77
+ thingsboardId?: string;
78
+ organizationId?: string;
79
+ organizationName: string | null;
80
+ locationId?: string;
81
+ locationName: string | null;
82
+ patientId?: string;
83
+ patientName: string | null;
84
+ floor?: string;
85
+ room?: string;
86
+ bed?: string;
87
+ };
88
+ export type CarehubDeviceListItem = {
89
+ id: string;
90
+ name: string;
91
+ thingsboardId?: string;
92
+ status: "active" | "inactive";
93
+ organizationId: string | null;
94
+ organizationName: string | null;
95
+ locationId: string | null;
96
+ locationName: string | null;
97
+ patientId: string | null;
98
+ patientName: string | null;
99
+ lastActivityTime?: string | null;
100
+ createdAt?: string | null;
101
+ };
102
+ export type CarehubDeviceListQuery = {
103
+ page?: number;
104
+ count?: number;
105
+ sortBy?: string;
106
+ orderBy?: "ASC" | "DESC";
107
+ search?: string;
108
+ patientSearch?: string;
109
+ organizationId?: string;
110
+ locationId?: string;
111
+ patientId?: string;
112
+ active?: boolean;
113
+ };
114
+ export type CarehubCreateDevice = {
115
+ name: string;
116
+ thingsboardId?: string;
117
+ organizationId?: string;
118
+ locationId?: string;
119
+ patientId?: string;
120
+ };
121
+ export type CarehubUpdateDevice = {
122
+ name: string;
123
+ thingsboardId?: string;
124
+ organizationId?: string | null;
125
+ locationId?: string | null;
126
+ patientId?: string | null;
127
+ };
128
+ export type CarehubAssignDevice = {
129
+ deviceId: string;
130
+ projectId: string;
131
+ locationId?: string;
132
+ };
133
+ export type CarehubTelemetryValue = {
134
+ value: string | number | boolean | null;
135
+ ts: number | null;
136
+ };
137
+ export type CarehubTelemetrySummary = Record<string, CarehubTelemetryValue>;
138
+ export type CarehubAlertSummary = Record<string, unknown>;
139
+ export type CarehubLiveQuery = {
140
+ page?: number;
141
+ count?: number;
142
+ sortBy?: string;
143
+ orderBy?: "ASC" | "DESC";
144
+ search?: string;
145
+ deviceId?: string;
146
+ organizationId?: string;
147
+ effectiveSleepStatus?: string;
148
+ residentState?: CarehubResidentState;
149
+ includeUnassigned?: boolean;
150
+ };
151
+ export type CarehubLiveTelemetry = {
152
+ total: number;
153
+ page: number;
154
+ count: number;
155
+ telemetry: Record<string, CarehubTelemetrySummary>;
156
+ alerts: Record<string, CarehubAlertSummary>;
157
+ };
158
+ export type CarehubDeviceTelemetry = {
159
+ deviceId: string;
160
+ telemetry?: CarehubTelemetrySummary;
161
+ alerts?: CarehubAlertSummary;
162
+ };
163
+ export type CarehubObservationIds = {
164
+ heartRate: string | null;
165
+ respiratoryRate: string | null;
166
+ sleepStatus: string | null;
167
+ presenceStatus: string | null;
168
+ batch?: string | null;
169
+ };
170
+ export type CarehubNotification = {
171
+ commId: string;
172
+ status: string;
173
+ authoredOn: string;
174
+ type: string;
175
+ [key: string]: unknown;
176
+ };
177
+ export type CarehubNotificationsQuery = {
178
+ patient?: string;
179
+ device?: string;
180
+ status?: string;
181
+ type?: string;
182
+ startDate?: string;
183
+ endDate?: string;
184
+ cursor?: string;
185
+ page?: number;
186
+ count?: number;
187
+ };
188
+ export type CarehubNotificationsResponse = CarehubPage<CarehubNotification> & {
189
+ truncated: {
190
+ reason: "result-cap" | "scan-budget";
191
+ limit: number;
192
+ } | null;
193
+ };
194
+ export type CarehubRecentNotificationsResponse = {
195
+ recent: CarehubNotification[];
196
+ total: number;
197
+ warm: boolean;
198
+ source: "redis" | "medplum";
199
+ };
200
+ export type CarehubThreshold = {
201
+ id?: string;
202
+ projectId?: string;
203
+ status: "active" | "retired";
204
+ date?: string;
205
+ settings: Record<string, unknown>;
206
+ };
207
+ export type CarehubTrendPoint = {
208
+ timestamp: string;
209
+ timestampMs: number;
210
+ data: number | null;
211
+ maxThreshold?: number;
212
+ minThreshold?: number;
213
+ maxBaseLine?: number;
214
+ minBaseLine?: number;
215
+ pointTimestamp?: string;
216
+ pointTimestampRange?: {
217
+ start?: string;
218
+ end?: string;
219
+ };
220
+ deviceManufacturer?: string;
221
+ deviceModel?: string;
222
+ deviceId?: string;
223
+ };
224
+ export type CarehubTrends = {
225
+ heartRate?: Record<string, CarehubTrendPoint[]>;
226
+ respiratoryRate?: Record<string, CarehubTrendPoint[]>;
227
+ };
228
+ export type CarehubSleepMetric = {
229
+ current: number | string | null;
230
+ average: number | string | null;
231
+ diff: number | null;
232
+ };
233
+ export type CarehubSleepStatistics = Record<string, Record<string, CarehubSleepMetric>>;
234
+ export type CarehubLocation = {
235
+ id: string;
236
+ name: string;
237
+ floor?: string;
238
+ room?: string;
239
+ bed?: string;
240
+ organizationId?: string;
241
+ organizationName?: string;
242
+ deviceName?: string;
243
+ patientName?: string;
244
+ deviceId?: string;
245
+ patientId?: string;
246
+ };
247
+ export type CarehubLocationQuery = {
248
+ search?: string;
249
+ floor?: string;
250
+ room?: string;
251
+ bed?: string;
252
+ organizationId?: string;
253
+ deviceId?: string;
254
+ page?: number;
255
+ count?: number;
256
+ };
257
+ export type CarehubCreateLocation = {
258
+ name: string;
259
+ floor?: string;
260
+ room?: string;
261
+ bed?: string;
262
+ organizationId?: string;
263
+ };
264
+ export type CarehubUpdateLocation = CarehubCreateLocation & {
265
+ organizationId?: string | null;
266
+ deviceId?: string | null;
267
+ patientId?: string;
268
+ };
269
+ export type CarehubZone = {
270
+ zoneId: string;
271
+ zoneName: string;
272
+ deviceCount: number;
273
+ assignedResidentDeviceCount: number;
274
+ activeDeviceCount: number;
275
+ inactiveDeviceCount: number;
276
+ };
277
+ export type CarehubZoneDetail = {
278
+ id: string;
279
+ name: string;
280
+ locations: Array<{
281
+ id: string;
282
+ name: string;
283
+ floor?: string;
284
+ room?: string;
285
+ bed?: string;
286
+ devices: Array<{
287
+ id: string;
288
+ name?: string;
289
+ }>;
290
+ residents: Array<{
291
+ id: string;
292
+ name?: string;
293
+ }>;
294
+ }>;
295
+ };
296
+ export type CarehubExportPdf = {
297
+ documentReference: Record<string, unknown>;
298
+ binary: Record<string, unknown>;
299
+ downloadUrl: string;
300
+ expiresAt?: string;
301
+ };
302
+ export type CarehubExportPdfRequest = {
303
+ code: string;
304
+ mailTo?: string[];
305
+ timeZone?: string;
306
+ language: string;
307
+ patientId: string;
308
+ period: {
309
+ start: string;
310
+ end: string;
311
+ };
312
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,6 +4,7 @@ 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";
7
8
  import * as aiMethods from "./chat/ai/methods";
8
9
  import * as observationMethods from "./observation/methods";
9
10
  import { GenerateObservationBodyParams } from "./observation/types/generate-observation-body/GenerateObservationBodyParams";
@@ -55,7 +56,7 @@ export declare class OvokClient extends MedplumClient {
55
56
  */
56
57
  getSubscriptionManager(): SubscriptionManager;
57
58
  }
58
- type Methods = typeof authMethods & typeof observationMethods & typeof questionnaireResponseMethods & typeof aiMethods & typeof aiFhirMethods & typeof botMethods & typeof platformMethods;
59
+ type Methods = typeof authMethods & typeof observationMethods & typeof questionnaireResponseMethods & typeof aiMethods & typeof aiFhirMethods & typeof botMethods & typeof carehubMethods & typeof platformMethods;
59
60
  type Omitted<T> = Omit<T, "executeBot">;
60
61
  declare module "./ovok-client" {
61
62
  interface OvokClient extends Omitted<Methods> {
@@ -40,6 +40,7 @@ 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"));
43
44
  const aiMethods = __importStar(require("./chat/ai/methods"));
44
45
  const rate_limit_error_1 = require("./errors/rate-limit-error");
45
46
  const observationMethods = __importStar(require("./observation/methods"));
@@ -66,6 +67,7 @@ class OvokClient extends core_1.MedplumClient {
66
67
  this.bindMethods(aiMethods);
67
68
  this.bindMethods(aiFhirMethods);
68
69
  this.bindMethods(botMethods);
70
+ this.bindMethods(carehubMethods);
69
71
  this.bindMethods(platformMethods);
70
72
  this.clientStorage = config.storage;
71
73
  this.offlineQueueOptions = (_b = config.offlineQueue) !== null && _b !== void 0 ? _b : {};
@@ -56,5 +56,53 @@ exports.OVOK_CORE_API_REQUIREMENTS = {
56
56
  { method: "GET", path: "/localization/i18next/:language", group: "Localization" },
57
57
  { method: "PATCH", path: "/localization/i18next/:language", group: "Localization" },
58
58
  { method: "GET", path: "/patient/:id/observation", group: "Patient" },
59
+ { method: "GET", path: "/v1/carehub/patient", group: "Carehub/Patient" },
60
+ { method: "GET", path: "/v1/carehub/patient/:id", group: "Carehub/Patient" },
61
+ { method: "GET", path: "/v1/carehub/patient/:id/$everything", group: "Carehub/Patient" },
62
+ { method: "GET", path: "/v1/carehub/patient/:id/current-vitals", group: "Carehub/Patient" },
63
+ { method: "POST", path: "/v1/carehub/patient", group: "Carehub/Patient" },
64
+ { method: "PUT", path: "/v1/carehub/patient/:id", group: "Carehub/Patient" },
65
+ { method: "DELETE", path: "/v1/carehub/patient/:id", group: "Carehub/Patient" },
66
+ { method: "GET", path: "/v1/carehub/device", group: "Carehub/Device" },
67
+ { method: "GET", path: "/v1/carehub/device/:id", group: "Carehub/Device" },
68
+ { method: "POST", path: "/v1/carehub/device", group: "Carehub/Device" },
69
+ { method: "PUT", path: "/v1/carehub/device/:id", group: "Carehub/Device" },
70
+ { method: "DELETE", path: "/v1/carehub/device/:id", group: "Carehub/Device" },
71
+ { method: "PUT", path: "/v1/carehub/device/assign/project", group: "Carehub/Device" },
72
+ { method: "GET", path: "/v1/carehub/device/live", group: "Carehub/Device" },
73
+ { method: "GET", path: "/v1/carehub/device/live/telemetry", group: "Carehub/Device" },
74
+ { method: "GET", path: "/v1/carehub/device/live/cloudwatch/:deviceId", group: "Carehub/Device" },
75
+ { method: "GET", path: "/v1/carehub/telemetry/:deviceId", group: "Carehub/Telemetry" },
76
+ { method: "GET", path: "/v1/carehub/telemetry/effectiveIds", group: "Carehub/Telemetry" },
77
+ { method: "GET", path: "/v1/carehub/telemetry/lastIds", group: "Carehub/Telemetry" },
78
+ { method: "GET", path: "/v1/carehub/telemetry/:deviceId/effectiveIds", group: "Carehub/Telemetry" },
79
+ { method: "GET", path: "/v1/carehub/telemetry/:deviceId/lastIds", group: "Carehub/Telemetry" },
80
+ { method: "GET", path: "/v1/carehub/notifications", group: "Carehub/Notifications" },
81
+ { method: "GET", path: "/v1/carehub/notifications/recent", group: "Carehub/Notifications" },
82
+ { method: "GET", path: "/v1/carehub/notifications/oob", group: "Carehub/Notifications" },
83
+ { method: "GET", path: "/v1/carehub/notifications/medical", group: "Carehub/Notifications" },
84
+ { method: "GET", path: "/v1/carehub/notifications/recent/medical", group: "Carehub/Notifications" },
85
+ { method: "GET", path: "/v1/carehub/notifications/medical/:episodeId", group: "Carehub/Notifications" },
86
+ { method: "POST", path: "/v1/carehub/notifications/medical/:episodeId/ack", group: "Carehub/Notifications" },
87
+ { method: "PATCH", path: "/v1/carehub/notifications/:id/ack", group: "Carehub/Notifications" },
88
+ { method: "GET", path: "/v1/carehub/threshold", group: "Carehub/Threshold" },
89
+ { method: "PUT", path: "/v1/carehub/threshold", group: "Carehub/Threshold" },
90
+ { method: "GET", path: "/v1/carehub/threshold/patient/:patientId", group: "Carehub/Threshold" },
91
+ { method: "PUT", path: "/v1/carehub/threshold/patient/:patientId", group: "Carehub/Threshold" },
92
+ { method: "GET", path: "/v2/carehub/threshold", group: "Carehub/Threshold" },
93
+ { method: "PUT", path: "/v2/carehub/threshold", group: "Carehub/Threshold" },
94
+ { method: "GET", path: "/v2/carehub/threshold/patient/:patientId", group: "Carehub/Threshold" },
95
+ { method: "PUT", path: "/v2/carehub/threshold/patient/:patientId", group: "Carehub/Threshold" },
96
+ { method: "GET", path: "/v1/carehub/trends/graphs", group: "Carehub/Trends" },
97
+ { method: "GET", path: "/v1/carehub/sleep/statistics", group: "Carehub/Sleep" },
98
+ { method: "GET", path: "/v1/carehub/location", group: "Carehub/Location" },
99
+ { method: "GET", path: "/v1/carehub/location/:id", group: "Carehub/Location" },
100
+ { method: "POST", path: "/v1/carehub/location", group: "Carehub/Location" },
101
+ { method: "PUT", path: "/v1/carehub/location/:id", group: "Carehub/Location" },
102
+ { method: "DELETE", path: "/v1/carehub/location/:id", group: "Carehub/Location" },
103
+ { method: "GET", path: "/v1/carehub/zones", group: "Carehub/Zones" },
104
+ { method: "GET", path: "/v1/carehub/zones/:zoneId", group: "Carehub/Zones" },
105
+ { method: "GET", path: "/v1/carehub/zones/device-counts", group: "Carehub/Zones" },
106
+ { method: "POST", path: "/v1/carehub/export/pdf", group: "Carehub/Export" },
59
107
  ],
60
108
  };
@@ -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.3.5",
51
+ version: "0.3.6",
52
52
  },
53
53
  fhirVersion: "4.0.1",
54
54
  format: ["json"],
package/dist/index.d.ts CHANGED
@@ -936,3 +936,4 @@ export * from "./conformance/capability-requirements";
936
936
  export * from "./conformance/api-requirements";
937
937
  export * from "./conformance/capability";
938
938
  export * from "./client/platform/types";
939
+ export * from "./client/carehub/types";
package/dist/index.js CHANGED
@@ -59,3 +59,4 @@ __exportStar(require("./conformance/capability-requirements"), exports);
59
59
  __exportStar(require("./conformance/api-requirements"), exports);
60
60
  __exportStar(require("./conformance/capability"), exports);
61
61
  __exportStar(require("./client/platform/types"), exports);
62
+ __exportStar(require("./client/carehub/types"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ovok/core",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",