@eka-care/medical-records-ui 1.2.46 → 1.2.49

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 (45) hide show
  1. package/dist/{OriginalRecordPanel-7ABSRLHL.js → OriginalRecordPanel-ACJA42N4.js} +19 -19
  2. package/dist/{OriginalRecordPanel-7ABSRLHL.js.map → OriginalRecordPanel-ACJA42N4.js.map} +1 -1
  3. package/dist/{OriginalRecordPanel-TXXNII2B.mjs → OriginalRecordPanel-OLTPTY67.mjs} +3 -3
  4. package/dist/{SmartUploadModal-T6X23MO6.mjs → SmartUploadModal-GFZJXN2W.mjs} +3 -3
  5. package/dist/SmartUploadModal-PBOXKS7G.js +11 -0
  6. package/dist/{SmartUploadModal-XPONUCRC.js.map → SmartUploadModal-PBOXKS7G.js.map} +1 -1
  7. package/dist/VitalHistoryPanel-EP4LHE7S.mjs +12 -0
  8. package/dist/VitalHistoryPanel-HXSUVAHK.js +12 -0
  9. package/dist/{VitalHistoryPanel-3QHLYRCV.js.map → VitalHistoryPanel-HXSUVAHK.js.map} +1 -1
  10. package/dist/{chunk-O3OIK3TY.mjs → chunk-2JNAVITH.mjs} +2 -2
  11. package/dist/{chunk-Y5RVZY4E.js → chunk-6MSNQKP7.js} +14 -14
  12. package/dist/{chunk-Y5RVZY4E.js.map → chunk-6MSNQKP7.js.map} +1 -1
  13. package/dist/{chunk-2Y2R64Q7.mjs → chunk-BSDXRKXE.mjs} +3 -3
  14. package/dist/{chunk-V4FEDCZC.js → chunk-E2ZFUVV7.js} +11 -11
  15. package/dist/{chunk-V4FEDCZC.js.map → chunk-E2ZFUVV7.js.map} +1 -1
  16. package/dist/{chunk-Y2TQED3H.mjs → chunk-GRCZLZX3.mjs} +8 -7
  17. package/dist/chunk-GRCZLZX3.mjs.map +1 -0
  18. package/dist/{chunk-GLUFA2DL.mjs → chunk-KDMB3N57.mjs} +2 -2
  19. package/dist/{chunk-ZSF36NZD.js → chunk-SOOIC3M7.js} +21 -21
  20. package/dist/{chunk-ZSF36NZD.js.map → chunk-SOOIC3M7.js.map} +1 -1
  21. package/dist/{chunk-2VELBQXA.js → chunk-Z4DDE6TT.js} +20 -19
  22. package/dist/chunk-Z4DDE6TT.js.map +1 -0
  23. package/dist/index.d.mts +3 -1
  24. package/dist/index.d.ts +3 -1
  25. package/dist/index.js +157 -151
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +27 -21
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/widgets-6IXHASJD.js +53 -0
  30. package/dist/{widgets-LBIWPOYW.js.map → widgets-6IXHASJD.js.map} +1 -1
  31. package/dist/{widgets-Q6QVESWZ.mjs → widgets-CRBIN732.mjs} +2 -2
  32. package/package.json +2 -2
  33. package/dist/SmartUploadModal-XPONUCRC.js +0 -11
  34. package/dist/VitalHistoryPanel-3QHLYRCV.js +0 -12
  35. package/dist/VitalHistoryPanel-YKJY5WB3.mjs +0 -12
  36. package/dist/chunk-2VELBQXA.js.map +0 -1
  37. package/dist/chunk-Y2TQED3H.mjs.map +0 -1
  38. package/dist/widgets-LBIWPOYW.js +0 -53
  39. /package/dist/{OriginalRecordPanel-TXXNII2B.mjs.map → OriginalRecordPanel-OLTPTY67.mjs.map} +0 -0
  40. /package/dist/{SmartUploadModal-T6X23MO6.mjs.map → SmartUploadModal-GFZJXN2W.mjs.map} +0 -0
  41. /package/dist/{VitalHistoryPanel-YKJY5WB3.mjs.map → VitalHistoryPanel-EP4LHE7S.mjs.map} +0 -0
  42. /package/dist/{chunk-O3OIK3TY.mjs.map → chunk-2JNAVITH.mjs.map} +0 -0
  43. /package/dist/{chunk-2Y2R64Q7.mjs.map → chunk-BSDXRKXE.mjs.map} +0 -0
  44. /package/dist/{chunk-GLUFA2DL.mjs.map → chunk-KDMB3N57.mjs.map} +0 -0
  45. /package/dist/{widgets-Q6QVESWZ.mjs.map → widgets-CRBIN732.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import "./chunk-2Y2R64Q7.mjs";
3
- import "./chunk-GLUFA2DL.mjs";
2
+ import "./chunk-BSDXRKXE.mjs";
3
+ import "./chunk-KDMB3N57.mjs";
4
4
  import {
5
5
  SmartSparkles_default,
6
6
  latestTrendCells,
@@ -12,7 +12,7 @@ import {
12
12
  useRecordPanelTable,
13
13
  useRecordPreview,
14
14
  useSmartRecordsActions
15
- } from "./chunk-O3OIK3TY.mjs";
15
+ } from "./chunk-2JNAVITH.mjs";
16
16
  import {
17
17
  isHttpUrl
18
18
  } from "./chunk-LFLPB6DK.mjs";
@@ -57,7 +57,7 @@ import {
57
57
  useCasesConnection,
58
58
  useSdk,
59
59
  writeVitalTrendCache
60
- } from "./chunk-Y2TQED3H.mjs";
60
+ } from "./chunk-GRCZLZX3.mjs";
61
61
  import {
62
62
  stripEmptyLeadingTables
63
63
  } from "./chunk-RWRJSQ2U.mjs";
@@ -685,6 +685,7 @@ function SdkProviderInner({
685
685
  config,
686
686
  bid,
687
687
  patientId,
688
+ linkedPatientIds,
688
689
  documentTypes,
689
690
  onUnknownDocumentType,
690
691
  children
@@ -720,12 +721,13 @@ function SdkProviderInner({
720
721
  () => ({
721
722
  bid,
722
723
  patientId,
724
+ linkedPatientIds,
723
725
  store,
724
726
  labelOf,
725
727
  documentTypes: docTypes,
726
728
  environment: config.environment
727
729
  }),
728
- [bid, patientId, store, labelOf, docTypes, config.environment]
730
+ [bid, patientId, linkedPatientIds, store, labelOf, docTypes, config.environment]
729
731
  );
730
732
  return /* @__PURE__ */ jsx2(SdkContext.Provider, { value, children });
731
733
  }
@@ -733,6 +735,7 @@ function SdkProvider({
733
735
  config,
734
736
  bid,
735
737
  patientId,
738
+ linkedPatientIds,
736
739
  documentTypes,
737
740
  onUnknownDocumentType,
738
741
  children
@@ -744,6 +747,7 @@ function SdkProvider({
744
747
  config,
745
748
  bid,
746
749
  patientId,
750
+ linkedPatientIds,
747
751
  documentTypes,
748
752
  onUnknownDocumentType,
749
753
  children
@@ -3858,7 +3862,7 @@ function useSidebarCollection({ limit } = {}) {
3858
3862
  // src/connection/useRecordsConnection.ts
3859
3863
  import { useCallback as useCallback15, useEffect as useEffect10, useRef as useRef9, useState as useState13 } from "react";
3860
3864
  function useRecordsConnection() {
3861
- const { bid, patientId, store, labelOf } = useSdk();
3865
+ const { bid, patientId, linkedPatientIds, store, labelOf } = useSdk();
3862
3866
  const toMs = (s) => s != null ? s * 1e3 : null;
3863
3867
  const [sourceRefreshedAt, setSourceRefreshedAt] = useState13(
3864
3868
  () => toMs(getCore().sourceRefreshedAt)
@@ -3877,6 +3881,7 @@ function useRecordsConnection() {
3877
3881
  const fresh = await getCore().listDocuments({
3878
3882
  bid,
3879
3883
  patientId,
3884
+ linkedPatientIds,
3880
3885
  preferenceType: "HTML",
3881
3886
  onStale: (cached) => {
3882
3887
  applyItems(cached);
@@ -3888,21 +3893,21 @@ function useRecordsConnection() {
3888
3893
  } catch {
3889
3894
  records.setStatus("idle");
3890
3895
  }
3891
- }, [bid, patientId, store, applyItems]);
3896
+ }, [bid, patientId, linkedPatientIds, store, applyItems]);
3892
3897
  useEffect10(() => {
3893
- const key = `${bid}::${patientId}`;
3898
+ const key = `${bid}::${patientId}::${linkedPatientIds?.join(",") ?? ""}`;
3894
3899
  if (loadedKeyRef.current === key) return;
3895
3900
  loadedKeyRef.current = key;
3896
3901
  void load();
3897
- }, [bid, patientId, load]);
3902
+ }, [bid, patientId, linkedPatientIds, load]);
3898
3903
  useEffect10(() => {
3899
3904
  const unsubscribe = getCore().subscribe("documents:changed", () => {
3900
3905
  clearVitalTrendCacheForPatient(bid, patientId);
3901
- void getCore().listLocalDocuments({ bid, patientId }).then(applyItems).catch(() => {
3906
+ void getCore().listLocalDocuments({ bid, patientId, linkedPatientIds }).then(applyItems).catch(() => {
3902
3907
  });
3903
3908
  });
3904
3909
  return unsubscribe;
3905
- }, [bid, patientId, applyItems]);
3910
+ }, [bid, patientId, linkedPatientIds, applyItems]);
3906
3911
  const editRecord = useCallback15(
3907
3912
  async (documentId, data) => {
3908
3913
  await getCore().editDocument({ documentId, data, bid, patientId });
@@ -3955,7 +3960,7 @@ import { useStore as useStore8 } from "zustand";
3955
3960
  import { useCallback as useCallback16, useEffect as useEffect13, useRef as useRef10 } from "react";
3956
3961
  import { useStore as useStore9 } from "zustand";
3957
3962
  function useCollectionConnection(enabled = true) {
3958
- const { bid, patientId, store } = useSdk();
3963
+ const { bid, patientId, linkedPatientIds, store } = useSdk();
3959
3964
  const loadedKeyRef = useRef10(null);
3960
3965
  const types = useStore9(store, (s) => s.filters.types);
3961
3966
  const documentDateFrom = useStore9(store, (s) => s.filters.documentDateFrom);
@@ -3973,6 +3978,7 @@ function useCollectionConnection(enabled = true) {
3973
3978
  const fresh = await getCore().groupCollectionItems({
3974
3979
  bid,
3975
3980
  patientId,
3981
+ linkedPatientIds,
3976
3982
  filter: filterRef.current,
3977
3983
  onStale: (cached) => {
3978
3984
  apply(cached);
@@ -3984,20 +3990,20 @@ function useCollectionConnection(enabled = true) {
3984
3990
  } catch (e) {
3985
3991
  store.getState().collection.setError(e instanceof Error ? e.message : "Failed to load records");
3986
3992
  }
3987
- }, [bid, patientId, store, apply]);
3993
+ }, [bid, patientId, linkedPatientIds, store, apply]);
3988
3994
  const reload = useCallback16(() => {
3989
- void getCore().groupCollectionItems({ bid, patientId, localOnly: true, filter: filterRef.current }).then((groups) => {
3995
+ void getCore().groupCollectionItems({ bid, patientId, linkedPatientIds, localOnly: true, filter: filterRef.current }).then((groups) => {
3990
3996
  apply(groups);
3991
3997
  }).catch(() => {
3992
3998
  });
3993
- }, [bid, patientId, apply]);
3999
+ }, [bid, patientId, linkedPatientIds, apply]);
3994
4000
  useEffect13(() => {
3995
4001
  if (!enabled) return;
3996
- const key = `${bid}::${patientId}`;
4002
+ const key = `${bid}::${patientId}::${linkedPatientIds?.join(",") ?? ""}`;
3997
4003
  if (loadedKeyRef.current === key) return;
3998
4004
  loadedKeyRef.current = key;
3999
4005
  void load();
4000
- }, [enabled, bid, patientId, load]);
4006
+ }, [enabled, bid, patientId, linkedPatientIds, load]);
4001
4007
  const firstFilterRef = useRef10(true);
4002
4008
  useEffect13(() => {
4003
4009
  if (!enabled) return;
@@ -4768,12 +4774,12 @@ function CareContextEmptyState({ noCareContext }) {
4768
4774
  import { memo as memo11, Suspense as Suspense2, lazy as lazy2 } from "react";
4769
4775
  import { jsx as jsx33 } from "react/jsx-runtime";
4770
4776
  var VitalHistoryPanel2 = lazy2(
4771
- () => import("./VitalHistoryPanel-YKJY5WB3.mjs").then((m) => ({
4777
+ () => import("./VitalHistoryPanel-EP4LHE7S.mjs").then((m) => ({
4772
4778
  default: m.VitalHistoryPanel
4773
4779
  }))
4774
4780
  );
4775
4781
  var OriginalRecordPanel = lazy2(
4776
- () => import("./OriginalRecordPanel-TXXNII2B.mjs").then((m) => ({
4782
+ () => import("./OriginalRecordPanel-OLTPTY67.mjs").then((m) => ({
4777
4783
  default: m.OriginalRecordPanel
4778
4784
  }))
4779
4785
  );
@@ -4805,10 +4811,10 @@ var MainPanel = memo11(function MainPanel2({
4805
4811
  // src/views/SmartRecordsView/SmartRecordsView.tsx
4806
4812
  import { Fragment as Fragment9, jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
4807
4813
  var DeleteConfirmModal = lazy3(
4808
- () => import("./widgets-Q6QVESWZ.mjs").then((m) => ({ default: m.DeleteConfirmModal }))
4814
+ () => import("./widgets-CRBIN732.mjs").then((m) => ({ default: m.DeleteConfirmModal }))
4809
4815
  );
4810
4816
  var SmartUploadModal2 = lazy3(
4811
- () => import("./SmartUploadModal-T6X23MO6.mjs").then((m) => ({
4817
+ () => import("./SmartUploadModal-GFZJXN2W.mjs").then((m) => ({
4812
4818
  default: m.SmartUploadModal
4813
4819
  }))
4814
4820
  );