@ovok/core 0.3.13 → 0.3.14
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 +21 -4
- package/dist/client/patient/methods.d.ts +13 -1
- package/dist/client/patient/methods.js +48 -0
- package/dist/client/patient/types.d.ts +8 -1
- package/dist/conformance/capability-requirements.js +27 -3
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +8 -1
- package/dist/hooks/patient-hooks.d.ts +8 -1
- package/dist/hooks/patient-hooks.js +51 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -77,7 +77,9 @@ not included until Ovok publishes a supported billing contract.
|
|
|
77
77
|
|
|
78
78
|
Patient applications can read their authenticated profile and health data through typed methods
|
|
79
79
|
backed by the existing `../ovok-core` routes. The profile response includes the Patient resource,
|
|
80
|
-
project context, menu configuration, access policy, and active sessions.
|
|
80
|
+
project context, menu configuration, access policy, and active sessions. The resource facade also
|
|
81
|
+
covers measurement history/detail, CarePlans, questionnaires and responses, assigned devices, and
|
|
82
|
+
CommunicationRequest-backed notifications.
|
|
81
83
|
|
|
82
84
|
```typescript
|
|
83
85
|
const me = await client.getCurrentPatientProfile();
|
|
@@ -92,12 +94,27 @@ const history = await client.getPatientDeviceTelemetryHistory(deviceId, {
|
|
|
92
94
|
to: "2026-09-26T00:00:00.000Z",
|
|
93
95
|
pageSize: 50,
|
|
94
96
|
});
|
|
97
|
+
const measurements = await client.listPatientMeasurementHistory({
|
|
98
|
+
patient: `Patient/${me.profile.id}`,
|
|
99
|
+
_sort: "-date",
|
|
100
|
+
_count: 50,
|
|
101
|
+
});
|
|
102
|
+
const carePlans = await client.listPatientCarePlans({
|
|
103
|
+
patient: `Patient/${me.profile.id}`,
|
|
104
|
+
status: "active",
|
|
105
|
+
});
|
|
106
|
+
const notifications = await client.listPatientNotifications({
|
|
107
|
+
patient: `Patient/${me.profile.id}`,
|
|
108
|
+
_sort: "-authored",
|
|
109
|
+
});
|
|
95
110
|
```
|
|
96
111
|
|
|
97
112
|
These helpers use bearer-authenticated `/auth/me` and `/fhir/*` contracts and are additive to the
|
|
98
|
-
native observation and offline-measurement APIs. The
|
|
99
|
-
|
|
100
|
-
|
|
113
|
+
native observation and offline-measurement APIs. The returned resource lists are subject to the
|
|
114
|
+
patient's backend AccessPolicy. Device pairing/claiming and notification acknowledgement are not
|
|
115
|
+
invented here because `../ovok-core` does not currently expose patient-scoped contracts for them.
|
|
116
|
+
The exported `OVOK_CORE_API_REQUIREMENTS` lists ordinary HTTP routes, while
|
|
117
|
+
`OVOK_CORE_REQUIREMENTS` covers the FHIR operations. Billing is intentionally absent.
|
|
101
118
|
|
|
102
119
|
Questionnaire applications can use the Ovok-specific patient-scoped operations and keep the
|
|
103
120
|
response write atomic with its extracted Observations:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OvokClient } from "../ovok-client";
|
|
2
|
-
import { OvokCurrentPatientProfile, OvokPatientLatestObservationsQuery, OvokPatientObservationBundle, OvokPatientAppointment, OvokPatientSchedule, OvokPatientSchedulingQuery, OvokPatientSlot, OvokPatientTelemetryHistory, OvokPatientTelemetryHistoryQuery } from "./types";
|
|
2
|
+
import { OvokCurrentPatientProfile, OvokPatientLatestObservationsQuery, OvokPatientObservationBundle, OvokPatientAppointment, OvokPatientCarePlan, OvokPatientDevice, OvokPatientMeasurement, OvokPatientNotification, OvokPatientQuestionnaire, OvokPatientQuestionnaireResponse, OvokPatientResourceQuery, OvokPatientSchedule, OvokPatientSchedulingQuery, OvokPatientSlot, OvokPatientTelemetryHistory, OvokPatientTelemetryHistoryQuery } from "./types";
|
|
3
3
|
export declare function getCurrentPatientProfile(this: OvokClient): Promise<OvokCurrentPatientProfile>;
|
|
4
4
|
export declare function getPatientLatestObservations(this: OvokClient, params?: OvokPatientLatestObservationsQuery): Promise<OvokPatientObservationBundle>;
|
|
5
5
|
export declare function getPatientDeviceTelemetry(this: OvokClient, deviceId: string): Promise<OvokPatientObservationBundle>;
|
|
@@ -10,3 +10,15 @@ export declare function createPatientAppointment(this: OvokClient, appointment:
|
|
|
10
10
|
export declare function updatePatientAppointment(this: OvokClient, appointment: OvokPatientAppointment): Promise<OvokPatientAppointment>;
|
|
11
11
|
export declare function listPatientSchedules(this: OvokClient, params?: OvokPatientSchedulingQuery): Promise<OvokPatientSchedule[]>;
|
|
12
12
|
export declare function listPatientSlots(this: OvokClient, params?: OvokPatientSchedulingQuery): Promise<OvokPatientSlot[]>;
|
|
13
|
+
export declare function listPatientMeasurementHistory(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientMeasurement[]>;
|
|
14
|
+
export declare function getPatientMeasurement(this: OvokClient, measurementId: string): Promise<OvokPatientMeasurement>;
|
|
15
|
+
export declare function listPatientCarePlans(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientCarePlan[]>;
|
|
16
|
+
export declare function getPatientCarePlan(this: OvokClient, carePlanId: string): Promise<OvokPatientCarePlan>;
|
|
17
|
+
export declare function listPatientQuestionnaires(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientQuestionnaire[]>;
|
|
18
|
+
export declare function getPatientQuestionnaire(this: OvokClient, questionnaireId: string): Promise<OvokPatientQuestionnaire>;
|
|
19
|
+
export declare function listPatientQuestionnaireResponses(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientQuestionnaireResponse[]>;
|
|
20
|
+
export declare function getPatientQuestionnaireResponse(this: OvokClient, questionnaireResponseId: string): Promise<OvokPatientQuestionnaireResponse>;
|
|
21
|
+
export declare function listPatientDevices(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientDevice[]>;
|
|
22
|
+
export declare function getPatientDevice(this: OvokClient, deviceId: string): Promise<OvokPatientDevice>;
|
|
23
|
+
export declare function listPatientNotifications(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientNotification[]>;
|
|
24
|
+
export declare function getPatientNotification(this: OvokClient, notificationId: string): Promise<OvokPatientNotification>;
|
|
@@ -10,6 +10,18 @@ exports.createPatientAppointment = createPatientAppointment;
|
|
|
10
10
|
exports.updatePatientAppointment = updatePatientAppointment;
|
|
11
11
|
exports.listPatientSchedules = listPatientSchedules;
|
|
12
12
|
exports.listPatientSlots = listPatientSlots;
|
|
13
|
+
exports.listPatientMeasurementHistory = listPatientMeasurementHistory;
|
|
14
|
+
exports.getPatientMeasurement = getPatientMeasurement;
|
|
15
|
+
exports.listPatientCarePlans = listPatientCarePlans;
|
|
16
|
+
exports.getPatientCarePlan = getPatientCarePlan;
|
|
17
|
+
exports.listPatientQuestionnaires = listPatientQuestionnaires;
|
|
18
|
+
exports.getPatientQuestionnaire = getPatientQuestionnaire;
|
|
19
|
+
exports.listPatientQuestionnaireResponses = listPatientQuestionnaireResponses;
|
|
20
|
+
exports.getPatientQuestionnaireResponse = getPatientQuestionnaireResponse;
|
|
21
|
+
exports.listPatientDevices = listPatientDevices;
|
|
22
|
+
exports.getPatientDevice = getPatientDevice;
|
|
23
|
+
exports.listPatientNotifications = listPatientNotifications;
|
|
24
|
+
exports.getPatientNotification = getPatientNotification;
|
|
13
25
|
const segment = (value) => encodeURIComponent(value);
|
|
14
26
|
const query = (params) => {
|
|
15
27
|
const values = new URLSearchParams();
|
|
@@ -56,3 +68,39 @@ async function listPatientSchedules(params = {}) {
|
|
|
56
68
|
async function listPatientSlots(params = {}) {
|
|
57
69
|
return this.searchResources("Slot", params);
|
|
58
70
|
}
|
|
71
|
+
async function listPatientMeasurementHistory(params = {}) {
|
|
72
|
+
return (await this.searchResources("Observation", params));
|
|
73
|
+
}
|
|
74
|
+
async function getPatientMeasurement(measurementId) {
|
|
75
|
+
return this.readResource("Observation", measurementId);
|
|
76
|
+
}
|
|
77
|
+
async function listPatientCarePlans(params = {}) {
|
|
78
|
+
return (await this.searchResources("CarePlan", params));
|
|
79
|
+
}
|
|
80
|
+
async function getPatientCarePlan(carePlanId) {
|
|
81
|
+
return this.readResource("CarePlan", carePlanId);
|
|
82
|
+
}
|
|
83
|
+
async function listPatientQuestionnaires(params = {}) {
|
|
84
|
+
return (await this.searchResources("Questionnaire", params));
|
|
85
|
+
}
|
|
86
|
+
async function getPatientQuestionnaire(questionnaireId) {
|
|
87
|
+
return this.readResource("Questionnaire", questionnaireId);
|
|
88
|
+
}
|
|
89
|
+
async function listPatientQuestionnaireResponses(params = {}) {
|
|
90
|
+
return (await this.searchResources("QuestionnaireResponse", params));
|
|
91
|
+
}
|
|
92
|
+
async function getPatientQuestionnaireResponse(questionnaireResponseId) {
|
|
93
|
+
return this.readResource("QuestionnaireResponse", questionnaireResponseId);
|
|
94
|
+
}
|
|
95
|
+
async function listPatientDevices(params = {}) {
|
|
96
|
+
return (await this.searchResources("Device", params));
|
|
97
|
+
}
|
|
98
|
+
async function getPatientDevice(deviceId) {
|
|
99
|
+
return this.readResource("Device", deviceId);
|
|
100
|
+
}
|
|
101
|
+
async function listPatientNotifications(params = {}) {
|
|
102
|
+
return (await this.searchResources("CommunicationRequest", params));
|
|
103
|
+
}
|
|
104
|
+
async function getPatientNotification(notificationId) {
|
|
105
|
+
return this.readResource("CommunicationRequest", notificationId);
|
|
106
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Appointment, Bundle, Observation, Schedule, Slot } from "@medplum/fhirtypes";
|
|
1
|
+
import { Appointment, Bundle, CarePlan, CommunicationRequest, Device, Observation, Questionnaire, QuestionnaireResponse, Schedule, Slot } from "@medplum/fhirtypes";
|
|
2
2
|
export type OvokCurrentPatientProfile = {
|
|
3
3
|
project: {
|
|
4
4
|
resourceType: "Project";
|
|
@@ -69,9 +69,16 @@ export type OvokPatientTelemetryHistoryQuery = {
|
|
|
69
69
|
pageSize?: number;
|
|
70
70
|
};
|
|
71
71
|
export type OvokPatientSchedulingQuery = Record<string, string | number | boolean | undefined>;
|
|
72
|
+
export type OvokPatientResourceQuery = OvokPatientSchedulingQuery;
|
|
72
73
|
export type OvokPatientAppointment = Appointment;
|
|
73
74
|
export type OvokPatientSchedule = Schedule;
|
|
74
75
|
export type OvokPatientSlot = Slot;
|
|
76
|
+
export type OvokPatientMeasurement = Observation;
|
|
77
|
+
export type OvokPatientCarePlan = CarePlan;
|
|
78
|
+
export type OvokPatientDevice = Device;
|
|
79
|
+
export type OvokPatientNotification = CommunicationRequest;
|
|
80
|
+
export type OvokPatientQuestionnaire = Questionnaire;
|
|
81
|
+
export type OvokPatientQuestionnaireResponse = QuestionnaireResponse;
|
|
75
82
|
export type OvokPatientObservationBundle = Bundle<Observation>;
|
|
76
83
|
export type OvokPatientTelemetryHistory = {
|
|
77
84
|
deviceId: string;
|
|
@@ -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.
|
|
51
|
+
version: "0.3.14",
|
|
52
52
|
},
|
|
53
53
|
fhirVersion: "4.0.1",
|
|
54
54
|
format: ["json"],
|
|
@@ -72,7 +72,11 @@ exports.OVOK_CORE_REQUIREMENTS = {
|
|
|
72
72
|
resource: [
|
|
73
73
|
{
|
|
74
74
|
type: "Observation",
|
|
75
|
-
interaction: [
|
|
75
|
+
interaction: [
|
|
76
|
+
{ code: "search-type" },
|
|
77
|
+
{ code: "read" },
|
|
78
|
+
{ code: "create" },
|
|
79
|
+
],
|
|
76
80
|
operation: [
|
|
77
81
|
{
|
|
78
82
|
name: "lastn",
|
|
@@ -90,7 +94,11 @@ exports.OVOK_CORE_REQUIREMENTS = {
|
|
|
90
94
|
},
|
|
91
95
|
{
|
|
92
96
|
type: "QuestionnaireResponse",
|
|
93
|
-
interaction: [
|
|
97
|
+
interaction: [
|
|
98
|
+
{ code: "search-type" },
|
|
99
|
+
{ code: "read" },
|
|
100
|
+
{ code: "create" },
|
|
101
|
+
],
|
|
94
102
|
documentation: "Created as an entry of the transaction Bundle above, never on its own by this library.",
|
|
95
103
|
operation: [
|
|
96
104
|
{
|
|
@@ -102,6 +110,7 @@ exports.OVOK_CORE_REQUIREMENTS = {
|
|
|
102
110
|
},
|
|
103
111
|
{
|
|
104
112
|
type: "Questionnaire",
|
|
113
|
+
interaction: [{ code: "search-type" }, { code: "read" }],
|
|
105
114
|
operation: [
|
|
106
115
|
{
|
|
107
116
|
name: "populate",
|
|
@@ -110,6 +119,21 @@ exports.OVOK_CORE_REQUIREMENTS = {
|
|
|
110
119
|
},
|
|
111
120
|
],
|
|
112
121
|
},
|
|
122
|
+
{
|
|
123
|
+
type: "CarePlan",
|
|
124
|
+
interaction: [{ code: "search-type" }, { code: "read" }],
|
|
125
|
+
documentation: "Patient care-plan helpers read plans through the authenticated FHIR surface.",
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
type: "Device",
|
|
129
|
+
interaction: [{ code: "search-type" }, { code: "read" }],
|
|
130
|
+
documentation: "Patient device helpers read devices assigned to the authenticated patient.",
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
type: "CommunicationRequest",
|
|
134
|
+
interaction: [{ code: "search-type" }, { code: "read" }],
|
|
135
|
+
documentation: "Patient notification helpers read CommunicationRequest resources visible to the authenticated patient.",
|
|
136
|
+
},
|
|
113
137
|
{
|
|
114
138
|
type: "Appointment",
|
|
115
139
|
interaction: [
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ export declare const OvokProvider: (props: React.PropsWithChildren<{
|
|
|
7
7
|
}>) => React.JSX.Element;
|
|
8
8
|
export { observationsToMeasurements, useEcgRecording, useObservations, useSaveMeasurement, useUrineTests, } from "./observation-hooks";
|
|
9
9
|
export { useAdministeredProjects, useCarehubDeviceTelemetry, useCarehubDevices, useCarehubNotifications, useCarehubPatients, useCapabilityStatement, useOvokMutation, useOvokRequest, useProjectFeatures, useProjectSettings, usePublicApiEndpoints, useRecentCarehubNotifications, } from "./api-hooks";
|
|
10
|
-
export { useCurrentPatientProfile, useExtractQuestionnaireObservations, usePatientAppointments, usePatientDeviceTelemetry, usePatientDeviceTelemetryHistory, usePatientLatestObservations, usePatientSchedules, usePatientSlots, usePopulateQuestionnaire, useSubmitQuestionnaireResponse, } from "./patient-hooks";
|
|
10
|
+
export { useCurrentPatientProfile, useExtractQuestionnaireObservations, usePatientAppointments, usePatientCarePlans, usePatientDevices, usePatientDeviceTelemetry, usePatientDeviceTelemetryHistory, usePatientMeasurement, usePatientMeasurementHistory, usePatientLatestObservations, usePatientNotifications, usePatientQuestionnaireResponses, usePatientQuestionnaires, usePatientSchedules, usePatientSlots, usePopulateQuestionnaire, useSubmitQuestionnaireResponse, } from "./patient-hooks";
|
package/dist/hooks/index.js
CHANGED
|
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.useSubmitQuestionnaireResponse = exports.usePopulateQuestionnaire = exports.usePatientSlots = exports.usePatientSchedules = exports.usePatientLatestObservations = exports.usePatientDeviceTelemetryHistory = exports.usePatientDeviceTelemetry = exports.usePatientAppointments = exports.useExtractQuestionnaireObservations = exports.useCurrentPatientProfile = exports.useRecentCarehubNotifications = exports.usePublicApiEndpoints = exports.useProjectSettings = exports.useProjectFeatures = exports.useOvokRequest = exports.useOvokMutation = exports.useCapabilityStatement = exports.useCarehubPatients = exports.useCarehubNotifications = exports.useCarehubDevices = exports.useCarehubDeviceTelemetry = 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;
|
|
37
|
+
exports.useSubmitQuestionnaireResponse = exports.usePopulateQuestionnaire = exports.usePatientSlots = exports.usePatientSchedules = exports.usePatientQuestionnaires = exports.usePatientQuestionnaireResponses = exports.usePatientNotifications = exports.usePatientLatestObservations = exports.usePatientMeasurementHistory = exports.usePatientMeasurement = exports.usePatientDeviceTelemetryHistory = exports.usePatientDeviceTelemetry = exports.usePatientDevices = exports.usePatientCarePlans = exports.usePatientAppointments = exports.useExtractQuestionnaireObservations = exports.useCurrentPatientProfile = exports.useRecentCarehubNotifications = exports.usePublicApiEndpoints = exports.useProjectSettings = exports.useProjectFeatures = exports.useOvokRequest = exports.useOvokMutation = exports.useCapabilityStatement = exports.useCarehubPatients = exports.useCarehubNotifications = exports.useCarehubDevices = exports.useCarehubDeviceTelemetry = 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
38
|
/*
|
|
39
39
|
* The only React-dependent module in the package.
|
|
40
40
|
*
|
|
@@ -93,9 +93,16 @@ var patient_hooks_1 = require("./patient-hooks");
|
|
|
93
93
|
Object.defineProperty(exports, "useCurrentPatientProfile", { enumerable: true, get: function () { return patient_hooks_1.useCurrentPatientProfile; } });
|
|
94
94
|
Object.defineProperty(exports, "useExtractQuestionnaireObservations", { enumerable: true, get: function () { return patient_hooks_1.useExtractQuestionnaireObservations; } });
|
|
95
95
|
Object.defineProperty(exports, "usePatientAppointments", { enumerable: true, get: function () { return patient_hooks_1.usePatientAppointments; } });
|
|
96
|
+
Object.defineProperty(exports, "usePatientCarePlans", { enumerable: true, get: function () { return patient_hooks_1.usePatientCarePlans; } });
|
|
97
|
+
Object.defineProperty(exports, "usePatientDevices", { enumerable: true, get: function () { return patient_hooks_1.usePatientDevices; } });
|
|
96
98
|
Object.defineProperty(exports, "usePatientDeviceTelemetry", { enumerable: true, get: function () { return patient_hooks_1.usePatientDeviceTelemetry; } });
|
|
97
99
|
Object.defineProperty(exports, "usePatientDeviceTelemetryHistory", { enumerable: true, get: function () { return patient_hooks_1.usePatientDeviceTelemetryHistory; } });
|
|
100
|
+
Object.defineProperty(exports, "usePatientMeasurement", { enumerable: true, get: function () { return patient_hooks_1.usePatientMeasurement; } });
|
|
101
|
+
Object.defineProperty(exports, "usePatientMeasurementHistory", { enumerable: true, get: function () { return patient_hooks_1.usePatientMeasurementHistory; } });
|
|
98
102
|
Object.defineProperty(exports, "usePatientLatestObservations", { enumerable: true, get: function () { return patient_hooks_1.usePatientLatestObservations; } });
|
|
103
|
+
Object.defineProperty(exports, "usePatientNotifications", { enumerable: true, get: function () { return patient_hooks_1.usePatientNotifications; } });
|
|
104
|
+
Object.defineProperty(exports, "usePatientQuestionnaireResponses", { enumerable: true, get: function () { return patient_hooks_1.usePatientQuestionnaireResponses; } });
|
|
105
|
+
Object.defineProperty(exports, "usePatientQuestionnaires", { enumerable: true, get: function () { return patient_hooks_1.usePatientQuestionnaires; } });
|
|
99
106
|
Object.defineProperty(exports, "usePatientSchedules", { enumerable: true, get: function () { return patient_hooks_1.usePatientSchedules; } });
|
|
100
107
|
Object.defineProperty(exports, "usePatientSlots", { enumerable: true, get: function () { return patient_hooks_1.usePatientSlots; } });
|
|
101
108
|
Object.defineProperty(exports, "usePopulateQuestionnaire", { enumerable: true, get: function () { return patient_hooks_1.usePopulateQuestionnaire; } });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Bundle, Observation, Parameters, QuestionnaireResponse } from "@medplum/fhirtypes";
|
|
2
|
-
import { OvokCurrentPatientProfile, OvokPatientAppointment, OvokPatientLatestObservationsQuery, OvokPatientObservationBundle, OvokPatientSchedule, OvokPatientSchedulingQuery, OvokPatientSlot, OvokPatientTelemetryHistory, OvokPatientTelemetryHistoryQuery } from "../client/patient/types";
|
|
2
|
+
import { OvokCurrentPatientProfile, OvokPatientAppointment, OvokPatientCarePlan, OvokPatientDevice, OvokPatientLatestObservationsQuery, OvokPatientMeasurement, OvokPatientNotification, OvokPatientObservationBundle, OvokPatientQuestionnaire, OvokPatientQuestionnaireResponse, OvokPatientResourceQuery, OvokPatientSchedule, OvokPatientSchedulingQuery, OvokPatientSlot, OvokPatientTelemetryHistory, OvokPatientTelemetryHistoryQuery } 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>;
|
|
@@ -9,6 +9,13 @@ export declare const usePatientDeviceTelemetryHistory: (deviceId: string | undef
|
|
|
9
9
|
export declare const usePatientAppointments: (params?: OvokPatientSchedulingQuery) => OvokRequestState<OvokPatientAppointment[]>;
|
|
10
10
|
export declare const usePatientSchedules: (params?: OvokPatientSchedulingQuery) => OvokRequestState<OvokPatientSchedule[]>;
|
|
11
11
|
export declare const usePatientSlots: (params?: OvokPatientSchedulingQuery) => OvokRequestState<OvokPatientSlot[]>;
|
|
12
|
+
export declare const usePatientMeasurementHistory: (params?: OvokPatientResourceQuery) => OvokRequestState<OvokPatientMeasurement[]>;
|
|
13
|
+
export declare const usePatientMeasurement: (measurementId?: string) => OvokRequestState<OvokPatientMeasurement>;
|
|
14
|
+
export declare const usePatientCarePlans: (params?: OvokPatientResourceQuery) => OvokRequestState<OvokPatientCarePlan[]>;
|
|
15
|
+
export declare const usePatientQuestionnaires: (params?: OvokPatientResourceQuery) => OvokRequestState<OvokPatientQuestionnaire[]>;
|
|
16
|
+
export declare const usePatientQuestionnaireResponses: (params?: OvokPatientResourceQuery) => OvokRequestState<OvokPatientQuestionnaireResponse[]>;
|
|
17
|
+
export declare const usePatientDevices: (params?: OvokPatientResourceQuery) => OvokRequestState<OvokPatientDevice[]>;
|
|
18
|
+
export declare const usePatientNotifications: (params?: OvokPatientResourceQuery) => OvokRequestState<OvokPatientNotification[]>;
|
|
12
19
|
export declare const usePopulateQuestionnaire: () => OvokMutationState<{
|
|
13
20
|
questionnaireId: string;
|
|
14
21
|
parameters?: Parameters;
|
|
@@ -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.usePatientSlots = exports.usePatientSchedules = exports.usePatientAppointments = exports.usePatientDeviceTelemetryHistory = exports.usePatientDeviceTelemetry = exports.usePatientLatestObservations = 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.usePatientDeviceTelemetryHistory = exports.usePatientDeviceTelemetry = exports.usePatientLatestObservations = 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");
|
|
@@ -89,6 +89,56 @@ const usePatientSlots = (params = {}) => {
|
|
|
89
89
|
return (0, api_hooks_1.useOvokRequest)(load);
|
|
90
90
|
};
|
|
91
91
|
exports.usePatientSlots = usePatientSlots;
|
|
92
|
+
const usePatientMeasurementHistory = (params = {}) => {
|
|
93
|
+
const client = (0, index_1.useClient)();
|
|
94
|
+
const serialized = JSON.stringify(params);
|
|
95
|
+
const load = React.useCallback(() => client.listPatientMeasurementHistory(params), [client, serialized]);
|
|
96
|
+
return (0, api_hooks_1.useOvokRequest)(load);
|
|
97
|
+
};
|
|
98
|
+
exports.usePatientMeasurementHistory = usePatientMeasurementHistory;
|
|
99
|
+
const usePatientMeasurement = (measurementId) => {
|
|
100
|
+
const client = (0, index_1.useClient)();
|
|
101
|
+
const load = React.useCallback(() => measurementId
|
|
102
|
+
? client.getPatientMeasurement(measurementId)
|
|
103
|
+
: Promise.reject(new Error("measurementId is required")), [client, measurementId]);
|
|
104
|
+
return (0, api_hooks_1.useOvokRequest)(load, measurementId !== undefined);
|
|
105
|
+
};
|
|
106
|
+
exports.usePatientMeasurement = usePatientMeasurement;
|
|
107
|
+
const usePatientCarePlans = (params = {}) => {
|
|
108
|
+
const client = (0, index_1.useClient)();
|
|
109
|
+
const serialized = JSON.stringify(params);
|
|
110
|
+
const load = React.useCallback(() => client.listPatientCarePlans(params), [client, serialized]);
|
|
111
|
+
return (0, api_hooks_1.useOvokRequest)(load);
|
|
112
|
+
};
|
|
113
|
+
exports.usePatientCarePlans = usePatientCarePlans;
|
|
114
|
+
const usePatientQuestionnaires = (params = {}) => {
|
|
115
|
+
const client = (0, index_1.useClient)();
|
|
116
|
+
const serialized = JSON.stringify(params);
|
|
117
|
+
const load = React.useCallback(() => client.listPatientQuestionnaires(params), [client, serialized]);
|
|
118
|
+
return (0, api_hooks_1.useOvokRequest)(load);
|
|
119
|
+
};
|
|
120
|
+
exports.usePatientQuestionnaires = usePatientQuestionnaires;
|
|
121
|
+
const usePatientQuestionnaireResponses = (params = {}) => {
|
|
122
|
+
const client = (0, index_1.useClient)();
|
|
123
|
+
const serialized = JSON.stringify(params);
|
|
124
|
+
const load = React.useCallback(() => client.listPatientQuestionnaireResponses(params), [client, serialized]);
|
|
125
|
+
return (0, api_hooks_1.useOvokRequest)(load);
|
|
126
|
+
};
|
|
127
|
+
exports.usePatientQuestionnaireResponses = usePatientQuestionnaireResponses;
|
|
128
|
+
const usePatientDevices = (params = {}) => {
|
|
129
|
+
const client = (0, index_1.useClient)();
|
|
130
|
+
const serialized = JSON.stringify(params);
|
|
131
|
+
const load = React.useCallback(() => client.listPatientDevices(params), [client, serialized]);
|
|
132
|
+
return (0, api_hooks_1.useOvokRequest)(load);
|
|
133
|
+
};
|
|
134
|
+
exports.usePatientDevices = usePatientDevices;
|
|
135
|
+
const usePatientNotifications = (params = {}) => {
|
|
136
|
+
const client = (0, index_1.useClient)();
|
|
137
|
+
const serialized = JSON.stringify(params);
|
|
138
|
+
const load = React.useCallback(() => client.listPatientNotifications(params), [client, serialized]);
|
|
139
|
+
return (0, api_hooks_1.useOvokRequest)(load);
|
|
140
|
+
};
|
|
141
|
+
exports.usePatientNotifications = usePatientNotifications;
|
|
92
142
|
const usePopulateQuestionnaire = () => (0, api_hooks_1.useOvokMutation)((client, params) => client.populateQuestionnaire(params.questionnaireId, params.parameters));
|
|
93
143
|
exports.usePopulateQuestionnaire = usePopulateQuestionnaire;
|
|
94
144
|
const useSubmitQuestionnaireResponse = () => {
|