@ovok/core 0.3.9 → 0.3.10
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/dist/client/ovok-client.d.ts +2 -1
- package/dist/client/ovok-client.js +2 -0
- package/dist/client/patient/methods.d.ts +6 -0
- package/dist/client/patient/methods.js +34 -0
- package/dist/client/patient/types.d.ts +77 -0
- package/dist/client/patient/types.js +2 -0
- package/dist/conformance/api-requirements.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ import * as experienceMethods from "./experience/methods";
|
|
|
10
10
|
import * as observationMethods from "./observation/methods";
|
|
11
11
|
import { GenerateObservationBodyParams } from "./observation/types/generate-observation-body/GenerateObservationBodyParams";
|
|
12
12
|
import { OfflineMeasurementFlushOptions, OfflineMeasurementFlushResult, OfflineMeasurementQueueOptions } from "./offline";
|
|
13
|
+
import * as patientMethods from "./patient/methods";
|
|
13
14
|
import * as platformMethods from "./platform/methods";
|
|
14
15
|
import * as questionnaireResponseMethods from "./questionnaire-response/methods";
|
|
15
16
|
export declare const MAX_CONDITIONAL_OBSERVATION_ENTRIES = 8;
|
|
@@ -57,7 +58,7 @@ export declare class OvokClient extends MedplumClient {
|
|
|
57
58
|
*/
|
|
58
59
|
getSubscriptionManager(): SubscriptionManager;
|
|
59
60
|
}
|
|
60
|
-
type Methods = typeof authMethods & typeof observationMethods & typeof questionnaireResponseMethods & typeof aiMethods & typeof aiFhirMethods & typeof botMethods & typeof carehubMethods & typeof platformMethods & typeof experienceMethods;
|
|
61
|
+
type Methods = typeof authMethods & typeof observationMethods & typeof questionnaireResponseMethods & typeof aiMethods & typeof aiFhirMethods & typeof botMethods & typeof carehubMethods & typeof platformMethods & typeof experienceMethods & typeof patientMethods;
|
|
61
62
|
type Omitted<T> = Omit<T, "executeBot">;
|
|
62
63
|
declare module "./ovok-client" {
|
|
63
64
|
interface OvokClient extends Omitted<Methods> {
|
|
@@ -47,6 +47,7 @@ const experienceMethods = __importStar(require("./experience/methods"));
|
|
|
47
47
|
const observationMethods = __importStar(require("./observation/methods"));
|
|
48
48
|
const observation_bundle_utils_1 = require("./observation/observation-bundle-utils");
|
|
49
49
|
const offline_1 = require("./offline");
|
|
50
|
+
const patientMethods = __importStar(require("./patient/methods"));
|
|
50
51
|
const platformMethods = __importStar(require("./platform/methods"));
|
|
51
52
|
const questionnaireResponseMethods = __importStar(require("./questionnaire-response/methods"));
|
|
52
53
|
exports.MAX_CONDITIONAL_OBSERVATION_ENTRIES = 8;
|
|
@@ -71,6 +72,7 @@ class OvokClient extends core_1.MedplumClient {
|
|
|
71
72
|
this.bindMethods(carehubMethods);
|
|
72
73
|
this.bindMethods(platformMethods);
|
|
73
74
|
this.bindMethods(experienceMethods);
|
|
75
|
+
this.bindMethods(patientMethods);
|
|
74
76
|
this.clientStorage = config.storage;
|
|
75
77
|
this.offlineQueueOptions = (_b = config.offlineQueue) !== null && _b !== void 0 ? _b : {};
|
|
76
78
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { OvokClient } from "../ovok-client";
|
|
2
|
+
import { OvokCurrentPatientProfile, OvokPatientLatestObservationsQuery, OvokPatientObservationBundle, OvokPatientTelemetryHistory, OvokPatientTelemetryHistoryQuery } from "./types";
|
|
3
|
+
export declare function getCurrentPatientProfile(this: OvokClient): Promise<OvokCurrentPatientProfile>;
|
|
4
|
+
export declare function getPatientLatestObservations(this: OvokClient, params?: OvokPatientLatestObservationsQuery): Promise<OvokPatientObservationBundle>;
|
|
5
|
+
export declare function getPatientDeviceTelemetry(this: OvokClient, deviceId: string): Promise<OvokPatientObservationBundle>;
|
|
6
|
+
export declare function getPatientDeviceTelemetryHistory(this: OvokClient, deviceId: string, params?: OvokPatientTelemetryHistoryQuery): Promise<OvokPatientTelemetryHistory>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCurrentPatientProfile = getCurrentPatientProfile;
|
|
4
|
+
exports.getPatientLatestObservations = getPatientLatestObservations;
|
|
5
|
+
exports.getPatientDeviceTelemetry = getPatientDeviceTelemetry;
|
|
6
|
+
exports.getPatientDeviceTelemetryHistory = getPatientDeviceTelemetryHistory;
|
|
7
|
+
const segment = (value) => encodeURIComponent(value);
|
|
8
|
+
const query = (params) => {
|
|
9
|
+
const values = new URLSearchParams();
|
|
10
|
+
for (const [key, value] of Object.entries(params)) {
|
|
11
|
+
if (value !== undefined) {
|
|
12
|
+
values.set(key, String(value));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
const encoded = values.toString();
|
|
16
|
+
return encoded === "" ? "" : `?${encoded}`;
|
|
17
|
+
};
|
|
18
|
+
async function getCurrentPatientProfile() {
|
|
19
|
+
return this.get("/auth/me");
|
|
20
|
+
}
|
|
21
|
+
async function getPatientLatestObservations(params = {}) {
|
|
22
|
+
const code = Array.isArray(params.code) ? params.code.join(",") : params.code;
|
|
23
|
+
return this.get(`/fhir/Observation/$lastn${query({
|
|
24
|
+
patient: params.patient,
|
|
25
|
+
max: params.max,
|
|
26
|
+
code,
|
|
27
|
+
})}`);
|
|
28
|
+
}
|
|
29
|
+
async function getPatientDeviceTelemetry(deviceId) {
|
|
30
|
+
return this.get(`/fhir/Device/${segment(deviceId)}/telemetry`);
|
|
31
|
+
}
|
|
32
|
+
async function getPatientDeviceTelemetryHistory(deviceId, params = {}) {
|
|
33
|
+
return this.get(`/fhir/Device/${segment(deviceId)}/telemetry/history${query(params)}`);
|
|
34
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Bundle, Observation } from "@medplum/fhirtypes";
|
|
2
|
+
export type OvokCurrentPatientProfile = {
|
|
3
|
+
project: {
|
|
4
|
+
resourceType: "Project";
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
strictMode: boolean;
|
|
8
|
+
};
|
|
9
|
+
membership: {
|
|
10
|
+
resourceType: "ProjectMembership";
|
|
11
|
+
id: string;
|
|
12
|
+
user: {
|
|
13
|
+
reference: string;
|
|
14
|
+
display: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
profile: {
|
|
18
|
+
resourceType: "Patient";
|
|
19
|
+
id: string;
|
|
20
|
+
name: Array<{
|
|
21
|
+
given: string[];
|
|
22
|
+
family: string;
|
|
23
|
+
}>;
|
|
24
|
+
telecom: Array<{
|
|
25
|
+
system: string;
|
|
26
|
+
use: string;
|
|
27
|
+
value: string;
|
|
28
|
+
}>;
|
|
29
|
+
};
|
|
30
|
+
config: {
|
|
31
|
+
resourceType: "UserConfiguration";
|
|
32
|
+
menu: Array<{
|
|
33
|
+
title: string;
|
|
34
|
+
link: Array<{
|
|
35
|
+
name: string;
|
|
36
|
+
target: string;
|
|
37
|
+
}>;
|
|
38
|
+
}>;
|
|
39
|
+
};
|
|
40
|
+
accessPolicy: {
|
|
41
|
+
resourceType: "AccessPolicy";
|
|
42
|
+
resource: Array<{
|
|
43
|
+
resourceType: string;
|
|
44
|
+
}>;
|
|
45
|
+
ipAccessRule: Array<{
|
|
46
|
+
ip: string;
|
|
47
|
+
}>;
|
|
48
|
+
};
|
|
49
|
+
security: {
|
|
50
|
+
mfaEnrolled: boolean;
|
|
51
|
+
sessions: Array<{
|
|
52
|
+
id: string;
|
|
53
|
+
lastUpdated: string;
|
|
54
|
+
authMethod: string;
|
|
55
|
+
remoteAddress: string;
|
|
56
|
+
}>;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export type OvokPatientLatestObservationsQuery = {
|
|
60
|
+
patient?: string;
|
|
61
|
+
max?: number;
|
|
62
|
+
code?: string | string[];
|
|
63
|
+
};
|
|
64
|
+
export type OvokPatientTelemetryHistoryQuery = {
|
|
65
|
+
from?: string;
|
|
66
|
+
to?: string;
|
|
67
|
+
code?: string;
|
|
68
|
+
page?: number;
|
|
69
|
+
pageSize?: number;
|
|
70
|
+
};
|
|
71
|
+
export type OvokPatientObservationBundle = Bundle<Observation>;
|
|
72
|
+
export type OvokPatientTelemetryHistory = {
|
|
73
|
+
deviceId: string;
|
|
74
|
+
patientId: string;
|
|
75
|
+
signalsPatientId: string;
|
|
76
|
+
[key: string]: unknown;
|
|
77
|
+
};
|
|
@@ -28,6 +28,7 @@ exports.OVOK_CORE_API_REQUIREMENTS = {
|
|
|
28
28
|
{ method: "POST", path: "/v2/auth/reset-password", group: "Auth" },
|
|
29
29
|
{ method: "POST", path: "/v2/auth/reset-password/process", group: "Auth" },
|
|
30
30
|
{ method: "GET", path: "/auth/session", group: "Auth" },
|
|
31
|
+
{ method: "GET", path: "/auth/me", group: "Auth" },
|
|
31
32
|
{ method: "DELETE", path: "/auth/session/current", group: "Auth" },
|
|
32
33
|
{ method: "DELETE", path: "/auth/session/:option", group: "Auth" },
|
|
33
34
|
{ method: "DELETE", path: "/auth/delete", group: "Auth" },
|
|
@@ -87,6 +88,9 @@ exports.OVOK_CORE_API_REQUIREMENTS = {
|
|
|
87
88
|
{ method: "GET", path: "/localization/i18next/:language", group: "Localization" },
|
|
88
89
|
{ method: "PATCH", path: "/localization/i18next/:language", group: "Localization" },
|
|
89
90
|
{ method: "GET", path: "/patient/:id/observation", group: "Patient" },
|
|
91
|
+
{ method: "GET", path: "/fhir/Observation/$lastn", group: "Patient" },
|
|
92
|
+
{ method: "GET", path: "/fhir/Device/:id/telemetry", group: "Patient" },
|
|
93
|
+
{ method: "GET", path: "/fhir/Device/:id/telemetry/history", group: "Patient" },
|
|
90
94
|
{ method: "GET", path: "/v1/carehub/patient", group: "Carehub/Patient" },
|
|
91
95
|
{ method: "GET", path: "/v1/carehub/patient/:id", group: "Carehub/Patient" },
|
|
92
96
|
{ method: "GET", path: "/v1/carehub/patient/:id/$everything", group: "Carehub/Patient" },
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -61,3 +61,4 @@ __exportStar(require("./conformance/capability"), exports);
|
|
|
61
61
|
__exportStar(require("./client/platform/types"), exports);
|
|
62
62
|
__exportStar(require("./client/carehub/types"), exports);
|
|
63
63
|
__exportStar(require("./client/experience/types"), exports);
|
|
64
|
+
__exportStar(require("./client/patient/types"), exports);
|