@ovok/core 0.3.15 → 0.3.16
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 +5 -0
- package/dist/client/patient/methods.d.ts +2 -1
- package/dist/client/patient/methods.js +21 -0
- package/dist/client/patient/types.d.ts +11 -0
- package/dist/conformance/capability-requirements.js +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +2 -1
- package/dist/hooks/patient-hooks.d.ts +2 -1
- package/dist/hooks/patient-hooks.js +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,6 +83,11 @@ CommunicationRequest-backed notifications.
|
|
|
83
83
|
|
|
84
84
|
```typescript
|
|
85
85
|
const me = await client.getCurrentPatientProfile();
|
|
86
|
+
const dashboard = await client.getPatientDashboard({
|
|
87
|
+
latestObservations: { code: ["8867-4", "9279-1"], max: 5 },
|
|
88
|
+
measurementHistory: { _sort: "-date", _count: 50 },
|
|
89
|
+
carePlans: { status: "active" },
|
|
90
|
+
});
|
|
86
91
|
const latest = await client.getPatientLatestObservations({
|
|
87
92
|
patient: `Patient/${me.profile.id}`,
|
|
88
93
|
code: ["8867-4", "9279-1"],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OvokClient } from "../ovok-client";
|
|
2
|
-
import { OvokCurrentPatientProfile, OvokPatientLatestObservationsQuery, OvokPatientObservationBundle, OvokPatientAppointment, OvokPatientCarePlan, OvokPatientDevice, OvokPatientMeasurement, OvokPatientNotification, OvokPatientQuestionnaire, OvokPatientQuestionnaireResponse, OvokPatientResourceQuery, OvokPatientSchedule, OvokPatientSchedulingQuery, OvokPatientSlot, OvokPatientTelemetryHistory, OvokPatientTelemetryHistoryQuery } from "./types";
|
|
2
|
+
import { OvokCurrentPatientProfile, OvokPatientLatestObservationsQuery, OvokPatientObservationBundle, OvokPatientAppointment, OvokPatientCarePlan, OvokPatientDashboard, OvokPatientDashboardQuery, 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>;
|
|
@@ -22,3 +22,4 @@ export declare function listPatientDevices(this: OvokClient, params?: OvokPatien
|
|
|
22
22
|
export declare function getPatientDevice(this: OvokClient, deviceId: string): Promise<OvokPatientDevice>;
|
|
23
23
|
export declare function listPatientNotifications(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientNotification[]>;
|
|
24
24
|
export declare function getPatientNotification(this: OvokClient, notificationId: string): Promise<OvokPatientNotification>;
|
|
25
|
+
export declare function getPatientDashboard(this: OvokClient, params?: OvokPatientDashboardQuery): Promise<OvokPatientDashboard>;
|
|
@@ -22,6 +22,7 @@ exports.listPatientDevices = listPatientDevices;
|
|
|
22
22
|
exports.getPatientDevice = getPatientDevice;
|
|
23
23
|
exports.listPatientNotifications = listPatientNotifications;
|
|
24
24
|
exports.getPatientNotification = getPatientNotification;
|
|
25
|
+
exports.getPatientDashboard = getPatientDashboard;
|
|
25
26
|
const segment = (value) => encodeURIComponent(value);
|
|
26
27
|
const query = (params) => {
|
|
27
28
|
const values = new URLSearchParams();
|
|
@@ -104,3 +105,23 @@ async function listPatientNotifications(params = {}) {
|
|
|
104
105
|
async function getPatientNotification(notificationId) {
|
|
105
106
|
return this.readResource("CommunicationRequest", notificationId);
|
|
106
107
|
}
|
|
108
|
+
async function getPatientDashboard(params = {}) {
|
|
109
|
+
var _a, _b, _c, _d, _e, _f;
|
|
110
|
+
const profile = await this.getCurrentPatientProfile();
|
|
111
|
+
const patient = `Patient/${profile.profile.id}`;
|
|
112
|
+
const latestObservations = await this.getPatientLatestObservations({
|
|
113
|
+
...params.latestObservations,
|
|
114
|
+
patient: (_b = (_a = params.latestObservations) === null || _a === void 0 ? void 0 : _a.patient) !== null && _b !== void 0 ? _b : patient,
|
|
115
|
+
});
|
|
116
|
+
const [measurementHistory, carePlans] = await Promise.all([
|
|
117
|
+
this.listPatientMeasurementHistory({
|
|
118
|
+
...params.measurementHistory,
|
|
119
|
+
patient: (_d = (_c = params.measurementHistory) === null || _c === void 0 ? void 0 : _c.patient) !== null && _d !== void 0 ? _d : patient,
|
|
120
|
+
}),
|
|
121
|
+
this.listPatientCarePlans({
|
|
122
|
+
...params.carePlans,
|
|
123
|
+
patient: (_f = (_e = params.carePlans) === null || _e === void 0 ? void 0 : _e.patient) !== null && _f !== void 0 ? _f : patient,
|
|
124
|
+
}),
|
|
125
|
+
]);
|
|
126
|
+
return { carePlans, latestObservations, measurementHistory, profile };
|
|
127
|
+
}
|
|
@@ -70,6 +70,11 @@ export type OvokPatientTelemetryHistoryQuery = {
|
|
|
70
70
|
};
|
|
71
71
|
export type OvokPatientSchedulingQuery = Record<string, string | number | boolean | undefined>;
|
|
72
72
|
export type OvokPatientResourceQuery = OvokPatientSchedulingQuery;
|
|
73
|
+
export type OvokPatientDashboardQuery = {
|
|
74
|
+
latestObservations?: OvokPatientLatestObservationsQuery;
|
|
75
|
+
measurementHistory?: OvokPatientResourceQuery;
|
|
76
|
+
carePlans?: OvokPatientResourceQuery;
|
|
77
|
+
};
|
|
73
78
|
export type OvokPatientAppointment = Appointment;
|
|
74
79
|
export type OvokPatientSchedule = Schedule;
|
|
75
80
|
export type OvokPatientSlot = Slot;
|
|
@@ -79,6 +84,12 @@ export type OvokPatientDevice = Device;
|
|
|
79
84
|
export type OvokPatientNotification = CommunicationRequest;
|
|
80
85
|
export type OvokPatientQuestionnaire = Questionnaire;
|
|
81
86
|
export type OvokPatientQuestionnaireResponse = QuestionnaireResponse;
|
|
87
|
+
export type OvokPatientDashboard = {
|
|
88
|
+
profile: OvokCurrentPatientProfile;
|
|
89
|
+
latestObservations: OvokPatientObservationBundle;
|
|
90
|
+
measurementHistory: OvokPatientMeasurement[];
|
|
91
|
+
carePlans: OvokPatientCarePlan[];
|
|
92
|
+
};
|
|
82
93
|
export type OvokPatientObservationBundle = Bundle<Observation>;
|
|
83
94
|
export type OvokPatientTelemetryHistory = {
|
|
84
95
|
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.16",
|
|
52
52
|
},
|
|
53
53
|
fhirVersion: "4.0.1",
|
|
54
54
|
format: ["json"],
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -9,4 +9,4 @@ export { observationsToMeasurements, useEcgRecording, useObservations, useSaveMe
|
|
|
9
9
|
export { useAdministeredProjects, useCarehubDeviceTelemetry, useCarehubDevices, useCarehubNotifications, useCarehubPatients, useCapabilityStatement, useOvokMutation, useOvokRequest, useProjectFeatures, useProjectSettings, usePublicApiEndpoints, useRecentCarehubNotifications, } from "./api-hooks";
|
|
10
10
|
export { useConsentSignature, useContent, useCreateVideoCallAppointment, useCreateVideoCallUserAccess, useDocuments, useVideoCallAccess, useVideoCallAppointments, } from "./experience-hooks";
|
|
11
11
|
export { useI18nextDocument, useLocales, useLocalizations, useUpdateI18nextDocument, useUpdateLocalization, } from "./platform-hooks";
|
|
12
|
-
export { useCurrentPatientProfile, useExtractQuestionnaireObservations, usePatientAppointments, usePatientCarePlans, usePatientDevices, usePatientDeviceTelemetry, usePatientDeviceTelemetryHistory, usePatientMeasurement, usePatientMeasurementHistory, usePatientLatestObservations, usePatientNotifications, usePatientQuestionnaireResponses, usePatientQuestionnaires, usePatientSchedules, usePatientSlots, usePopulateQuestionnaire, useSubmitQuestionnaireResponse, } from "./patient-hooks";
|
|
12
|
+
export { useCurrentPatientProfile, useExtractQuestionnaireObservations, usePatientAppointments, usePatientCarePlans, usePatientDevices, usePatientDeviceTelemetry, usePatientDeviceTelemetryHistory, usePatientMeasurement, usePatientMeasurementHistory, usePatientDashboard, usePatientLatestObservations, usePatientNotifications, usePatientQuestionnaireResponses, usePatientQuestionnaires, usePatientSchedules, usePatientSlots, usePopulateQuestionnaire, useSubmitQuestionnaireResponse, } from "./patient-hooks";
|
package/dist/hooks/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
})();
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
exports.usePatientMeasurement = exports.usePatientDeviceTelemetryHistory = exports.usePatientDeviceTelemetry = exports.usePatientDevices = exports.usePatientCarePlans = exports.usePatientAppointments = exports.useExtractQuestionnaireObservations = exports.useCurrentPatientProfile = 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.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
|
-
exports.useSubmitQuestionnaireResponse = exports.usePopulateQuestionnaire = exports.usePatientSlots = exports.usePatientSchedules = exports.usePatientQuestionnaires = exports.usePatientQuestionnaireResponses = exports.usePatientNotifications = exports.usePatientLatestObservations = exports.usePatientMeasurementHistory = void 0;
|
|
38
|
+
exports.useSubmitQuestionnaireResponse = exports.usePopulateQuestionnaire = exports.usePatientSlots = exports.usePatientSchedules = exports.usePatientQuestionnaires = exports.usePatientQuestionnaireResponses = exports.usePatientNotifications = exports.usePatientLatestObservations = exports.usePatientDashboard = exports.usePatientMeasurementHistory = void 0;
|
|
39
39
|
/*
|
|
40
40
|
* The only React-dependent module in the package.
|
|
41
41
|
*
|
|
@@ -114,6 +114,7 @@ Object.defineProperty(exports, "usePatientDeviceTelemetry", { enumerable: true,
|
|
|
114
114
|
Object.defineProperty(exports, "usePatientDeviceTelemetryHistory", { enumerable: true, get: function () { return patient_hooks_1.usePatientDeviceTelemetryHistory; } });
|
|
115
115
|
Object.defineProperty(exports, "usePatientMeasurement", { enumerable: true, get: function () { return patient_hooks_1.usePatientMeasurement; } });
|
|
116
116
|
Object.defineProperty(exports, "usePatientMeasurementHistory", { enumerable: true, get: function () { return patient_hooks_1.usePatientMeasurementHistory; } });
|
|
117
|
+
Object.defineProperty(exports, "usePatientDashboard", { enumerable: true, get: function () { return patient_hooks_1.usePatientDashboard; } });
|
|
117
118
|
Object.defineProperty(exports, "usePatientLatestObservations", { enumerable: true, get: function () { return patient_hooks_1.usePatientLatestObservations; } });
|
|
118
119
|
Object.defineProperty(exports, "usePatientNotifications", { enumerable: true, get: function () { return patient_hooks_1.usePatientNotifications; } });
|
|
119
120
|
Object.defineProperty(exports, "usePatientQuestionnaireResponses", { enumerable: true, get: function () { return patient_hooks_1.usePatientQuestionnaireResponses; } });
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Bundle, Observation, Parameters, QuestionnaireResponse } from "@medplum/fhirtypes";
|
|
2
|
-
import { OvokCurrentPatientProfile, OvokPatientAppointment, OvokPatientCarePlan, 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, 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>;
|
|
6
|
+
export declare const usePatientDashboard: (params?: OvokPatientDashboardQuery) => OvokRequestState<OvokPatientDashboard>;
|
|
6
7
|
export declare const usePatientLatestObservations: (params?: OvokPatientLatestObservationsQuery) => OvokRequestState<OvokPatientObservationBundle>;
|
|
7
8
|
export declare const usePatientDeviceTelemetry: (deviceId?: string) => OvokRequestState<OvokPatientObservationBundle>;
|
|
8
9
|
export declare const usePatientDeviceTelemetryHistory: (deviceId: string | undefined, params?: OvokPatientTelemetryHistoryQuery) => OvokRequestState<OvokPatientTelemetryHistory>;
|
|
@@ -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.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.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");
|
|
@@ -44,6 +44,13 @@ const useCurrentPatientProfile = () => {
|
|
|
44
44
|
return (0, api_hooks_1.useOvokRequest)(load);
|
|
45
45
|
};
|
|
46
46
|
exports.useCurrentPatientProfile = useCurrentPatientProfile;
|
|
47
|
+
const usePatientDashboard = (params = {}) => {
|
|
48
|
+
const client = (0, index_1.useClient)();
|
|
49
|
+
const serialized = JSON.stringify(params);
|
|
50
|
+
const load = React.useCallback(() => client.getPatientDashboard(params), [client, serialized]);
|
|
51
|
+
return (0, api_hooks_1.useOvokRequest)(load);
|
|
52
|
+
};
|
|
53
|
+
exports.usePatientDashboard = usePatientDashboard;
|
|
47
54
|
const usePatientLatestObservations = (params = {}) => {
|
|
48
55
|
const client = (0, index_1.useClient)();
|
|
49
56
|
const serialized = JSON.stringify(params);
|