@eka-care/medical-records-ui 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, MouseEvent } from 'react';
3
- import { SDKEnvironment, SDKLog, EditRecordRequest, CreateCaseRequest, UpdateCaseRequest } from '@eka-care/medical-records-ts-sdk';
3
+ import { SDKEnvironment, SDKLog, EditDocumentRequest, CreateCaseRequest, UpdateCaseRequest } from '@eka-care/medical-records-ts-sdk';
4
4
  export { SDKLog } from '@eka-care/medical-records-ts-sdk';
5
5
  import * as zustand from 'zustand';
6
6
 
@@ -263,7 +263,7 @@ interface RecordsConnectionActions {
263
263
  refresh: () => Promise<void>;
264
264
  /** Unix epoch ms of the last successful server refresh, or null before first call. */
265
265
  sourceRefreshedAt: number | null;
266
- editRecord: (documentId: string, data: EditRecordRequest) => Promise<void>;
266
+ editRecord: (documentId: string, data: EditDocumentRequest) => Promise<void>;
267
267
  deleteRecord: (documentId: string) => Promise<void>;
268
268
  }
269
269
  declare function useRecordsConnection(): RecordsConnectionActions;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, MouseEvent } from 'react';
3
- import { SDKEnvironment, SDKLog, EditRecordRequest, CreateCaseRequest, UpdateCaseRequest } from '@eka-care/medical-records-ts-sdk';
3
+ import { SDKEnvironment, SDKLog, EditDocumentRequest, CreateCaseRequest, UpdateCaseRequest } from '@eka-care/medical-records-ts-sdk';
4
4
  export { SDKLog } from '@eka-care/medical-records-ts-sdk';
5
5
  import * as zustand from 'zustand';
6
6
 
@@ -263,7 +263,7 @@ interface RecordsConnectionActions {
263
263
  refresh: () => Promise<void>;
264
264
  /** Unix epoch ms of the last successful server refresh, or null before first call. */
265
265
  sourceRefreshedAt: number | null;
266
- editRecord: (documentId: string, data: EditRecordRequest) => Promise<void>;
266
+ editRecord: (documentId: string, data: EditDocumentRequest) => Promise<void>;
267
267
  deleteRecord: (documentId: string) => Promise<void>;
268
268
  }
269
269
  declare function useRecordsConnection(): RecordsConnectionActions;
package/dist/index.js CHANGED
@@ -1197,14 +1197,14 @@ function useRecordsConnection() {
1197
1197
  void getCore().listLocalDocuments({ bid, patientId, limit: LIMIT }).then(applyItems);
1198
1198
  }, [bid, patientId, labelOf, applyItems]);
1199
1199
  _react.useEffect.call(void 0, () => {
1200
- const unsubscribe = getCore().subscribe("records:changed", () => {
1200
+ const unsubscribe = getCore().subscribe("documents:changed", () => {
1201
1201
  void getCore().listLocalDocuments({ bid, patientId, limit: LIMIT }).then(applyItems);
1202
1202
  });
1203
1203
  return unsubscribe;
1204
1204
  }, [bid, patientId, applyItems]);
1205
1205
  const editRecord = _react.useCallback.call(void 0,
1206
1206
  async (documentId, data) => {
1207
- await getCore().editRecord({ documentId, data, bid, patientId });
1207
+ await getCore().editDocument({ documentId, data, bid, patientId });
1208
1208
  },
1209
1209
  [bid, patientId]
1210
1210
  );
@@ -1213,7 +1213,7 @@ function useRecordsConnection() {
1213
1213
  const records = store.getState().records;
1214
1214
  records.markPending(documentId);
1215
1215
  try {
1216
- await getCore().deleteRecord({ documentId, bid, patientId });
1216
+ await getCore().deleteDocument({ documentId, bid, patientId });
1217
1217
  records.remove(documentId);
1218
1218
  } catch (e) {
1219
1219
  records.unmarkPending(documentId);
@@ -1481,7 +1481,7 @@ function useUploadConnection() {
1481
1481
  }));
1482
1482
  localIds.forEach((id) => store.getState().uploadQueue.updateProgress(id, 0));
1483
1483
  try {
1484
- const res = await getCore().addRecord({
1484
+ const res = await getCore().addDocument({
1485
1485
  batchRequests,
1486
1486
  files: items.map((it) => [it.file]),
1487
1487
  filenames: items.map((it) => [it.file.name]),