@ovok/core 0.4.49-dev.495 → 0.4.49-dev.496
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/observation/measurement-fields.d.ts +1 -1
- package/dist/client/observation/methods/observationsToMeasurements.d.ts +1 -1
- package/dist/client/observation/methods/observationsToMeasurements.js +59 -59
- package/dist/client/observation/services/base-observation-service.d.ts +1 -1
- package/dist/client/observation/services/blood-oxygen.d.ts +1 -1
- package/dist/client/observation/services/blood-oxygen.js +7 -7
- package/dist/client/observation/services/blood-pressure.d.ts +1 -1
- package/dist/client/observation/services/blood-pressure.js +16 -16
- package/dist/client/observation/services/component-observation-services.d.ts +1 -1
- package/dist/client/observation/services/component-observation-services.js +3 -3
- package/dist/client/observation/services/creator.d.ts +1 -1
- package/dist/client/observation/services/creator.js +10 -10
- package/dist/client/observation/services/ecg-observation-fragments.d.ts +1 -1
- package/dist/client/observation/services/ecg.d.ts +1 -1
- package/dist/client/observation/services/ecg.js +10 -10
- package/dist/client/observation/services/lipid-panel.d.ts +1 -1
- package/dist/client/observation/services/lipid-panel.js +13 -13
- package/dist/client/observation/services/single-value-services.d.ts +1 -1
- package/dist/client/observation/services/single-value-services.js +19 -19
- package/dist/client/observation/services/step-count.d.ts +1 -1
- package/dist/client/observation/services/step-count.js +5 -5
- package/dist/client/observation/services/uric-acid-service.d.ts +1 -1
- package/dist/client/observation/services/uric-acid-service.js +7 -7
- package/dist/client/offline/offline-measurement-queue.d.ts +1 -2
- package/dist/client/wearables/types.d.ts +5 -0
- package/dist/conformance/capability-requirements.js +1 -1
- package/dist/next/auth/access-token.d.ts +9 -0
- package/dist/next/auth/access-token.js +18 -0
- package/dist/next/auth/client-credentials.d.ts +16 -0
- package/dist/next/auth/client-credentials.js +40 -0
- package/dist/next/auth/credentials.d.ts +5 -0
- package/dist/next/auth/credentials.js +7 -0
- package/dist/next/auth/session-store.d.ts +12 -0
- package/dist/next/auth/session-store.js +33 -0
- package/dist/next/auth/session.d.ts +28 -0
- package/dist/next/auth/session.js +27 -0
- package/dist/next/auth/token-endpoint.d.ts +12 -0
- package/dist/next/auth/token-endpoint.js +28 -0
- package/dist/next/auth/user-session.d.ts +27 -0
- package/dist/next/auth/user-session.js +82 -0
- package/dist/next/config/ovok-config.d.ts +42 -0
- package/dist/next/config/ovok-config.js +2 -0
- package/dist/next/config/settings.d.ts +6 -0
- package/dist/next/config/settings.js +74 -0
- package/dist/next/errors/error-from-response.d.ts +2 -0
- package/dist/next/errors/error-from-response.js +35 -0
- package/dist/next/errors/ovok-errors.d.ts +42 -0
- package/dist/next/errors/ovok-errors.js +74 -0
- package/dist/next/http/http-client.d.ts +35 -0
- package/dist/next/http/http-client.js +113 -0
- package/dist/next/http/retry-after.d.ts +1 -0
- package/dist/next/http/retry-after.js +16 -0
- package/dist/next/http/retry-policy.d.ts +13 -0
- package/dist/next/http/retry-policy.js +27 -0
- package/dist/next/http/transmit.d.ts +14 -0
- package/dist/next/http/transmit.js +57 -0
- package/dist/next/http/url.d.ts +6 -0
- package/dist/next/http/url.js +22 -0
- package/dist/next/index.d.ts +69 -0
- package/dist/next/index.js +33 -0
- package/dist/next/ovok.d.ts +52 -0
- package/dist/next/ovok.js +74 -0
- package/dist/next/paging/bundle-page.d.ts +4 -0
- package/dist/next/paging/bundle-page.js +25 -0
- package/dist/next/paging/cursor-pages.d.ts +7 -0
- package/dist/next/paging/cursor-pages.js +14 -0
- package/dist/next/paging/numbered-pages.d.ts +15 -0
- package/dist/next/paging/numbered-pages.js +20 -0
- package/dist/next/paging/page.d.ts +12 -0
- package/dist/next/paging/page.js +17 -0
- package/dist/next/resources/accounts/accounts-resource.d.ts +8 -0
- package/dist/next/resources/accounts/accounts-resource.js +13 -0
- package/dist/next/resources/ai/ai-chat-resource.d.ts +8 -0
- package/dist/next/resources/ai/ai-chat-resource.js +12 -0
- package/dist/next/resources/ai/ai-resource.d.ts +16 -0
- package/dist/next/resources/ai/ai-resource.js +19 -0
- package/dist/next/resources/ai/chat-messages-resource.d.ts +9 -0
- package/dist/next/resources/ai/chat-messages-resource.js +18 -0
- package/dist/next/resources/ai/chat-sessions-resource.d.ts +14 -0
- package/dist/next/resources/ai/chat-sessions-resource.js +23 -0
- package/dist/next/resources/auth/auth-sessions-resource.d.ts +13 -0
- package/dist/next/resources/auth/auth-sessions-resource.js +25 -0
- package/dist/next/resources/auth/registration.d.ts +35 -0
- package/dist/next/resources/auth/registration.js +24 -0
- package/dist/next/resources/auth/social-login.d.ts +8 -0
- package/dist/next/resources/auth/social-login.js +7 -0
- package/dist/next/resources/auth-resource.d.ts +63 -0
- package/dist/next/resources/auth-resource.js +119 -0
- package/dist/next/resources/bots/bots-resource.d.ts +10 -0
- package/dist/next/resources/bots/bots-resource.js +15 -0
- package/dist/next/resources/cms/cms-delivery.d.ts +22 -0
- package/dist/next/resources/cms/cms-delivery.js +36 -0
- package/dist/next/resources/cms/cms-documents-resource.d.ts +11 -0
- package/dist/next/resources/cms/cms-documents-resource.js +17 -0
- package/dist/next/resources/cms/cms-resource.d.ts +17 -0
- package/dist/next/resources/cms/cms-resource.js +38 -0
- package/dist/next/resources/cms/payload-pages.d.ts +6 -0
- package/dist/next/resources/cms/payload-pages.js +15 -0
- package/dist/next/resources/cms/release-notes-resource.d.ts +10 -0
- package/dist/next/resources/cms/release-notes-resource.js +15 -0
- package/dist/next/resources/cms/translation-tree.d.ts +3 -0
- package/dist/next/resources/cms/translation-tree.js +45 -0
- package/dist/next/resources/consent/consent-resource.d.ts +23 -0
- package/dist/next/resources/consent/consent-resource.js +43 -0
- package/dist/next/resources/content/content-resource.d.ts +19 -0
- package/dist/next/resources/content/content-resource.js +41 -0
- package/dist/next/resources/documents/documents-resource.d.ts +26 -0
- package/dist/next/resources/documents/documents-resource.js +41 -0
- package/dist/next/resources/email/email-resource.d.ts +6 -0
- package/dist/next/resources/email/email-resource.js +10 -0
- package/dist/next/resources/email/email-templates-resource.d.ts +8 -0
- package/dist/next/resources/email/email-templates-resource.js +13 -0
- package/dist/next/resources/fhir-resource.d.ts +28 -0
- package/dist/next/resources/fhir-resource.js +64 -0
- package/dist/next/resources/health-resource.d.ts +17 -0
- package/dist/next/resources/health-resource.js +14 -0
- package/dist/next/resources/invites/invite-flow-resource.d.ts +12 -0
- package/dist/next/resources/invites/invite-flow-resource.js +19 -0
- package/dist/next/resources/invites/invites-resource.d.ts +17 -0
- package/dist/next/resources/invites/invites-resource.js +14 -0
- package/dist/next/resources/localization/i18next-resource.d.ts +10 -0
- package/dist/next/resources/localization/i18next-resource.js +18 -0
- package/dist/next/resources/localization/locales-resource.d.ts +9 -0
- package/dist/next/resources/localization/locales-resource.js +16 -0
- package/dist/next/resources/localization/localizations-resource.d.ts +17 -0
- package/dist/next/resources/localization/localizations-resource.js +27 -0
- package/dist/next/resources/measurements/measurements-resource.d.ts +42 -0
- package/dist/next/resources/measurements/measurements-resource.js +77 -0
- package/dist/next/resources/measurements/observation-builder.d.ts +5 -0
- package/dist/next/resources/measurements/observation-builder.js +57 -0
- package/dist/next/resources/measurements/save-error.d.ts +5 -0
- package/dist/next/resources/measurements/save-error.js +18 -0
- package/dist/next/resources/measurements/signed-in-account.d.ts +11 -0
- package/dist/next/resources/measurements/signed-in-account.js +26 -0
- package/dist/next/resources/patient/fhir-records.d.ts +19 -0
- package/dist/next/resources/patient/fhir-records.js +33 -0
- package/dist/next/resources/patient/patient-resource.d.ts +21 -0
- package/dist/next/resources/patient/patient-resource.js +38 -0
- package/dist/next/resources/projects/project-features-resource.d.ts +9 -0
- package/dist/next/resources/projects/project-features-resource.js +17 -0
- package/dist/next/resources/projects/project-members-resource.d.ts +19 -0
- package/dist/next/resources/projects/project-members-resource.js +25 -0
- package/dist/next/resources/projects/project-settings-resource.d.ts +10 -0
- package/dist/next/resources/projects/project-settings-resource.js +21 -0
- package/dist/next/resources/projects/projects-resource.d.ts +20 -0
- package/dist/next/resources/projects/projects-resource.js +21 -0
- package/dist/next/resources/questionnaires/questionnaires-resource.d.ts +18 -0
- package/dist/next/resources/questionnaires/questionnaires-resource.js +36 -0
- package/dist/next/resources/sharing/sharing-invites-resource.d.ts +9 -0
- package/dist/next/resources/sharing/sharing-invites-resource.js +17 -0
- package/dist/next/resources/sharing/sharing-resource.d.ts +10 -0
- package/dist/next/resources/sharing/sharing-resource.js +14 -0
- package/dist/next/resources/sharing/sharing-settings-resource.d.ts +9 -0
- package/dist/next/resources/sharing/sharing-settings-resource.js +16 -0
- package/dist/next/resources/sharing/sharing-shares-resource.d.ts +9 -0
- package/dist/next/resources/sharing/sharing-shares-resource.js +27 -0
- package/dist/next/resources/signals/signals-gateway-resource.d.ts +14 -0
- package/dist/next/resources/signals/signals-gateway-resource.js +44 -0
- package/dist/next/resources/signals/signals-resource.d.ts +13 -0
- package/dist/next/resources/signals/signals-resource.js +19 -0
- package/dist/next/resources/signals/undeliverable-resource.d.ts +26 -0
- package/dist/next/resources/signals/undeliverable-resource.js +18 -0
- package/dist/next/resources/slim/live-reads.d.ts +12 -0
- package/dist/next/resources/slim/live-reads.js +76 -0
- package/dist/next/resources/slim/slim-alarms-resource.d.ts +13 -0
- package/dist/next/resources/slim/slim-alarms-resource.js +25 -0
- package/dist/next/resources/slim/slim-change-history-resource.d.ts +9 -0
- package/dist/next/resources/slim/slim-change-history-resource.js +19 -0
- package/dist/next/resources/slim/slim-child-projects-resource.d.ts +17 -0
- package/dist/next/resources/slim/slim-child-projects-resource.js +22 -0
- package/dist/next/resources/slim/slim-devices-resource.d.ts +28 -0
- package/dist/next/resources/slim/slim-devices-resource.js +80 -0
- package/dist/next/resources/slim/slim-exports-resource.d.ts +8 -0
- package/dist/next/resources/slim/slim-exports-resource.js +14 -0
- package/dist/next/resources/slim/slim-locations-resource.d.ts +14 -0
- package/dist/next/resources/slim/slim-locations-resource.js +30 -0
- package/dist/next/resources/slim/slim-medical-notifications-resource.d.ts +18 -0
- package/dist/next/resources/slim/slim-medical-notifications-resource.js +46 -0
- package/dist/next/resources/slim/slim-notification-notes-resource.d.ts +12 -0
- package/dist/next/resources/slim/slim-notification-notes-resource.js +34 -0
- package/dist/next/resources/slim/slim-notifications-resource.d.ts +19 -0
- package/dist/next/resources/slim/slim-notifications-resource.js +26 -0
- package/dist/next/resources/slim/slim-organizations-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-organizations-resource.js +25 -0
- package/dist/next/resources/slim/slim-out-of-bed-resource.d.ts +13 -0
- package/dist/next/resources/slim/slim-out-of-bed-resource.js +20 -0
- package/dist/next/resources/slim/slim-paths.d.ts +6 -0
- package/dist/next/resources/slim/slim-paths.js +9 -0
- package/dist/next/resources/slim/slim-patient-thresholds-resource.d.ts +10 -0
- package/dist/next/resources/slim/slim-patient-thresholds-resource.js +20 -0
- package/dist/next/resources/slim/slim-patients-resource.d.ts +20 -0
- package/dist/next/resources/slim/slim-patients-resource.js +39 -0
- package/dist/next/resources/slim/slim-policies-resource.d.ts +12 -0
- package/dist/next/resources/slim/slim-policies-resource.js +29 -0
- package/dist/next/resources/slim/slim-practitioners-resource.d.ts +8 -0
- package/dist/next/resources/slim/slim-practitioners-resource.js +14 -0
- package/dist/next/resources/slim/slim-projects-resource.d.ts +16 -0
- package/dist/next/resources/slim/slim-projects-resource.js +35 -0
- package/dist/next/resources/slim/slim-queries.d.ts +34 -0
- package/dist/next/resources/slim/slim-queries.js +2 -0
- package/dist/next/resources/slim/slim-resource.d.ts +38 -0
- package/dist/next/resources/slim/slim-resource.js +44 -0
- package/dist/next/resources/slim/slim-sleep-resource.d.ts +9 -0
- package/dist/next/resources/slim/slim-sleep-resource.js +15 -0
- package/dist/next/resources/slim/slim-thresholds-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-thresholds-resource.js +18 -0
- package/dist/next/resources/slim/slim-trends-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-trends-resource.js +19 -0
- package/dist/next/resources/slim/slim-users-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-users-resource.js +15 -0
- package/dist/next/resources/slim/slim-zones-resource.d.ts +12 -0
- package/dist/next/resources/slim/slim-zones-resource.js +24 -0
- package/dist/next/resources/video-calls/video-call-access-resource.d.ts +11 -0
- package/dist/next/resources/video-calls/video-call-access-resource.js +19 -0
- package/dist/next/resources/video-calls/video-call-appointments-resource.d.ts +10 -0
- package/dist/next/resources/video-calls/video-call-appointments-resource.js +21 -0
- package/dist/next/resources/video-calls/video-call-emails-resource.d.ts +10 -0
- package/dist/next/resources/video-calls/video-call-emails-resource.js +19 -0
- package/dist/next/resources/video-calls/video-calls-resource.d.ts +14 -0
- package/dist/next/resources/video-calls/video-calls-resource.js +20 -0
- package/dist/next/resources/wearables/wearable-connections-resource.d.ts +12 -0
- package/dist/next/resources/wearables/wearable-connections-resource.js +25 -0
- package/dist/next/resources/wearables/wearable-providers-resource.d.ts +12 -0
- package/dist/next/resources/wearables/wearable-providers-resource.js +27 -0
- package/dist/next/resources/wearables/wearables-resource.d.ts +8 -0
- package/dist/next/resources/wearables/wearables-resource.js +14 -0
- package/dist/next/storage/ovok-storage.d.ts +11 -0
- package/dist/next/storage/ovok-storage.js +19 -0
- package/dist/types/MeasurementTypes.d.ts +5 -0
- package/dist/types/MeasurementTypes.js +21 -0
- package/dist/types/index.d.ts +1 -5
- package/dist/types/index.js +1 -5
- package/next/index.d.ts +1 -0
- package/next/index.js +3 -0
- package/package.json +3 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SignedInAccount = void 0;
|
|
4
|
+
const ovok_errors_1 = require("../../errors/ovok-errors");
|
|
5
|
+
/** The account a measurement belongs to; a machine client has none. */
|
|
6
|
+
class SignedInAccount {
|
|
7
|
+
constructor(session) {
|
|
8
|
+
this.session = session;
|
|
9
|
+
}
|
|
10
|
+
/** The project and profile signed in now, or null when no one is. */
|
|
11
|
+
async key() {
|
|
12
|
+
const session = await this.current();
|
|
13
|
+
return session === null ? null : `${session.project.reference}|${session.profile.reference}`;
|
|
14
|
+
}
|
|
15
|
+
async profileReference() {
|
|
16
|
+
const session = await this.current();
|
|
17
|
+
if (session === null) {
|
|
18
|
+
throw new ovok_errors_1.OvokValidationError((0, ovok_errors_1.detailsFor)("No user is signed in; name the patient instead."));
|
|
19
|
+
}
|
|
20
|
+
return session.profile.reference;
|
|
21
|
+
}
|
|
22
|
+
async current() {
|
|
23
|
+
return this.session === null ? null : this.session.current();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.SignedInAccount = SignedInAccount;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Appointment, ExtractResource, ResourceType } from "@medplum/fhirtypes";
|
|
2
|
+
import { RequestOptions } from "../../http/transmit";
|
|
3
|
+
import { QueryParams } from "../../http/url";
|
|
4
|
+
import { FhirResource } from "../fhir-resource";
|
|
5
|
+
/** Lists resolve to the first page's resources, as the Medplum client's `searchResources` did. */
|
|
6
|
+
export declare class FhirListResource<K extends ResourceType> {
|
|
7
|
+
protected readonly fhir: FhirResource;
|
|
8
|
+
protected readonly type: K;
|
|
9
|
+
constructor(fhir: FhirResource, type: K);
|
|
10
|
+
list(params?: QueryParams, options?: RequestOptions): Promise<ExtractResource<K>[]>;
|
|
11
|
+
}
|
|
12
|
+
export declare class FhirRecordsResource<K extends ResourceType> extends FhirListResource<K> {
|
|
13
|
+
retrieve(id: string, options?: RequestOptions): Promise<ExtractResource<K>>;
|
|
14
|
+
}
|
|
15
|
+
export declare class AppointmentsResource extends FhirRecordsResource<"Appointment"> {
|
|
16
|
+
constructor(fhir: FhirResource);
|
|
17
|
+
create(appointment: Appointment, options?: RequestOptions): Promise<Appointment>;
|
|
18
|
+
update(id: string, appointment: Appointment, options?: RequestOptions): Promise<Appointment>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppointmentsResource = exports.FhirRecordsResource = exports.FhirListResource = void 0;
|
|
4
|
+
/** Lists resolve to the first page's resources, as the Medplum client's `searchResources` did. */
|
|
5
|
+
class FhirListResource {
|
|
6
|
+
constructor(fhir, type) {
|
|
7
|
+
this.fhir = fhir;
|
|
8
|
+
this.type = type;
|
|
9
|
+
}
|
|
10
|
+
async list(params = {}, options) {
|
|
11
|
+
const page = await this.fhir.search(this.type, params, options);
|
|
12
|
+
return page.data;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.FhirListResource = FhirListResource;
|
|
16
|
+
class FhirRecordsResource extends FhirListResource {
|
|
17
|
+
retrieve(id, options) {
|
|
18
|
+
return this.fhir.read(this.type, id, options);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.FhirRecordsResource = FhirRecordsResource;
|
|
22
|
+
class AppointmentsResource extends FhirRecordsResource {
|
|
23
|
+
constructor(fhir) {
|
|
24
|
+
super(fhir, "Appointment");
|
|
25
|
+
}
|
|
26
|
+
create(appointment, options) {
|
|
27
|
+
return this.fhir.create(appointment, options);
|
|
28
|
+
}
|
|
29
|
+
update(id, appointment, options) {
|
|
30
|
+
return this.fhir.update({ ...appointment, id }, options);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.AppointmentsResource = AppointmentsResource;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { OvokPatientDashboard, OvokPatientDashboardQuery, OvokPatientLatestObservationsQuery, OvokPatientObservationBundle } from "../../../client/patient/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
import { FhirResource } from "../fhir-resource";
|
|
5
|
+
import { AppointmentsResource, FhirListResource, FhirRecordsResource } from "./fhir-records";
|
|
6
|
+
export declare class PatientResource {
|
|
7
|
+
private readonly http;
|
|
8
|
+
readonly appointments: AppointmentsResource;
|
|
9
|
+
readonly schedules: FhirListResource<"Schedule">;
|
|
10
|
+
readonly slots: FhirListResource<"Slot">;
|
|
11
|
+
readonly measurements: FhirRecordsResource<"Observation">;
|
|
12
|
+
readonly carePlans: FhirRecordsResource<"CarePlan">;
|
|
13
|
+
readonly questionnaires: FhirRecordsResource<"Questionnaire">;
|
|
14
|
+
readonly questionnaireResponses: FhirRecordsResource<"QuestionnaireResponse">;
|
|
15
|
+
readonly devices: FhirRecordsResource<"Device">;
|
|
16
|
+
readonly notifications: FhirRecordsResource<"CommunicationRequest">;
|
|
17
|
+
constructor(http: HttpClient, fhir: FhirResource);
|
|
18
|
+
latestObservations(params?: OvokPatientLatestObservationsQuery, options?: RequestOptions): Promise<OvokPatientObservationBundle>;
|
|
19
|
+
/** Every read is scoped to the signed-in patient unless its query names another. */
|
|
20
|
+
dashboard(params?: OvokPatientDashboardQuery, options?: RequestOptions): Promise<OvokPatientDashboard>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PatientResource = void 0;
|
|
4
|
+
const query_string_1 = require("../../../client/query-string");
|
|
5
|
+
const auth_resource_1 = require("../auth-resource");
|
|
6
|
+
const fhir_records_1 = require("./fhir-records");
|
|
7
|
+
const LATEST_OBSERVATIONS_PATH = "fhir/Observation/$lastn";
|
|
8
|
+
class PatientResource {
|
|
9
|
+
constructor(http, fhir) {
|
|
10
|
+
this.http = http;
|
|
11
|
+
this.appointments = new fhir_records_1.AppointmentsResource(fhir);
|
|
12
|
+
this.schedules = new fhir_records_1.FhirListResource(fhir, "Schedule");
|
|
13
|
+
this.slots = new fhir_records_1.FhirListResource(fhir, "Slot");
|
|
14
|
+
this.measurements = new fhir_records_1.FhirRecordsResource(fhir, "Observation");
|
|
15
|
+
this.carePlans = new fhir_records_1.FhirRecordsResource(fhir, "CarePlan");
|
|
16
|
+
this.questionnaires = new fhir_records_1.FhirRecordsResource(fhir, "Questionnaire");
|
|
17
|
+
this.questionnaireResponses = new fhir_records_1.FhirRecordsResource(fhir, "QuestionnaireResponse");
|
|
18
|
+
this.devices = new fhir_records_1.FhirRecordsResource(fhir, "Device");
|
|
19
|
+
this.notifications = new fhir_records_1.FhirRecordsResource(fhir, "CommunicationRequest");
|
|
20
|
+
}
|
|
21
|
+
latestObservations(params = {}, options) {
|
|
22
|
+
const { patient, max, code } = params;
|
|
23
|
+
return this.http.get(`${LATEST_OBSERVATIONS_PATH}${(0, query_string_1.toQueryString)({ patient, max, code })}`, options);
|
|
24
|
+
}
|
|
25
|
+
/** Every read is scoped to the signed-in patient unless its query names another. */
|
|
26
|
+
async dashboard(params = {}, options) {
|
|
27
|
+
const profile = await this.http.get(auth_resource_1.ME_PATH, options);
|
|
28
|
+
const patient = `Patient/${profile.profile.id}`;
|
|
29
|
+
const latestObservations = await this.latestObservations(withPatient(params.latestObservations, patient), options);
|
|
30
|
+
const [measurementHistory, carePlans] = await Promise.all([
|
|
31
|
+
this.measurements.list(withPatient(params.measurementHistory, patient), options),
|
|
32
|
+
this.carePlans.list(withPatient(params.carePlans, patient), options),
|
|
33
|
+
]);
|
|
34
|
+
return { carePlans, latestObservations, measurementHistory, profile };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.PatientResource = PatientResource;
|
|
38
|
+
const withPatient = (query, patient) => { var _a; return ({ ...query, patient: (_a = query === null || query === void 0 ? void 0 : query.patient) !== null && _a !== void 0 ? _a : patient }); };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OvokProjectFeature, OvokProjectFeatures } from "../../../client/platform/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
export declare class ProjectFeaturesResource {
|
|
5
|
+
private readonly http;
|
|
6
|
+
constructor(http: HttpClient);
|
|
7
|
+
retrieve(options?: RequestOptions): Promise<OvokProjectFeatures>;
|
|
8
|
+
update(features: OvokProjectFeature[], options?: RequestOptions): Promise<OvokProjectFeatures>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectFeaturesResource = void 0;
|
|
4
|
+
const FEATURES_PATH = "v1/projects/me/features";
|
|
5
|
+
class ProjectFeaturesResource {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
this.http = http;
|
|
8
|
+
}
|
|
9
|
+
retrieve(options) {
|
|
10
|
+
return this.http.get(FEATURES_PATH, options);
|
|
11
|
+
}
|
|
12
|
+
update(features, options) {
|
|
13
|
+
const body = { features };
|
|
14
|
+
return this.http.patch(FEATURES_PATH, body, options);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.ProjectFeaturesResource = ProjectFeaturesResource;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { OvokInviteProjectMember, OvokProjectMember, OvokProjectMemberResponse, OvokRemoveProjectMemberResponse, OvokUpdateProjectMember } from "../../../client/platform/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
import { PagePromise } from "../../paging/page";
|
|
5
|
+
export type ProjectMemberListQuery = {
|
|
6
|
+
accessPolicyId?: string;
|
|
7
|
+
profileId?: string;
|
|
8
|
+
userId?: string;
|
|
9
|
+
page?: number;
|
|
10
|
+
count?: number;
|
|
11
|
+
};
|
|
12
|
+
export declare class ProjectMembersResource {
|
|
13
|
+
private readonly http;
|
|
14
|
+
constructor(http: HttpClient);
|
|
15
|
+
list(query?: ProjectMemberListQuery, options?: RequestOptions): PagePromise<OvokProjectMember>;
|
|
16
|
+
invite(body: OvokInviteProjectMember, options?: RequestOptions): Promise<OvokProjectMemberResponse>;
|
|
17
|
+
update(membershipId: string, body: OvokUpdateProjectMember, options?: RequestOptions): Promise<OvokProjectMemberResponse>;
|
|
18
|
+
remove(membershipId: string, options?: RequestOptions): Promise<OvokRemoveProjectMemberResponse>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectMembersResource = void 0;
|
|
4
|
+
const url_1 = require("../../http/url");
|
|
5
|
+
const numbered_pages_1 = require("../../paging/numbered-pages");
|
|
6
|
+
const MEMBERS_PATH = "v1/projects/me/members";
|
|
7
|
+
const memberPath = (membershipId) => `${MEMBERS_PATH}/${(0, url_1.pathSegment)(membershipId)}`;
|
|
8
|
+
class ProjectMembersResource {
|
|
9
|
+
constructor(http) {
|
|
10
|
+
this.http = http;
|
|
11
|
+
}
|
|
12
|
+
list(query = {}, options) {
|
|
13
|
+
return (0, numbered_pages_1.numberedRoutePages)((path) => this.http.get(path, options), MEMBERS_PATH, query);
|
|
14
|
+
}
|
|
15
|
+
invite(body, options) {
|
|
16
|
+
return this.http.post(MEMBERS_PATH, body, options);
|
|
17
|
+
}
|
|
18
|
+
update(membershipId, body, options) {
|
|
19
|
+
return this.http.patch(memberPath(membershipId), body, options);
|
|
20
|
+
}
|
|
21
|
+
remove(membershipId, options) {
|
|
22
|
+
return this.http.delete(memberPath(membershipId), options);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.ProjectMembersResource = ProjectMembersResource;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { OvokProjectSettingKey, OvokProjectSettings, OvokProjectTextSettingKey } from "../../../client/platform/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
export declare class ProjectSettingsResource {
|
|
5
|
+
private readonly http;
|
|
6
|
+
constructor(http: HttpClient);
|
|
7
|
+
retrieve(options?: RequestOptions): Promise<OvokProjectSettings>;
|
|
8
|
+
update(key: OvokProjectSettingKey, enabled: boolean, options?: RequestOptions): Promise<OvokProjectSettings>;
|
|
9
|
+
updateText(key: OvokProjectTextSettingKey, value: string | null, options?: RequestOptions): Promise<OvokProjectSettings>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectSettingsResource = void 0;
|
|
4
|
+
const url_1 = require("../../http/url");
|
|
5
|
+
const SETTINGS_PATH = "v1/project/settings";
|
|
6
|
+
const TEXT_SETTINGS_PATH = `${SETTINGS_PATH}/values`;
|
|
7
|
+
class ProjectSettingsResource {
|
|
8
|
+
constructor(http) {
|
|
9
|
+
this.http = http;
|
|
10
|
+
}
|
|
11
|
+
retrieve(options) {
|
|
12
|
+
return this.http.get(SETTINGS_PATH, options);
|
|
13
|
+
}
|
|
14
|
+
update(key, enabled, options) {
|
|
15
|
+
return this.http.put(`${SETTINGS_PATH}/${(0, url_1.pathSegment)(key)}`, { enabled }, options);
|
|
16
|
+
}
|
|
17
|
+
updateText(key, value, options) {
|
|
18
|
+
return this.http.put(`${TEXT_SETTINGS_PATH}/${(0, url_1.pathSegment)(key)}`, { value }, options);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.ProjectSettingsResource = ProjectSettingsResource;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { OvokAdministeredProject } from "../../../client/platform/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
import { PagePromise } from "../../paging/page";
|
|
5
|
+
import { ProjectFeaturesResource } from "./project-features-resource";
|
|
6
|
+
import { ProjectMembersResource } from "./project-members-resource";
|
|
7
|
+
import { ProjectSettingsResource } from "./project-settings-resource";
|
|
8
|
+
export type ProjectListQuery = {
|
|
9
|
+
page?: number;
|
|
10
|
+
count?: number;
|
|
11
|
+
};
|
|
12
|
+
export declare class ProjectsResource {
|
|
13
|
+
private readonly http;
|
|
14
|
+
readonly members: ProjectMembersResource;
|
|
15
|
+
readonly features: ProjectFeaturesResource;
|
|
16
|
+
readonly settings: ProjectSettingsResource;
|
|
17
|
+
constructor(http: HttpClient);
|
|
18
|
+
/** The projects the caller administers, wherever they are signed in. */
|
|
19
|
+
list(query?: ProjectListQuery, options?: RequestOptions): PagePromise<OvokAdministeredProject>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectsResource = void 0;
|
|
4
|
+
const numbered_pages_1 = require("../../paging/numbered-pages");
|
|
5
|
+
const project_features_resource_1 = require("./project-features-resource");
|
|
6
|
+
const project_members_resource_1 = require("./project-members-resource");
|
|
7
|
+
const project_settings_resource_1 = require("./project-settings-resource");
|
|
8
|
+
const PROJECTS_PATH = "v1/projects";
|
|
9
|
+
class ProjectsResource {
|
|
10
|
+
constructor(http) {
|
|
11
|
+
this.http = http;
|
|
12
|
+
this.members = new project_members_resource_1.ProjectMembersResource(http);
|
|
13
|
+
this.features = new project_features_resource_1.ProjectFeaturesResource(http);
|
|
14
|
+
this.settings = new project_settings_resource_1.ProjectSettingsResource(http);
|
|
15
|
+
}
|
|
16
|
+
/** The projects the caller administers, wherever they are signed in. */
|
|
17
|
+
list(query = {}, options) {
|
|
18
|
+
return (0, numbered_pages_1.numberedRoutePages)((path) => this.http.get(path, options), PROJECTS_PATH, query);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.ProjectsResource = ProjectsResource;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Bundle, Observation, Parameters, QuestionnaireResponse } from "@medplum/fhirtypes";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
import { FhirResource } from "../fhir-resource";
|
|
5
|
+
export declare class QuestionnairesResource {
|
|
6
|
+
private readonly http;
|
|
7
|
+
constructor(http: HttpClient);
|
|
8
|
+
populate(questionnaireId: string, parameters?: Parameters, options?: RequestOptions): Promise<Parameters>;
|
|
9
|
+
}
|
|
10
|
+
export declare class QuestionnaireResponsesResource {
|
|
11
|
+
private readonly http;
|
|
12
|
+
private readonly fhir;
|
|
13
|
+
constructor(http: HttpClient, fhir: FhirResource);
|
|
14
|
+
submit(response: QuestionnaireResponse, options?: RequestOptions): Promise<Bundle>;
|
|
15
|
+
/** One transaction, so the response is never saved without its observations. */
|
|
16
|
+
submitWithObservations(response: QuestionnaireResponse, observations: Observation[], options?: RequestOptions): Promise<Bundle>;
|
|
17
|
+
extract(questionnaireResponseId: string, options?: RequestOptions): Promise<Parameters>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuestionnaireResponsesResource = exports.QuestionnairesResource = void 0;
|
|
4
|
+
const url_1 = require("../../http/url");
|
|
5
|
+
class QuestionnairesResource {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
this.http = http;
|
|
8
|
+
}
|
|
9
|
+
populate(questionnaireId, parameters = { resourceType: "Parameters", parameter: [] }, options) {
|
|
10
|
+
return this.http.post(`fhir/Questionnaire/${(0, url_1.pathSegment)(questionnaireId)}/$populate`, parameters, options);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.QuestionnairesResource = QuestionnairesResource;
|
|
14
|
+
class QuestionnaireResponsesResource {
|
|
15
|
+
constructor(http, fhir) {
|
|
16
|
+
this.http = http;
|
|
17
|
+
this.fhir = fhir;
|
|
18
|
+
}
|
|
19
|
+
submit(response, options) {
|
|
20
|
+
return this.submitWithObservations(response, [], options);
|
|
21
|
+
}
|
|
22
|
+
/** One transaction, so the response is never saved without its observations. */
|
|
23
|
+
submitWithObservations(response, observations, options) {
|
|
24
|
+
const entry = [createEntry(response), ...observations.map(createEntry)];
|
|
25
|
+
return this.fhir.batch({ resourceType: "Bundle", type: "transaction", entry }, options);
|
|
26
|
+
}
|
|
27
|
+
extract(questionnaireResponseId, options) {
|
|
28
|
+
return this.http.post(`fhir/QuestionnaireResponse/${(0, url_1.pathSegment)(questionnaireResponseId)}/$extract`, {}, options);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.QuestionnaireResponsesResource = QuestionnaireResponsesResource;
|
|
32
|
+
const createEntry = (resource) => ({
|
|
33
|
+
fullUrl: resource.id,
|
|
34
|
+
request: { method: "POST", url: resource.resourceType },
|
|
35
|
+
resource,
|
|
36
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CreatePatientSharingInvite, PatientSharingInvite, PatientSharingShare, RedeemPatientSharingInvite } from "../../../client/patient-sharing/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
export declare class SharingInvitesResource {
|
|
5
|
+
private readonly http;
|
|
6
|
+
constructor(http: HttpClient);
|
|
7
|
+
create(body: CreatePatientSharingInvite, options?: RequestOptions): Promise<PatientSharingInvite>;
|
|
8
|
+
redeem(body: RedeemPatientSharingInvite, options?: RequestOptions): Promise<PatientSharingShare>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SharingInvitesResource = void 0;
|
|
4
|
+
const INVITES_PATH = "v1/patient-sharing/invites";
|
|
5
|
+
const REDEEM_PATH = `${INVITES_PATH}/redeem`;
|
|
6
|
+
class SharingInvitesResource {
|
|
7
|
+
constructor(http) {
|
|
8
|
+
this.http = http;
|
|
9
|
+
}
|
|
10
|
+
create(body, options) {
|
|
11
|
+
return this.http.post(INVITES_PATH, body, options);
|
|
12
|
+
}
|
|
13
|
+
redeem(body, options) {
|
|
14
|
+
return this.http.post(REDEEM_PATH, body, options);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.SharingInvitesResource = SharingInvitesResource;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HttpClient } from "../../http/http-client";
|
|
2
|
+
import { SharingInvitesResource } from "./sharing-invites-resource";
|
|
3
|
+
import { SharingSettingsResource } from "./sharing-settings-resource";
|
|
4
|
+
import { SharingSharesResource } from "./sharing-shares-resource";
|
|
5
|
+
export declare class SharingResource {
|
|
6
|
+
readonly invites: SharingInvitesResource;
|
|
7
|
+
readonly shares: SharingSharesResource;
|
|
8
|
+
readonly settings: SharingSettingsResource;
|
|
9
|
+
constructor(http: HttpClient);
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SharingResource = void 0;
|
|
4
|
+
const sharing_invites_resource_1 = require("./sharing-invites-resource");
|
|
5
|
+
const sharing_settings_resource_1 = require("./sharing-settings-resource");
|
|
6
|
+
const sharing_shares_resource_1 = require("./sharing-shares-resource");
|
|
7
|
+
class SharingResource {
|
|
8
|
+
constructor(http) {
|
|
9
|
+
this.invites = new sharing_invites_resource_1.SharingInvitesResource(http);
|
|
10
|
+
this.shares = new sharing_shares_resource_1.SharingSharesResource(http);
|
|
11
|
+
this.settings = new sharing_settings_resource_1.SharingSettingsResource(http);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.SharingResource = SharingResource;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PatientSharingSettings, PatientSharingSettingsUpdate } from "../../../client/patient-sharing/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
export declare class SharingSettingsResource {
|
|
5
|
+
private readonly http;
|
|
6
|
+
constructor(http: HttpClient);
|
|
7
|
+
retrieve(options?: RequestOptions): Promise<PatientSharingSettings>;
|
|
8
|
+
update(settings: PatientSharingSettingsUpdate, options?: RequestOptions): Promise<PatientSharingSettings>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SharingSettingsResource = void 0;
|
|
4
|
+
const SETTINGS_PATH = "v1/patient-sharing/settings";
|
|
5
|
+
class SharingSettingsResource {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
this.http = http;
|
|
8
|
+
}
|
|
9
|
+
retrieve(options) {
|
|
10
|
+
return this.http.get(SETTINGS_PATH, options);
|
|
11
|
+
}
|
|
12
|
+
update(settings, options) {
|
|
13
|
+
return this.http.put(SETTINGS_PATH, settings, options);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.SharingSettingsResource = SharingSettingsResource;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PatientSharingShares } from "../../../client/patient-sharing/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
export declare class SharingSharesResource {
|
|
5
|
+
private readonly http;
|
|
6
|
+
constructor(http: HttpClient);
|
|
7
|
+
list(options?: RequestOptions): Promise<PatientSharingShares>;
|
|
8
|
+
revoke(consentId: string, options?: RequestOptions): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SharingSharesResource = void 0;
|
|
4
|
+
const url_1 = require("../../http/url");
|
|
5
|
+
const SHARES_PATH = "v1/patient-sharing/shares";
|
|
6
|
+
// An older server leaves out the groups it predates.
|
|
7
|
+
const withEveryGroup = (shares) => {
|
|
8
|
+
var _a, _b, _c;
|
|
9
|
+
return ({
|
|
10
|
+
...shares,
|
|
11
|
+
practitioners: (_a = shares.practitioners) !== null && _a !== void 0 ? _a : [],
|
|
12
|
+
relatedPersons: (_b = shares.relatedPersons) !== null && _b !== void 0 ? _b : [],
|
|
13
|
+
received: (_c = shares.received) !== null && _c !== void 0 ? _c : [],
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
class SharingSharesResource {
|
|
17
|
+
constructor(http) {
|
|
18
|
+
this.http = http;
|
|
19
|
+
}
|
|
20
|
+
async list(options) {
|
|
21
|
+
return withEveryGroup(await this.http.get(SHARES_PATH, options));
|
|
22
|
+
}
|
|
23
|
+
revoke(consentId, options) {
|
|
24
|
+
return this.http.delete(`${SHARES_PATH}/${(0, url_1.pathSegment)(consentId)}`, options);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.SharingSharesResource = SharingSharesResource;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HttpClient, HttpMethod } from "../../http/http-client";
|
|
2
|
+
import { RequestOptions } from "../../http/transmit";
|
|
3
|
+
import { QueryParams } from "../../http/url";
|
|
4
|
+
export type SignalsGatewayRequest = {
|
|
5
|
+
method: HttpMethod;
|
|
6
|
+
path: readonly string[];
|
|
7
|
+
query?: QueryParams;
|
|
8
|
+
body?: unknown;
|
|
9
|
+
};
|
|
10
|
+
export declare class SignalsGatewayResource {
|
|
11
|
+
private readonly http;
|
|
12
|
+
constructor(http: HttpClient);
|
|
13
|
+
request<T = unknown>(request: SignalsGatewayRequest, options?: RequestOptions): Promise<T>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SignalsGatewayResource = void 0;
|
|
4
|
+
const ovok_errors_1 = require("../../errors/ovok-errors");
|
|
5
|
+
const url_1 = require("../../http/url");
|
|
6
|
+
const GATEWAY_PATH = "v1/signals/api";
|
|
7
|
+
const CONTROL_CHARACTER_RANGE_END = 0x1f;
|
|
8
|
+
const DELETE_CHARACTER_CODE = 0x7f;
|
|
9
|
+
class SignalsGatewayResource {
|
|
10
|
+
constructor(http) {
|
|
11
|
+
this.http = http;
|
|
12
|
+
}
|
|
13
|
+
request(request, options) {
|
|
14
|
+
var _a;
|
|
15
|
+
const path = pathFor(request.path);
|
|
16
|
+
const query = (0, url_1.toSearchQuery)((_a = request.query) !== null && _a !== void 0 ? _a : {});
|
|
17
|
+
return this.http.send({
|
|
18
|
+
method: request.method,
|
|
19
|
+
path: `${GATEWAY_PATH}/${path}${query}`,
|
|
20
|
+
body: request.body,
|
|
21
|
+
}, options);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.SignalsGatewayResource = SignalsGatewayResource;
|
|
25
|
+
const pathFor = (segments) => {
|
|
26
|
+
if (!Array.isArray(segments) ||
|
|
27
|
+
segments.length === 0 ||
|
|
28
|
+
!segments.every((segment) => isSafePathSegment(segment))) {
|
|
29
|
+
throw new ovok_errors_1.OvokValidationError((0, ovok_errors_1.detailsFor)("Signals gateway paths need non-empty, safe path segments."));
|
|
30
|
+
}
|
|
31
|
+
return segments.map(encodePathSegment).join("/");
|
|
32
|
+
};
|
|
33
|
+
const isSafePathSegment = (segment) => typeof segment === "string" &&
|
|
34
|
+
segment.length > 0 &&
|
|
35
|
+
segment !== "." &&
|
|
36
|
+
segment !== ".." &&
|
|
37
|
+
!segment.includes("/") &&
|
|
38
|
+
!segment.includes("\\") &&
|
|
39
|
+
!Array.from(segment).some(isControlCharacter);
|
|
40
|
+
const isControlCharacter = (character) => {
|
|
41
|
+
const code = character.charCodeAt(0);
|
|
42
|
+
return code <= CONTROL_CHARACTER_RANGE_END || code === DELETE_CHARACTER_CODE;
|
|
43
|
+
};
|
|
44
|
+
const encodePathSegment = (segment) => encodeURIComponent(segment).replace(/[!'()*]/g, (character) => `%${character.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EnableSignalsResponse } from "../../../client/signals/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
import { SignalsGatewayResource } from "./signals-gateway-resource";
|
|
5
|
+
import { UndeliverableResource } from "./undeliverable-resource";
|
|
6
|
+
export declare class SignalsResource {
|
|
7
|
+
private readonly http;
|
|
8
|
+
readonly gateway: SignalsGatewayResource;
|
|
9
|
+
readonly undeliverable: UndeliverableResource;
|
|
10
|
+
constructor(http: HttpClient);
|
|
11
|
+
/** Idempotent: retry after 409 or 503. Readings saved through Ovok reach Signals without a second submit. */
|
|
12
|
+
enable(patientId: string, options?: RequestOptions): Promise<EnableSignalsResponse>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SignalsResource = void 0;
|
|
4
|
+
const url_1 = require("../../http/url");
|
|
5
|
+
const signals_gateway_resource_1 = require("./signals-gateway-resource");
|
|
6
|
+
const undeliverable_resource_1 = require("./undeliverable-resource");
|
|
7
|
+
const enableSignalsPath = (patientId) => `fhir/Patient/${(0, url_1.pathSegment)(patientId)}/$enable-signals`;
|
|
8
|
+
class SignalsResource {
|
|
9
|
+
constructor(http) {
|
|
10
|
+
this.http = http;
|
|
11
|
+
this.gateway = new signals_gateway_resource_1.SignalsGatewayResource(http);
|
|
12
|
+
this.undeliverable = new undeliverable_resource_1.UndeliverableResource(http);
|
|
13
|
+
}
|
|
14
|
+
/** Idempotent: retry after 409 or 503. Readings saved through Ovok reach Signals without a second submit. */
|
|
15
|
+
enable(patientId, options) {
|
|
16
|
+
return this.http.post(enableSignalsPath(patientId), undefined, options);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.SignalsResource = SignalsResource;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HttpClient } from "../../http/http-client";
|
|
2
|
+
import { RequestOptions } from "../../http/transmit";
|
|
3
|
+
export type SignalsUndeliverableResident = {
|
|
4
|
+
patientId: string;
|
|
5
|
+
};
|
|
6
|
+
export type SignalsUndeliverable = {
|
|
7
|
+
count: number;
|
|
8
|
+
residents: SignalsUndeliverableResident[];
|
|
9
|
+
};
|
|
10
|
+
export type SignalsDeliveryRepair = {
|
|
11
|
+
patientIds?: string[];
|
|
12
|
+
};
|
|
13
|
+
export type SignalsDeliveryRepairResult = {
|
|
14
|
+
attempted: number;
|
|
15
|
+
repaired: number;
|
|
16
|
+
stillUndeliverable: number;
|
|
17
|
+
skipped: number;
|
|
18
|
+
notReached: number;
|
|
19
|
+
};
|
|
20
|
+
export declare class UndeliverableResource {
|
|
21
|
+
private readonly http;
|
|
22
|
+
constructor(http: HttpClient);
|
|
23
|
+
list(options?: RequestOptions): Promise<SignalsUndeliverable>;
|
|
24
|
+
/** Without `patientIds`, repairs the residents `list` shows. */
|
|
25
|
+
repair(request?: SignalsDeliveryRepair, options?: RequestOptions): Promise<SignalsDeliveryRepairResult>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UndeliverableResource = void 0;
|
|
4
|
+
const UNDELIVERABLE_PATH = "signals/config/undeliverable";
|
|
5
|
+
const REPAIR_PATH = `${UNDELIVERABLE_PATH}/repair`;
|
|
6
|
+
class UndeliverableResource {
|
|
7
|
+
constructor(http) {
|
|
8
|
+
this.http = http;
|
|
9
|
+
}
|
|
10
|
+
list(options) {
|
|
11
|
+
return this.http.get(UNDELIVERABLE_PATH, options);
|
|
12
|
+
}
|
|
13
|
+
/** Without `patientIds`, repairs the residents `list` shows. */
|
|
14
|
+
repair(request = {}, options) {
|
|
15
|
+
return this.http.post(REPAIR_PATH, request, options);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.UndeliverableResource = UndeliverableResource;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HttpClient } from "../../http/http-client";
|
|
2
|
+
import { RequestOptions } from "../../http/transmit";
|
|
3
|
+
/** Identical concurrent reads share one request, aborted only once every caller has aborted. */
|
|
4
|
+
export declare class LiveReads {
|
|
5
|
+
private readonly http;
|
|
6
|
+
private readonly inFlight;
|
|
7
|
+
constructor(http: HttpClient);
|
|
8
|
+
get<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
9
|
+
private share;
|
|
10
|
+
private start;
|
|
11
|
+
private forget;
|
|
12
|
+
}
|