@ovok/core 0.3.10 → 0.3.12

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.
Files changed (34) hide show
  1. package/README.md +60 -2
  2. package/dist/client/auth/methods/changePassword.d.ts +2 -2
  3. package/dist/client/auth/methods/changePassword.js +2 -1
  4. package/dist/client/auth/methods/requestDeleteUser.js +4 -1
  5. package/dist/client/auth/types/ChangePasswordBody.d.ts +2 -1
  6. package/dist/client/auth/types/ChangePasswordResponse.d.ts +2 -0
  7. package/dist/client/auth/types/ChangePasswordResponse.js +2 -0
  8. package/dist/client/auth/types/RequestDeleteUserBody.d.ts +1 -1
  9. package/dist/client/patient/methods.d.ts +7 -1
  10. package/dist/client/patient/methods.js +24 -0
  11. package/dist/client/patient/types.d.ts +5 -1
  12. package/dist/client/questionnaire-response/methods/createQuestionnaireResponseWithObservations.d.ts +1 -1
  13. package/dist/client/questionnaire-response/methods/extractQuestionnaireObservations.d.ts +3 -0
  14. package/dist/client/questionnaire-response/methods/extractQuestionnaireObservations.js +7 -0
  15. package/dist/client/questionnaire-response/methods/index.d.ts +3 -0
  16. package/dist/client/questionnaire-response/methods/index.js +3 -0
  17. package/dist/client/questionnaire-response/methods/populateQuestionnaire.d.ts +4 -0
  18. package/dist/client/questionnaire-response/methods/populateQuestionnaire.js +7 -0
  19. package/dist/client/questionnaire-response/methods/submitQuestionnaireResponse.d.ts +3 -0
  20. package/dist/client/questionnaire-response/methods/submitQuestionnaireResponse.js +6 -0
  21. package/dist/client/questionnaire-response/types.d.ts +3 -0
  22. package/dist/client/questionnaire-response/types.js +2 -0
  23. package/dist/conformance/api-requirements.d.ts +3 -3
  24. package/dist/conformance/api-requirements.js +3 -1
  25. package/dist/conformance/capability-requirements.js +38 -1
  26. package/dist/hooks/index.d.ts +1 -0
  27. package/dist/hooks/index.js +12 -1
  28. package/dist/hooks/patient-hooks.d.ts +22 -0
  29. package/dist/hooks/patient-hooks.js +101 -0
  30. package/dist/index.d.ts +2 -0
  31. package/dist/index.js +2 -0
  32. package/dist/types/index.d.ts +1 -0
  33. package/dist/types/index.js +1 -0
  34. package/package.json +1 -1
package/README.md CHANGED
@@ -73,6 +73,58 @@ const locales = await client.getLocales();
73
73
  All methods preserve the backend HTTP verbs and return the backend response shapes. Billing is
74
74
  not included until Ovok publishes a supported billing contract.
75
75
 
76
+ ## Patient application APIs
77
+
78
+ Patient applications can read their authenticated profile and health data through typed methods
79
+ backed by the existing `../ovok-core` routes. The profile response includes the Patient resource,
80
+ project context, menu configuration, access policy, and active sessions.
81
+
82
+ ```typescript
83
+ const me = await client.getCurrentPatientProfile();
84
+ const latest = await client.getPatientLatestObservations({
85
+ patient: `Patient/${me.profile.id}`,
86
+ code: ["8867-4", "9279-1"],
87
+ max: 5,
88
+ });
89
+ const currentTelemetry = await client.getPatientDeviceTelemetry(deviceId);
90
+ const history = await client.getPatientDeviceTelemetryHistory(deviceId, {
91
+ from: "2026-09-25T00:00:00.000Z",
92
+ to: "2026-09-26T00:00:00.000Z",
93
+ pageSize: 50,
94
+ });
95
+ ```
96
+
97
+ These helpers use bearer-authenticated `/auth/me` and `/fhir/*` contracts and are additive to the
98
+ native observation and offline-measurement APIs. The exported `OVOK_CORE_API_REQUIREMENTS` lists
99
+ the ordinary HTTP routes, while `OVOK_CORE_REQUIREMENTS` covers the FHIR operations. Billing is
100
+ intentionally absent.
101
+
102
+ Questionnaire applications can use the Ovok-specific patient-scoped operations and keep the
103
+ response write atomic with its extracted Observations:
104
+
105
+ ```typescript
106
+ const populated = await client.populateQuestionnaire(questionnaireId);
107
+ const saved = await client.submitQuestionnaireResponse(questionnaireResponse, observations);
108
+ const extracted = await client.extractQuestionnaireObservations(questionnaireResponseId);
109
+ ```
110
+
111
+ Scheduling uses standard FHIR resources exposed by the backend. The SDK intentionally does not
112
+ build on Ovok's deprecated `/appointment` or `/schedule` controllers:
113
+
114
+ ```typescript
115
+ const appointments = await client.listPatientAppointments({
116
+ patient: `Patient/${patientId}`,
117
+ status: "booked",
118
+ });
119
+ const schedules = await client.listPatientSchedules({
120
+ actor: `Practitioner/${practitionerId}`,
121
+ });
122
+ const slots = await client.listPatientSlots({
123
+ schedule: `Schedule/${scheduleId}`,
124
+ status: "free",
125
+ });
126
+ ```
127
+
76
128
  ## CareHub APIs
77
129
 
78
130
  CareHub methods cover the verified `/v1/carehub/*` and `/v2/carehub/*` application routes for
@@ -115,8 +167,10 @@ download elements; the backend remains responsible for authorization and signed
115
167
 
116
168
  ## React hooks
117
169
 
118
- The package exports additive hooks for capability discovery, project configuration, CareHub lists,
119
- telemetry, and notifications. Every request hook returns `data`, `loading`, `error`, and `reload`.
170
+ The package exports additive hooks for capability discovery, project configuration, patient profile
171
+ and health data, questionnaires, scheduling resources, CareHub lists, telemetry, and notifications.
172
+ Every request hook returns `data`, `loading`, `error`, and `reload`; questionnaire mutations expose
173
+ `data`, `loading`, `error`, `mutate`, and `reset`.
120
174
 
121
175
  ```tsx
122
176
  const { data: patients, loading, error } = useCarehubPatients({
@@ -126,6 +180,10 @@ const { data: patients, loading, error } = useCarehubPatients({
126
180
  const saveSettings = useOvokMutation((client, settings: OvokProjectSettings) =>
127
181
  client.updateProjectSetting("PATIENT_LOGIN_ENABLED", settings.settings.PATIENT_LOGIN_ENABLED),
128
182
  );
183
+
184
+ const { data: me } = useCurrentPatientProfile();
185
+ const { data: appointments } = usePatientAppointments({ status: "booked" });
186
+ const populateQuestionnaire = usePopulateQuestionnaire();
129
187
  ```
130
188
 
131
189
  Hooks are additive to the existing `OvokProvider`, observation hooks, auth methods, and offline
@@ -1,4 +1,4 @@
1
1
  import { OvokClient } from "../../ovok-client";
2
- import { AuthResponse } from "../types/AuthResponse";
3
2
  import { ChangePasswordBody } from "../types/ChangePasswordBody";
4
- export declare function changePassword(this: OvokClient, body: ChangePasswordBody): Promise<AuthResponse>;
3
+ import { ChangePasswordResponse } from "../types/ChangePasswordResponse";
4
+ export declare function changePassword(this: OvokClient, body: ChangePasswordBody): Promise<ChangePasswordResponse>;
@@ -2,5 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.changePassword = changePassword;
4
4
  async function changePassword(body) {
5
- return this.post("auth/change-password", body);
5
+ const { oldPassword, newPassword } = body;
6
+ return this.patch("v2/auth/change-password", { oldPassword, newPassword });
6
7
  }
@@ -9,5 +9,8 @@ exports.requestDeleteUser = requestDeleteUser;
9
9
  * @returns {Promise<RequestDeleteUserResponse>} Response containing scheduled deletion status and user information
10
10
  */
11
11
  async function requestDeleteUser(body) {
12
- return this.delete(`auth/delete?days=${body.days}&wipe=${body.wipe}`);
12
+ return this.delete("auth/delete", {
13
+ body: JSON.stringify(body),
14
+ headers: { "Content-Type": "application/json" },
15
+ });
13
16
  }
@@ -1,5 +1,6 @@
1
1
  export interface ChangePasswordBody {
2
2
  oldPassword: string;
3
3
  newPassword: string;
4
- confirmPassword: string;
4
+ /** Optional client-side confirmation; Ovok Core does not receive this field. */
5
+ confirmPassword?: string;
5
6
  }
@@ -0,0 +1,2 @@
1
+ import { User } from "@medplum/fhirtypes";
2
+ export type ChangePasswordResponse = Omit<User, "passwordHash">;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,6 @@
1
1
  export interface RequestDeleteUserBody {
2
2
  /**
3
- * @type {number} Between 1 and 30
3
+ * @type {number} Between 0 and 90
4
4
  * @description After how many days the user should be deleted.
5
5
  */
6
6
  days: number;
@@ -1,6 +1,12 @@
1
1
  import { OvokClient } from "../ovok-client";
2
- import { OvokCurrentPatientProfile, OvokPatientLatestObservationsQuery, OvokPatientObservationBundle, OvokPatientTelemetryHistory, OvokPatientTelemetryHistoryQuery } from "./types";
2
+ import { OvokCurrentPatientProfile, OvokPatientLatestObservationsQuery, OvokPatientObservationBundle, OvokPatientAppointment, OvokPatientSchedule, OvokPatientSchedulingQuery, OvokPatientSlot, OvokPatientTelemetryHistory, OvokPatientTelemetryHistoryQuery } from "./types";
3
3
  export declare function getCurrentPatientProfile(this: OvokClient): Promise<OvokCurrentPatientProfile>;
4
4
  export declare function getPatientLatestObservations(this: OvokClient, params?: OvokPatientLatestObservationsQuery): Promise<OvokPatientObservationBundle>;
5
5
  export declare function getPatientDeviceTelemetry(this: OvokClient, deviceId: string): Promise<OvokPatientObservationBundle>;
6
6
  export declare function getPatientDeviceTelemetryHistory(this: OvokClient, deviceId: string, params?: OvokPatientTelemetryHistoryQuery): Promise<OvokPatientTelemetryHistory>;
7
+ export declare function listPatientAppointments(this: OvokClient, params?: OvokPatientSchedulingQuery): Promise<OvokPatientAppointment[]>;
8
+ export declare function getPatientAppointment(this: OvokClient, appointmentId: string): Promise<OvokPatientAppointment>;
9
+ export declare function createPatientAppointment(this: OvokClient, appointment: OvokPatientAppointment): Promise<OvokPatientAppointment>;
10
+ export declare function updatePatientAppointment(this: OvokClient, appointment: OvokPatientAppointment): Promise<OvokPatientAppointment>;
11
+ export declare function listPatientSchedules(this: OvokClient, params?: OvokPatientSchedulingQuery): Promise<OvokPatientSchedule[]>;
12
+ export declare function listPatientSlots(this: OvokClient, params?: OvokPatientSchedulingQuery): Promise<OvokPatientSlot[]>;
@@ -4,6 +4,12 @@ exports.getCurrentPatientProfile = getCurrentPatientProfile;
4
4
  exports.getPatientLatestObservations = getPatientLatestObservations;
5
5
  exports.getPatientDeviceTelemetry = getPatientDeviceTelemetry;
6
6
  exports.getPatientDeviceTelemetryHistory = getPatientDeviceTelemetryHistory;
7
+ exports.listPatientAppointments = listPatientAppointments;
8
+ exports.getPatientAppointment = getPatientAppointment;
9
+ exports.createPatientAppointment = createPatientAppointment;
10
+ exports.updatePatientAppointment = updatePatientAppointment;
11
+ exports.listPatientSchedules = listPatientSchedules;
12
+ exports.listPatientSlots = listPatientSlots;
7
13
  const segment = (value) => encodeURIComponent(value);
8
14
  const query = (params) => {
9
15
  const values = new URLSearchParams();
@@ -32,3 +38,21 @@ async function getPatientDeviceTelemetry(deviceId) {
32
38
  async function getPatientDeviceTelemetryHistory(deviceId, params = {}) {
33
39
  return this.get(`/fhir/Device/${segment(deviceId)}/telemetry/history${query(params)}`);
34
40
  }
41
+ async function listPatientAppointments(params = {}) {
42
+ return this.searchResources("Appointment", params);
43
+ }
44
+ async function getPatientAppointment(appointmentId) {
45
+ return this.readResource("Appointment", appointmentId);
46
+ }
47
+ async function createPatientAppointment(appointment) {
48
+ return this.createResource(appointment);
49
+ }
50
+ async function updatePatientAppointment(appointment) {
51
+ return this.updateResource(appointment);
52
+ }
53
+ async function listPatientSchedules(params = {}) {
54
+ return this.searchResources("Schedule", params);
55
+ }
56
+ async function listPatientSlots(params = {}) {
57
+ return this.searchResources("Slot", params);
58
+ }
@@ -1,4 +1,4 @@
1
- import { Bundle, Observation } from "@medplum/fhirtypes";
1
+ import { Appointment, Bundle, Observation, Schedule, Slot } from "@medplum/fhirtypes";
2
2
  export type OvokCurrentPatientProfile = {
3
3
  project: {
4
4
  resourceType: "Project";
@@ -68,6 +68,10 @@ export type OvokPatientTelemetryHistoryQuery = {
68
68
  page?: number;
69
69
  pageSize?: number;
70
70
  };
71
+ export type OvokPatientSchedulingQuery = Record<string, string | number | boolean | undefined>;
72
+ export type OvokPatientAppointment = Appointment;
73
+ export type OvokPatientSchedule = Schedule;
74
+ export type OvokPatientSlot = Slot;
71
75
  export type OvokPatientObservationBundle = Bundle<Observation>;
72
76
  export type OvokPatientTelemetryHistory = {
73
77
  deviceId: string;
@@ -1,3 +1,3 @@
1
1
  import { Bundle, Observation, QuestionnaireResponse } from "@medplum/fhirtypes";
2
2
  import { OvokClient } from "../../ovok-client";
3
- export declare function createQuestionnaireResponseWithObservations(this: OvokClient, questionnaireResponse: QuestionnaireResponse, observations: Observation[]): Promise<Bundle<import("@medplum/fhirtypes").Resource>>;
3
+ export declare function createQuestionnaireResponseWithObservations(this: OvokClient, questionnaireResponse: QuestionnaireResponse, observations: Observation[]): Promise<Bundle>;
@@ -0,0 +1,3 @@
1
+ import { OvokClient } from "../../ovok-client";
2
+ import { OvokQuestionnaireOperationResponse } from "../types";
3
+ export declare function extractQuestionnaireObservations(this: OvokClient, questionnaireResponseId: string): Promise<OvokQuestionnaireOperationResponse>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractQuestionnaireObservations = extractQuestionnaireObservations;
4
+ const segment = (value) => encodeURIComponent(value);
5
+ async function extractQuestionnaireObservations(questionnaireResponseId) {
6
+ return this.post(`/fhir/QuestionnaireResponse/${segment(questionnaireResponseId)}/$extract`, {});
7
+ }
@@ -1 +1,4 @@
1
1
  export * from "./createQuestionnaireResponseWithObservations";
2
+ export * from "./extractQuestionnaireObservations";
3
+ export * from "./populateQuestionnaire";
4
+ export * from "./submitQuestionnaireResponse";
@@ -15,3 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./createQuestionnaireResponseWithObservations"), exports);
18
+ __exportStar(require("./extractQuestionnaireObservations"), exports);
19
+ __exportStar(require("./populateQuestionnaire"), exports);
20
+ __exportStar(require("./submitQuestionnaireResponse"), exports);
@@ -0,0 +1,4 @@
1
+ import { Parameters } from "@medplum/fhirtypes";
2
+ import { OvokClient } from "../../ovok-client";
3
+ import { OvokQuestionnaireOperationResponse } from "../types";
4
+ export declare function populateQuestionnaire(this: OvokClient, questionnaireId: string, parameters?: Parameters): Promise<OvokQuestionnaireOperationResponse>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.populateQuestionnaire = populateQuestionnaire;
4
+ const segment = (value) => encodeURIComponent(value);
5
+ async function populateQuestionnaire(questionnaireId, parameters = { resourceType: "Parameters", parameter: [] }) {
6
+ return this.post(`/fhir/Questionnaire/${segment(questionnaireId)}/$populate`, parameters);
7
+ }
@@ -0,0 +1,3 @@
1
+ import { Bundle, Observation, QuestionnaireResponse } from "@medplum/fhirtypes";
2
+ import { OvokClient } from "../../ovok-client";
3
+ export declare function submitQuestionnaireResponse(this: OvokClient, questionnaireResponse: QuestionnaireResponse, observations?: Observation[]): Promise<Bundle>;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.submitQuestionnaireResponse = submitQuestionnaireResponse;
4
+ async function submitQuestionnaireResponse(questionnaireResponse, observations = []) {
5
+ return this.createQuestionnaireResponseWithObservations(questionnaireResponse, observations);
6
+ }
@@ -0,0 +1,3 @@
1
+ import { Parameters } from "@medplum/fhirtypes";
2
+ export type OvokQuestionnaireOperationResponse = Parameters;
3
+ export type OvokQuestionnairePopulateParameters = Parameters;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -23,15 +23,15 @@ export declare const OVOK_CORE_API_REQUIREMENTS: {
23
23
  path: string;
24
24
  group: string;
25
25
  } | {
26
- method: "GET";
26
+ method: "PATCH";
27
27
  path: string;
28
28
  group: string;
29
29
  } | {
30
- method: "DELETE";
30
+ method: "GET";
31
31
  path: string;
32
32
  group: string;
33
33
  } | {
34
- method: "PATCH";
34
+ method: "DELETE";
35
35
  path: string;
36
36
  group: string;
37
37
  } | {
@@ -24,7 +24,7 @@ exports.OVOK_CORE_API_REQUIREMENTS = {
24
24
  { method: "POST", path: "/auth/tenant/Patient/register", group: "Auth" },
25
25
  { method: "POST", path: "/auth/external/google", group: "Auth" },
26
26
  { method: "POST", path: "/auth/external/apple", group: "Auth" },
27
- { method: "POST", path: "/auth/change-password", group: "Auth" },
27
+ { method: "PATCH", path: "/v2/auth/change-password", group: "Auth" },
28
28
  { method: "POST", path: "/v2/auth/reset-password", group: "Auth" },
29
29
  { method: "POST", path: "/v2/auth/reset-password/process", group: "Auth" },
30
30
  { method: "GET", path: "/auth/session", group: "Auth" },
@@ -91,6 +91,8 @@ exports.OVOK_CORE_API_REQUIREMENTS = {
91
91
  { method: "GET", path: "/fhir/Observation/$lastn", group: "Patient" },
92
92
  { method: "GET", path: "/fhir/Device/:id/telemetry", group: "Patient" },
93
93
  { method: "GET", path: "/fhir/Device/:id/telemetry/history", group: "Patient" },
94
+ { method: "POST", path: "/fhir/Questionnaire/:id/$populate", group: "Questionnaire" },
95
+ { method: "POST", path: "/fhir/QuestionnaireResponse/:id/$extract", group: "Questionnaire" },
94
96
  { method: "GET", path: "/v1/carehub/patient", group: "Carehub/Patient" },
95
97
  { method: "GET", path: "/v1/carehub/patient/:id", group: "Carehub/Patient" },
96
98
  { method: "GET", path: "/v1/carehub/patient/:id/$everything", group: "Carehub/Patient" },
@@ -48,7 +48,7 @@ exports.OVOK_CORE_REQUIREMENTS = {
48
48
  description: "The FHIR surface a server must provide for the @ovok/core client library's own methods to function.",
49
49
  software: {
50
50
  name: "@ovok/core",
51
- version: "0.3.8",
51
+ version: "0.3.11",
52
52
  },
53
53
  fhirVersion: "4.0.1",
54
54
  format: ["json"],
@@ -92,6 +92,43 @@ exports.OVOK_CORE_REQUIREMENTS = {
92
92
  type: "QuestionnaireResponse",
93
93
  interaction: [{ code: "create" }],
94
94
  documentation: "Created as an entry of the transaction Bundle above, never on its own by this library.",
95
+ operation: [
96
+ {
97
+ name: "extract",
98
+ definition: "https://fhir.ovok.com/fhir/OperationDefinition/questionnaireresponse-extract",
99
+ documentation: "extractQuestionnaireObservations extracts the Observations represented by a saved QuestionnaireResponse.",
100
+ },
101
+ ],
102
+ },
103
+ {
104
+ type: "Questionnaire",
105
+ operation: [
106
+ {
107
+ name: "populate",
108
+ definition: "https://fhir.ovok.com/fhir/OperationDefinition/questionnaire-populate",
109
+ documentation: "populateQuestionnaire pre-fills a QuestionnaireResponse for the authenticated patient.",
110
+ },
111
+ ],
112
+ },
113
+ {
114
+ type: "Appointment",
115
+ interaction: [
116
+ { code: "search-type" },
117
+ { code: "read" },
118
+ { code: "create" },
119
+ { code: "update" },
120
+ ],
121
+ documentation: "Patient scheduling helpers search, read, create, and update standard FHIR Appointment resources.",
122
+ },
123
+ {
124
+ type: "Schedule",
125
+ interaction: [{ code: "search-type" }],
126
+ documentation: "Patient scheduling helpers search standard FHIR Schedule resources.",
127
+ },
128
+ {
129
+ type: "Slot",
130
+ interaction: [{ code: "search-type" }],
131
+ documentation: "Patient scheduling helpers search standard FHIR Slot resources.",
95
132
  },
96
133
  ],
97
134
  },
@@ -7,3 +7,4 @@ export declare const OvokProvider: (props: React.PropsWithChildren<{
7
7
  }>) => React.JSX.Element;
8
8
  export { observationsToMeasurements, useEcgRecording, useObservations, useSaveMeasurement, useUrineTests, } from "./observation-hooks";
9
9
  export { useAdministeredProjects, useCarehubDeviceTelemetry, useCarehubDevices, useCarehubNotifications, useCarehubPatients, useCapabilityStatement, useOvokMutation, useOvokRequest, useProjectFeatures, useProjectSettings, usePublicApiEndpoints, useRecentCarehubNotifications, } from "./api-hooks";
10
+ export { useCurrentPatientProfile, useExtractQuestionnaireObservations, usePatientAppointments, usePatientDeviceTelemetry, usePatientDeviceTelemetryHistory, usePatientLatestObservations, usePatientSchedules, usePatientSlots, usePopulateQuestionnaire, useSubmitQuestionnaireResponse, } from "./patient-hooks";
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.useRecentCarehubNotifications = exports.usePublicApiEndpoints = exports.useProjectSettings = exports.useProjectFeatures = exports.useOvokRequest = exports.useOvokMutation = exports.useCapabilityStatement = exports.useCarehubPatients = exports.useCarehubNotifications = exports.useCarehubDevices = exports.useCarehubDeviceTelemetry = exports.useAdministeredProjects = exports.useUrineTests = exports.useSaveMeasurement = exports.useObservations = exports.useEcgRecording = exports.observationsToMeasurements = exports.OvokProvider = exports.useClient = exports.useCachedBinaryUrl = exports.reactContext = exports.useSubscription = exports.useSearchResources = exports.useSearchOne = exports.useSearch = exports.useResource = exports.usePrevious = exports.useMedplumProfile = exports.useMedplumNavigate = exports.useMedplumContext = void 0;
37
+ exports.useSubmitQuestionnaireResponse = exports.usePopulateQuestionnaire = exports.usePatientSlots = exports.usePatientSchedules = exports.usePatientLatestObservations = exports.usePatientDeviceTelemetryHistory = exports.usePatientDeviceTelemetry = exports.usePatientAppointments = exports.useExtractQuestionnaireObservations = exports.useCurrentPatientProfile = exports.useRecentCarehubNotifications = exports.usePublicApiEndpoints = exports.useProjectSettings = exports.useProjectFeatures = exports.useOvokRequest = exports.useOvokMutation = exports.useCapabilityStatement = exports.useCarehubPatients = exports.useCarehubNotifications = exports.useCarehubDevices = exports.useCarehubDeviceTelemetry = exports.useAdministeredProjects = exports.useUrineTests = exports.useSaveMeasurement = exports.useObservations = exports.useEcgRecording = exports.observationsToMeasurements = exports.OvokProvider = exports.useClient = exports.useCachedBinaryUrl = exports.reactContext = exports.useSubscription = exports.useSearchResources = exports.useSearchOne = exports.useSearch = exports.useResource = exports.usePrevious = exports.useMedplumProfile = exports.useMedplumNavigate = exports.useMedplumContext = void 0;
38
38
  /*
39
39
  * The only React-dependent module in the package.
40
40
  *
@@ -89,3 +89,14 @@ Object.defineProperty(exports, "useProjectFeatures", { enumerable: true, get: fu
89
89
  Object.defineProperty(exports, "useProjectSettings", { enumerable: true, get: function () { return api_hooks_1.useProjectSettings; } });
90
90
  Object.defineProperty(exports, "usePublicApiEndpoints", { enumerable: true, get: function () { return api_hooks_1.usePublicApiEndpoints; } });
91
91
  Object.defineProperty(exports, "useRecentCarehubNotifications", { enumerable: true, get: function () { return api_hooks_1.useRecentCarehubNotifications; } });
92
+ var patient_hooks_1 = require("./patient-hooks");
93
+ Object.defineProperty(exports, "useCurrentPatientProfile", { enumerable: true, get: function () { return patient_hooks_1.useCurrentPatientProfile; } });
94
+ Object.defineProperty(exports, "useExtractQuestionnaireObservations", { enumerable: true, get: function () { return patient_hooks_1.useExtractQuestionnaireObservations; } });
95
+ Object.defineProperty(exports, "usePatientAppointments", { enumerable: true, get: function () { return patient_hooks_1.usePatientAppointments; } });
96
+ Object.defineProperty(exports, "usePatientDeviceTelemetry", { enumerable: true, get: function () { return patient_hooks_1.usePatientDeviceTelemetry; } });
97
+ Object.defineProperty(exports, "usePatientDeviceTelemetryHistory", { enumerable: true, get: function () { return patient_hooks_1.usePatientDeviceTelemetryHistory; } });
98
+ Object.defineProperty(exports, "usePatientLatestObservations", { enumerable: true, get: function () { return patient_hooks_1.usePatientLatestObservations; } });
99
+ Object.defineProperty(exports, "usePatientSchedules", { enumerable: true, get: function () { return patient_hooks_1.usePatientSchedules; } });
100
+ Object.defineProperty(exports, "usePatientSlots", { enumerable: true, get: function () { return patient_hooks_1.usePatientSlots; } });
101
+ Object.defineProperty(exports, "usePopulateQuestionnaire", { enumerable: true, get: function () { return patient_hooks_1.usePopulateQuestionnaire; } });
102
+ Object.defineProperty(exports, "useSubmitQuestionnaireResponse", { enumerable: true, get: function () { return patient_hooks_1.useSubmitQuestionnaireResponse; } });
@@ -0,0 +1,22 @@
1
+ import { Bundle, Observation, Parameters, QuestionnaireResponse } from "@medplum/fhirtypes";
2
+ import { OvokCurrentPatientProfile, OvokPatientAppointment, OvokPatientLatestObservationsQuery, OvokPatientObservationBundle, OvokPatientSchedule, OvokPatientSchedulingQuery, OvokPatientSlot, OvokPatientTelemetryHistory, OvokPatientTelemetryHistoryQuery } from "../client/patient/types";
3
+ import { OvokQuestionnaireOperationResponse } from "../client/questionnaire-response/types";
4
+ import { OvokMutationState, OvokRequestState } from "./api-hooks";
5
+ export declare const useCurrentPatientProfile: () => OvokRequestState<OvokCurrentPatientProfile>;
6
+ export declare const usePatientLatestObservations: (params?: OvokPatientLatestObservationsQuery) => OvokRequestState<OvokPatientObservationBundle>;
7
+ export declare const usePatientDeviceTelemetry: (deviceId?: string) => OvokRequestState<OvokPatientObservationBundle>;
8
+ export declare const usePatientDeviceTelemetryHistory: (deviceId: string | undefined, params?: OvokPatientTelemetryHistoryQuery) => OvokRequestState<OvokPatientTelemetryHistory>;
9
+ export declare const usePatientAppointments: (params?: OvokPatientSchedulingQuery) => OvokRequestState<OvokPatientAppointment[]>;
10
+ export declare const usePatientSchedules: (params?: OvokPatientSchedulingQuery) => OvokRequestState<OvokPatientSchedule[]>;
11
+ export declare const usePatientSlots: (params?: OvokPatientSchedulingQuery) => OvokRequestState<OvokPatientSlot[]>;
12
+ export declare const usePopulateQuestionnaire: () => OvokMutationState<{
13
+ questionnaireId: string;
14
+ parameters?: Parameters;
15
+ }, OvokQuestionnaireOperationResponse>;
16
+ export declare const useSubmitQuestionnaireResponse: () => OvokMutationState<{
17
+ questionnaireResponse: QuestionnaireResponse;
18
+ observations?: Observation[];
19
+ }, Bundle>;
20
+ export declare const useExtractQuestionnaireObservations: () => OvokMutationState<{
21
+ questionnaireResponseId: string;
22
+ }, OvokQuestionnaireOperationResponse>;
@@ -0,0 +1,101 @@
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.useExtractQuestionnaireObservations = exports.useSubmitQuestionnaireResponse = exports.usePopulateQuestionnaire = exports.usePatientSlots = exports.usePatientSchedules = exports.usePatientAppointments = exports.usePatientDeviceTelemetryHistory = exports.usePatientDeviceTelemetry = exports.usePatientLatestObservations = exports.useCurrentPatientProfile = void 0;
38
+ const React = __importStar(require("react"));
39
+ const api_hooks_1 = require("./api-hooks");
40
+ const index_1 = require("./index");
41
+ const useCurrentPatientProfile = () => {
42
+ const client = (0, index_1.useClient)();
43
+ const load = React.useCallback(() => client.getCurrentPatientProfile(), [client]);
44
+ return (0, api_hooks_1.useOvokRequest)(load);
45
+ };
46
+ exports.useCurrentPatientProfile = useCurrentPatientProfile;
47
+ const usePatientLatestObservations = (params = {}) => {
48
+ const client = (0, index_1.useClient)();
49
+ const serialized = JSON.stringify(params);
50
+ const load = React.useCallback(() => client.getPatientLatestObservations(params), [client, serialized]);
51
+ return (0, api_hooks_1.useOvokRequest)(load);
52
+ };
53
+ exports.usePatientLatestObservations = usePatientLatestObservations;
54
+ const usePatientDeviceTelemetry = (deviceId) => {
55
+ const client = (0, index_1.useClient)();
56
+ const load = React.useCallback(() => deviceId
57
+ ? client.getPatientDeviceTelemetry(deviceId)
58
+ : Promise.reject(new Error("deviceId is required")), [client, deviceId]);
59
+ return (0, api_hooks_1.useOvokRequest)(load, deviceId !== undefined);
60
+ };
61
+ exports.usePatientDeviceTelemetry = usePatientDeviceTelemetry;
62
+ const usePatientDeviceTelemetryHistory = (deviceId, params = {}) => {
63
+ const client = (0, index_1.useClient)();
64
+ const serialized = JSON.stringify(params);
65
+ const load = React.useCallback(() => deviceId
66
+ ? client.getPatientDeviceTelemetryHistory(deviceId, params)
67
+ : Promise.reject(new Error("deviceId is required")), [client, deviceId, serialized]);
68
+ return (0, api_hooks_1.useOvokRequest)(load, deviceId !== undefined);
69
+ };
70
+ exports.usePatientDeviceTelemetryHistory = usePatientDeviceTelemetryHistory;
71
+ const usePatientAppointments = (params = {}) => {
72
+ const client = (0, index_1.useClient)();
73
+ const serialized = JSON.stringify(params);
74
+ const load = React.useCallback(() => client.listPatientAppointments(params), [client, serialized]);
75
+ return (0, api_hooks_1.useOvokRequest)(load);
76
+ };
77
+ exports.usePatientAppointments = usePatientAppointments;
78
+ const usePatientSchedules = (params = {}) => {
79
+ const client = (0, index_1.useClient)();
80
+ const serialized = JSON.stringify(params);
81
+ const load = React.useCallback(() => client.listPatientSchedules(params), [client, serialized]);
82
+ return (0, api_hooks_1.useOvokRequest)(load);
83
+ };
84
+ exports.usePatientSchedules = usePatientSchedules;
85
+ const usePatientSlots = (params = {}) => {
86
+ const client = (0, index_1.useClient)();
87
+ const serialized = JSON.stringify(params);
88
+ const load = React.useCallback(() => client.listPatientSlots(params), [client, serialized]);
89
+ return (0, api_hooks_1.useOvokRequest)(load);
90
+ };
91
+ exports.usePatientSlots = usePatientSlots;
92
+ const usePopulateQuestionnaire = () => (0, api_hooks_1.useOvokMutation)((client, params) => client.populateQuestionnaire(params.questionnaireId, params.parameters));
93
+ exports.usePopulateQuestionnaire = usePopulateQuestionnaire;
94
+ const useSubmitQuestionnaireResponse = () => {
95
+ return (0, api_hooks_1.useOvokMutation)((client, params) => client.submitQuestionnaireResponse(params.questionnaireResponse, params.observations));
96
+ };
97
+ exports.useSubmitQuestionnaireResponse = useSubmitQuestionnaireResponse;
98
+ const useExtractQuestionnaireObservations = () => {
99
+ return (0, api_hooks_1.useOvokMutation)((client, params) => client.extractQuestionnaireObservations(params.questionnaireResponseId));
100
+ };
101
+ exports.useExtractQuestionnaireObservations = useExtractQuestionnaireObservations;
package/dist/index.d.ts CHANGED
@@ -939,3 +939,5 @@ export * from "./client/platform/types";
939
939
  export * from "./client/carehub/types";
940
940
  export * from "./client/experience/types";
941
941
  export * from "./client/patient/types";
942
+ export * from "./client/questionnaire-response/methods";
943
+ export * from "./client/questionnaire-response/types";
package/dist/index.js CHANGED
@@ -62,3 +62,5 @@ __exportStar(require("./client/platform/types"), exports);
62
62
  __exportStar(require("./client/carehub/types"), exports);
63
63
  __exportStar(require("./client/experience/types"), exports);
64
64
  __exportStar(require("./client/patient/types"), exports);
65
+ __exportStar(require("./client/questionnaire-response/methods"), exports);
66
+ __exportStar(require("./client/questionnaire-response/types"), exports);
@@ -3,6 +3,7 @@ export * from "../client/auth/types/LoginResponse";
3
3
  export * from "../client/auth/types/LoginBody";
4
4
  export * from "../client/auth/types/RegisterBody";
5
5
  export * from "../client/auth/types/ChangePasswordBody";
6
+ export * from "../client/auth/types/ChangePasswordResponse";
6
7
  export * from "../client/auth/types/RequestDeleteUserBody";
7
8
  export * from "../client/auth/types/ResetPasswordBody";
8
9
  export * from "../client/auth/types/Session";
@@ -20,6 +20,7 @@ __exportStar(require("../client/auth/types/LoginResponse"), exports);
20
20
  __exportStar(require("../client/auth/types/LoginBody"), exports);
21
21
  __exportStar(require("../client/auth/types/RegisterBody"), exports);
22
22
  __exportStar(require("../client/auth/types/ChangePasswordBody"), exports);
23
+ __exportStar(require("../client/auth/types/ChangePasswordResponse"), exports);
23
24
  __exportStar(require("../client/auth/types/RequestDeleteUserBody"), exports);
24
25
  __exportStar(require("../client/auth/types/ResetPasswordBody"), exports);
25
26
  __exportStar(require("../client/auth/types/Session"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ovok/core",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",