@ovok/core 0.4.45 β 0.4.47
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 +48 -18
- package/dist/client/auth/exchange-code.d.ts +1 -1
- package/dist/client/auth/exchange-code.js +1 -1
- package/dist/client/auth/handle-tenant-code.d.ts +1 -1
- package/dist/client/auth/methods/login.js +2 -2
- package/dist/client/auth/start-login.js +2 -2
- package/dist/client/auth/types/LoginBody.d.ts +7 -1
- package/dist/client/auth/types/ResetPasswordBody.d.ts +1 -1
- package/dist/client/errors/ovok-error.js +6 -6
- package/dist/client/errors/problem-code.d.ts +1 -0
- package/dist/client/errors/problem-code.js +10 -1
- package/dist/client/invites/methods.d.ts +14 -1
- package/dist/client/invites/methods.js +39 -7
- package/dist/client/invites/types.d.ts +17 -1
- package/dist/client/invites/types.js +4 -0
- package/dist/client/ovok-client.d.ts +2 -1
- package/dist/client/ovok-client.js +2 -0
- package/dist/client/patient-sharing/methods.js +2 -1
- package/dist/client/patient-sharing/types.d.ts +13 -0
- package/dist/client/wearables/index.d.ts +2 -0
- package/dist/client/wearables/index.js +18 -0
- package/dist/client/wearables/methods.d.ts +11 -0
- package/dist/client/wearables/methods.js +50 -0
- package/dist/client/wearables/types.d.ts +38 -0
- package/dist/client/wearables/types.js +2 -0
- package/dist/conformance/api-requirements.js +9 -0
- package/dist/conformance/capability-requirements.js +1 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.js +14 -2
- package/dist/hooks/invites-hooks.d.ts +7 -1
- package/dist/hooks/invites-hooks.js +19 -1
- package/dist/hooks/wearable-invalidation.d.ts +5 -0
- package/dist/hooks/wearable-invalidation.js +22 -0
- package/dist/hooks/wearables-hooks.d.ts +12 -0
- package/dist/hooks/wearables-hooks.js +79 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ Core TypeScript SDK for healthcare applications. Provides authentication, AI-FHI
|
|
|
18
18
|
- π§© Typed accounts, projects, localization, and patient-observation APIs
|
|
19
19
|
- π₯ Typed Slim patient, device, telemetry, notification, and monitoring APIs
|
|
20
20
|
- π¨ Typed Signals thresholds, alerts, and project settings APIs
|
|
21
|
+
- β Typed cloud wearable-provider configuration and patient connections
|
|
21
22
|
|
|
22
23
|
## Installation
|
|
23
24
|
|
|
@@ -374,7 +375,9 @@ try {
|
|
|
374
375
|
|
|
375
376
|
The client also exposes typed application APIs for consent signatures, document upload credentials,
|
|
376
377
|
document download endpoints, CMS content, LiveKit video calls, translation, AI chat, and AI FHIR
|
|
377
|
-
search. These methods are additive and do not change the
|
|
378
|
+
search, and cloud wearable-provider connections. These methods are additive and do not change the
|
|
379
|
+
native observation or offline contracts. See the [wearable connection guide](docs/integrations/wearable-connections.md)
|
|
380
|
+
for provider setup, patient consent, and the app-return flow.
|
|
378
381
|
|
|
379
382
|
```ts
|
|
380
383
|
const content = await client.searchContent("blog", "en-US", { search: "welcome" });
|
|
@@ -398,7 +401,7 @@ download elements; the backend remains responsible for authorization and signed
|
|
|
398
401
|
|
|
399
402
|
The package exports additive hooks for capability discovery, project configuration, patient profile
|
|
400
403
|
and health data, questionnaires, scheduling resources, Slim lists, telemetry, notifications,
|
|
401
|
-
documents, content, video consultations, and localization. Every request hook returns `data`,
|
|
404
|
+
documents, content, video consultations, wearable connections, and localization. Every request hook returns `data`,
|
|
402
405
|
`loading`, `error`, and `reload`; mutations expose `data`, `loading`, `error`, `mutate`, and `reset`.
|
|
403
406
|
|
|
404
407
|
```tsx
|
|
@@ -625,30 +628,54 @@ turning the feature on; an unmapped email can still produce the uniform 202
|
|
|
625
628
|
response without sending a message. `useUpdatePatientSharingSettings()` is the
|
|
626
629
|
corresponding mutation hook.
|
|
627
630
|
|
|
628
|
-
`listPatientSharing()` returns `outgoing`, `incoming`,
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
631
|
+
`listPatientSharing()` returns `outgoing`, `incoming`, `practitioners`, and
|
|
632
|
+
`relatedPersons`. `practitioners` lists active shares of a patient's whole record
|
|
633
|
+
with practitioners; `relatedPersons` lists the Observation codes a patient shares
|
|
634
|
+
with carers. For compatibility with older servers, the SDK defaults a missing
|
|
635
|
+
`practitioners` or `relatedPersons` array to `[]`. Listing is patient-only (403 for another profile).
|
|
632
636
|
`revokePatientSharing(consentId)` uses the existing DELETE route
|
|
633
637
|
to end a share immediately or decline a pending invite. It returns 204; 404
|
|
634
638
|
(`Share not found.`) means the caller is not a party, and a code-less 409
|
|
635
639
|
(`This share kept changing; try again.`) can be retried after reloading. A
|
|
636
640
|
practitioner's whole-record share has no measurement-code list.
|
|
637
641
|
|
|
638
|
-
Invitations
|
|
642
|
+
Invitations are named by purpose, all backed by `/v1/invites/*`:
|
|
639
643
|
|
|
640
644
|
```typescript
|
|
641
|
-
|
|
642
|
-
await client.
|
|
643
|
-
|
|
644
|
-
await client.
|
|
645
|
-
|
|
646
|
-
|
|
645
|
+
// A patient shares their record with a practitionerβ¦
|
|
646
|
+
await client.shareRecord({ recipient: "practitioner", email, firstName, lastName });
|
|
647
|
+
// β¦or shares some Observation codes with a carer (a related person).
|
|
648
|
+
await client.shareRecord({ recipient: "related-person", email, firstName, lastName, codes: ["8480-6"] });
|
|
649
|
+
await client.acceptRecordShare({ inviteId, code }); // practitioner or existing carer, signed in
|
|
650
|
+
await client.acceptRecordShare({ inviteId, code, password }); // new carer, signed out
|
|
651
|
+
|
|
652
|
+
// A practitioner invites a patient into their care.
|
|
653
|
+
await client.inviteToCare({ email, firstName, lastName });
|
|
654
|
+
await client.acceptCareInvite({ inviteId, code }); // patient, signed in
|
|
655
|
+
|
|
656
|
+
// Or dispatch acceptance using the signed-in Practitioner or Patient profile:
|
|
647
657
|
await client.acceptInvite({ inviteId, code });
|
|
648
658
|
```
|
|
649
659
|
|
|
650
|
-
`
|
|
651
|
-
React mutation states.
|
|
660
|
+
`useShareRecord()`, `useAcceptRecordShare()`, `useInviteToCare()`,
|
|
661
|
+
`useAcceptCareInvite()`, and `useAcceptInvite()` provide React mutation states.
|
|
662
|
+
|
|
663
|
+
`invitePractitioner()`, `invitePatient()`, `acceptPractitionerInvite()`,
|
|
664
|
+
`acceptPatientInvite()`, `useInvitePractitioner()`, and `useInvitePatient()` are
|
|
665
|
+
deprecated. Their routes (`/v1/invites/practitioner`, `/v1/invites/patient` and
|
|
666
|
+
their `/accept` routes) sunset on 2026-12-01; move to `shareRecord()`,
|
|
667
|
+
`inviteToCare()`, `acceptRecordShare()`, and `acceptCareInvite()` before then.
|
|
668
|
+
|
|
669
|
+
A carer accepts a record share from the patient app. A carer new to the project
|
|
670
|
+
accepts signed out and sends a `password`; that creates their account, and they
|
|
671
|
+
then sign in with `login({ type: "RelatedPerson", email, password, tenantCode })`.
|
|
672
|
+
There is no carer registration route. A 422 `password_required` means the invite
|
|
673
|
+
needs a password; a 409 `address_has_account` means the address already has an
|
|
674
|
+
account, so the patient must send a new invite. Carer sharing needs patient
|
|
675
|
+
sharing enabled and `RELATED_PERSON_INVITATION_ENABLED` not set to `false`; carer
|
|
676
|
+
sign-in needs `RELATED_PERSON_LOGIN_ENABLED` not set to `false`. Map the
|
|
677
|
+
`RELATED_PERSON_INVITED` and `RELATED_PERSON_RECORD_SHARED` email templates
|
|
678
|
+
before inviting carers. The invite methods always return `{ status: "sent" }`
|
|
652
679
|
(HTTP 202), whether or not an email is ultimately sent. Show only βIf that
|
|
653
680
|
address can be invited, an email is on its wayβ; the response must not reveal
|
|
654
681
|
whether the address has an account. Both names are trimmed by Core, and email
|
|
@@ -663,7 +690,9 @@ invite can also fail with 401 (no session), 403 (feature/role gate), 422 (invali
|
|
|
663
690
|
body), 409 `invitation_not_configured` (missing default policy),
|
|
664
691
|
`app_url_not_configured` (missing audience app URL), or
|
|
665
692
|
`practitioner_without_access_policy` (a full-access practitioner cannot be
|
|
666
|
-
narrowed to a share policy).
|
|
693
|
+
narrowed to a share policy). Accepting a record share can also return 409
|
|
694
|
+
`related_person_without_access_policy` or `sharing_not_configured` (patient
|
|
695
|
+
sharing lost its template; turn it on again). A code-less 409 means another invite for the same
|
|
667
696
|
address or practitioner is still being written; offer retry. A 429 means the
|
|
668
697
|
inviter has 20 pending invites. Use
|
|
669
698
|
`readOvokError(error)` and `OVOK_INVITE_ERROR_CODES` to branch on stable codes.
|
|
@@ -672,7 +701,7 @@ inviter has 20 pending invites. Use
|
|
|
672
701
|
|
|
673
702
|
Every app that can receive invitations needs a page at
|
|
674
703
|
`<app URL>/accept-invite?invite=<uuid>&code=<secret>`. Practitioner links use
|
|
675
|
-
`PRACTITIONER_APP_URL`; patient links use `PATIENT_APP_URL`. The secret is valid
|
|
704
|
+
`PRACTITIONER_APP_URL`; patient and carer links use `PATIENT_APP_URL`. The secret is valid
|
|
676
705
|
for seven days. `parseAcceptInviteLink(url)` returns a body only when the UUID and
|
|
677
706
|
16β128 character code are present and valid; otherwise show βThis link is
|
|
678
707
|
incompleteβ and make no request. Once parsed, remove the code from the address
|
|
@@ -681,7 +710,8 @@ bar/history and do not send it to logs or analytics.
|
|
|
681
710
|
If the visitor is signed out, send them through sign-in and restore the link on
|
|
682
711
|
return. There is no preview endpoint. Once signed in, call `acceptInvite()`; it
|
|
683
712
|
chooses the route from the `Patient` or `Practitioner` profile and rejects other
|
|
684
|
-
profile types.
|
|
713
|
+
profile types. Carers call `acceptRecordShare()` directly: signed in when they
|
|
714
|
+
already have an account, otherwise signed out with a new password. Never accept on page load. For a patient accepting, explain that
|
|
685
715
|
their whole record will be shared and wait for an explicit Accept action. A
|
|
686
716
|
patient can decline with `revokePatientSharing(inviteId)`; practitioners have no
|
|
687
717
|
decline route and can ignore the link. After a successful acceptance, show who
|
|
@@ -9,7 +9,7 @@ const exchangeCode = async ({ ...props }) => {
|
|
|
9
9
|
tenantCode: props.tenantCode,
|
|
10
10
|
}, undefined, props.requestOptions);
|
|
11
11
|
}
|
|
12
|
-
return props.client.post(
|
|
12
|
+
return props.client.post(`auth/tenant/${props.type}/login/token`, {
|
|
13
13
|
sessionCode: props.sessionCode,
|
|
14
14
|
codeVerifier: props.codeVerifier,
|
|
15
15
|
}, undefined, props.requestOptions);
|
|
@@ -2,5 +2,5 @@ import { StartLoginResponse } from "./types/StartLoginResponse";
|
|
|
2
2
|
export declare const handleTenantCode: ({ profiles, tenantCode, type, }: {
|
|
3
3
|
profiles: StartLoginResponse["profiles"];
|
|
4
4
|
tenantCode?: string;
|
|
5
|
-
type: "Practitioner" | "Patient";
|
|
5
|
+
type: "Practitioner" | "Patient" | "RelatedPerson";
|
|
6
6
|
}) => string;
|
|
@@ -60,7 +60,7 @@ async function login(body, requestOptions) {
|
|
|
60
60
|
});
|
|
61
61
|
const exchange = (sessionCode) => (0, exchange_code_1.exchangeCode)({
|
|
62
62
|
client: this,
|
|
63
|
-
type:
|
|
63
|
+
type: body.type,
|
|
64
64
|
sessionCode,
|
|
65
65
|
codeVerifier,
|
|
66
66
|
requestOptions,
|
|
@@ -68,6 +68,6 @@ async function login(body, requestOptions) {
|
|
|
68
68
|
if (startResponse.nextStep === "mfa") {
|
|
69
69
|
return mfaStep(this, body.type, startResponse.loginId, exchange, requestOptions);
|
|
70
70
|
}
|
|
71
|
-
(0, handle_tenant_code_1.handleTenantCode)({ profiles: startResponse.profiles, tenantCode: body.tenantCode, type:
|
|
71
|
+
(0, handle_tenant_code_1.handleTenantCode)({ profiles: startResponse.profiles, tenantCode: body.tenantCode, type: body.type });
|
|
72
72
|
return exchange(startResponse.sessionCode);
|
|
73
73
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.startLogin = void 0;
|
|
4
4
|
const startLogin = async ({ client, body, codeChallenge, requestOptions, }) => {
|
|
5
|
-
if (body.type
|
|
6
|
-
return client.post(
|
|
5
|
+
if (body.type !== "Practitioner") {
|
|
6
|
+
return client.post(`auth/tenant/${body.type}/login/start`, {
|
|
7
7
|
email: body.email,
|
|
8
8
|
password: body.password,
|
|
9
9
|
codeChallenge,
|
|
@@ -12,5 +12,11 @@ export type PractitionerLoginBody = LoginCredentials & {
|
|
|
12
12
|
/** Selects a project when the person belongs to multiple projects. */
|
|
13
13
|
tenantCode?: string;
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
/** A carer; their account comes only from accepting a record-share invite. */
|
|
16
|
+
export type RelatedPersonLoginBody = LoginCredentials & {
|
|
17
|
+
type: "RelatedPerson";
|
|
18
|
+
/** The tenant code to log in to. */
|
|
19
|
+
tenantCode: string;
|
|
20
|
+
};
|
|
21
|
+
export type LoginBody = PatientLoginBody | PractitionerLoginBody | RelatedPersonLoginBody;
|
|
16
22
|
export {};
|
|
@@ -29,7 +29,7 @@ const HTTP_REASON_PHRASES = new Set([
|
|
|
29
29
|
]);
|
|
30
30
|
/** Reads the error details Medplum preserves from Ovok's non-FHIR responses. */
|
|
31
31
|
const readOvokError = (error) => {
|
|
32
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
32
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
33
33
|
if (error instanceof OvokApiError) {
|
|
34
34
|
return {
|
|
35
35
|
status: error.status,
|
|
@@ -62,17 +62,17 @@ const readOvokError = (error) => {
|
|
|
62
62
|
? bareMessage
|
|
63
63
|
: undefined;
|
|
64
64
|
const writtenCode = (_h = (0, ovok_error_utils_1.stringValue)(nestedError === null || nestedError === void 0 ? void 0 : nestedError.code)) !== null && _h !== void 0 ? _h : (0, ovok_error_utils_1.codeValue)(payload === null || payload === void 0 ? void 0 : payload.error);
|
|
65
|
-
const code = (_l = (_k = (_j = (0, problem_code_1.conditionCode)((0, problem_code_1.ownCode)(payload === null || payload === void 0 ? void 0 : payload.code), writtenCode)) !== null && _j !== void 0 ? _j : writtenCode) !== null && _k !== void 0 ? _k : bareCode) !== null && _l !== void 0 ? _l : (0, ovok_error_utils_1.codeFromOutcome)((_m = payload === null || payload === void 0 ? void 0 : payload.outcome) !== null && _m !== void 0 ? _m : payload);
|
|
66
65
|
const type = (0, problem_code_1.problemTypeOf)(payload === null || payload === void 0 ? void 0 : payload.type);
|
|
66
|
+
const code = (_o = (_l = (_k = (_j = (0, problem_code_1.conditionCode)((0, problem_code_1.ownCode)(payload === null || payload === void 0 ? void 0 : payload.code), writtenCode)) !== null && _j !== void 0 ? _j : writtenCode) !== null && _k !== void 0 ? _k : bareCode) !== null && _l !== void 0 ? _l : (0, ovok_error_utils_1.codeFromOutcome)((_m = payload === null || payload === void 0 ? void 0 : payload.outcome) !== null && _m !== void 0 ? _m : payload)) !== null && _o !== void 0 ? _o : (0, problem_code_1.problemCodeOf)(type);
|
|
67
67
|
const traceId = (0, ovok_error_utils_1.stringValue)(payload === null || payload === void 0 ? void 0 : payload.traceId);
|
|
68
|
-
const status = (
|
|
68
|
+
const status = (_w = (_u = (_t = (_s = (_r = (_q = (_p = metadata.status) !== null && _p !== void 0 ? _p : (0, ovok_error_utils_1.numberValue)(root === null || root === void 0 ? void 0 : root.status)) !== null && _q !== void 0 ? _q : (0, ovok_error_utils_1.numberValue)(root === null || root === void 0 ? void 0 : root.statusCode)) !== null && _r !== void 0 ? _r : (0, ovok_error_utils_1.numberValue)(response === null || response === void 0 ? void 0 : response.status)) !== null && _s !== void 0 ? _s : (0, ovok_error_utils_1.numberValue)(payload === null || payload === void 0 ? void 0 : payload.status)) !== null && _t !== void 0 ? _t : (0, ovok_error_utils_1.numberValue)(payload === null || payload === void 0 ? void 0 : payload.statusCode)) !== null && _u !== void 0 ? _u : (0, ovok_error_utils_1.statusFromOutcome)((_v = payload === null || payload === void 0 ? void 0 : payload.outcome) !== null && _v !== void 0 ? _v : payload)) !== null && _w !== void 0 ? _w : (code ? STATUS_BY_BARE_CODE[code] : undefined);
|
|
69
69
|
const fieldErrors = (0, field_errors_1.readFieldErrors)(payload);
|
|
70
70
|
const missing = Array.isArray(payload === null || payload === void 0 ? void 0 : payload.missing)
|
|
71
71
|
? payload.missing.filter((entry) => typeof entry === "string")
|
|
72
72
|
: [];
|
|
73
73
|
const retryAfterSec = (0, ovok_error_utils_1.numberValue)(payload === null || payload === void 0 ? void 0 : payload.retryAfterSec);
|
|
74
|
-
const retryAfterMs = (
|
|
75
|
-
const requestId = (
|
|
74
|
+
const retryAfterMs = (_y = (_x = metadata.retryAfterMs) !== null && _x !== void 0 ? _x : (0, ovok_error_utils_1.numberValue)(payload === null || payload === void 0 ? void 0 : payload.retryAfterMs)) !== null && _y !== void 0 ? _y : (retryAfterSec === undefined ? undefined : retryAfterSec * 1000);
|
|
75
|
+
const requestId = (_z = metadata.requestId) !== null && _z !== void 0 ? _z : (0, ovok_error_utils_1.stringValue)(payload === null || payload === void 0 ? void 0 : payload.requestId);
|
|
76
76
|
return {
|
|
77
77
|
status,
|
|
78
78
|
code,
|
|
@@ -115,7 +115,7 @@ function mapOvokApiError(error, options = {}) {
|
|
|
115
115
|
}
|
|
116
116
|
const details = (0, exports.readOvokError)(error);
|
|
117
117
|
const typedStatuses = options.includeAccessErrors
|
|
118
|
-
? [403, 404, 409, 410, 422, 424, 503]
|
|
118
|
+
? [403, 404, 409, 410, 422, 424, 501, 503]
|
|
119
119
|
: [409, 410, 422, 424, 503];
|
|
120
120
|
return typedStatuses.includes((_a = details.status) !== null && _a !== void 0 ? _a : 0)
|
|
121
121
|
? new OvokApiError(details, error)
|
|
@@ -2,3 +2,4 @@ export declare const ownCode: (value: unknown) => string | undefined;
|
|
|
2
2
|
/** Core sends a throw site's code upper-cased in `code` and as written in `error`: keep the written form. */
|
|
3
3
|
export declare const conditionCode: (problemCode: string | undefined, writtenCode: string | undefined) => string | undefined;
|
|
4
4
|
export declare const problemTypeOf: (value: unknown) => string | undefined;
|
|
5
|
+
export declare const problemCodeOf: (type: string | undefined) => string | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.problemTypeOf = exports.conditionCode = exports.ownCode = void 0;
|
|
3
|
+
exports.problemCodeOf = exports.problemTypeOf = exports.conditionCode = exports.ownCode = void 0;
|
|
4
4
|
const ovok_error_utils_1 = require("./ovok-error-utils");
|
|
5
5
|
const PROBLEM_TYPE_PREFIX = "https://docs.ovok.com/errors/";
|
|
6
6
|
// The codes Core gives an error by its status alone: they name no condition, so `code` stays undefined for them.
|
|
@@ -43,3 +43,12 @@ const problemTypeOf = (value) => {
|
|
|
43
43
|
return (type === null || type === void 0 ? void 0 : type.startsWith(PROBLEM_TYPE_PREFIX)) ? type : undefined;
|
|
44
44
|
};
|
|
45
45
|
exports.problemTypeOf = problemTypeOf;
|
|
46
|
+
const problemCodeOf = (type) => {
|
|
47
|
+
const slug = type === null || type === void 0 ? void 0 : type.slice(PROBLEM_TYPE_PREFIX.length);
|
|
48
|
+
if (!slug) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
const code = slug.replace(/-/g, "_").toUpperCase();
|
|
52
|
+
return STATUS_ONLY_CODES.has(code) ? undefined : code;
|
|
53
|
+
};
|
|
54
|
+
exports.problemCodeOf = problemCodeOf;
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import type { MedplumRequestOptions } from "@medplum/core";
|
|
2
2
|
import { OvokClient } from "../ovok-client";
|
|
3
3
|
import { PatientSharingPractitionerShare } from "../patient-sharing/types";
|
|
4
|
-
import { AcceptInviteBody, InviteBody, InviteSent } from "./types";
|
|
4
|
+
import { AcceptInviteBody, AcceptRecordShareBody, InviteBody, InviteSent, RecordShareAccepted, RecordShareBody } from "./types";
|
|
5
|
+
/** A patient shares their record with a practitioner, or with a carer (a related person) for some codes. */
|
|
6
|
+
export declare function shareRecord(this: OvokClient, body: RecordShareBody, requestOptions?: MedplumRequestOptions): Promise<InviteSent>;
|
|
7
|
+
/** Accepts a record share; a carer new to the project accepts signed out with a `password`. */
|
|
8
|
+
export declare function acceptRecordShare(this: OvokClient, body: AcceptRecordShareBody, requestOptions?: MedplumRequestOptions): Promise<RecordShareAccepted>;
|
|
9
|
+
/** A practitioner invites a patient into their care. */
|
|
10
|
+
export declare function inviteToCare(this: OvokClient, body: InviteBody, requestOptions?: MedplumRequestOptions): Promise<InviteSent>;
|
|
11
|
+
/** The signed-in patient accepts a practitioner's care invite. */
|
|
12
|
+
export declare function acceptCareInvite(this: OvokClient, body: AcceptInviteBody, requestOptions?: MedplumRequestOptions): Promise<PatientSharingPractitionerShare>;
|
|
13
|
+
/** @deprecated Use shareRecord({ recipient: "practitioner", ... }); the route sunsets on 2026-12-01. */
|
|
5
14
|
export declare function invitePractitioner(this: OvokClient, body: InviteBody, requestOptions?: MedplumRequestOptions): Promise<InviteSent>;
|
|
15
|
+
/** @deprecated Use inviteToCare; the route sunsets on 2026-12-01. */
|
|
6
16
|
export declare function invitePatient(this: OvokClient, body: InviteBody, requestOptions?: MedplumRequestOptions): Promise<InviteSent>;
|
|
17
|
+
/** @deprecated Use acceptRecordShare; the route sunsets on 2026-12-01. */
|
|
7
18
|
export declare function acceptPractitionerInvite(this: OvokClient, body: AcceptInviteBody, requestOptions?: MedplumRequestOptions): Promise<PatientSharingPractitionerShare>;
|
|
19
|
+
/** @deprecated Use acceptCareInvite; the route sunsets on 2026-12-01. */
|
|
8
20
|
export declare function acceptPatientInvite(this: OvokClient, body: AcceptInviteBody, requestOptions?: MedplumRequestOptions): Promise<PatientSharingPractitionerShare>;
|
|
21
|
+
/** Accepts as the signed-in practitioner (a record share) or patient (a care invite). */
|
|
9
22
|
export declare function acceptInvite(this: OvokClient, body: AcceptInviteBody, requestOptions?: MedplumRequestOptions): Promise<PatientSharingPractitionerShare>;
|
|
@@ -1,32 +1,64 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shareRecord = shareRecord;
|
|
4
|
+
exports.acceptRecordShare = acceptRecordShare;
|
|
5
|
+
exports.inviteToCare = inviteToCare;
|
|
6
|
+
exports.acceptCareInvite = acceptCareInvite;
|
|
3
7
|
exports.invitePractitioner = invitePractitioner;
|
|
4
8
|
exports.invitePatient = invitePatient;
|
|
5
9
|
exports.acceptPractitionerInvite = acceptPractitionerInvite;
|
|
6
10
|
exports.acceptPatientInvite = acceptPatientInvite;
|
|
7
11
|
exports.acceptInvite = acceptInvite;
|
|
8
12
|
const request_options_1 = require("../request-options");
|
|
13
|
+
/** A patient shares their record with a practitioner, or with a carer (a related person) for some codes. */
|
|
14
|
+
function shareRecord(body, requestOptions) {
|
|
15
|
+
return this.post("/v1/invites/record-share", body, undefined, requestOptions);
|
|
16
|
+
}
|
|
17
|
+
/** Accepts a record share; a carer new to the project accepts signed out with a `password`. */
|
|
18
|
+
function acceptRecordShare(body, requestOptions) {
|
|
19
|
+
return this.post("/v1/invites/record-share/accept", body, undefined, requestOptions)
|
|
20
|
+
.then((result) => {
|
|
21
|
+
this.invalidateUrl("/v1/patient-sharing/shares");
|
|
22
|
+
return result;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/** A practitioner invites a patient into their care. */
|
|
26
|
+
function inviteToCare(body, requestOptions) {
|
|
27
|
+
return this.post("/v1/invites/care", body, undefined, requestOptions);
|
|
28
|
+
}
|
|
29
|
+
/** The signed-in patient accepts a practitioner's care invite. */
|
|
30
|
+
function acceptCareInvite(body, requestOptions) {
|
|
31
|
+
return this.post("/v1/invites/care/accept", body, undefined, requestOptions)
|
|
32
|
+
.then((result) => {
|
|
33
|
+
this.invalidateUrl("/v1/patient-sharing/shares");
|
|
34
|
+
return result;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/** @deprecated Use shareRecord({ recipient: "practitioner", ... }); the route sunsets on 2026-12-01. */
|
|
9
38
|
function invitePractitioner(body, requestOptions) {
|
|
10
39
|
return this.post("/v1/invites/practitioner", body, undefined, requestOptions);
|
|
11
40
|
}
|
|
41
|
+
/** @deprecated Use inviteToCare; the route sunsets on 2026-12-01. */
|
|
12
42
|
function invitePatient(body, requestOptions) {
|
|
13
43
|
return this.post("/v1/invites/patient", body, undefined, requestOptions);
|
|
14
44
|
}
|
|
45
|
+
/** @deprecated Use acceptRecordShare; the route sunsets on 2026-12-01. */
|
|
15
46
|
function acceptPractitionerInvite(body, requestOptions) {
|
|
16
47
|
return this.post("/v1/invites/practitioner/accept", body, undefined, requestOptions);
|
|
17
48
|
}
|
|
49
|
+
/** @deprecated Use acceptCareInvite; the route sunsets on 2026-12-01. */
|
|
18
50
|
function acceptPatientInvite(body, requestOptions) {
|
|
19
51
|
return this.post("/v1/invites/patient/accept", body, undefined, requestOptions);
|
|
20
52
|
}
|
|
53
|
+
/** Accepts as the signed-in practitioner (a record share) or patient (a care invite). */
|
|
21
54
|
function acceptInvite(body, requestOptions) {
|
|
22
55
|
var _a;
|
|
23
56
|
const resourceType = (_a = this.getProfile()) === null || _a === void 0 ? void 0 : _a.resourceType;
|
|
24
|
-
if (resourceType
|
|
25
|
-
|
|
57
|
+
if (resourceType === "Practitioner") {
|
|
58
|
+
return this.acceptRecordShare(body, ...(0, request_options_1.optionalArg)(requestOptions));
|
|
26
59
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
60
|
+
if (resourceType === "Patient") {
|
|
61
|
+
return this.acceptCareInvite(body, ...(0, request_options_1.optionalArg)(requestOptions));
|
|
62
|
+
}
|
|
63
|
+
throw new Error("Accepting an invite requires a signed-in Patient or Practitioner profile.");
|
|
32
64
|
}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { PatientSharingPractitionerShare } from "../patient-sharing/types";
|
|
1
|
+
import { PatientSharingPractitionerShare, PatientSharingRelatedPersonShare } from "../patient-sharing/types";
|
|
2
2
|
export type InviteBody = {
|
|
3
3
|
email: string;
|
|
4
4
|
firstName: string;
|
|
5
5
|
lastName: string;
|
|
6
6
|
};
|
|
7
|
+
export type RecordShareBody = (InviteBody & {
|
|
8
|
+
recipient: "practitioner";
|
|
9
|
+
}) | (InviteBody & {
|
|
10
|
+
recipient: "related-person";
|
|
11
|
+
/** The Observation codes the carer may read: 1 to 100. */
|
|
12
|
+
codes: string[];
|
|
13
|
+
});
|
|
7
14
|
export type InviteSent = {
|
|
8
15
|
status: "sent";
|
|
9
16
|
};
|
|
@@ -11,9 +18,18 @@ export type AcceptInviteBody = {
|
|
|
11
18
|
inviteId: string;
|
|
12
19
|
code: string;
|
|
13
20
|
};
|
|
21
|
+
export type AcceptRecordShareBody = AcceptInviteBody & {
|
|
22
|
+
/** Only for a carer whose account the invite creates; they accept signed out. */
|
|
23
|
+
password?: string | null;
|
|
24
|
+
};
|
|
14
25
|
export type AcceptInviteResult = PatientSharingPractitionerShare;
|
|
26
|
+
export type RecordShareAccepted = PatientSharingPractitionerShare | PatientSharingRelatedPersonShare;
|
|
15
27
|
export declare const OVOK_INVITE_ERROR_CODES: {
|
|
16
28
|
readonly invitationNotConfigured: "invitation_not_configured";
|
|
17
29
|
readonly appUrlNotConfigured: "app_url_not_configured";
|
|
18
30
|
readonly practitionerWithoutAccessPolicy: "practitioner_without_access_policy";
|
|
31
|
+
readonly relatedPersonWithoutAccessPolicy: "related_person_without_access_policy";
|
|
32
|
+
readonly addressHasAccount: "address_has_account";
|
|
33
|
+
readonly passwordRequired: "password_required";
|
|
34
|
+
readonly sharingNotConfigured: "sharing_not_configured";
|
|
19
35
|
};
|
|
@@ -5,4 +5,8 @@ exports.OVOK_INVITE_ERROR_CODES = {
|
|
|
5
5
|
invitationNotConfigured: "invitation_not_configured",
|
|
6
6
|
appUrlNotConfigured: "app_url_not_configured",
|
|
7
7
|
practitionerWithoutAccessPolicy: "practitioner_without_access_policy",
|
|
8
|
+
relatedPersonWithoutAccessPolicy: "related_person_without_access_policy",
|
|
9
|
+
addressHasAccount: "address_has_account",
|
|
10
|
+
passwordRequired: "password_required",
|
|
11
|
+
sharingNotConfigured: "sharing_not_configured",
|
|
8
12
|
};
|
|
@@ -23,6 +23,7 @@ import * as platformMethods from "./platform/methods";
|
|
|
23
23
|
import * as questionnaireResponseMethods from "./questionnaire-response/methods";
|
|
24
24
|
import * as signalsMethods from "./signals/methods";
|
|
25
25
|
import * as slimMethods from "./slim/methods";
|
|
26
|
+
import * as wearableMethods from "./wearables/methods";
|
|
26
27
|
export { MAX_CONDITIONAL_OBSERVATION_ENTRIES, MAX_OBSERVATION_BUNDLE_BYTES, } from "./observation/observation-bundle-utils";
|
|
27
28
|
export type { OvokUnauthenticatedReason } from "./auth/session-fetch";
|
|
28
29
|
export type SaveObservationsResult = {
|
|
@@ -146,7 +147,7 @@ export declare class OvokClient extends MedplumClient {
|
|
|
146
147
|
*/
|
|
147
148
|
getSubscriptionManager(): SubscriptionManager;
|
|
148
149
|
}
|
|
149
|
-
type Methods = typeof authMethods & typeof observationMethods & typeof questionnaireResponseMethods & typeof aiMethods & typeof aiFhirMethods & typeof botMethods & typeof slimMethods & typeof emailMethods & typeof cmsMethods & typeof changeHistoryMethods & typeof consentMethods & typeof platformMethods & typeof experienceMethods & typeof inviteMethods & typeof notificationMethods & typeof patientMethods & typeof patientSharingMethods & typeof signalsMethods;
|
|
150
|
+
type Methods = typeof authMethods & typeof observationMethods & typeof questionnaireResponseMethods & typeof aiMethods & typeof aiFhirMethods & typeof botMethods & typeof slimMethods & typeof emailMethods & typeof cmsMethods & typeof changeHistoryMethods & typeof consentMethods & typeof platformMethods & typeof experienceMethods & typeof inviteMethods & typeof notificationMethods & typeof patientMethods & typeof patientSharingMethods & typeof wearableMethods & typeof signalsMethods;
|
|
150
151
|
type Omitted<T> = Omit<T, "executeBot">;
|
|
151
152
|
declare module "./ovok-client" {
|
|
152
153
|
interface OvokClient extends Omitted<Methods> {
|
|
@@ -66,6 +66,7 @@ const request_options_1 = require("./request-options");
|
|
|
66
66
|
const errors_2 = require("./signals/errors");
|
|
67
67
|
const signalsMethods = __importStar(require("./signals/methods"));
|
|
68
68
|
const slimMethods = __importStar(require("./slim/methods"));
|
|
69
|
+
const wearableMethods = __importStar(require("./wearables/methods"));
|
|
69
70
|
var observation_bundle_utils_2 = require("./observation/observation-bundle-utils");
|
|
70
71
|
Object.defineProperty(exports, "MAX_CONDITIONAL_OBSERVATION_ENTRIES", { enumerable: true, get: function () { return observation_bundle_utils_2.MAX_CONDITIONAL_OBSERVATION_ENTRIES; } });
|
|
71
72
|
Object.defineProperty(exports, "MAX_OBSERVATION_BUNDLE_BYTES", { enumerable: true, get: function () { return observation_bundle_utils_2.MAX_OBSERVATION_BUNDLE_BYTES; } });
|
|
@@ -143,6 +144,7 @@ class OvokClient extends core_1.MedplumClient {
|
|
|
143
144
|
this.bindMethods(notificationMethods, (error) => (0, ovok_error_1.mapOvokApiError)((0, rate_limit_error_1.mapRateLimitError)(error), { includeAccessErrors: true }));
|
|
144
145
|
this.bindMethods(patientMethods);
|
|
145
146
|
this.bindMethods(patientSharingMethods);
|
|
147
|
+
this.bindMethods(wearableMethods, (error) => (0, ovok_error_1.mapOvokApiError)((0, rate_limit_error_1.mapRateLimitError)(error), { includeAccessErrors: true }));
|
|
146
148
|
this.bindMethods(signalsMethods, (error) => {
|
|
147
149
|
const mapped = (0, errors_2.mapSignalsError)((0, rate_limit_error_1.mapRateLimitError)(error), {
|
|
148
150
|
signalsRequest: true,
|
|
@@ -18,10 +18,11 @@ function redeemPatientSharingInvite(body, requestOptions) {
|
|
|
18
18
|
}
|
|
19
19
|
function listPatientSharing(requestOptions) {
|
|
20
20
|
return this.get("/v1/patient-sharing/shares", ...(0, request_options_1.optionalArg)(requestOptions)).then((shares) => {
|
|
21
|
-
var _a;
|
|
21
|
+
var _a, _b;
|
|
22
22
|
return ({
|
|
23
23
|
...shares,
|
|
24
24
|
practitioners: (_a = shares.practitioners) !== null && _a !== void 0 ? _a : [],
|
|
25
|
+
relatedPersons: (_b = shares.relatedPersons) !== null && _b !== void 0 ? _b : [],
|
|
25
26
|
});
|
|
26
27
|
});
|
|
27
28
|
}
|
|
@@ -25,10 +25,23 @@ export type PatientSharingPractitionerShare = {
|
|
|
25
25
|
startedAt: string | null;
|
|
26
26
|
endsAt: string | null;
|
|
27
27
|
};
|
|
28
|
+
/** Observation codes a patient shares with a related person (a carer). */
|
|
29
|
+
export type PatientSharingRelatedPersonShare = {
|
|
30
|
+
consentId: string;
|
|
31
|
+
sharer: PatientSharingParty;
|
|
32
|
+
relatedPerson: {
|
|
33
|
+
relatedPersonId: string;
|
|
34
|
+
name: string | null;
|
|
35
|
+
};
|
|
36
|
+
codes: string[];
|
|
37
|
+
startedAt: string | null;
|
|
38
|
+
endsAt: string | null;
|
|
39
|
+
};
|
|
28
40
|
export type PatientSharingShares = {
|
|
29
41
|
outgoing: PatientSharingShare[];
|
|
30
42
|
incoming: PatientSharingShare[];
|
|
31
43
|
practitioners: PatientSharingPractitionerShare[];
|
|
44
|
+
relatedPersons: PatientSharingRelatedPersonShare[];
|
|
32
45
|
};
|
|
33
46
|
export type CreatePatientSharingInvite = {
|
|
34
47
|
codes: string[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./methods"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MedplumRequestOptions } from "@medplum/core";
|
|
2
|
+
import { OvokClient } from "../ovok-client";
|
|
3
|
+
import { CreateWearableProviderRequest, UpdateWearableProviderRequest, WearableConnectionAuthorization, WearableConnections, WearableProvider, WearableProviderSettings, WearableProviderSettingsList } from "./types";
|
|
4
|
+
export declare function listWearableProviders(this: OvokClient, requestOptions?: MedplumRequestOptions): Promise<WearableProviderSettingsList>;
|
|
5
|
+
export declare function getWearableProvider(this: OvokClient, provider: WearableProvider, requestOptions?: MedplumRequestOptions): Promise<WearableProviderSettings>;
|
|
6
|
+
export declare function createWearableProvider(this: OvokClient, body: CreateWearableProviderRequest, requestOptions?: MedplumRequestOptions): Promise<WearableProviderSettings>;
|
|
7
|
+
export declare function updateWearableProvider(this: OvokClient, provider: WearableProvider, body: UpdateWearableProviderRequest, requestOptions?: MedplumRequestOptions): Promise<WearableProviderSettings>;
|
|
8
|
+
export declare function deleteWearableProvider(this: OvokClient, provider: WearableProvider, requestOptions?: MedplumRequestOptions): Promise<void>;
|
|
9
|
+
export declare function listWearableConnections(this: OvokClient, requestOptions?: MedplumRequestOptions): Promise<WearableConnections>;
|
|
10
|
+
export declare function authorizeWearableConnection(this: OvokClient, provider: WearableProvider, requestOptions?: MedplumRequestOptions): Promise<WearableConnectionAuthorization>;
|
|
11
|
+
export declare function deleteWearableConnection(this: OvokClient, provider: WearableProvider, requestOptions?: MedplumRequestOptions): Promise<void>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listWearableProviders = listWearableProviders;
|
|
4
|
+
exports.getWearableProvider = getWearableProvider;
|
|
5
|
+
exports.createWearableProvider = createWearableProvider;
|
|
6
|
+
exports.updateWearableProvider = updateWearableProvider;
|
|
7
|
+
exports.deleteWearableProvider = deleteWearableProvider;
|
|
8
|
+
exports.listWearableConnections = listWearableConnections;
|
|
9
|
+
exports.authorizeWearableConnection = authorizeWearableConnection;
|
|
10
|
+
exports.deleteWearableConnection = deleteWearableConnection;
|
|
11
|
+
const request_options_1 = require("../request-options");
|
|
12
|
+
const providerPath = (provider) => `/v1/wearables/providers/${encodeURIComponent(provider)}`;
|
|
13
|
+
const connectionPath = (provider) => `/v1/wearables/connections/${encodeURIComponent(provider)}`;
|
|
14
|
+
const invalidateProviderSettings = (client, provider) => {
|
|
15
|
+
client.invalidateUrl("/v1/wearables/providers");
|
|
16
|
+
if (provider) {
|
|
17
|
+
client.invalidateUrl(providerPath(provider));
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
function listWearableProviders(requestOptions) {
|
|
21
|
+
return this.get("/v1/wearables/providers", ...(0, request_options_1.optionalArg)(requestOptions));
|
|
22
|
+
}
|
|
23
|
+
function getWearableProvider(provider, requestOptions) {
|
|
24
|
+
return this.get(providerPath(provider), ...(0, request_options_1.optionalArg)(requestOptions));
|
|
25
|
+
}
|
|
26
|
+
function createWearableProvider(body, requestOptions) {
|
|
27
|
+
return this.post("/v1/wearables/providers", body, undefined, requestOptions).then((settings) => {
|
|
28
|
+
invalidateProviderSettings(this, body.provider);
|
|
29
|
+
return settings;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
async function updateWearableProvider(provider, body, requestOptions) {
|
|
33
|
+
const settings = await this.patch(providerPath(provider), body, ...(0, request_options_1.optionalArg)(requestOptions));
|
|
34
|
+
invalidateProviderSettings(this, provider);
|
|
35
|
+
return settings;
|
|
36
|
+
}
|
|
37
|
+
async function deleteWearableProvider(provider, requestOptions) {
|
|
38
|
+
await this.delete(providerPath(provider), ...(0, request_options_1.optionalArg)(requestOptions));
|
|
39
|
+
invalidateProviderSettings(this, provider);
|
|
40
|
+
}
|
|
41
|
+
function listWearableConnections(requestOptions) {
|
|
42
|
+
return this.get("/v1/wearables/connections", ...(0, request_options_1.optionalArg)(requestOptions));
|
|
43
|
+
}
|
|
44
|
+
function authorizeWearableConnection(provider, requestOptions) {
|
|
45
|
+
return this.post(`${connectionPath(provider)}/authorize`, undefined, undefined, requestOptions);
|
|
46
|
+
}
|
|
47
|
+
async function deleteWearableConnection(provider, requestOptions) {
|
|
48
|
+
await this.delete(connectionPath(provider), ...(0, request_options_1.optionalArg)(requestOptions));
|
|
49
|
+
this.invalidateUrl("/v1/wearables/connections");
|
|
50
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type WearableProvider = "oura" | "whoop" | "strava" | "withings" | "polar" | "suunto" | "garmin" | "ultrahuman";
|
|
2
|
+
export type WearableErrorCode = "PROVIDER_CONFIGURED" | "PROVIDER_NOT_CONFIGURED" | "SUBSCRIPTION_KEY_REQUIRED" | "SUBSCRIPTION_KEY_NOT_USED" | "PROVIDER_NOT_AVAILABLE" | "APP_URL_NOT_CONFIGURED" | "CONNECTION_NOT_FOUND" | "STATE_STORE_UNAVAILABLE" | "FEATURE_NOT_CONFIGURED" | "PROJECT_CONTEXT_REQUIRED" | "PATIENT_PROFILE_REQUIRED";
|
|
3
|
+
export type WearableProviderSettings = {
|
|
4
|
+
provider: WearableProvider;
|
|
5
|
+
configured: boolean;
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
clientId: string | null;
|
|
8
|
+
redirectUri: string | null;
|
|
9
|
+
};
|
|
10
|
+
export type WearableProviderSettingsList = {
|
|
11
|
+
providers: WearableProviderSettings[];
|
|
12
|
+
};
|
|
13
|
+
export type CreateWearableProviderRequest = {
|
|
14
|
+
provider: WearableProvider;
|
|
15
|
+
clientId: string;
|
|
16
|
+
secret: string;
|
|
17
|
+
subscriptionKey: string | null;
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type UpdateWearableProviderRequest = {
|
|
21
|
+
clientId?: string;
|
|
22
|
+
secret?: string;
|
|
23
|
+
subscriptionKey?: string | null;
|
|
24
|
+
enabled?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export type WearableConnection = {
|
|
27
|
+
provider: WearableProvider;
|
|
28
|
+
connection: {
|
|
29
|
+
connectedAt: string;
|
|
30
|
+
} | null;
|
|
31
|
+
};
|
|
32
|
+
export type WearableConnections = {
|
|
33
|
+
connections: WearableConnection[];
|
|
34
|
+
};
|
|
35
|
+
export type WearableConnectionAuthorization = {
|
|
36
|
+
provider: WearableProvider;
|
|
37
|
+
authorizationUrl: string;
|
|
38
|
+
};
|
|
@@ -21,6 +21,10 @@ exports.OVOK_CORE_API_REQUIREMENTS = {
|
|
|
21
21
|
{ method: "POST", path: "/auth/tenant/Patient/login/token", group: "Auth" },
|
|
22
22
|
{ method: "POST", path: "/auth/tenant/Practitioner/login/token", group: "Auth" },
|
|
23
23
|
{ method: "POST", path: "/auth/tenant/Practitioner/login/mfa", group: "Auth" },
|
|
24
|
+
{ method: "POST", path: "/auth/tenant/Patient/login/mfa", group: "Auth" },
|
|
25
|
+
{ method: "POST", path: "/auth/tenant/RelatedPerson/login/start", group: "Auth" },
|
|
26
|
+
{ method: "POST", path: "/auth/tenant/RelatedPerson/login/token", group: "Auth" },
|
|
27
|
+
{ method: "POST", path: "/auth/tenant/RelatedPerson/login/mfa", group: "Auth" },
|
|
24
28
|
{ method: "POST", path: "/auth/tenant/Patient/register", group: "Auth" },
|
|
25
29
|
{ method: "POST", path: "/auth/tenant/Practitioner/register", group: "Auth" },
|
|
26
30
|
{ method: "POST", path: "/auth/external/google", group: "Auth" },
|
|
@@ -91,6 +95,11 @@ exports.OVOK_CORE_API_REQUIREMENTS = {
|
|
|
91
95
|
{ method: "DELETE", path: "/v1/patient-sharing/shares/:consentId", group: "PatientSharing" },
|
|
92
96
|
{ method: "POST", path: "/v1/patient-sharing/invites", group: "PatientSharing" },
|
|
93
97
|
{ method: "POST", path: "/v1/patient-sharing/invites/redeem", group: "PatientSharing" },
|
|
98
|
+
{ method: "POST", path: "/v1/invites/record-share", group: "Invites" },
|
|
99
|
+
{ method: "POST", path: "/v1/invites/record-share/accept", group: "Invites" },
|
|
100
|
+
{ method: "POST", path: "/v1/invites/care", group: "Invites" },
|
|
101
|
+
{ method: "POST", path: "/v1/invites/care/accept", group: "Invites" },
|
|
102
|
+
// Deprecated: sunset on 2026-12-01, used only by the deprecated invite methods.
|
|
94
103
|
{ method: "POST", path: "/v1/invites/practitioner", group: "Invites" },
|
|
95
104
|
{ method: "POST", path: "/v1/invites/patient", group: "Invites" },
|
|
96
105
|
{ method: "POST", path: "/v1/invites/practitioner/accept", group: "Invites" },
|
|
@@ -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.
|
|
51
|
+
version: "0.4.47",
|
|
52
52
|
},
|
|
53
53
|
fhirVersion: "4.0.1",
|
|
54
54
|
format: ["json"],
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -18,7 +18,8 @@ export { useRecentAlarms, useRecentOutOfBed, useRecentSlimNotifications, useSlim
|
|
|
18
18
|
export { useCreateNotificationNote, useCreateSignalsAlertNote, useCreateSignalsRawAlertNote, useDeleteNotificationNote, useDeleteSignalsNote, useNotificationNotes, useSignalsAlertNotes, useSignalsRawAlertNotes, useUpdateNotificationNote, useUpdateSignalsNote, } from "./notification-note-hooks";
|
|
19
19
|
export { useAcknowledgeSlimAlarm, useAcknowledgeSlimMedicalNotification, } from "./notification-ack-hooks";
|
|
20
20
|
export { useCmsDocument, useCmsDocuments, useLegalPage, useReleaseNotes, useTranslations, } from "./cms-hooks";
|
|
21
|
-
export { useAcceptInvite, useInvitePatient, useInvitePractitioner, } from "./invites-hooks";
|
|
21
|
+
export { useAcceptCareInvite, useAcceptInvite, useAcceptRecordShare, useInvitePatient, useInvitePractitioner, useInviteToCare, useShareRecord, } from "./invites-hooks";
|
|
22
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
|
+
export { useAuthorizeWearableConnection, useCreateWearableProvider, useDeleteWearableConnection, useDeleteWearableProvider, useUpdateWearableProvider, useWearableConnections, useWearableProviders, } from "./wearables-hooks";
|
|
24
25
|
export { useAcknowledgeSignalsAlert, useEnableSignalsForPatient, useRemoveSignalsThreshold, useSetSignalsThreshold, useSignalsAlert, useSignalsAlerts, useSignalsSettings, useSignalsThresholds, useUpdateSignalsSettings, } from "./signals-hooks";
|
package/dist/hooks/index.js
CHANGED
|
@@ -35,8 +35,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
})();
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
exports.useSlimPatientThresholdV2 = exports.useSetMedicalConsent = 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.usePublicApiEndpoints = exports.useProjectSettings = exports.useProjectFeatures = exports.useOvokRequest = exports.useOvokMutation = exports.useCapabilityStatement = exports.useSlimPatients = 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.
|
|
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;
|
|
38
|
+
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.useShareRecord = exports.useInviteToCare = exports.useInvitePractitioner = exports.useInvitePatient = exports.useAcceptRecordShare = exports.useAcceptInvite = exports.useAcceptCareInvite = 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.useSlimNotifications = exports.useSlimMedicalNotifications = exports.useSlimAlarms = exports.useRecentSlimNotifications = exports.useRecentOutOfBed = exports.useRecentAlarms = exports.useUpdateSlimThresholdV2 = exports.useUpdateSlimPatientThresholdV2 = exports.useUnconfirmedLimits = exports.useSlimThresholdV2 = void 0;
|
|
39
|
+
exports.useUpdateSignalsSettings = exports.useSignalsThresholds = exports.useSignalsSettings = exports.useSignalsAlerts = exports.useSignalsAlert = exports.useSetSignalsThreshold = exports.useRemoveSignalsThreshold = exports.useEnableSignalsForPatient = exports.useAcknowledgeSignalsAlert = exports.useWearableProviders = exports.useWearableConnections = exports.useUpdateWearableProvider = exports.useDeleteWearableProvider = exports.useDeleteWearableConnection = exports.useCreateWearableProvider = exports.useAuthorizeWearableConnection = exports.useUpdatePatientSharingSettings = exports.useRevokePatientSharing = exports.useRedeemPatientSharingInvite = exports.usePatientSharingSettings = exports.usePatientSharing = exports.useCreatePatientSharingInvite = exports.useSubmitQuestionnaireResponse = void 0;
|
|
40
40
|
/*
|
|
41
41
|
* The only React-dependent module in the package.
|
|
42
42
|
*
|
|
@@ -149,9 +149,13 @@ Object.defineProperty(exports, "useLegalPage", { enumerable: true, get: function
|
|
|
149
149
|
Object.defineProperty(exports, "useReleaseNotes", { enumerable: true, get: function () { return cms_hooks_1.useReleaseNotes; } });
|
|
150
150
|
Object.defineProperty(exports, "useTranslations", { enumerable: true, get: function () { return cms_hooks_1.useTranslations; } });
|
|
151
151
|
var invites_hooks_1 = require("./invites-hooks");
|
|
152
|
+
Object.defineProperty(exports, "useAcceptCareInvite", { enumerable: true, get: function () { return invites_hooks_1.useAcceptCareInvite; } });
|
|
152
153
|
Object.defineProperty(exports, "useAcceptInvite", { enumerable: true, get: function () { return invites_hooks_1.useAcceptInvite; } });
|
|
154
|
+
Object.defineProperty(exports, "useAcceptRecordShare", { enumerable: true, get: function () { return invites_hooks_1.useAcceptRecordShare; } });
|
|
153
155
|
Object.defineProperty(exports, "useInvitePatient", { enumerable: true, get: function () { return invites_hooks_1.useInvitePatient; } });
|
|
154
156
|
Object.defineProperty(exports, "useInvitePractitioner", { enumerable: true, get: function () { return invites_hooks_1.useInvitePractitioner; } });
|
|
157
|
+
Object.defineProperty(exports, "useInviteToCare", { enumerable: true, get: function () { return invites_hooks_1.useInviteToCare; } });
|
|
158
|
+
Object.defineProperty(exports, "useShareRecord", { enumerable: true, get: function () { return invites_hooks_1.useShareRecord; } });
|
|
155
159
|
var patient_hooks_1 = require("./patient-hooks");
|
|
156
160
|
Object.defineProperty(exports, "useCurrentPatientProfile", { enumerable: true, get: function () { return patient_hooks_1.useCurrentPatientProfile; } });
|
|
157
161
|
Object.defineProperty(exports, "useExtractQuestionnaireObservations", { enumerable: true, get: function () { return patient_hooks_1.useExtractQuestionnaireObservations; } });
|
|
@@ -176,6 +180,14 @@ Object.defineProperty(exports, "usePatientSharingSettings", { enumerable: true,
|
|
|
176
180
|
Object.defineProperty(exports, "useRedeemPatientSharingInvite", { enumerable: true, get: function () { return patient_sharing_hooks_1.useRedeemPatientSharingInvite; } });
|
|
177
181
|
Object.defineProperty(exports, "useRevokePatientSharing", { enumerable: true, get: function () { return patient_sharing_hooks_1.useRevokePatientSharing; } });
|
|
178
182
|
Object.defineProperty(exports, "useUpdatePatientSharingSettings", { enumerable: true, get: function () { return patient_sharing_hooks_1.useUpdatePatientSharingSettings; } });
|
|
183
|
+
var wearables_hooks_1 = require("./wearables-hooks");
|
|
184
|
+
Object.defineProperty(exports, "useAuthorizeWearableConnection", { enumerable: true, get: function () { return wearables_hooks_1.useAuthorizeWearableConnection; } });
|
|
185
|
+
Object.defineProperty(exports, "useCreateWearableProvider", { enumerable: true, get: function () { return wearables_hooks_1.useCreateWearableProvider; } });
|
|
186
|
+
Object.defineProperty(exports, "useDeleteWearableConnection", { enumerable: true, get: function () { return wearables_hooks_1.useDeleteWearableConnection; } });
|
|
187
|
+
Object.defineProperty(exports, "useDeleteWearableProvider", { enumerable: true, get: function () { return wearables_hooks_1.useDeleteWearableProvider; } });
|
|
188
|
+
Object.defineProperty(exports, "useUpdateWearableProvider", { enumerable: true, get: function () { return wearables_hooks_1.useUpdateWearableProvider; } });
|
|
189
|
+
Object.defineProperty(exports, "useWearableConnections", { enumerable: true, get: function () { return wearables_hooks_1.useWearableConnections; } });
|
|
190
|
+
Object.defineProperty(exports, "useWearableProviders", { enumerable: true, get: function () { return wearables_hooks_1.useWearableProviders; } });
|
|
179
191
|
var signals_hooks_1 = require("./signals-hooks");
|
|
180
192
|
Object.defineProperty(exports, "useAcknowledgeSignalsAlert", { enumerable: true, get: function () { return signals_hooks_1.useAcknowledgeSignalsAlert; } });
|
|
181
193
|
Object.defineProperty(exports, "useEnableSignalsForPatient", { enumerable: true, get: function () { return signals_hooks_1.useEnableSignalsForPatient; } });
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { AcceptInviteBody, AcceptInviteResult, InviteBody, InviteSent } from "../client/invites";
|
|
1
|
+
import { AcceptInviteBody, AcceptInviteResult, AcceptRecordShareBody, InviteBody, InviteSent, RecordShareAccepted, RecordShareBody } from "../client/invites";
|
|
2
2
|
import { OvokMutationState } from "./api-hooks";
|
|
3
|
+
export declare const useShareRecord: () => OvokMutationState<RecordShareBody, InviteSent>;
|
|
4
|
+
export declare const useInviteToCare: () => OvokMutationState<InviteBody, InviteSent>;
|
|
5
|
+
export declare const useAcceptRecordShare: () => OvokMutationState<AcceptRecordShareBody, RecordShareAccepted>;
|
|
6
|
+
export declare const useAcceptCareInvite: () => OvokMutationState<AcceptInviteBody, AcceptInviteResult>;
|
|
7
|
+
/** @deprecated Use useShareRecord with `recipient: "practitioner"`; the route sunsets on 2026-12-01. */
|
|
3
8
|
export declare const useInvitePractitioner: () => OvokMutationState<InviteBody, InviteSent>;
|
|
9
|
+
/** @deprecated Use useInviteToCare; the route sunsets on 2026-12-01. */
|
|
4
10
|
export declare const useInvitePatient: () => OvokMutationState<InviteBody, InviteSent>;
|
|
5
11
|
export declare const useAcceptInvite: () => OvokMutationState<AcceptInviteBody, AcceptInviteResult>;
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useAcceptInvite = exports.useInvitePatient = exports.useInvitePractitioner = void 0;
|
|
4
|
+
exports.useAcceptInvite = exports.useInvitePatient = exports.useInvitePractitioner = exports.useAcceptCareInvite = exports.useAcceptRecordShare = exports.useInviteToCare = exports.useShareRecord = void 0;
|
|
5
5
|
const api_hooks_1 = require("./api-hooks");
|
|
6
6
|
const notification_invalidation_1 = require("./notification-invalidation");
|
|
7
|
+
const useShareRecord = () => (0, api_hooks_1.useOvokMutation)((client, body) => client.shareRecord(body));
|
|
8
|
+
exports.useShareRecord = useShareRecord;
|
|
9
|
+
const useInviteToCare = () => (0, api_hooks_1.useOvokMutation)((client, body) => client.inviteToCare(body));
|
|
10
|
+
exports.useInviteToCare = useInviteToCare;
|
|
11
|
+
const useAcceptRecordShare = () => (0, api_hooks_1.useOvokMutation)(async (client, body) => {
|
|
12
|
+
const result = await client.acceptRecordShare(body);
|
|
13
|
+
(0, notification_invalidation_1.notifyNotificationChanges)(client, { type: "patient-sharing" });
|
|
14
|
+
return result;
|
|
15
|
+
});
|
|
16
|
+
exports.useAcceptRecordShare = useAcceptRecordShare;
|
|
17
|
+
const useAcceptCareInvite = () => (0, api_hooks_1.useOvokMutation)(async (client, body) => {
|
|
18
|
+
const result = await client.acceptCareInvite(body);
|
|
19
|
+
(0, notification_invalidation_1.notifyNotificationChanges)(client, { type: "patient-sharing" });
|
|
20
|
+
return result;
|
|
21
|
+
});
|
|
22
|
+
exports.useAcceptCareInvite = useAcceptCareInvite;
|
|
23
|
+
/** @deprecated Use useShareRecord with `recipient: "practitioner"`; the route sunsets on 2026-12-01. */
|
|
7
24
|
const useInvitePractitioner = () => (0, api_hooks_1.useOvokMutation)((client, body) => client.invitePractitioner(body));
|
|
8
25
|
exports.useInvitePractitioner = useInvitePractitioner;
|
|
26
|
+
/** @deprecated Use useInviteToCare; the route sunsets on 2026-12-01. */
|
|
9
27
|
const useInvitePatient = () => (0, api_hooks_1.useOvokMutation)((client, body) => client.invitePatient(body));
|
|
10
28
|
exports.useInvitePatient = useInvitePatient;
|
|
11
29
|
const useAcceptInvite = () => (0, api_hooks_1.useOvokMutation)(async (client, body) => {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OvokClient } from "../client/ovok-client";
|
|
2
|
+
type WearableChange = "providers" | "connections";
|
|
3
|
+
export declare const subscribeToWearableChanges: (client: OvokClient, change: WearableChange, reload: () => void) => (() => void);
|
|
4
|
+
export declare const notifyWearableChanges: (client: OvokClient, change: WearableChange) => void;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.notifyWearableChanges = exports.subscribeToWearableChanges = void 0;
|
|
4
|
+
const listeners = new WeakMap();
|
|
5
|
+
const subscribeToWearableChanges = (client, change, reload) => {
|
|
6
|
+
var _a;
|
|
7
|
+
const listener = (updated) => {
|
|
8
|
+
if (updated === change) {
|
|
9
|
+
reload();
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const clientListeners = (_a = listeners.get(client)) !== null && _a !== void 0 ? _a : new Set();
|
|
13
|
+
clientListeners.add(listener);
|
|
14
|
+
listeners.set(client, clientListeners);
|
|
15
|
+
return () => clientListeners.delete(listener);
|
|
16
|
+
};
|
|
17
|
+
exports.subscribeToWearableChanges = subscribeToWearableChanges;
|
|
18
|
+
const notifyWearableChanges = (client, change) => {
|
|
19
|
+
var _a;
|
|
20
|
+
(_a = listeners.get(client)) === null || _a === void 0 ? void 0 : _a.forEach((listener) => listener(change));
|
|
21
|
+
};
|
|
22
|
+
exports.notifyWearableChanges = notifyWearableChanges;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CreateWearableProviderRequest, UpdateWearableProviderRequest, WearableConnectionAuthorization, WearableConnections, WearableProvider, WearableProviderSettings, WearableProviderSettingsList } from "../client/wearables";
|
|
2
|
+
import { OvokMutationState, OvokRequestState } from "./api-hooks";
|
|
3
|
+
export declare const useWearableProviders: () => OvokRequestState<WearableProviderSettingsList>;
|
|
4
|
+
export declare const useWearableConnections: () => OvokRequestState<WearableConnections>;
|
|
5
|
+
export declare const useCreateWearableProvider: () => OvokMutationState<CreateWearableProviderRequest, WearableProviderSettings>;
|
|
6
|
+
export declare const useUpdateWearableProvider: () => OvokMutationState<{
|
|
7
|
+
provider: WearableProvider;
|
|
8
|
+
body: UpdateWearableProviderRequest;
|
|
9
|
+
}, WearableProviderSettings>;
|
|
10
|
+
export declare const useDeleteWearableProvider: () => OvokMutationState<WearableProvider, void>;
|
|
11
|
+
export declare const useAuthorizeWearableConnection: () => OvokMutationState<WearableProvider, WearableConnectionAuthorization>;
|
|
12
|
+
export declare const useDeleteWearableConnection: () => OvokMutationState<WearableProvider, void>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.useDeleteWearableConnection = exports.useAuthorizeWearableConnection = exports.useDeleteWearableProvider = exports.useUpdateWearableProvider = exports.useCreateWearableProvider = exports.useWearableConnections = exports.useWearableProviders = void 0;
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const api_hooks_1 = require("./api-hooks");
|
|
40
|
+
const wearable_invalidation_1 = require("./wearable-invalidation");
|
|
41
|
+
const index_1 = require("./index");
|
|
42
|
+
const useWearableProviders = () => {
|
|
43
|
+
const client = (0, index_1.useClient)();
|
|
44
|
+
const state = (0, api_hooks_1.useOvokClientRequest)((current, signal) => current.listWearableProviders({ signal }));
|
|
45
|
+
React.useEffect(() => (0, wearable_invalidation_1.subscribeToWearableChanges)(client, "providers", state.reload), [client, state.reload]);
|
|
46
|
+
return state;
|
|
47
|
+
};
|
|
48
|
+
exports.useWearableProviders = useWearableProviders;
|
|
49
|
+
const useWearableConnections = () => {
|
|
50
|
+
const client = (0, index_1.useClient)();
|
|
51
|
+
const state = (0, api_hooks_1.useOvokClientRequest)((current, signal) => current.listWearableConnections({ signal }));
|
|
52
|
+
React.useEffect(() => (0, wearable_invalidation_1.subscribeToWearableChanges)(client, "connections", state.reload), [client, state.reload]);
|
|
53
|
+
return state;
|
|
54
|
+
};
|
|
55
|
+
exports.useWearableConnections = useWearableConnections;
|
|
56
|
+
const useCreateWearableProvider = () => (0, api_hooks_1.useOvokMutation)(async (client, body) => {
|
|
57
|
+
const settings = await client.createWearableProvider(body);
|
|
58
|
+
(0, wearable_invalidation_1.notifyWearableChanges)(client, "providers");
|
|
59
|
+
return settings;
|
|
60
|
+
});
|
|
61
|
+
exports.useCreateWearableProvider = useCreateWearableProvider;
|
|
62
|
+
const useUpdateWearableProvider = () => (0, api_hooks_1.useOvokMutation)(async (client, { provider, body }) => {
|
|
63
|
+
const settings = await client.updateWearableProvider(provider, body);
|
|
64
|
+
(0, wearable_invalidation_1.notifyWearableChanges)(client, "providers");
|
|
65
|
+
return settings;
|
|
66
|
+
});
|
|
67
|
+
exports.useUpdateWearableProvider = useUpdateWearableProvider;
|
|
68
|
+
const useDeleteWearableProvider = () => (0, api_hooks_1.useOvokMutation)(async (client, provider) => {
|
|
69
|
+
await client.deleteWearableProvider(provider);
|
|
70
|
+
(0, wearable_invalidation_1.notifyWearableChanges)(client, "providers");
|
|
71
|
+
});
|
|
72
|
+
exports.useDeleteWearableProvider = useDeleteWearableProvider;
|
|
73
|
+
const useAuthorizeWearableConnection = () => (0, api_hooks_1.useOvokMutation)((client, provider) => client.authorizeWearableConnection(provider));
|
|
74
|
+
exports.useAuthorizeWearableConnection = useAuthorizeWearableConnection;
|
|
75
|
+
const useDeleteWearableConnection = () => (0, api_hooks_1.useOvokMutation)(async (client, provider) => {
|
|
76
|
+
await client.deleteWearableConnection(provider);
|
|
77
|
+
(0, wearable_invalidation_1.notifyWearableChanges)(client, "connections");
|
|
78
|
+
});
|
|
79
|
+
exports.useDeleteWearableConnection = useDeleteWearableConnection;
|
package/dist/index.d.ts
CHANGED
|
@@ -958,6 +958,7 @@ export * from "./client/slim/paging";
|
|
|
958
958
|
export * from "./client/experience/types";
|
|
959
959
|
export * from "./client/patient/types";
|
|
960
960
|
export * from "./client/patient-sharing";
|
|
961
|
+
export * from "./client/wearables";
|
|
961
962
|
export { SignalsError, isSignalsError, mapSignalsError } from "./client/signals/errors";
|
|
962
963
|
export * from "./client/storage";
|
|
963
964
|
export * from "./client/questionnaire-response/methods";
|
package/dist/index.js
CHANGED
|
@@ -77,6 +77,7 @@ __exportStar(require("./client/slim/paging"), exports);
|
|
|
77
77
|
__exportStar(require("./client/experience/types"), exports);
|
|
78
78
|
__exportStar(require("./client/patient/types"), exports);
|
|
79
79
|
__exportStar(require("./client/patient-sharing"), exports);
|
|
80
|
+
__exportStar(require("./client/wearables"), exports);
|
|
80
81
|
var errors_1 = require("./client/signals/errors");
|
|
81
82
|
Object.defineProperty(exports, "SignalsError", { enumerable: true, get: function () { return errors_1.SignalsError; } });
|
|
82
83
|
Object.defineProperty(exports, "isSignalsError", { enumerable: true, get: function () { return errors_1.isSignalsError; } });
|