@ovok/core 0.4.33 → 0.4.35

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
@@ -157,12 +157,7 @@ const latest = await client.getPatientLatestObservations({
157
157
  code: ["8867-4", "9279-1"],
158
158
  max: 5,
159
159
  });
160
- const currentTelemetry = await client.getPatientDeviceTelemetry(deviceId);
161
- const history = await client.getPatientDeviceTelemetryHistory(deviceId, {
162
- from: "2026-09-25T00:00:00.000Z",
163
- to: "2026-09-26T00:00:00.000Z",
164
- pageSize: 50,
165
- });
160
+ const currentTelemetry = await client.getSlimDeviceTelemetry(deviceId);
166
161
  const measurements = await client.listPatientMeasurementHistory({
167
162
  patient: `Patient/${me.profile.id}`,
168
163
  _sort: "-date",
@@ -179,7 +174,8 @@ const notifications = await client.listPatientNotifications({
179
174
  ```
180
175
 
181
176
  These helpers use bearer-authenticated `/auth/me` and `/fhir/*` contracts and are additive to the
182
- native observation and offline-measurement APIs. The returned resource lists are subject to the
177
+ native observation and offline-measurement APIs. Live device telemetry comes from the Slim routes
178
+ (`getSlimDeviceTelemetry`, `listSlimLiveTelemetry`). The returned resource lists are subject to the
183
179
  patient's backend AccessPolicy. Device pairing/claiming and notification acknowledgement are not
184
180
  invented here because `../ovok-core` does not currently expose patient-scoped contracts for them.
185
181
  The exported `OVOK_CORE_API_REQUIREMENTS` lists ordinary HTTP routes, while
@@ -4,6 +4,7 @@ exports.generateObservationBodiesByMeasurement = generateObservationBodiesByMeas
4
4
  const core_1 = require("@medplum/core");
5
5
  const creator_1 = require("../services/creator");
6
6
  const getDeviceObject_1 = require("../utils/getDeviceObject");
7
+ const DEVICE_READING_IDENTIFIER_SYSTEM = "https://api.ovok.com/fhir/StructureDefinition/device-reading-id";
7
8
  const getPatientReference = async (client, patientId) => {
8
9
  if (patientId) {
9
10
  return `Patient/${patientId}`;
@@ -11,6 +12,21 @@ const getPatientReference = async (client, patientId) => {
11
12
  const profile = (await client.getProfileAsync());
12
13
  return (0, core_1.getReferenceString)(profile);
13
14
  };
15
+ const addSourceIdentifier = (observations, patientReference, sourceId) => patientReference && sourceId
16
+ ? observations.map((observation, index) => {
17
+ var _a;
18
+ return ({
19
+ ...observation,
20
+ identifier: [
21
+ ...((_a = observation.identifier) !== null && _a !== void 0 ? _a : []),
22
+ {
23
+ system: DEVICE_READING_IDENTIFIER_SYSTEM,
24
+ value: `${patientReference}/${sourceId}/${index}`,
25
+ },
26
+ ],
27
+ });
28
+ })
29
+ : observations;
14
30
  async function generateObservationBodiesByMeasurement(params) {
15
31
  var _a;
16
32
  const { device, measurement } = params;
@@ -26,7 +42,7 @@ async function generateObservationBodiesByMeasurement(params) {
26
42
  }
27
43
  : observation;
28
44
  if (observationFragments) {
29
- return observationFragments
45
+ const observations = observationFragments
30
46
  .map((fragment) => ({
31
47
  resourceType: "Observation",
32
48
  status: "registered",
@@ -40,6 +56,7 @@ async function generateObservationBodiesByMeasurement(params) {
40
56
  }))
41
57
  .filter(hasObservationValue)
42
58
  .map(applyEffectiveDateTime);
59
+ return addSourceIdentifier(observations, patientReference, params.sourceId);
43
60
  }
44
61
  const observationCodes = observationService.getObservationCodes();
45
62
  const values = observationService.generateValues(measurement);
@@ -55,7 +72,7 @@ async function generateObservationBodiesByMeasurement(params) {
55
72
  code,
56
73
  ...(additionalProperties[index] || {}),
57
74
  }));
58
- return observationBodies.filter(hasObservationValue).map(applyEffectiveDateTime);
75
+ return addSourceIdentifier(observationBodies.filter(hasObservationValue).map(applyEffectiveDateTime), patientReference, params.sourceId);
59
76
  }
60
77
  const hasObservationValue = (observation) => {
61
78
  var _a, _b, _c, _d, _e, _f;
@@ -4,5 +4,7 @@ export type GenerateObservationBodyParams = {
4
4
  device?: MeasurementDevice;
5
5
  effectiveDateTime?: Date;
6
6
  patientId?: string;
7
+ /** Stable ID from the originating device reading. */
8
+ sourceId?: string;
7
9
  measurement: Measurement;
8
10
  };
@@ -8,6 +8,7 @@ const DEFAULT_RETRY_BACKOFF_MS = 5000;
8
8
  const DEFAULT_MAX_RETRY_BACKOFF_MS = 60 * 60 * 1000;
9
9
  const IDENTIFIER_SYSTEM = "https://api.ovok.com/fhir/StructureDefinition/offline-measurement-id";
10
10
  exports.OFFLINE_MEASUREMENT_IDENTIFIER_SYSTEM = IDENTIFIER_SYSTEM;
11
+ const DEVICE_READING_IDENTIFIER_SYSTEM = "https://api.ovok.com/fhir/StructureDefinition/device-reading-id";
11
12
  const canonicalize = (value) => {
12
13
  if (value instanceof Date) {
13
14
  return value.toISOString();
@@ -44,25 +45,43 @@ const stableValueId = (input) => {
44
45
  hex[16] = ((Number.parseInt(hex[16], 16) & 0x3) | 0x8).toString(16);
45
46
  return `${hex.slice(0, 8).join("")}-${hex.slice(8, 12).join("")}-${hex.slice(12, 16).join("")}-${hex.slice(16, 20).join("")}-${hex.slice(20).join("")}`;
46
47
  };
47
- const stableMeasurementId = (observation) => stableValueId(observation);
48
+ const stableMeasurementId = (observation) => {
49
+ const identifiers = observation.identifier;
50
+ if (!(identifiers === null || identifiers === void 0 ? void 0 : identifiers.some((identifier) => identifier.system === DEVICE_READING_IDENTIFIER_SYSTEM))) {
51
+ return stableValueId(observation);
52
+ }
53
+ const remainingIdentifiers = identifiers.filter((identifier) => identifier.system !== DEVICE_READING_IDENTIFIER_SYSTEM);
54
+ const legacyObservation = { ...observation };
55
+ if (remainingIdentifiers.length > 0) {
56
+ legacyObservation.identifier = remainingIdentifiers;
57
+ }
58
+ else {
59
+ delete legacyObservation.identifier;
60
+ }
61
+ return stableValueId(legacyObservation);
62
+ };
48
63
  exports.stableMeasurementId = stableMeasurementId;
49
64
  const entryForObservation = (observation) => {
50
- var _a;
65
+ var _a, _b;
51
66
  const id = stableMeasurementId(observation);
52
67
  const identifier = {
53
68
  system: IDENTIFIER_SYSTEM,
54
69
  value: id,
55
70
  };
71
+ const sourceIdentifier = (_a = observation.identifier) === null || _a === void 0 ? void 0 : _a.find((item) => item.system === DEVICE_READING_IDENTIFIER_SYSTEM);
72
+ const ifNoneExist = sourceIdentifier
73
+ ? `identifier=${encodeURIComponent(`${IDENTIFIER_SYSTEM}|${id}`)},${encodeURIComponent(`${DEVICE_READING_IDENTIFIER_SYSTEM}|${sourceIdentifier.value}`)}`
74
+ : `identifier=${IDENTIFIER_SYSTEM}|${id}`;
56
75
  return {
57
76
  fullUrl: `urn:uuid:${id}`,
58
77
  request: {
59
78
  method: "POST",
60
79
  url: "Observation",
61
- ifNoneExist: `identifier=${IDENTIFIER_SYSTEM}|${id}`,
80
+ ifNoneExist,
62
81
  },
63
82
  resource: {
64
83
  ...observation,
65
- identifier: [...((_a = observation.identifier) !== null && _a !== void 0 ? _a : []), identifier],
84
+ identifier: [...((_b = observation.identifier) !== null && _b !== void 0 ? _b : []), identifier],
66
85
  },
67
86
  };
68
87
  };
@@ -1,10 +1,8 @@
1
1
  import type { MedplumRequestOptions } from "@medplum/core";
2
2
  import { OvokClient } from "../ovok-client";
3
- import { OvokCurrentPatientProfile, OvokPatientLatestObservationsQuery, OvokPatientObservationBundle, OvokPatientAppointment, OvokPatientCarePlan, OvokPatientDashboard, OvokPatientDashboardQuery, OvokPatientDevice, OvokPatientMeasurement, OvokPatientNotification, OvokPatientQuestionnaire, OvokPatientQuestionnaireResponse, OvokPatientResourceQuery, OvokPatientSchedule, OvokPatientSchedulingQuery, OvokPatientSlot, OvokPatientTelemetryHistory, OvokPatientTelemetryHistoryQuery } from "./types";
3
+ import { OvokCurrentPatientProfile, OvokPatientLatestObservationsQuery, OvokPatientObservationBundle, OvokPatientAppointment, OvokPatientCarePlan, OvokPatientDashboard, OvokPatientDashboardQuery, OvokPatientDevice, OvokPatientMeasurement, OvokPatientNotification, OvokPatientQuestionnaire, OvokPatientQuestionnaireResponse, OvokPatientResourceQuery, OvokPatientSchedule, OvokPatientSchedulingQuery, OvokPatientSlot } from "./types";
4
4
  export declare function getCurrentPatientProfile(this: OvokClient, requestOptions?: MedplumRequestOptions): Promise<OvokCurrentPatientProfile>;
5
5
  export declare function getPatientLatestObservations(this: OvokClient, params?: OvokPatientLatestObservationsQuery, requestOptions?: MedplumRequestOptions): Promise<OvokPatientObservationBundle>;
6
- export declare function getPatientDeviceTelemetry(this: OvokClient, deviceId: string, requestOptions?: MedplumRequestOptions): Promise<OvokPatientObservationBundle>;
7
- export declare function getPatientDeviceTelemetryHistory(this: OvokClient, deviceId: string, params?: OvokPatientTelemetryHistoryQuery, requestOptions?: MedplumRequestOptions): Promise<OvokPatientTelemetryHistory>;
8
6
  export declare function listPatientAppointments(this: OvokClient, params?: OvokPatientSchedulingQuery, requestOptions?: MedplumRequestOptions): Promise<OvokPatientAppointment[]>;
9
7
  export declare function getPatientAppointment(this: OvokClient, appointmentId: string, requestOptions?: MedplumRequestOptions): Promise<OvokPatientAppointment>;
10
8
  export declare function createPatientAppointment(this: OvokClient, appointment: OvokPatientAppointment, requestOptions?: MedplumRequestOptions): Promise<OvokPatientAppointment>;
@@ -2,8 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCurrentPatientProfile = getCurrentPatientProfile;
4
4
  exports.getPatientLatestObservations = getPatientLatestObservations;
5
- exports.getPatientDeviceTelemetry = getPatientDeviceTelemetry;
6
- exports.getPatientDeviceTelemetryHistory = getPatientDeviceTelemetryHistory;
7
5
  exports.listPatientAppointments = listPatientAppointments;
8
6
  exports.getPatientAppointment = getPatientAppointment;
9
7
  exports.createPatientAppointment = createPatientAppointment;
@@ -23,7 +21,6 @@ exports.getPatientDevice = getPatientDevice;
23
21
  exports.listPatientNotifications = listPatientNotifications;
24
22
  exports.getPatientNotification = getPatientNotification;
25
23
  exports.getPatientDashboard = getPatientDashboard;
26
- const segment = (value) => encodeURIComponent(value);
27
24
  const query = (params) => {
28
25
  const values = new URLSearchParams();
29
26
  for (const [key, value] of Object.entries(params)) {
@@ -45,12 +42,6 @@ async function getPatientLatestObservations(params = {}, requestOptions) {
45
42
  code,
46
43
  })}`, { ...{ cache: "no-cache" }, ...requestOptions });
47
44
  }
48
- async function getPatientDeviceTelemetry(deviceId, requestOptions) {
49
- return this.get(`/fhir/Device/${segment(deviceId)}/telemetry`, ...(requestOptions === undefined ? [] : [requestOptions]));
50
- }
51
- async function getPatientDeviceTelemetryHistory(deviceId, params = {}, requestOptions) {
52
- return this.get(`/fhir/Device/${segment(deviceId)}/telemetry/history${query(params)}`, ...(requestOptions === undefined ? [] : [requestOptions]));
53
- }
54
45
  async function listPatientAppointments(params = {}, requestOptions) {
55
46
  return this.searchResources("Appointment", params, ...(requestOptions === undefined ? [] : [requestOptions]));
56
47
  }
@@ -61,13 +61,6 @@ export type OvokPatientLatestObservationsQuery = {
61
61
  max?: number;
62
62
  code?: string | string[];
63
63
  };
64
- export type OvokPatientTelemetryHistoryQuery = {
65
- from?: string;
66
- to?: string;
67
- code?: string;
68
- page?: number;
69
- pageSize?: number;
70
- };
71
64
  export type OvokPatientSchedulingQuery = Record<string, string | number | boolean | undefined>;
72
65
  export type OvokPatientResourceQuery = OvokPatientSchedulingQuery;
73
66
  export type OvokPatientDashboardQuery = {
@@ -91,9 +84,3 @@ export type OvokPatientDashboard = {
91
84
  carePlans: OvokPatientCarePlan[];
92
85
  };
93
86
  export type OvokPatientObservationBundle = Bundle<Observation>;
94
- export type OvokPatientTelemetryHistory = {
95
- deviceId: string;
96
- patientId: string;
97
- signalsPatientId: string;
98
- [key: string]: unknown;
99
- };
@@ -1,16 +1,11 @@
1
1
  import type { MedplumRequestOptions } from "@medplum/core";
2
2
  import { OvokClient } from "../ovok-client";
3
- import { OvokAccount, OvokAdministeredProject, OvokCreateProject, OvokCreatedProject, OvokI18nDocument, OvokI18nValue, OvokInviteProjectMember, OvokLocalization, OvokLocalizationQuery, OvokLocalizationUpdate, OvokLocales, OvokPage, OvokPatientObservations, OvokProjectFeature, OvokProjectFeatures, OvokProjectMember, OvokProjectMemberResponse, OvokProjectSettings, OvokProjectSettingKey, OvokProjectTextSettingKey, OvokRemoveProjectMemberResponse, OvokUpdateProjectMember } from "./types";
3
+ import { OvokAccount, OvokAdministeredProject, OvokI18nDocument, OvokI18nValue, OvokInviteProjectMember, OvokLocalization, OvokLocalizationQuery, OvokLocalizationUpdate, OvokLocales, OvokPage, OvokPatientObservations, OvokProjectFeature, OvokProjectFeatures, OvokProjectMember, OvokProjectMemberResponse, OvokProjectSettings, OvokProjectSettingKey, OvokProjectTextSettingKey, OvokRemoveProjectMemberResponse, OvokUpdateProjectMember } from "./types";
4
4
  export declare function getAccounts(this: OvokClient, requestOptions?: MedplumRequestOptions): Promise<OvokAccount[]>;
5
5
  export declare function listAdministeredProjects(this: OvokClient, params?: {
6
6
  page?: number;
7
7
  count?: number;
8
8
  }, requestOptions?: MedplumRequestOptions): Promise<OvokPage<OvokAdministeredProject>>;
9
- export declare function createProject(this: OvokClient, body: OvokCreateProject, requestOptions?: MedplumRequestOptions): Promise<OvokCreatedProject>;
10
- export declare function bootstrapProject(this: OvokClient, body: OvokCreateProject, requestOptions?: MedplumRequestOptions): Promise<OvokCreatedProject>;
11
- export declare function getProjectTenantCode(this: OvokClient, requestOptions?: MedplumRequestOptions): Promise<{
12
- tenantCode: string;
13
- }>;
14
9
  export declare function listProjectMembers(this: OvokClient, params?: {
15
10
  accessPolicyId?: string;
16
11
  profileId?: string;
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAccounts = getAccounts;
4
4
  exports.listAdministeredProjects = listAdministeredProjects;
5
- exports.createProject = createProject;
6
- exports.bootstrapProject = bootstrapProject;
7
- exports.getProjectTenantCode = getProjectTenantCode;
8
5
  exports.listProjectMembers = listProjectMembers;
9
6
  exports.inviteProjectMember = inviteProjectMember;
10
7
  exports.updateProjectMember = updateProjectMember;
@@ -40,15 +37,6 @@ async function getAccounts(requestOptions) {
40
37
  async function listAdministeredProjects(params = {}, requestOptions) {
41
38
  return this.get(`/v1/projects${query(params)}`, ...(requestOptions === undefined ? [] : [requestOptions]));
42
39
  }
43
- async function createProject(body, requestOptions) {
44
- return this.post("/v1/projects", body, undefined, requestOptions);
45
- }
46
- async function bootstrapProject(body, requestOptions) {
47
- return this.post("/v1/projects/bootstrap", body, undefined, requestOptions);
48
- }
49
- async function getProjectTenantCode(requestOptions) {
50
- return this.get("/v1/projects/me/tenant-code", ...(requestOptions === undefined ? [] : [requestOptions]));
51
- }
52
40
  async function listProjectMembers(params = {}, requestOptions) {
53
41
  return this.get(`/v1/projects/me/members${query(params)}`, ...(requestOptions === undefined ? [] : [requestOptions]));
54
42
  }
@@ -16,14 +16,6 @@ export type OvokAdministeredProject = {
16
16
  isMainProject: boolean | null;
17
17
  parentProjectId: string | null;
18
18
  };
19
- export type OvokCreateProject = {
20
- name: string;
21
- };
22
- export type OvokCreatedProject = {
23
- projectId: string;
24
- tenantCode: string;
25
- name: string;
26
- };
27
19
  export type OvokProjectMemberReference = {
28
20
  reference?: string;
29
21
  display?: string;
@@ -75,9 +75,6 @@ exports.OVOK_CORE_API_REQUIREMENTS = {
75
75
  { method: "POST", path: "/video-call/livekit/notification/active-call/:appointmentId", group: "Video" },
76
76
  { method: "GET", path: "/accounts", group: "Accounts" },
77
77
  { method: "GET", path: "/v1/projects", group: "Projects" },
78
- { method: "POST", path: "/v1/projects", group: "Projects" },
79
- { method: "POST", path: "/v1/projects/bootstrap", group: "Projects" },
80
- { method: "GET", path: "/v1/projects/me/tenant-code", group: "Projects" },
81
78
  { method: "GET", path: "/v1/projects/me/members", group: "Projects" },
82
79
  { method: "POST", path: "/v1/projects/me/members", group: "Projects" },
83
80
  { method: "PATCH", path: "/v1/projects/me/members/:membershipId", group: "Projects" },
@@ -108,8 +105,6 @@ exports.OVOK_CORE_API_REQUIREMENTS = {
108
105
  { method: "PATCH", path: "/localization/i18next/:language", group: "Localization" },
109
106
  { method: "GET", path: "/patient/:id/observation", group: "Patient" },
110
107
  { method: "GET", path: "/fhir/Observation/$lastn", group: "Patient" },
111
- { method: "GET", path: "/fhir/Device/:id/telemetry", group: "Patient" },
112
- { method: "GET", path: "/fhir/Device/:id/telemetry/history", group: "Patient" },
113
108
  { method: "POST", path: "/fhir/Questionnaire/:id/$populate", group: "Questionnaire" },
114
109
  { method: "POST", path: "/fhir/QuestionnaireResponse/:id/$extract", group: "Questionnaire" },
115
110
  { method: "GET", path: "/v1/slim/patient", group: "Slim/Patient" },
@@ -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.33",
51
+ version: "0.4.35",
52
52
  },
53
53
  fhirVersion: "4.0.1",
54
54
  format: ["json"],
@@ -19,6 +19,6 @@ export { useCreateNotificationNote, useCreateSignalsAlertNote, useCreateSignalsR
19
19
  export { useAcknowledgeSlimAlarm, useAcknowledgeSlimMedicalNotification, } from "./notification-ack-hooks";
20
20
  export { useCmsDocument, useCmsDocuments, useLegalPage, useReleaseNotes, useTranslations, } from "./cms-hooks";
21
21
  export { useAcceptInvite, useInvitePatient, useInvitePractitioner, } from "./invites-hooks";
22
- export { useCurrentPatientProfile, useExtractQuestionnaireObservations, usePatientAppointments, usePatientCarePlans, usePatientDevices, usePatientDeviceTelemetry, usePatientDeviceTelemetryHistory, usePatientMeasurement, usePatientMeasurementHistory, usePatientDashboard, usePatientLatestObservations, usePatientNotifications, usePatientQuestionnaireResponses, usePatientQuestionnaires, usePatientSchedules, usePatientSlots, usePopulateQuestionnaire, useSubmitQuestionnaireResponse, } from "./patient-hooks";
22
+ export { useCurrentPatientProfile, useExtractQuestionnaireObservations, usePatientAppointments, usePatientCarePlans, usePatientDevices, usePatientMeasurement, usePatientMeasurementHistory, usePatientDashboard, usePatientLatestObservations, usePatientNotifications, usePatientQuestionnaireResponses, usePatientQuestionnaires, usePatientSchedules, usePatientSlots, usePopulateQuestionnaire, useSubmitQuestionnaireResponse, } from "./patient-hooks";
23
23
  export { useCreatePatientSharingInvite, usePatientSharing, usePatientSharingSettings, useRedeemPatientSharingInvite, useRevokePatientSharing, useUpdatePatientSharingSettings, } from "./patient-sharing-hooks";
24
24
  export { useAcknowledgeSignalsAlert, useEnableSignalsForPatient, useRemoveSignalsThreshold, useSetSignalsThreshold, useSignalsAlert, useSignalsAlerts, useSignalsSettings, useSignalsThresholds, useUpdateSignalsSettings, } from "./signals-hooks";
@@ -35,8 +35,8 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.useSetLegalConsent = exports.useRepushUnconfirmedLimits = exports.useMedicalConsent = exports.useLegalConsent = exports.useChangeHistory = exports.useEmailTemplates = exports.useUpdateProjectTextSetting = exports.useUpdateLocalization = exports.useUpdateI18nextDocument = exports.useLocalizations = exports.useLocales = exports.useI18nextDocument = exports.useVideoCallAppointments = exports.useVideoCallAccess = exports.useDocuments = exports.useCreateVideoCallUserAccess = exports.useCreateVideoCallAppointment = exports.useContent = exports.useConsentSignature = exports.useOvokPoll = exports.useRecentSlimNotifications = exports.usePublicApiEndpoints = exports.useProjectSettings = exports.useProjectFeatures = exports.useOvokRequest = exports.useOvokMutation = exports.useCapabilityStatement = exports.useSlimPatients = exports.useSlimNotifications = exports.useSlimDevices = exports.useSlimDeviceTelemetry = exports.useAdministeredProjects = exports.useUrineTests = exports.useSaveMeasurement = exports.useObservations = exports.useEcgRecording = exports.observationsToMeasurements = exports.OvokProvider = exports.useClient = exports.useCachedBinaryUrl = exports.reactContext = exports.useSubscription = exports.useSearchResources = exports.useSearchOne = exports.useSearch = exports.useResource = exports.usePrevious = exports.useMedplumProfile = exports.useMedplumNavigate = exports.useMedplumContext = void 0;
38
- exports.useCreatePatientSharingInvite = exports.useSubmitQuestionnaireResponse = exports.usePopulateQuestionnaire = exports.usePatientSlots = exports.usePatientSchedules = exports.usePatientQuestionnaires = exports.usePatientQuestionnaireResponses = exports.usePatientNotifications = exports.usePatientLatestObservations = exports.usePatientDashboard = exports.usePatientMeasurementHistory = exports.usePatientMeasurement = exports.usePatientDeviceTelemetryHistory = exports.usePatientDeviceTelemetry = exports.usePatientDevices = exports.usePatientCarePlans = exports.usePatientAppointments = exports.useExtractQuestionnaireObservations = exports.useCurrentPatientProfile = exports.useInvitePractitioner = exports.useInvitePatient = exports.useAcceptInvite = exports.useTranslations = exports.useReleaseNotes = exports.useLegalPage = exports.useCmsDocuments = exports.useCmsDocument = exports.useAcknowledgeSlimMedicalNotification = exports.useAcknowledgeSlimAlarm = exports.useUpdateSignalsNote = exports.useUpdateNotificationNote = exports.useSignalsRawAlertNotes = exports.useSignalsAlertNotes = exports.useNotificationNotes = exports.useDeleteSignalsNote = exports.useDeleteNotificationNote = exports.useCreateSignalsRawAlertNote = exports.useCreateSignalsAlertNote = exports.useCreateNotificationNote = exports.useSlimOutOfBedNotifications = exports.useSlimMedicalNotifications = exports.useSlimAlarms = exports.useRecentOutOfBed = exports.useRecentAlarms = exports.useUpdateSlimThresholdV2 = exports.useUpdateSlimPatientThresholdV2 = exports.useUnconfirmedLimits = exports.useSlimThresholdV2 = exports.useSlimPatientThresholdV2 = exports.useSetMedicalConsent = void 0;
39
- exports.useUpdateSignalsSettings = exports.useSignalsThresholds = exports.useSignalsSettings = exports.useSignalsAlerts = exports.useSignalsAlert = exports.useSetSignalsThreshold = exports.useRemoveSignalsThreshold = exports.useEnableSignalsForPatient = exports.useAcknowledgeSignalsAlert = exports.useUpdatePatientSharingSettings = exports.useRevokePatientSharing = exports.useRedeemPatientSharingInvite = exports.usePatientSharingSettings = exports.usePatientSharing = void 0;
38
+ exports.usePatientSharingSettings = exports.usePatientSharing = exports.useCreatePatientSharingInvite = exports.useSubmitQuestionnaireResponse = exports.usePopulateQuestionnaire = exports.usePatientSlots = exports.usePatientSchedules = exports.usePatientQuestionnaires = exports.usePatientQuestionnaireResponses = exports.usePatientNotifications = exports.usePatientLatestObservations = exports.usePatientDashboard = exports.usePatientMeasurementHistory = exports.usePatientMeasurement = exports.usePatientDevices = exports.usePatientCarePlans = exports.usePatientAppointments = exports.useExtractQuestionnaireObservations = exports.useCurrentPatientProfile = exports.useInvitePractitioner = exports.useInvitePatient = exports.useAcceptInvite = exports.useTranslations = exports.useReleaseNotes = exports.useLegalPage = exports.useCmsDocuments = exports.useCmsDocument = exports.useAcknowledgeSlimMedicalNotification = exports.useAcknowledgeSlimAlarm = exports.useUpdateSignalsNote = exports.useUpdateNotificationNote = exports.useSignalsRawAlertNotes = exports.useSignalsAlertNotes = exports.useNotificationNotes = exports.useDeleteSignalsNote = exports.useDeleteNotificationNote = exports.useCreateSignalsRawAlertNote = exports.useCreateSignalsAlertNote = exports.useCreateNotificationNote = exports.useSlimOutOfBedNotifications = exports.useSlimMedicalNotifications = exports.useSlimAlarms = exports.useRecentOutOfBed = exports.useRecentAlarms = exports.useUpdateSlimThresholdV2 = exports.useUpdateSlimPatientThresholdV2 = exports.useUnconfirmedLimits = exports.useSlimThresholdV2 = exports.useSlimPatientThresholdV2 = exports.useSetMedicalConsent = void 0;
39
+ exports.useUpdateSignalsSettings = exports.useSignalsThresholds = exports.useSignalsSettings = exports.useSignalsAlerts = exports.useSignalsAlert = exports.useSetSignalsThreshold = exports.useRemoveSignalsThreshold = exports.useEnableSignalsForPatient = exports.useAcknowledgeSignalsAlert = exports.useUpdatePatientSharingSettings = exports.useRevokePatientSharing = exports.useRedeemPatientSharingInvite = void 0;
40
40
  /*
41
41
  * The only React-dependent module in the package.
42
42
  *
@@ -158,8 +158,6 @@ Object.defineProperty(exports, "useExtractQuestionnaireObservations", { enumerab
158
158
  Object.defineProperty(exports, "usePatientAppointments", { enumerable: true, get: function () { return patient_hooks_1.usePatientAppointments; } });
159
159
  Object.defineProperty(exports, "usePatientCarePlans", { enumerable: true, get: function () { return patient_hooks_1.usePatientCarePlans; } });
160
160
  Object.defineProperty(exports, "usePatientDevices", { enumerable: true, get: function () { return patient_hooks_1.usePatientDevices; } });
161
- Object.defineProperty(exports, "usePatientDeviceTelemetry", { enumerable: true, get: function () { return patient_hooks_1.usePatientDeviceTelemetry; } });
162
- Object.defineProperty(exports, "usePatientDeviceTelemetryHistory", { enumerable: true, get: function () { return patient_hooks_1.usePatientDeviceTelemetryHistory; } });
163
161
  Object.defineProperty(exports, "usePatientMeasurement", { enumerable: true, get: function () { return patient_hooks_1.usePatientMeasurement; } });
164
162
  Object.defineProperty(exports, "usePatientMeasurementHistory", { enumerable: true, get: function () { return patient_hooks_1.usePatientMeasurementHistory; } });
165
163
  Object.defineProperty(exports, "usePatientDashboard", { enumerable: true, get: function () { return patient_hooks_1.usePatientDashboard; } });
@@ -1,12 +1,10 @@
1
1
  import { Bundle, Observation, Parameters, QuestionnaireResponse } from "@medplum/fhirtypes";
2
- import { OvokCurrentPatientProfile, OvokPatientAppointment, OvokPatientCarePlan, OvokPatientDashboard, OvokPatientDashboardQuery, OvokPatientDevice, OvokPatientLatestObservationsQuery, OvokPatientMeasurement, OvokPatientNotification, OvokPatientObservationBundle, OvokPatientQuestionnaire, OvokPatientQuestionnaireResponse, OvokPatientResourceQuery, OvokPatientSchedule, OvokPatientSchedulingQuery, OvokPatientSlot, OvokPatientTelemetryHistory, OvokPatientTelemetryHistoryQuery } from "../client/patient/types";
2
+ import { OvokCurrentPatientProfile, OvokPatientAppointment, OvokPatientCarePlan, OvokPatientDashboard, OvokPatientDashboardQuery, OvokPatientDevice, OvokPatientLatestObservationsQuery, OvokPatientMeasurement, OvokPatientNotification, OvokPatientObservationBundle, OvokPatientQuestionnaire, OvokPatientQuestionnaireResponse, OvokPatientResourceQuery, OvokPatientSchedule, OvokPatientSchedulingQuery, OvokPatientSlot } from "../client/patient/types";
3
3
  import { OvokQuestionnaireOperationResponse } from "../client/questionnaire-response/types";
4
4
  import { OvokMutationState, OvokRequestState } from "./api-hooks";
5
5
  export declare const useCurrentPatientProfile: () => OvokRequestState<OvokCurrentPatientProfile>;
6
6
  export declare const usePatientDashboard: (params?: OvokPatientDashboardQuery) => OvokRequestState<OvokPatientDashboard>;
7
7
  export declare const usePatientLatestObservations: (params?: OvokPatientLatestObservationsQuery) => OvokRequestState<OvokPatientObservationBundle>;
8
- export declare const usePatientDeviceTelemetry: (deviceId?: string) => OvokRequestState<OvokPatientObservationBundle>;
9
- export declare const usePatientDeviceTelemetryHistory: (deviceId: string | undefined, params?: OvokPatientTelemetryHistoryQuery) => OvokRequestState<OvokPatientTelemetryHistory>;
10
8
  export declare const usePatientAppointments: (params?: OvokPatientSchedulingQuery) => OvokRequestState<OvokPatientAppointment[]>;
11
9
  export declare const usePatientSchedules: (params?: OvokPatientSchedulingQuery) => OvokRequestState<OvokPatientSchedule[]>;
12
10
  export declare const usePatientSlots: (params?: OvokPatientSchedulingQuery) => OvokRequestState<OvokPatientSlot[]>;
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.useExtractQuestionnaireObservations = exports.useSubmitQuestionnaireResponse = exports.usePopulateQuestionnaire = exports.usePatientNotifications = exports.usePatientDevices = exports.usePatientQuestionnaireResponses = exports.usePatientQuestionnaires = exports.usePatientCarePlans = exports.usePatientMeasurement = exports.usePatientMeasurementHistory = exports.usePatientSlots = exports.usePatientSchedules = exports.usePatientAppointments = exports.usePatientDeviceTelemetryHistory = exports.usePatientDeviceTelemetry = exports.usePatientLatestObservations = exports.usePatientDashboard = exports.useCurrentPatientProfile = void 0;
37
+ exports.useExtractQuestionnaireObservations = exports.useSubmitQuestionnaireResponse = exports.usePopulateQuestionnaire = exports.usePatientNotifications = exports.usePatientDevices = exports.usePatientQuestionnaireResponses = exports.usePatientQuestionnaires = exports.usePatientCarePlans = exports.usePatientMeasurement = exports.usePatientMeasurementHistory = exports.usePatientSlots = exports.usePatientSchedules = exports.usePatientAppointments = exports.usePatientLatestObservations = exports.usePatientDashboard = exports.useCurrentPatientProfile = 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");
@@ -58,23 +58,6 @@ const usePatientLatestObservations = (params = {}) => {
58
58
  return (0, api_hooks_1.useOvokRequest)(load);
59
59
  };
60
60
  exports.usePatientLatestObservations = usePatientLatestObservations;
61
- const usePatientDeviceTelemetry = (deviceId) => {
62
- const client = (0, index_1.useClient)();
63
- const load = React.useCallback((signal) => deviceId
64
- ? client.getPatientDeviceTelemetry(deviceId, { signal })
65
- : Promise.reject(new Error("deviceId is required")), [client, deviceId]);
66
- return (0, api_hooks_1.useOvokRequest)(load, deviceId !== undefined);
67
- };
68
- exports.usePatientDeviceTelemetry = usePatientDeviceTelemetry;
69
- const usePatientDeviceTelemetryHistory = (deviceId, params = {}) => {
70
- const client = (0, index_1.useClient)();
71
- const serialized = JSON.stringify(params);
72
- const load = React.useCallback((signal) => deviceId
73
- ? client.getPatientDeviceTelemetryHistory(deviceId, params, { signal })
74
- : Promise.reject(new Error("deviceId is required")), [client, deviceId, serialized]);
75
- return (0, api_hooks_1.useOvokRequest)(load, deviceId !== undefined);
76
- };
77
- exports.usePatientDeviceTelemetryHistory = usePatientDeviceTelemetryHistory;
78
61
  const usePatientAppointments = (params = {}) => {
79
62
  const client = (0, index_1.useClient)();
80
63
  const serialized = JSON.stringify(params);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ovok/core",
3
- "version": "0.4.33",
3
+ "version": "0.4.35",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",