@eka-care/medical-records-ui 1.2.13 → 1.2.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/{OriginalRecordPanel-EYOVIYJH.mjs → OriginalRecordPanel-HBEPXX4Y.mjs} +3 -3
- package/dist/{OriginalRecordPanel-M6IZWRUF.js → OriginalRecordPanel-PCFL4KRH.js} +19 -19
- package/dist/{OriginalRecordPanel-M6IZWRUF.js.map → OriginalRecordPanel-PCFL4KRH.js.map} +1 -1
- package/dist/SmartUploadModal-3P2GAWXM.js +11 -0
- package/dist/{SmartUploadModal-RQ5W33OE.js.map → SmartUploadModal-3P2GAWXM.js.map} +1 -1
- package/dist/{SmartUploadModal-IOLZU6YA.mjs → SmartUploadModal-4TEHAM5P.mjs} +3 -3
- package/dist/VitalHistoryPanel-L43PLXTX.js +12 -0
- package/dist/{VitalHistoryPanel-FHY27XA5.js.map → VitalHistoryPanel-L43PLXTX.js.map} +1 -1
- package/dist/VitalHistoryPanel-US2HXGCR.mjs +12 -0
- package/dist/{chunk-36KDDCWU.mjs → chunk-5V3A6NJU.mjs} +2 -2
- package/dist/{chunk-2SFND57U.js → chunk-H2DKQ6IE.js} +14 -14
- package/dist/{chunk-2SFND57U.js.map → chunk-H2DKQ6IE.js.map} +1 -1
- package/dist/{chunk-6EN4LTIT.mjs → chunk-MPOY25TA.mjs} +3 -2
- package/dist/chunk-MPOY25TA.mjs.map +1 -0
- package/dist/{chunk-7XNJKV4H.js → chunk-NTFOVMHN.js} +3 -2
- package/dist/chunk-NTFOVMHN.js.map +1 -0
- package/dist/{chunk-FXAL6MAX.mjs → chunk-PIQG3RZA.mjs} +3 -3
- package/dist/{chunk-U4JSEP3G.js → chunk-VA2ZDYP2.js} +16 -15
- package/dist/chunk-VA2ZDYP2.js.map +1 -0
- package/dist/{chunk-LG6SPPD4.js → chunk-VHE5O2AM.js} +21 -21
- package/dist/{chunk-LG6SPPD4.js.map → chunk-VHE5O2AM.js.map} +1 -1
- package/dist/{chunk-LLBFSULS.mjs → chunk-ZRNPUDQY.mjs} +7 -6
- package/dist/chunk-ZRNPUDQY.mjs.map +1 -0
- package/dist/index.css +7 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +42 -9
- package/dist/index.d.ts +42 -9
- package/dist/index.js +269 -153
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +389 -273
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +7 -1
- package/dist/styles.css.map +1 -1
- package/dist/widgets-J6JCO5NX.js +51 -0
- package/dist/{widgets-3MZCYTPF.js.map → widgets-J6JCO5NX.js.map} +1 -1
- package/dist/{widgets-NJ2AXABO.mjs → widgets-V22RS7VB.mjs} +2 -2
- package/package.json +2 -2
- package/dist/SmartUploadModal-RQ5W33OE.js +0 -11
- package/dist/VitalHistoryPanel-FHY27XA5.js +0 -12
- package/dist/VitalHistoryPanel-XTATAJHE.mjs +0 -12
- package/dist/chunk-6EN4LTIT.mjs.map +0 -1
- package/dist/chunk-7XNJKV4H.js.map +0 -1
- package/dist/chunk-LLBFSULS.mjs.map +0 -1
- package/dist/chunk-U4JSEP3G.js.map +0 -1
- package/dist/widgets-3MZCYTPF.js +0 -51
- /package/dist/{OriginalRecordPanel-EYOVIYJH.mjs.map → OriginalRecordPanel-HBEPXX4Y.mjs.map} +0 -0
- /package/dist/{SmartUploadModal-IOLZU6YA.mjs.map → SmartUploadModal-4TEHAM5P.mjs.map} +0 -0
- /package/dist/{VitalHistoryPanel-XTATAJHE.mjs.map → VitalHistoryPanel-US2HXGCR.mjs.map} +0 -0
- /package/dist/{chunk-36KDDCWU.mjs.map → chunk-5V3A6NJU.mjs.map} +0 -0
- /package/dist/{chunk-FXAL6MAX.mjs.map → chunk-PIQG3RZA.mjs.map} +0 -0
- /package/dist/{widgets-NJ2AXABO.mjs.map → widgets-V22RS7VB.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
-
require('./chunk-
|
|
3
|
-
require('./chunk-
|
|
2
|
+
require('./chunk-H2DKQ6IE.js');
|
|
3
|
+
require('./chunk-VHE5O2AM.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ var _chunkMVWFPQXZjs = require('./chunk-MVWFPQXZ.js');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkVA2ZDYP2js = require('./chunk-VA2ZDYP2.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var _chunkGDE4LXTRjs = require('./chunk-GDE4LXTR.js');
|
|
@@ -55,7 +55,7 @@ var _chunkGDE4LXTRjs = require('./chunk-GDE4LXTR.js');
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
var
|
|
58
|
+
var _chunkNTFOVMHNjs = require('./chunk-NTFOVMHN.js');
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
var _chunkKOOLUMNAjs = require('./chunk-KOOLUMNA.js');
|
|
@@ -670,8 +670,8 @@ function NoPatientPlaceholder() {
|
|
|
670
670
|
] })
|
|
671
671
|
] }),
|
|
672
672
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__empty-text", children: [
|
|
673
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
674
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
673
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "heading", children: "No patient selected" }),
|
|
674
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "muted", children: "Select a patient to view their medical records." })
|
|
675
675
|
] })
|
|
676
676
|
] });
|
|
677
677
|
}
|
|
@@ -687,9 +687,9 @@ function SdkProviderInner({
|
|
|
687
687
|
onUnknownDocumentType,
|
|
688
688
|
children
|
|
689
689
|
}) {
|
|
690
|
-
|
|
690
|
+
_chunkNTFOVMHNjs.initWorkerClient.call(void 0, config, patientId);
|
|
691
691
|
_react.useEffect.call(void 0, () => {
|
|
692
|
-
|
|
692
|
+
_chunkNTFOVMHNjs.setAuthToken.call(void 0, config.accessToken);
|
|
693
693
|
}, [config.accessToken]);
|
|
694
694
|
const store = _react.useMemo.call(void 0,
|
|
695
695
|
() => createPatientStore(bid, patientId),
|
|
@@ -698,17 +698,17 @@ function SdkProviderInner({
|
|
|
698
698
|
_react.useEffect.call(void 0, () => () => store.getState().__cleanup(), [store]);
|
|
699
699
|
_react.useEffect.call(void 0, () => {
|
|
700
700
|
const handleOnline = () => {
|
|
701
|
-
void
|
|
701
|
+
void _chunkNTFOVMHNjs.getCore.call(void 0, ).sync();
|
|
702
702
|
};
|
|
703
703
|
window.addEventListener("online", handleOnline);
|
|
704
704
|
return () => window.removeEventListener("online", handleOnline);
|
|
705
705
|
}, []);
|
|
706
706
|
const labelOf = _react.useMemo.call(void 0,
|
|
707
|
-
() =>
|
|
707
|
+
() => _chunkNTFOVMHNjs.createDocumentTypeLabelResolver.call(void 0, documentTypes, onUnknownDocumentType),
|
|
708
708
|
[documentTypes, onUnknownDocumentType]
|
|
709
709
|
);
|
|
710
710
|
const docTypes = _react.useMemo.call(void 0,
|
|
711
|
-
() => _nullishCoalesce(documentTypes, () => ( Object.entries(
|
|
711
|
+
() => _nullishCoalesce(documentTypes, () => ( Object.entries(_chunkNTFOVMHNjs.DOCUMENT_TYPE_LABELS).map(([id, display_name]) => ({
|
|
712
712
|
id,
|
|
713
713
|
display_name
|
|
714
714
|
})))),
|
|
@@ -725,7 +725,7 @@ function SdkProviderInner({
|
|
|
725
725
|
}),
|
|
726
726
|
[bid, patientId, store, labelOf, docTypes, config.environment]
|
|
727
727
|
);
|
|
728
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
728
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.SdkContext.Provider, { value, children });
|
|
729
729
|
}
|
|
730
730
|
function SdkProvider({
|
|
731
731
|
config,
|
|
@@ -964,7 +964,7 @@ var FileCard = _react.memo.call(void 0, function FileCard2({
|
|
|
964
964
|
// src/views/containers/care-panel/CareFilesPanel.tsx
|
|
965
965
|
|
|
966
966
|
function CareFilesPanel({ caseId }) {
|
|
967
|
-
const { store } =
|
|
967
|
+
const { store } = _chunkNTFOVMHNjs.useSdk.call(void 0, );
|
|
968
968
|
const recordsById = _zustand.useStore.call(void 0, store, (s) => s.records.byId);
|
|
969
969
|
const filterTypes = _zustand.useStore.call(void 0, store, (s) => s.filters.types);
|
|
970
970
|
const {
|
|
@@ -972,7 +972,7 @@ function CareFilesPanel({ caseId }) {
|
|
|
972
972
|
openSmartRecord,
|
|
973
973
|
requestDelete,
|
|
974
974
|
onToast: onToastAction
|
|
975
|
-
} =
|
|
975
|
+
} = _chunkVA2ZDYP2js.useSmartRecordsActions.call(void 0, );
|
|
976
976
|
const tabScrollRef = _react.useRef.call(void 0, null);
|
|
977
977
|
const [activeTab, setActiveTab] = _react.useState.call(void 0, "all");
|
|
978
978
|
const allRecords = _react.useMemo.call(void 0,
|
|
@@ -1088,10 +1088,10 @@ function CareFilesPanel({ caseId }) {
|
|
|
1088
1088
|
// src/views/containers/care-panel/CareContextPanel.tsx
|
|
1089
1089
|
|
|
1090
1090
|
function CareContextPanel({ caseId, onBack }) {
|
|
1091
|
-
const { store } =
|
|
1091
|
+
const { store } = _chunkNTFOVMHNjs.useSdk.call(void 0, );
|
|
1092
1092
|
const recordsById = _zustand.useStore.call(void 0, store, (s) => s.records.byId);
|
|
1093
1093
|
const casesById = _zustand.useStore.call(void 0, store, (s) => s.cases.byId);
|
|
1094
|
-
const { requestDelete, attachToContext, selectRecord, onCopyToNote, onToast: onToastAction } =
|
|
1094
|
+
const { requestDelete, attachToContext, selectRecord, onCopyToNote, onToast: onToastAction } = _chunkVA2ZDYP2js.useSmartRecordsActions.call(void 0, );
|
|
1095
1095
|
const onToast = _react.useCallback.call(void 0,
|
|
1096
1096
|
(message, type) => _optionalChain([onToastAction, 'optionalCall', _14 => _14(message, _nullishCoalesce(type, () => ( "success")))]),
|
|
1097
1097
|
[onToastAction]
|
|
@@ -1141,7 +1141,7 @@ function CareContextPanel({ caseId, onBack }) {
|
|
|
1141
1141
|
const countLabel = `${fileCount} record${fileCount !== 1 ? "s" : ""}`;
|
|
1142
1142
|
if (isUngrouped || fileCount === 0) return countLabel;
|
|
1143
1143
|
const newest = records.reduce((max, r) => Math.max(max, r.createdAtEpoch), 0);
|
|
1144
|
-
return newest ? `Updated ${
|
|
1144
|
+
return newest ? `Updated ${_chunkNTFOVMHNjs.epochToDisplay.call(void 0, newest)} \xB7 ${countLabel}` : countLabel;
|
|
1145
1145
|
}, [records, fileCount, isUngrouped]);
|
|
1146
1146
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, RecordsActionsProvider, { value: careContextActions, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__panel mr-sv__care-context-panel", children: [
|
|
1147
1147
|
recordIds.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
@@ -1152,7 +1152,7 @@ function CareContextPanel({ caseId, onBack }) {
|
|
|
1152
1152
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-cc-panel__header", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-cc-panel__header-left", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-cc-panel__info", children: [
|
|
1153
1153
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-cc-panel__name-row", children: [
|
|
1154
1154
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1155
|
-
|
|
1155
|
+
_chunkNTFOVMHNjs.Typography_default,
|
|
1156
1156
|
{
|
|
1157
1157
|
variant: "label",
|
|
1158
1158
|
as: "span",
|
|
@@ -1160,16 +1160,16 @@ function CareContextPanel({ caseId, onBack }) {
|
|
|
1160
1160
|
children: isUngrouped ? "No care context" : _optionalChain([c, 'optionalAccess', _17 => _17.name]) || "Untitled"
|
|
1161
1161
|
}
|
|
1162
1162
|
),
|
|
1163
|
-
_optionalChain([c, 'optionalAccess', _18 => _18.typeCode]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "mr-cc-panel__badge", children: _nullishCoalesce(_optionalChain([
|
|
1163
|
+
_optionalChain([c, 'optionalAccess', _18 => _18.typeCode]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "mr-cc-panel__badge", children: _nullishCoalesce(_optionalChain([_chunkNTFOVMHNjs.CASE_TYPE_OPTIONS, 'access', _19 => _19.find, 'call', _20 => _20((o) => o.value === c.typeCode), 'optionalAccess', _21 => _21.label]), () => ( c.typeCode)) })
|
|
1164
1164
|
] }),
|
|
1165
1165
|
subtitle && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "mr-cc-panel__sub", children: subtitle })
|
|
1166
1166
|
] }) }) })
|
|
1167
1167
|
] }),
|
|
1168
1168
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-sv__panel-body", children: recordIds.length === 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__empty", children: [
|
|
1169
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1169
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.EmptyIllustration, {}),
|
|
1170
1170
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__empty-text", children: [
|
|
1171
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1172
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1171
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "heading", children: "No records" }),
|
|
1172
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "muted", children: "No records have been added to this care context." })
|
|
1173
1173
|
] })
|
|
1174
1174
|
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CareFilesPanel, { caseId }) })
|
|
1175
1175
|
] }) });
|
|
@@ -1190,10 +1190,10 @@ function SmartRecordPreviewPanel({
|
|
|
1190
1190
|
onBack,
|
|
1191
1191
|
preview: loadedPreview
|
|
1192
1192
|
}) {
|
|
1193
|
-
const { store } =
|
|
1194
|
-
const { hideOpenInNewTab, hasCopyToNote, onCopyToNote, onCopyVitalsToNote, onToast } =
|
|
1193
|
+
const { store } = _chunkNTFOVMHNjs.useSdk.call(void 0, );
|
|
1194
|
+
const { hideOpenInNewTab, hasCopyToNote, onCopyToNote, onCopyVitalsToNote, onToast } = _chunkVA2ZDYP2js.useSmartRecordsActions.call(void 0, );
|
|
1195
1195
|
const record = _zustand.useStore.call(void 0, store, (s) => s.records.byId[recordId]);
|
|
1196
|
-
const ownPreview =
|
|
1196
|
+
const ownPreview = _chunkVA2ZDYP2js.useRecordPreview.call(void 0, loadedPreview ? null : recordId);
|
|
1197
1197
|
const preview = _nullishCoalesce(loadedPreview, () => ( ownPreview));
|
|
1198
1198
|
const isBlockedHttp = preview.files.length > 0 && _chunkGDE4LXTRjs.isHttpUrl.call(void 0, preview.files[0].url);
|
|
1199
1199
|
const [previewLoadUnavailable, setPreviewLoadUnavailable] = _react.useState.call(void 0, false);
|
|
@@ -1233,7 +1233,7 @@ function SmartRecordPreviewPanel({
|
|
|
1233
1233
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__panel-header", children: [
|
|
1234
1234
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__panel-left", children: [
|
|
1235
1235
|
onBack && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1236
|
-
|
|
1236
|
+
_chunkNTFOVMHNjs.IconButton,
|
|
1237
1237
|
{
|
|
1238
1238
|
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ChevronLeft, { size: 16, "aria-hidden": true }),
|
|
1239
1239
|
label: "Back",
|
|
@@ -1243,8 +1243,8 @@ function SmartRecordPreviewPanel({
|
|
|
1243
1243
|
}
|
|
1244
1244
|
),
|
|
1245
1245
|
record && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__panel-info mr-sv__panel-info--start", children: [
|
|
1246
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1247
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1246
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "label", as: "span", className: "mr-sv__panel-name", children: record.title }),
|
|
1247
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "hint", as: "span", className: "mr-sv__panel-meta-text", children: _chunkNTFOVMHNjs.epochToDisplay.call(void 0, record.createdAtEpoch) })
|
|
1248
1248
|
] })
|
|
1249
1249
|
] }),
|
|
1250
1250
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-orig__header-actions", children: [
|
|
@@ -1263,7 +1263,7 @@ function SmartRecordPreviewPanel({
|
|
|
1263
1263
|
}
|
|
1264
1264
|
),
|
|
1265
1265
|
preview.status === "loaded" && preview.files.length > 0 && !previewUnavailable && !hideOpenInNewTab && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1266
|
-
|
|
1266
|
+
_chunkNTFOVMHNjs.IconButton,
|
|
1267
1267
|
{
|
|
1268
1268
|
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ExternalLink, { size: 16, "aria-hidden": true }),
|
|
1269
1269
|
label: "Open in new tab",
|
|
@@ -1294,14 +1294,14 @@ function SmartRecordPreviewPanel({
|
|
|
1294
1294
|
children: [
|
|
1295
1295
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.LoaderCircle, { size: 44, className: "mr-sv__loading-spinner", "aria-hidden": true }),
|
|
1296
1296
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__empty-text", children: [
|
|
1297
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1298
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1297
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "heading", children: "Loading preview..." }),
|
|
1298
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "muted", children: "Fetching document" })
|
|
1299
1299
|
] })
|
|
1300
1300
|
]
|
|
1301
1301
|
}
|
|
1302
1302
|
),
|
|
1303
|
-
preview.status === "error" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1304
|
-
preview.status === "loaded" && preview.files.length === 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1303
|
+
preview.status === "error" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "muted", className: "mr-sv__panel-empty", children: "Failed to load document preview." }),
|
|
1304
|
+
preview.status === "loaded" && preview.files.length === 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "muted", className: "mr-sv__panel-empty", children: "No preview available for this record." }),
|
|
1305
1305
|
preview.status === "loaded" && preview.files.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1306
1306
|
"div",
|
|
1307
1307
|
{
|
|
@@ -1358,9 +1358,9 @@ function fetchTrend(ekaId, bid, patientId, fallbackUnit) {
|
|
|
1358
1358
|
const inFlightKey = `${bid}:${patientId}:${ekaId}`;
|
|
1359
1359
|
const existing = inFlight.get(inFlightKey);
|
|
1360
1360
|
if (existing) return existing;
|
|
1361
|
-
const promise = withLimit(() =>
|
|
1361
|
+
const promise = withLimit(() => _chunkNTFOVMHNjs.getCore.call(void 0, ).getParameterTrend({ parameterId: ekaId, bid, patientId })).then((data) => {
|
|
1362
1362
|
const cells = _chunkMVWFPQXZjs.latestTrendCells.call(void 0, data, fallbackUnit, TREND_COUNT);
|
|
1363
|
-
|
|
1363
|
+
_chunkNTFOVMHNjs.writeVitalTrendCache.call(void 0, bid, patientId, ekaId, cells);
|
|
1364
1364
|
return cells;
|
|
1365
1365
|
}).finally(() => {
|
|
1366
1366
|
inFlight.delete(inFlightKey);
|
|
@@ -1375,7 +1375,7 @@ function removeFromSet(prev, ekaId) {
|
|
|
1375
1375
|
return next;
|
|
1376
1376
|
}
|
|
1377
1377
|
function useVitalTrendPrefetch(rows, visibleEkaIds) {
|
|
1378
|
-
const { bid, patientId } =
|
|
1378
|
+
const { bid, patientId } = _chunkNTFOVMHNjs.useSdk.call(void 0, );
|
|
1379
1379
|
const [trendByEka, setTrendByEka] = _react.useState.call(void 0, /* @__PURE__ */ new Map());
|
|
1380
1380
|
const [pendingEkaIds, setPendingEkaIds] = _react.useState.call(void 0, /* @__PURE__ */ new Set());
|
|
1381
1381
|
const timersRef = _react.useRef.call(void 0, /* @__PURE__ */ new Map());
|
|
@@ -1395,7 +1395,7 @@ function useVitalTrendPrefetch(rows, visibleEkaIds) {
|
|
|
1395
1395
|
}
|
|
1396
1396
|
for (const ekaId of visibleEkaIds) {
|
|
1397
1397
|
if (!ekaId || resolved.has(ekaId)) continue;
|
|
1398
|
-
const cached =
|
|
1398
|
+
const cached = _chunkNTFOVMHNjs.readVitalTrendCache.call(void 0, bid, patientId, ekaId);
|
|
1399
1399
|
if (cached) {
|
|
1400
1400
|
resolved.add(ekaId);
|
|
1401
1401
|
setTrendByEka((prev) => new Map(prev).set(ekaId, cached));
|
|
@@ -1585,7 +1585,7 @@ function VitalsPanelGrid({
|
|
|
1585
1585
|
children: [
|
|
1586
1586
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-cc-table__controls", children: [
|
|
1587
1587
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1588
|
-
|
|
1588
|
+
_chunkNTFOVMHNjs.SearchInput_default,
|
|
1589
1589
|
{
|
|
1590
1590
|
className: "mr-cc-table__search",
|
|
1591
1591
|
iconSize: 16,
|
|
@@ -1632,7 +1632,7 @@ function VitalsPanelGrid({
|
|
|
1632
1632
|
]
|
|
1633
1633
|
}
|
|
1634
1634
|
),
|
|
1635
|
-
filteredRows.length === 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-cc-table__empty", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1635
|
+
filteredRows.length === 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-cc-table__empty", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "muted", children: "No vitals match." }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { height: `${rowVirtualizer.getTotalSize()}px`, minWidth: gridMinWidth, position: "relative" }, children: rowVirtualizer.getVirtualItems().map((virtualRow) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1636
1636
|
"div",
|
|
1637
1637
|
{
|
|
1638
1638
|
"data-index": virtualRow.index,
|
|
@@ -1834,11 +1834,11 @@ function SmartRecordSmartPanel({
|
|
|
1834
1834
|
caseId,
|
|
1835
1835
|
onBack
|
|
1836
1836
|
}) {
|
|
1837
|
-
const { store } =
|
|
1837
|
+
const { store } = _chunkNTFOVMHNjs.useSdk.call(void 0, );
|
|
1838
1838
|
const record = _zustand.useStore.call(void 0, store, (s) => s.records.byId[recordId]);
|
|
1839
1839
|
const caseName = _zustand.useStore.call(void 0, store, (s) => caseId ? _optionalChain([s, 'access', _48 => _48.cases, 'access', _49 => _49.byId, 'access', _50 => _50[caseId], 'optionalAccess', _51 => _51.name]) : void 0);
|
|
1840
|
-
const { onCopyToNote, openHistory, openOriginal, onCopyVitalsToNote } =
|
|
1841
|
-
const { status, table } =
|
|
1840
|
+
const { onCopyToNote, openHistory, openOriginal, onCopyVitalsToNote } = _chunkVA2ZDYP2js.useSmartRecordsActions.call(void 0, );
|
|
1841
|
+
const { status, table } = _chunkVA2ZDYP2js.useRecordPanelTable.call(void 0, recordId);
|
|
1842
1842
|
const [visibleEkaIds, setVisibleEkaIds] = _react.useState.call(void 0, []);
|
|
1843
1843
|
const { rows: rowsWithTrend, pendingEkaIds } = useVitalTrendPrefetch(table.rows, visibleEkaIds);
|
|
1844
1844
|
const hasTrendableVitals = table.rows.some((r) => r.ekaId);
|
|
@@ -1852,7 +1852,7 @@ function SmartRecordSmartPanel({
|
|
|
1852
1852
|
[openOriginal, recordId, caseId]
|
|
1853
1853
|
);
|
|
1854
1854
|
const meta = record ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1855
|
-
|
|
1855
|
+
_chunkNTFOVMHNjs.epochToDisplay.call(void 0, record.createdAtEpoch),
|
|
1856
1856
|
record.totalVitals > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1857
1857
|
" \xB7 ",
|
|
1858
1858
|
record.totalVitals,
|
|
@@ -1866,8 +1866,8 @@ function SmartRecordSmartPanel({
|
|
|
1866
1866
|
] }) }),
|
|
1867
1867
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-cc-panel__header", children: [
|
|
1868
1868
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-cc-panel__header-left", children: record && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-cc-panel__info", children: [
|
|
1869
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-cc-panel__name-row", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1870
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "mr-cc-panel__sub", children: caseName ? `${caseName} \xB7 ${
|
|
1869
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-cc-panel__name-row", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "label", as: "span", className: "mr-cc-panel__name", children: record.title }) }),
|
|
1870
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "mr-cc-panel__sub", children: caseName ? `${caseName} \xB7 ${_chunkNTFOVMHNjs.epochToDisplay.call(void 0, record.createdAtEpoch)}` : meta })
|
|
1871
1871
|
] }) }),
|
|
1872
1872
|
record && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { type: "button", className: "mr-sv__ghost-link-btn", onClick: handleViewOriginal, children: [
|
|
1873
1873
|
"View original",
|
|
@@ -1877,10 +1877,10 @@ function SmartRecordSmartPanel({
|
|
|
1877
1877
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__panel-body", children: [
|
|
1878
1878
|
status === "loading" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-cc-table mr-cc-table--state", children: [
|
|
1879
1879
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.LoaderCircle, { size: 20, className: "mr-sv__loading-spinner", "aria-hidden": true }),
|
|
1880
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1880
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "muted", children: "Building vitals summary\u2026" })
|
|
1881
1881
|
] }),
|
|
1882
|
-
status === "error" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-cc-table mr-cc-table--state", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1883
|
-
status === "loaded" && table.rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1882
|
+
status === "error" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-cc-table mr-cc-table--state", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "muted", children: "Couldn't load vitals summary." }) }),
|
|
1883
|
+
status === "loaded" && table.rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "muted", className: "mr-sv__panel-empty", children: "No vitals to show." }),
|
|
1884
1884
|
status === "loaded" && table.rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1885
1885
|
VitalsPanelGrid,
|
|
1886
1886
|
{
|
|
@@ -2759,7 +2759,7 @@ function PrescriptionPanel({ conversion, onBack, onViewOriginal, onAttach }) {
|
|
|
2759
2759
|
] }) }),
|
|
2760
2760
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-cc-panel__header", children: [
|
|
2761
2761
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-cc-panel__header-left", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-cc-panel__info", children: [
|
|
2762
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-cc-panel__name-row", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2762
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-cc-panel__name-row", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "label", as: "span", className: "mr-cc-panel__name", children: "Prescription" }) }),
|
|
2763
2763
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "mr-cc-panel__sub", children: meta })
|
|
2764
2764
|
] }) }),
|
|
2765
2765
|
onViewOriginal && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { type: "button", className: "mr-sv__ghost-link-btn", onClick: onViewOriginal, children: [
|
|
@@ -2768,44 +2768,149 @@ function PrescriptionPanel({ conversion, onBack, onViewOriginal, onAttach }) {
|
|
|
2768
2768
|
] })
|
|
2769
2769
|
] }),
|
|
2770
2770
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-sv__panel-body mr-rx-body", children: isEmpty ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__empty", children: [
|
|
2771
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2771
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.EmptyIllustration, {}),
|
|
2772
2772
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__empty-text", children: [
|
|
2773
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2774
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2773
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "heading", children: "No structured data" }),
|
|
2774
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "muted", children: "This prescription has no sections to show here." })
|
|
2775
2775
|
] })
|
|
2776
2776
|
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-rx-scroll", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-rx-cards", children: sections.map((section) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PrescriptionSectionCard, { section }, section.key)) }) }) }),
|
|
2777
2777
|
showAddToContext && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-cc-table__footer mr-rx-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "mr-cc-table__copy-note-btn", onClick: handleAddToContext, children: "Attach to session" }) })
|
|
2778
2778
|
] });
|
|
2779
2779
|
}
|
|
2780
2780
|
|
|
2781
|
+
// src/prescription/components/ScribeDocumentPanel.tsx
|
|
2782
|
+
|
|
2783
|
+
|
|
2784
|
+
|
|
2785
|
+
function ScribeDocumentPanel({
|
|
2786
|
+
documentId,
|
|
2787
|
+
recordId,
|
|
2788
|
+
title,
|
|
2789
|
+
date,
|
|
2790
|
+
renderDocument,
|
|
2791
|
+
onUnavailable,
|
|
2792
|
+
onBack,
|
|
2793
|
+
onViewOriginal
|
|
2794
|
+
}) {
|
|
2795
|
+
const [copyState, setCopyState] = _react.useState.call(void 0, null);
|
|
2796
|
+
const handleCopyFooter = _react.useCallback.call(void 0,
|
|
2797
|
+
(e) => {
|
|
2798
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
2799
|
+
void _optionalChain([copyState, 'optionalAccess', _199 => _199.copy, 'call', _200 => _200({ x: rect.left + rect.width / 2, y: rect.bottom })]);
|
|
2800
|
+
},
|
|
2801
|
+
[copyState]
|
|
2802
|
+
);
|
|
2803
|
+
const handleSelectAllKeyDown = _react.useCallback.call(void 0,
|
|
2804
|
+
(e) => {
|
|
2805
|
+
if (e.key !== " " && e.key !== "Enter") return;
|
|
2806
|
+
e.preventDefault();
|
|
2807
|
+
_optionalChain([copyState, 'optionalAccess', _201 => _201.toggleAll, 'call', _202 => _202()]);
|
|
2808
|
+
},
|
|
2809
|
+
[copyState]
|
|
2810
|
+
);
|
|
2811
|
+
const canCopy = !!copyState && copyState.total > 0;
|
|
2812
|
+
const someSelected = (_nullishCoalesce(_optionalChain([copyState, 'optionalAccess', _203 => _203.selectedCount]), () => ( 0))) > 0;
|
|
2813
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__panel", children: [
|
|
2814
|
+
onBack && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-sv__back-row", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { type: "button", className: "mr-sv__back-btn", onClick: onBack, children: [
|
|
2815
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ChevronLeft, { size: 16, "aria-hidden": true }),
|
|
2816
|
+
"Back"
|
|
2817
|
+
] }) }),
|
|
2818
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-cc-panel__header", children: [
|
|
2819
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-cc-panel__header-left", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-cc-panel__info", children: [
|
|
2820
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-cc-panel__name-row", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "label", as: "span", className: "mr-cc-panel__name", children: title }) }),
|
|
2821
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "mr-cc-panel__sub", children: date })
|
|
2822
|
+
] }) }),
|
|
2823
|
+
onViewOriginal && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { type: "button", className: "mr-sv__ghost-link-btn", onClick: onViewOriginal, children: [
|
|
2824
|
+
"View original",
|
|
2825
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ChevronRight, { size: 16, "aria-hidden": true })
|
|
2826
|
+
] })
|
|
2827
|
+
] }),
|
|
2828
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-sv__panel-body mr-rx-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-rx-scroll mr-scribe-doc", children: renderDocument({ documentId, recordId, setCopyState, onUnavailable }) }) }),
|
|
2829
|
+
canCopy && copyState && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-cc-table__footer", children: [
|
|
2830
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2831
|
+
"span",
|
|
2832
|
+
{
|
|
2833
|
+
className: `mr-sv__checkbox mr-cc-table__footer-check${copyState.allSelected ? " mr-sv__checkbox--checked" : ""}`,
|
|
2834
|
+
role: "checkbox",
|
|
2835
|
+
"aria-checked": copyState.allSelected,
|
|
2836
|
+
"aria-label": "Select all sections",
|
|
2837
|
+
tabIndex: 0,
|
|
2838
|
+
onClick: copyState.toggleAll,
|
|
2839
|
+
onKeyDown: handleSelectAllKeyDown,
|
|
2840
|
+
children: copyState.allSelected && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Check, { size: 10, strokeWidth: 3 })
|
|
2841
|
+
}
|
|
2842
|
+
),
|
|
2843
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "mr-cc-table__footer-label", onClick: copyState.toggleAll, children: "Select all" }),
|
|
2844
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "mr-cc-table__footer-count", children: [
|
|
2845
|
+
copyState.selectedCount,
|
|
2846
|
+
" of ",
|
|
2847
|
+
copyState.total,
|
|
2848
|
+
" selected"
|
|
2849
|
+
] }),
|
|
2850
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2851
|
+
"button",
|
|
2852
|
+
{
|
|
2853
|
+
type: "button",
|
|
2854
|
+
className: "mr-cc-table__copy-note-btn",
|
|
2855
|
+
disabled: !someSelected,
|
|
2856
|
+
onClick: handleCopyFooter,
|
|
2857
|
+
children: "Copy to note"
|
|
2858
|
+
}
|
|
2859
|
+
)
|
|
2860
|
+
] })
|
|
2861
|
+
] });
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2781
2864
|
// src/views/containers/smart-records/RecordPanel.tsx
|
|
2782
2865
|
|
|
2866
|
+
var SCRIBE_SOURCE = "scribe";
|
|
2783
2867
|
function RecordPanel({ recordId, caseId, onBack }) {
|
|
2784
|
-
const { store } =
|
|
2868
|
+
const { store } = _chunkNTFOVMHNjs.useSdk.call(void 0, );
|
|
2785
2869
|
const record = _zustand.useStore.call(void 0, store, (s) => s.records.byId[recordId]);
|
|
2786
|
-
const { openOriginal, attachToContext } =
|
|
2787
|
-
const preview =
|
|
2870
|
+
const { openOriginal, attachToContext, renderScribeDocument } = _chunkVA2ZDYP2js.useSmartRecordsActions.call(void 0, );
|
|
2871
|
+
const preview = _chunkVA2ZDYP2js.useRecordPreview.call(void 0, recordId);
|
|
2872
|
+
const source = _nullishCoalesce(_optionalChain([record, 'optionalAccess', _204 => _204.source]), () => ( preview.source));
|
|
2873
|
+
const [unavailableFor, setUnavailableFor] = _react.useState.call(void 0, null);
|
|
2874
|
+
_react.useEffect.call(void 0, () => setUnavailableFor(null), [recordId]);
|
|
2875
|
+
const handleScribeUnavailable = _react.useCallback.call(void 0, () => setUnavailableFor(recordId), [recordId]);
|
|
2876
|
+
const isScribeNote = !!preview.fhirBundle && source === SCRIBE_SOURCE && !!renderScribeDocument && unavailableFor !== recordId;
|
|
2788
2877
|
const conversion = _react.useMemo.call(void 0,
|
|
2789
|
-
() => preview.fhirBundle ? convertPrescriptionBundle(preview.fhirBundle) : null,
|
|
2790
|
-
[preview.fhirBundle]
|
|
2878
|
+
() => preview.fhirBundle && !isScribeNote ? convertPrescriptionBundle(preview.fhirBundle) : null,
|
|
2879
|
+
[preview.fhirBundle, isScribeNote]
|
|
2791
2880
|
);
|
|
2792
2881
|
const handleViewOriginal = _react.useCallback.call(void 0,
|
|
2793
2882
|
() => openOriginal(recordId, "smart", void 0, caseId),
|
|
2794
2883
|
[openOriginal, recordId, caseId]
|
|
2795
2884
|
);
|
|
2796
2885
|
const handleAttach = _react.useCallback.call(void 0,
|
|
2797
|
-
(name) => void _optionalChain([attachToContext, 'optionalCall',
|
|
2886
|
+
(name) => void _optionalChain([attachToContext, 'optionalCall', _205 => _205(recordId, name, recordId)]),
|
|
2798
2887
|
[attachToContext, recordId]
|
|
2799
2888
|
);
|
|
2800
2889
|
if (preview.status === "loading") {
|
|
2801
2890
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-sv__panel", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-sv__panel-body", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__loading-panel", children: [
|
|
2802
2891
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.LoaderCircle, { size: 44, className: "mr-sv__loading-spinner", "aria-hidden": true }),
|
|
2803
2892
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__empty-text", children: [
|
|
2804
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2805
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2893
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "heading", children: "Loading record..." }),
|
|
2894
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "muted", children: "Fetching the record details" })
|
|
2806
2895
|
] })
|
|
2807
2896
|
] }) }) });
|
|
2808
2897
|
}
|
|
2898
|
+
if (isScribeNote) {
|
|
2899
|
+
const documentId = recordId;
|
|
2900
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2901
|
+
ScribeDocumentPanel,
|
|
2902
|
+
{
|
|
2903
|
+
documentId,
|
|
2904
|
+
recordId,
|
|
2905
|
+
title: _nullishCoalesce(_optionalChain([record, 'optionalAccess', _206 => _206.title]), () => ( "Prescription")),
|
|
2906
|
+
date: record ? _chunkNTFOVMHNjs.epochToDisplay.call(void 0, record.createdAtEpoch) : "",
|
|
2907
|
+
renderDocument: renderScribeDocument,
|
|
2908
|
+
onUnavailable: handleScribeUnavailable,
|
|
2909
|
+
onBack,
|
|
2910
|
+
onViewOriginal: preview.files.length > 0 ? handleViewOriginal : void 0
|
|
2911
|
+
}
|
|
2912
|
+
);
|
|
2913
|
+
}
|
|
2809
2914
|
if (conversion) {
|
|
2810
2915
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2811
2916
|
PrescriptionPanel,
|
|
@@ -2817,7 +2922,7 @@ function RecordPanel({ recordId, caseId, onBack }) {
|
|
|
2817
2922
|
}
|
|
2818
2923
|
);
|
|
2819
2924
|
}
|
|
2820
|
-
if (_optionalChain([record, 'optionalAccess',
|
|
2925
|
+
if (_optionalChain([record, 'optionalAccess', _207 => _207.isSmart])) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SmartRecordSmartPanel, { recordId, caseId, onBack });
|
|
2821
2926
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SmartRecordPreviewPanel, { recordId, preview, onBack });
|
|
2822
2927
|
}
|
|
2823
2928
|
|
|
@@ -2836,7 +2941,7 @@ function useJumpToSelected(activeId, listKey) {
|
|
|
2836
2941
|
}, []);
|
|
2837
2942
|
const [state, setState] = _react.useState.call(void 0, HIDDEN);
|
|
2838
2943
|
const evaluate = _react.useCallback.call(void 0, () => {
|
|
2839
|
-
const active = _nullishCoalesce(_optionalChain([body, 'optionalAccess',
|
|
2944
|
+
const active = _nullishCoalesce(_optionalChain([body, 'optionalAccess', _208 => _208.querySelector, 'call', _209 => _209(".mr-sv__record-item--active")]), () => ( null));
|
|
2840
2945
|
if (!body || !active) {
|
|
2841
2946
|
setState((s) => s.visible ? HIDDEN : s);
|
|
2842
2947
|
return;
|
|
@@ -2864,7 +2969,7 @@ function useJumpToSelected(activeId, listKey) {
|
|
|
2864
2969
|
evaluate();
|
|
2865
2970
|
}, [evaluate, listKey]);
|
|
2866
2971
|
const jumpToSelected = _react.useCallback.call(void 0, () => {
|
|
2867
|
-
_optionalChain([body, 'optionalAccess',
|
|
2972
|
+
_optionalChain([body, 'optionalAccess', _210 => _210.querySelector, 'call', _211 => _211(".mr-sv__record-item--active"), 'optionalAccess', _212 => _212.scrollIntoView, 'call', _213 => _213({ behavior: "smooth", block: "center" })]);
|
|
2868
2973
|
}, [body]);
|
|
2869
2974
|
return {
|
|
2870
2975
|
scrollBodyRef,
|
|
@@ -2916,10 +3021,10 @@ function toCollectionFilter(filters) {
|
|
|
2916
3021
|
// src/views/hooks/smart-records/searchCollection.ts
|
|
2917
3022
|
var isRecord = (item) => "document_id" in item.data;
|
|
2918
3023
|
function recordText(data, labelOf) {
|
|
2919
|
-
return [_nullishCoalesce(_optionalChain([data, 'access',
|
|
3024
|
+
return [_nullishCoalesce(_optionalChain([data, 'access', _214 => _214.metadata, 'optionalAccess', _215 => _215.title]), () => ( "")), labelOf(_nullishCoalesce(data.document_type, () => ( ""))), ..._nullishCoalesce(_optionalChain([data, 'access', _216 => _216.metadata, 'optionalAccess', _217 => _217.tags]), () => ( []))];
|
|
2920
3025
|
}
|
|
2921
3026
|
function caseText(item) {
|
|
2922
|
-
return [_nullishCoalesce(_nullishCoalesce(item.title, () => ( _optionalChain([item, 'access',
|
|
3027
|
+
return [_nullishCoalesce(_nullishCoalesce(item.title, () => ( _optionalChain([item, 'access', _218 => _218.data, 'access', _219 => _219.item, 'optionalAccess', _220 => _220.display_name]))), () => ( ""))];
|
|
2923
3028
|
}
|
|
2924
3029
|
function searchCollection(groups, query, labelOf) {
|
|
2925
3030
|
const q = query.trim().toLowerCase();
|
|
@@ -3005,10 +3110,10 @@ function buildSidebarRows(groups, labelOf) {
|
|
|
3005
3110
|
kind: ROW_KIND.Case,
|
|
3006
3111
|
id: item.id,
|
|
3007
3112
|
date: _nullishCoalesce(newest, () => ( item.date)),
|
|
3008
|
-
title: item.title || _optionalChain([data, 'access',
|
|
3113
|
+
title: item.title || _optionalChain([data, 'access', _221 => _221.item, 'optionalAccess', _222 => _222.display_name]) || "Untitled case",
|
|
3009
3114
|
typeCode: "",
|
|
3010
3115
|
isSmart: false,
|
|
3011
|
-
caseTypeCode: _nullishCoalesce(_optionalChain([data, 'access',
|
|
3116
|
+
caseTypeCode: _nullishCoalesce(_optionalChain([data, 'access', _223 => _223.item, 'optionalAccess', _224 => _224.type]), () => ( "")),
|
|
3012
3117
|
recordCount: linked.length,
|
|
3013
3118
|
...matched2 ? { matchCount: matched2.length } : {}
|
|
3014
3119
|
};
|
|
@@ -3051,7 +3156,7 @@ function countRecordItems(groups) {
|
|
|
3051
3156
|
|
|
3052
3157
|
// src/views/hooks/smart-records/useSidebarCollection.ts
|
|
3053
3158
|
function useSidebarCollection({ limit } = {}) {
|
|
3054
|
-
const { store, labelOf } =
|
|
3159
|
+
const { store, labelOf } = _chunkNTFOVMHNjs.useSdk.call(void 0, );
|
|
3055
3160
|
const groups = _zustand.useStore.call(void 0, store, (s) => s.collection.groups);
|
|
3056
3161
|
const filters = _zustand.useStore.call(void 0, store, (s) => s.filters);
|
|
3057
3162
|
const searched = _react.useMemo.call(void 0, () => searchCollection(groups, filters.search, labelOf), [groups, filters.search, labelOf]);
|
|
@@ -3060,7 +3165,7 @@ function useSidebarCollection({ limit } = {}) {
|
|
|
3060
3165
|
return {
|
|
3061
3166
|
rows,
|
|
3062
3167
|
months,
|
|
3063
|
-
latestId: _nullishCoalesce(_optionalChain([rows, 'access',
|
|
3168
|
+
latestId: _nullishCoalesce(_optionalChain([rows, 'access', _225 => _225[0], 'optionalAccess', _226 => _226.id]), () => ( null)),
|
|
3064
3169
|
matchingRecordCount: _react.useMemo.call(void 0, () => countRecordItems(searched), [searched]),
|
|
3065
3170
|
hasActiveFilter: hasSidebarFilter(filters),
|
|
3066
3171
|
search: filters.search
|
|
@@ -3070,15 +3175,15 @@ function useSidebarCollection({ limit } = {}) {
|
|
|
3070
3175
|
// src/connection/useRecordsConnection.ts
|
|
3071
3176
|
|
|
3072
3177
|
function useRecordsConnection() {
|
|
3073
|
-
const { bid, patientId, store, labelOf } =
|
|
3178
|
+
const { bid, patientId, store, labelOf } = _chunkNTFOVMHNjs.useSdk.call(void 0, );
|
|
3074
3179
|
const toMs = (s) => s != null ? s * 1e3 : null;
|
|
3075
3180
|
const [sourceRefreshedAt, setSourceRefreshedAt] = _react.useState.call(void 0,
|
|
3076
|
-
() => toMs(
|
|
3181
|
+
() => toMs(_chunkNTFOVMHNjs.getCore.call(void 0, ).sourceRefreshedAt)
|
|
3077
3182
|
);
|
|
3078
3183
|
const loadedKeyRef = _react.useRef.call(void 0, null);
|
|
3079
3184
|
const applyItems = _react.useCallback.call(void 0,
|
|
3080
3185
|
(items) => {
|
|
3081
|
-
store.getState().records.setAll(items.map((d) =>
|
|
3186
|
+
store.getState().records.setAll(items.map((d) => _chunkNTFOVMHNjs.documentItemToUi.call(void 0, d, labelOf)));
|
|
3082
3187
|
},
|
|
3083
3188
|
[store, labelOf]
|
|
3084
3189
|
);
|
|
@@ -3086,7 +3191,7 @@ function useRecordsConnection() {
|
|
|
3086
3191
|
const records = store.getState().records;
|
|
3087
3192
|
records.setStatus("loading");
|
|
3088
3193
|
try {
|
|
3089
|
-
const fresh = await
|
|
3194
|
+
const fresh = await _chunkNTFOVMHNjs.getCore.call(void 0, ).listDocuments({
|
|
3090
3195
|
bid,
|
|
3091
3196
|
patientId,
|
|
3092
3197
|
preferenceType: "HTML",
|
|
@@ -3108,16 +3213,16 @@ function useRecordsConnection() {
|
|
|
3108
3213
|
void load();
|
|
3109
3214
|
}, [bid, patientId, load]);
|
|
3110
3215
|
_react.useEffect.call(void 0, () => {
|
|
3111
|
-
const unsubscribe =
|
|
3112
|
-
|
|
3113
|
-
void
|
|
3216
|
+
const unsubscribe = _chunkNTFOVMHNjs.getCore.call(void 0, ).subscribe("documents:changed", () => {
|
|
3217
|
+
_chunkNTFOVMHNjs.clearVitalTrendCacheForPatient.call(void 0, bid, patientId);
|
|
3218
|
+
void _chunkNTFOVMHNjs.getCore.call(void 0, ).listLocalDocuments({ bid, patientId }).then(applyItems).catch(() => {
|
|
3114
3219
|
});
|
|
3115
3220
|
});
|
|
3116
3221
|
return unsubscribe;
|
|
3117
3222
|
}, [bid, patientId, applyItems]);
|
|
3118
3223
|
const editRecord = _react.useCallback.call(void 0,
|
|
3119
3224
|
async (documentId, data) => {
|
|
3120
|
-
await
|
|
3225
|
+
await _chunkNTFOVMHNjs.getCore.call(void 0, ).editDocument({ documentId, data, bid, patientId });
|
|
3121
3226
|
},
|
|
3122
3227
|
[bid, patientId]
|
|
3123
3228
|
);
|
|
@@ -3126,7 +3231,7 @@ function useRecordsConnection() {
|
|
|
3126
3231
|
const records = store.getState().records;
|
|
3127
3232
|
records.markPending(documentId);
|
|
3128
3233
|
try {
|
|
3129
|
-
await
|
|
3234
|
+
await _chunkNTFOVMHNjs.getCore.call(void 0, ).deleteDocument({ documentId, bid, patientId });
|
|
3130
3235
|
records.remove(documentId);
|
|
3131
3236
|
records.unmarkPending(documentId);
|
|
3132
3237
|
} catch (e) {
|
|
@@ -3139,10 +3244,10 @@ function useRecordsConnection() {
|
|
|
3139
3244
|
const refresh = _react.useCallback.call(void 0, async () => {
|
|
3140
3245
|
store.getState().records.setStatus("loading");
|
|
3141
3246
|
try {
|
|
3142
|
-
const fresh = await
|
|
3143
|
-
|
|
3247
|
+
const fresh = await _chunkNTFOVMHNjs.getCore.call(void 0, ).refreshDocumentSource({ bid, patientId, preferenceType: "HTML" });
|
|
3248
|
+
_chunkNTFOVMHNjs.clearVitalTrendCacheForPatient.call(void 0, bid, patientId);
|
|
3144
3249
|
if (fresh.length > 0) applyItems(fresh);
|
|
3145
|
-
setSourceRefreshedAt(toMs(
|
|
3250
|
+
setSourceRefreshedAt(toMs(_chunkNTFOVMHNjs.getCore.call(void 0, ).sourceRefreshedAt));
|
|
3146
3251
|
store.getState().records.setStatus("fresh");
|
|
3147
3252
|
} catch (e5) {
|
|
3148
3253
|
store.getState().records.setStatus("stale");
|
|
@@ -3167,7 +3272,7 @@ function useRecordsConnection() {
|
|
|
3167
3272
|
|
|
3168
3273
|
|
|
3169
3274
|
function useCollectionConnection(enabled = true) {
|
|
3170
|
-
const { bid, patientId, store } =
|
|
3275
|
+
const { bid, patientId, store } = _chunkNTFOVMHNjs.useSdk.call(void 0, );
|
|
3171
3276
|
const loadedKeyRef = _react.useRef.call(void 0, null);
|
|
3172
3277
|
const types = _zustand.useStore.call(void 0, store, (s) => s.filters.types);
|
|
3173
3278
|
const documentDateFrom = _zustand.useStore.call(void 0, store, (s) => s.filters.documentDateFrom);
|
|
@@ -3182,17 +3287,15 @@ function useCollectionConnection(enabled = true) {
|
|
|
3182
3287
|
const collection = store.getState().collection;
|
|
3183
3288
|
collection.setStatus("loading");
|
|
3184
3289
|
try {
|
|
3185
|
-
const fresh = await
|
|
3290
|
+
const fresh = await _chunkNTFOVMHNjs.getCore.call(void 0, ).groupCollectionItems({
|
|
3186
3291
|
bid,
|
|
3187
3292
|
patientId,
|
|
3188
3293
|
filter: filterRef.current,
|
|
3189
3294
|
onStale: (cached) => {
|
|
3190
|
-
console.log("[mr-ui] groupCollectionItems stale", { bid, patientId, filter: filterRef.current, groups: cached });
|
|
3191
3295
|
apply(cached);
|
|
3192
3296
|
store.getState().collection.setStatus("stale");
|
|
3193
3297
|
}
|
|
3194
3298
|
});
|
|
3195
|
-
console.log("[mr-ui] groupCollectionItems fresh", { bid, patientId, filter: filterRef.current, groups: fresh });
|
|
3196
3299
|
apply(fresh);
|
|
3197
3300
|
store.getState().collection.setStatus("fresh");
|
|
3198
3301
|
} catch (e) {
|
|
@@ -3200,10 +3303,7 @@ function useCollectionConnection(enabled = true) {
|
|
|
3200
3303
|
}
|
|
3201
3304
|
}, [bid, patientId, store, apply]);
|
|
3202
3305
|
const reload = _react.useCallback.call(void 0, () => {
|
|
3203
|
-
void
|
|
3204
|
-
console.log("[mr-ui] groupCollectionItems localOnly", { bid, patientId, filter: filterRef.current, groups });
|
|
3205
|
-
apply(groups);
|
|
3206
|
-
}).catch(() => {
|
|
3306
|
+
void _chunkNTFOVMHNjs.getCore.call(void 0, ).groupCollectionItems({ bid, patientId, localOnly: true, filter: filterRef.current }).then(apply).catch(() => {
|
|
3207
3307
|
});
|
|
3208
3308
|
}, [bid, patientId, apply]);
|
|
3209
3309
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3224,8 +3324,8 @@ function useCollectionConnection(enabled = true) {
|
|
|
3224
3324
|
}, [enabled, types, documentDateFrom, documentDateTo, reload]);
|
|
3225
3325
|
_react.useEffect.call(void 0, () => {
|
|
3226
3326
|
if (!enabled) return;
|
|
3227
|
-
const unsubscribeDocs =
|
|
3228
|
-
const unsubscribeCases =
|
|
3327
|
+
const unsubscribeDocs = _chunkNTFOVMHNjs.getCore.call(void 0, ).subscribe("documents:changed", reload);
|
|
3328
|
+
const unsubscribeCases = _chunkNTFOVMHNjs.getCore.call(void 0, ).subscribe("cases:changed", reload);
|
|
3229
3329
|
return () => {
|
|
3230
3330
|
unsubscribeDocs();
|
|
3231
3331
|
unsubscribeCases();
|
|
@@ -3241,21 +3341,21 @@ function resolveContentType(file) {
|
|
|
3241
3341
|
if (t === "image/jpeg" || t === "image/jpg" || t === "image/png" || t === "application/pdf") {
|
|
3242
3342
|
return t;
|
|
3243
3343
|
}
|
|
3244
|
-
const ext = _optionalChain([file, 'access',
|
|
3344
|
+
const ext = _optionalChain([file, 'access', _227 => _227.name, 'access', _228 => _228.split, 'call', _229 => _229("."), 'access', _230 => _230.pop, 'call', _231 => _231(), 'optionalAccess', _232 => _232.toLowerCase, 'call', _233 => _233()]);
|
|
3245
3345
|
if (ext === "pdf") return "application/pdf";
|
|
3246
3346
|
if (ext === "png") return "image/png";
|
|
3247
3347
|
if (ext === "jpg" || ext === "jpeg") return "image/jpeg";
|
|
3248
3348
|
return "application/pdf";
|
|
3249
3349
|
}
|
|
3250
3350
|
function useUploadConnection() {
|
|
3251
|
-
const { bid, patientId, store } =
|
|
3351
|
+
const { bid, patientId, store } = _chunkNTFOVMHNjs.useSdk.call(void 0, );
|
|
3252
3352
|
const seq = _react.useRef.call(void 0, 0);
|
|
3253
3353
|
const upload = _react.useCallback.call(void 0,
|
|
3254
3354
|
async (items) => {
|
|
3255
3355
|
if (items.length === 0) return;
|
|
3256
3356
|
const localIds = items.map(({ file }) => {
|
|
3257
3357
|
const id = `upload-${seq.current += 1}-${file.name}`;
|
|
3258
|
-
store.getState().uploadQueue.add(
|
|
3358
|
+
store.getState().uploadQueue.add(_chunkNTFOVMHNjs.fileToQueueItem.call(void 0, id, file));
|
|
3259
3359
|
return id;
|
|
3260
3360
|
});
|
|
3261
3361
|
const batchRequests = items.map((it) => ({
|
|
@@ -3272,7 +3372,7 @@ function useUploadConnection() {
|
|
|
3272
3372
|
}));
|
|
3273
3373
|
localIds.forEach((id) => store.getState().uploadQueue.updateProgress(id, 0));
|
|
3274
3374
|
try {
|
|
3275
|
-
const res = await
|
|
3375
|
+
const res = await _chunkNTFOVMHNjs.getCore.call(void 0, ).addDocument({
|
|
3276
3376
|
batchRequests,
|
|
3277
3377
|
files: items.map((it) => [it.file]),
|
|
3278
3378
|
filenames: items.map((it) => [it.file.name]),
|
|
@@ -3280,12 +3380,12 @@ function useUploadConnection() {
|
|
|
3280
3380
|
patientId
|
|
3281
3381
|
});
|
|
3282
3382
|
const queue2 = store.getState().uploadQueue;
|
|
3283
|
-
if (res.message === "queued_offline" || !_optionalChain([res, 'access',
|
|
3383
|
+
if (res.message === "queued_offline" || !_optionalChain([res, 'access', _234 => _234.batch_response, 'optionalAccess', _235 => _235.length])) {
|
|
3284
3384
|
throw new Error("No internet connection. Your upload will retry automatically when you're back online.");
|
|
3285
3385
|
}
|
|
3286
3386
|
localIds.forEach((id, i) => {
|
|
3287
|
-
const documentId = _nullishCoalesce(_optionalChain([res, 'access',
|
|
3288
|
-
const errorDetails = _optionalChain([res, 'access',
|
|
3387
|
+
const documentId = _nullishCoalesce(_optionalChain([res, 'access', _236 => _236.batch_response, 'optionalAccess', _237 => _237[i], 'optionalAccess', _238 => _238.document_id]), () => ( ""));
|
|
3388
|
+
const errorDetails = _optionalChain([res, 'access', _239 => _239.batch_response, 'optionalAccess', _240 => _240[i], 'optionalAccess', _241 => _241.error_details]);
|
|
3289
3389
|
if (errorDetails) {
|
|
3290
3390
|
queue2.markFailed(id);
|
|
3291
3391
|
} else {
|
|
@@ -3309,7 +3409,7 @@ function useUploadConnection() {
|
|
|
3309
3409
|
|
|
3310
3410
|
function useLogout() {
|
|
3311
3411
|
return _react.useCallback.call(void 0, () => {
|
|
3312
|
-
|
|
3412
|
+
_chunkNTFOVMHNjs.teardownWorkerClient.call(void 0, );
|
|
3313
3413
|
}, []);
|
|
3314
3414
|
}
|
|
3315
3415
|
|
|
@@ -3394,31 +3494,31 @@ function useFilteredRecordIds(store) {
|
|
|
3394
3494
|
|
|
3395
3495
|
// src/connection/useRecordSelectors.ts
|
|
3396
3496
|
function useRecordById2(id) {
|
|
3397
|
-
return useRecordById(
|
|
3497
|
+
return useRecordById(_chunkNTFOVMHNjs.useSdk.call(void 0, ).store, id);
|
|
3398
3498
|
}
|
|
3399
3499
|
function useRecordIdRange2(start, end) {
|
|
3400
|
-
return useRecordIdRange(
|
|
3500
|
+
return useRecordIdRange(_chunkNTFOVMHNjs.useSdk.call(void 0, ).store, start, end);
|
|
3401
3501
|
}
|
|
3402
3502
|
function useRecordsCount2() {
|
|
3403
|
-
return useRecordsCount(
|
|
3503
|
+
return useRecordsCount(_chunkNTFOVMHNjs.useSdk.call(void 0, ).store);
|
|
3404
3504
|
}
|
|
3405
3505
|
function useRecordsStatus2() {
|
|
3406
|
-
return useRecordsStatus(
|
|
3506
|
+
return useRecordsStatus(_chunkNTFOVMHNjs.useSdk.call(void 0, ).store);
|
|
3407
3507
|
}
|
|
3408
3508
|
function useIsSelected2(id) {
|
|
3409
|
-
return useIsSelected(
|
|
3509
|
+
return useIsSelected(_chunkNTFOVMHNjs.useSdk.call(void 0, ).store, id);
|
|
3410
3510
|
}
|
|
3411
3511
|
function useCaseById2(id) {
|
|
3412
|
-
return useCaseById(
|
|
3512
|
+
return useCaseById(_chunkNTFOVMHNjs.useSdk.call(void 0, ).store, id);
|
|
3413
3513
|
}
|
|
3414
3514
|
function useCaseIds2() {
|
|
3415
|
-
return useCaseIds(
|
|
3515
|
+
return useCaseIds(_chunkNTFOVMHNjs.useSdk.call(void 0, ).store);
|
|
3416
3516
|
}
|
|
3417
3517
|
function useCasesStatus2() {
|
|
3418
|
-
return useCasesStatus(
|
|
3518
|
+
return useCasesStatus(_chunkNTFOVMHNjs.useSdk.call(void 0, ).store);
|
|
3419
3519
|
}
|
|
3420
3520
|
function useFilteredRecordIds2() {
|
|
3421
|
-
return useFilteredRecordIds(
|
|
3521
|
+
return useFilteredRecordIds(_chunkNTFOVMHNjs.useSdk.call(void 0, ).store);
|
|
3422
3522
|
}
|
|
3423
3523
|
|
|
3424
3524
|
// src/views/containers/smart-records/components/SidebarCaseItem.tsx
|
|
@@ -3428,7 +3528,7 @@ function useFilteredRecordIds2() {
|
|
|
3428
3528
|
|
|
3429
3529
|
|
|
3430
3530
|
var HighlightedText = _react.memo.call(void 0, function HighlightedText2({ text, query }) {
|
|
3431
|
-
const q = _nullishCoalesce(_optionalChain([query, 'optionalAccess',
|
|
3531
|
+
const q = _nullishCoalesce(_optionalChain([query, 'optionalAccess', _242 => _242.trim, 'call', _243 => _243(), 'access', _244 => _244.toLowerCase, 'call', _245 => _245()]), () => ( ""));
|
|
3432
3532
|
const start = q ? text.toLowerCase().indexOf(q) : -1;
|
|
3433
3533
|
if (start < 0) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: text });
|
|
3434
3534
|
const end = start + q.length;
|
|
@@ -3467,7 +3567,7 @@ var SidebarCaseItem = _react.memo.call(void 0, function SidebarCaseItem2({
|
|
|
3467
3567
|
);
|
|
3468
3568
|
const isEmpty = count === 0;
|
|
3469
3569
|
const countLabel = `${count} record${count !== 1 ? "s" : ""}`;
|
|
3470
|
-
const subline = isEmpty ? "No records available" : matchCount !== void 0 ? `${matchCount} of ${countLabel} match` : dateEpoch ? `Updated ${
|
|
3570
|
+
const subline = isEmpty ? "No records available" : matchCount !== void 0 ? `${matchCount} of ${countLabel} match` : dateEpoch ? `Updated ${_chunkNTFOVMHNjs.epochToDisplay.call(void 0, dateEpoch)} \xB7 ${countLabel}` : countLabel;
|
|
3471
3571
|
const interactive = isEmpty ? { "aria-disabled": true } : { role: "button", tabIndex: 0, "aria-selected": isActive, onClick: handleClick, onKeyDown: handleKeyDown };
|
|
3472
3572
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3473
3573
|
"div",
|
|
@@ -3537,7 +3637,7 @@ var SidebarRecordRow = _react.memo.call(void 0, function SidebarRecordRow2({
|
|
|
3537
3637
|
onClick: handleClick,
|
|
3538
3638
|
onKeyDown: handleKeyDown,
|
|
3539
3639
|
children: [
|
|
3540
|
-
dateEpoch !== null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3640
|
+
dateEpoch !== null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.DateTile_default, { epoch: dateEpoch, sub: "month" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-date-tile", "aria-hidden": true }),
|
|
3541
3641
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-sv__record-text", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "mr-sv__record-row-title", children: [
|
|
3542
3642
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "mr-sv__record-row-name", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HighlightedText, { text: title, query: highlight }) }),
|
|
3543
3643
|
isSmart && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SmartStar, {}),
|
|
@@ -3597,7 +3697,7 @@ var SidebarSearchField = _react.memo.call(void 0, function SidebarSearchField2({
|
|
|
3597
3697
|
function summarize(options, value) {
|
|
3598
3698
|
if (value.length === 0) return "All";
|
|
3599
3699
|
if (value.length > 2) return `${value.length} types`;
|
|
3600
|
-
return value.map((id) => _nullishCoalesce(_optionalChain([options, 'access',
|
|
3700
|
+
return value.map((id) => _nullishCoalesce(_optionalChain([options, 'access', _246 => _246.find, 'call', _247 => _247((o) => o.id === id), 'optionalAccess', _248 => _248.display_name]), () => ( id))).join(", ");
|
|
3601
3701
|
}
|
|
3602
3702
|
function SidebarTypeSelect({ options, value, onChange }) {
|
|
3603
3703
|
const [open, setOpen] = _react.useState.call(void 0, false);
|
|
@@ -3606,7 +3706,7 @@ function SidebarTypeSelect({ options, value, onChange }) {
|
|
|
3606
3706
|
_react.useEffect.call(void 0, () => {
|
|
3607
3707
|
if (!open) return;
|
|
3608
3708
|
const onMouseDown = (e) => {
|
|
3609
|
-
if (!_optionalChain([rootRef, 'access',
|
|
3709
|
+
if (!_optionalChain([rootRef, 'access', _249 => _249.current, 'optionalAccess', _250 => _250.contains, 'call', _251 => _251(e.target)])) setOpen(false);
|
|
3610
3710
|
};
|
|
3611
3711
|
document.addEventListener("mousedown", onMouseDown);
|
|
3612
3712
|
return () => document.removeEventListener("mousedown", onMouseDown);
|
|
@@ -3670,17 +3770,17 @@ function SidebarTypeSelect({ options, value, onChange }) {
|
|
|
3670
3770
|
|
|
3671
3771
|
var EMPTY_DRAFT = { preset: "anytime", from: "", to: "", types: [] };
|
|
3672
3772
|
function SidebarFilterPopover({ containerRef, onClose }) {
|
|
3673
|
-
const { store, documentTypes } =
|
|
3773
|
+
const { store, documentTypes } = _chunkNTFOVMHNjs.useSdk.call(void 0, );
|
|
3674
3774
|
const applied = _zustand.useStore.call(void 0, store, (s) => s.filters);
|
|
3675
3775
|
const [draft, setDraft] = _react.useState.call(void 0, () => ({
|
|
3676
3776
|
preset: applied.documentDatePreset,
|
|
3677
|
-
from: applied.documentDatePreset === "custom" ?
|
|
3678
|
-
to: applied.documentDatePreset === "custom" ?
|
|
3777
|
+
from: applied.documentDatePreset === "custom" ? _chunkNTFOVMHNjs.epochToDateInput.call(void 0, applied.documentDateFrom) : "",
|
|
3778
|
+
to: applied.documentDatePreset === "custom" ? _chunkNTFOVMHNjs.epochToDateInput.call(void 0, applied.documentDateTo) : "",
|
|
3679
3779
|
types: applied.types
|
|
3680
3780
|
}));
|
|
3681
3781
|
_react.useEffect.call(void 0, () => {
|
|
3682
3782
|
const handler = (e) => {
|
|
3683
|
-
if (_optionalChain([containerRef, 'access',
|
|
3783
|
+
if (_optionalChain([containerRef, 'access', _252 => _252.current, 'optionalAccess', _253 => _253.contains, 'call', _254 => _254(e.target)])) return;
|
|
3684
3784
|
onClose();
|
|
3685
3785
|
};
|
|
3686
3786
|
document.addEventListener("mousedown", handler);
|
|
@@ -3695,8 +3795,8 @@ function SidebarFilterPopover({ containerRef, onClose }) {
|
|
|
3695
3795
|
const handleTypes = _react.useCallback.call(void 0, (types) => setDraft((d) => ({ ...d, types })), []);
|
|
3696
3796
|
const handleClearAll = _react.useCallback.call(void 0, () => setDraft(EMPTY_DRAFT), []);
|
|
3697
3797
|
const handleApply = _react.useCallback.call(void 0, () => {
|
|
3698
|
-
const customTo =
|
|
3699
|
-
const range = draft.preset === "custom" ? { from:
|
|
3798
|
+
const customTo = _chunkNTFOVMHNjs.dateInputToEpoch.call(void 0, draft.to);
|
|
3799
|
+
const range = draft.preset === "custom" ? { from: _chunkNTFOVMHNjs.dateInputToEpoch.call(void 0, draft.from), to: customTo === null ? null : _chunkNTFOVMHNjs.endOfDay.call(void 0, customTo) } : _chunkNTFOVMHNjs.presetRange.call(void 0, draft.preset);
|
|
3700
3800
|
store.getState().filters.applyPopoverFilters({
|
|
3701
3801
|
documentDateFrom: range.from,
|
|
3702
3802
|
documentDateTo: range.to,
|
|
@@ -3712,25 +3812,25 @@ function SidebarFilterPopover({ containerRef, onClose }) {
|
|
|
3712
3812
|
}, [draft, store, onClose]);
|
|
3713
3813
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__filter-popover", role: "dialog", "aria-label": "Filter", children: [
|
|
3714
3814
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__filter-head", children: [
|
|
3715
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3815
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "label", as: "span", children: "Filter" }),
|
|
3716
3816
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "mr-sv__ghost-link-btn", onClick: handleClearAll, children: "Clear all" })
|
|
3717
3817
|
] }),
|
|
3718
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3719
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-sv__filter-presets", children:
|
|
3818
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "eyebrow", className: "mr-sv__filter-label", children: "Date" }),
|
|
3819
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-sv__filter-presets", children: _chunkNTFOVMHNjs.DATE_PRESET_OPTIONS.map((o) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "label", { className: "mr-sv__filter-preset", children: [
|
|
3720
3820
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { type: "radio", name: "mr-sv-date-preset", value: o.value, checked: draft.preset === o.value, onChange: handlePreset }),
|
|
3721
3821
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: o.label })
|
|
3722
3822
|
] }, o.value)) }),
|
|
3723
3823
|
draft.preset === "custom" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__filter-range", children: [
|
|
3724
3824
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__filter-range-field", children: [
|
|
3725
3825
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "mr-sv__filter-to", children: "From" }),
|
|
3726
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3826
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.DateField_default, { label: "From", value: draft.from, max: draft.to || void 0, onChange: handleFrom })
|
|
3727
3827
|
] }),
|
|
3728
3828
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__filter-range-field", children: [
|
|
3729
3829
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "mr-sv__filter-to", children: "To" }),
|
|
3730
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3830
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.DateField_default, { label: "To", value: draft.to, min: draft.from || void 0, onChange: handleTo })
|
|
3731
3831
|
] })
|
|
3732
3832
|
] }),
|
|
3733
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3833
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "eyebrow", className: "mr-sv__filter-label", children: "Type" }),
|
|
3734
3834
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, SidebarTypeSelect, { options: documentTypes, value: draft.types, onChange: handleTypes }),
|
|
3735
3835
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__filter-actions", children: [
|
|
3736
3836
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "mr-sv__filter-cancel", onClick: onClose, children: "Cancel" }),
|
|
@@ -3745,10 +3845,10 @@ function SidebarFilterPopover({ containerRef, onClose }) {
|
|
|
3745
3845
|
|
|
3746
3846
|
|
|
3747
3847
|
var SidebarFilterChips = _react.memo.call(void 0, function SidebarFilterChips2({ count }) {
|
|
3748
|
-
const { store, labelOf } =
|
|
3848
|
+
const { store, labelOf } = _chunkNTFOVMHNjs.useSdk.call(void 0, );
|
|
3749
3849
|
const filters = _zustand.useStore.call(void 0, store, (s) => s.filters);
|
|
3750
3850
|
const hasDate = filters.documentDateFrom != null || filters.documentDateTo != null;
|
|
3751
|
-
const dateLabel = filters.documentDatePreset === "custom" ?
|
|
3851
|
+
const dateLabel = filters.documentDatePreset === "custom" ? _chunkNTFOVMHNjs.customRangeLabel.call(void 0, filters.documentDateFrom, filters.documentDateTo) : _chunkNTFOVMHNjs.presetLabel.call(void 0, filters.documentDatePreset);
|
|
3752
3852
|
const write = _react.useCallback.call(void 0,
|
|
3753
3853
|
(patch) => {
|
|
3754
3854
|
const f = store.getState().filters;
|
|
@@ -3809,8 +3909,8 @@ var SmartRecordsSidebar = _react.memo.call(void 0, function SmartRecordsSidebar2
|
|
|
3809
3909
|
onRefresh,
|
|
3810
3910
|
isRefreshing
|
|
3811
3911
|
}) {
|
|
3812
|
-
const { store } =
|
|
3813
|
-
const { selectRecord } =
|
|
3912
|
+
const { store } = _chunkNTFOVMHNjs.useSdk.call(void 0, );
|
|
3913
|
+
const { selectRecord } = _chunkVA2ZDYP2js.useSmartRecordsActions.call(void 0, );
|
|
3814
3914
|
const collectionStatus = _zustand.useStore.call(void 0, store, (s) => s.collection.status);
|
|
3815
3915
|
const filterTypes = _zustand.useStore.call(void 0, store, (s) => s.filters.types);
|
|
3816
3916
|
const filterFrom = _zustand.useStore.call(void 0, store, (s) => s.filters.documentDateFrom);
|
|
@@ -3913,7 +4013,7 @@ var SmartRecordsSidebar = _react.memo.call(void 0, function SmartRecordsSidebar2
|
|
|
3913
4013
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "mr-sv__ghost-link-btn", onClick: clearFilters, children: "Clear filters" })
|
|
3914
4014
|
] });
|
|
3915
4015
|
}
|
|
3916
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4016
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "muted", className: "mr-sv__sidebar-empty", children: "No records yet." });
|
|
3917
4017
|
};
|
|
3918
4018
|
const renderSkeleton = () => SKELETON_ROWS.map((i) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__list-skeleton", "aria-hidden": true, children: [
|
|
3919
4019
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-sv__list-skeleton-date" }),
|
|
@@ -3962,10 +4062,10 @@ var SmartRecordsSidebar = _react.memo.call(void 0, function SmartRecordsSidebar2
|
|
|
3962
4062
|
|
|
3963
4063
|
function CareContextEmptyState({ noCareContext }) {
|
|
3964
4064
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__empty", children: [
|
|
3965
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4065
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.EmptyIllustration, {}),
|
|
3966
4066
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mr-sv__empty-text", children: [
|
|
3967
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3968
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4067
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "heading", as: "h2", children: noCareContext ? "Select a record" : "Select a care context" }),
|
|
4068
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.Typography_default, { variant: "muted", children: noCareContext ? "Pick a record on the left, or use the search bar to find one." : "Pick a record on the left to see its vitals or use the search bar." })
|
|
3969
4069
|
] })
|
|
3970
4070
|
] });
|
|
3971
4071
|
}
|
|
@@ -3974,12 +4074,12 @@ function CareContextEmptyState({ noCareContext }) {
|
|
|
3974
4074
|
|
|
3975
4075
|
|
|
3976
4076
|
var VitalHistoryPanel2 = _react.lazy.call(void 0,
|
|
3977
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./VitalHistoryPanel-
|
|
4077
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./VitalHistoryPanel-L43PLXTX.js"))).then((m) => ({
|
|
3978
4078
|
default: m.VitalHistoryPanel
|
|
3979
4079
|
}))
|
|
3980
4080
|
);
|
|
3981
4081
|
var OriginalRecordPanel = _react.lazy.call(void 0,
|
|
3982
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./OriginalRecordPanel-
|
|
4082
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./OriginalRecordPanel-PCFL4KRH.js"))).then((m) => ({
|
|
3983
4083
|
default: m.OriginalRecordPanel
|
|
3984
4084
|
}))
|
|
3985
4085
|
);
|
|
@@ -3988,7 +4088,7 @@ var MainPanel = _react.memo.call(void 0, function MainPanel2({
|
|
|
3988
4088
|
canGoBack,
|
|
3989
4089
|
onBack
|
|
3990
4090
|
}) {
|
|
3991
|
-
if (mainView.kind === "empty") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4091
|
+
if (mainView.kind === "empty") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.EmptyState, {});
|
|
3992
4092
|
if (mainView.kind === "smart")
|
|
3993
4093
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, RecordPanel, { recordId: mainView.recordId, caseId: mainView.caseId, onBack: canGoBack ? onBack : void 0 });
|
|
3994
4094
|
if (mainView.kind === "preview")
|
|
@@ -4011,10 +4111,10 @@ var MainPanel = _react.memo.call(void 0, function MainPanel2({
|
|
|
4011
4111
|
// src/views/SmartRecordsView/SmartRecordsView.tsx
|
|
4012
4112
|
|
|
4013
4113
|
var DeleteConfirmModal = _react.lazy.call(void 0,
|
|
4014
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./widgets-
|
|
4114
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./widgets-J6JCO5NX.js"))).then((m) => ({ default: m.DeleteConfirmModal }))
|
|
4015
4115
|
);
|
|
4016
4116
|
var SmartUploadModal2 = _react.lazy.call(void 0,
|
|
4017
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./SmartUploadModal-
|
|
4117
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./SmartUploadModal-3P2GAWXM.js"))).then((m) => ({
|
|
4018
4118
|
default: m.SmartUploadModal
|
|
4019
4119
|
}))
|
|
4020
4120
|
);
|
|
@@ -4036,7 +4136,8 @@ function SmartRecordsViewInner({
|
|
|
4036
4136
|
onCopyVitalsToNote,
|
|
4037
4137
|
onToast,
|
|
4038
4138
|
onViewChange,
|
|
4039
|
-
hideOpenInNewTab = false
|
|
4139
|
+
hideOpenInNewTab = false,
|
|
4140
|
+
renderScribeDocument
|
|
4040
4141
|
}) {
|
|
4041
4142
|
const {
|
|
4042
4143
|
mainView,
|
|
@@ -4054,44 +4155,54 @@ function SmartRecordsViewInner({
|
|
|
4054
4155
|
cancelDelete
|
|
4055
4156
|
} = useSmartRecordsView({ onViewOriginalRecord, onDeleteRecord });
|
|
4056
4157
|
const { refresh, deleteRecord } = useRecordsConnection();
|
|
4057
|
-
|
|
4158
|
+
_chunkNTFOVMHNjs.useCasesConnection.call(void 0, );
|
|
4058
4159
|
const { refresh: refreshCollection } = useCollectionConnection();
|
|
4059
|
-
const { store, labelOf } =
|
|
4160
|
+
const { store, labelOf } = _chunkNTFOVMHNjs.useSdk.call(void 0, );
|
|
4060
4161
|
const { upload } = useUploadConnection();
|
|
4061
4162
|
const recordsStatus = _zustand.useStore.call(void 0, store, (s) => s.records.status);
|
|
4062
4163
|
const recordsCount = _zustand.useStore.call(void 0, store, (s) => s.records.ids.length);
|
|
4063
4164
|
const casesCount = _zustand.useStore.call(void 0, store, (s) => s.cases.ids.length);
|
|
4064
4165
|
const collectionStatus = _zustand.useStore.call(void 0, store, (s) => s.collection.status);
|
|
4166
|
+
const collectionItemCount = _zustand.useStore.call(void 0,
|
|
4167
|
+
store,
|
|
4168
|
+
(s) => s.collection.groups.reduce((count, group) => count + group.items.length, 0)
|
|
4169
|
+
);
|
|
4065
4170
|
const rootRef = _react.useRef.call(void 0, null);
|
|
4066
4171
|
const onCopyToNoteRef = _react.useRef.call(void 0, onCopyToNote);
|
|
4067
4172
|
const onCopyVitalsToNoteRef = _react.useRef.call(void 0, onCopyVitalsToNote);
|
|
4068
4173
|
const onAddToContextRef = _react.useRef.call(void 0, onAddToContext);
|
|
4069
4174
|
const onToastRef = _react.useRef.call(void 0, onToast);
|
|
4070
4175
|
const onViewChangeRef = _react.useRef.call(void 0, onViewChange);
|
|
4176
|
+
const renderScribeDocumentRef = _react.useRef.call(void 0, renderScribeDocument);
|
|
4071
4177
|
onCopyToNoteRef.current = onCopyToNote;
|
|
4072
4178
|
onCopyVitalsToNoteRef.current = onCopyVitalsToNote;
|
|
4073
4179
|
onAddToContextRef.current = onAddToContext;
|
|
4074
4180
|
onToastRef.current = onToast;
|
|
4075
4181
|
onViewChangeRef.current = onViewChange;
|
|
4182
|
+
renderScribeDocumentRef.current = renderScribeDocument;
|
|
4076
4183
|
_react.useEffect.call(void 0, () => {
|
|
4077
|
-
_optionalChain([onViewChangeRef, 'access',
|
|
4184
|
+
_optionalChain([onViewChangeRef, 'access', _255 => _255.current, 'optionalCall', _256 => _256(mainView)]);
|
|
4078
4185
|
}, [mainView]);
|
|
4079
4186
|
const [selectedCaseId, setSelectedCaseId] = _react.useState.call(void 0, null);
|
|
4080
4187
|
const [uploadOpen, setUploadOpen] = _react.useState.call(void 0, false);
|
|
4081
4188
|
const stableCopyToNote = _react.useCallback.call(void 0,
|
|
4082
|
-
(text, anchor, vitalsRows) => _optionalChain([onCopyToNoteRef, 'access',
|
|
4189
|
+
(text, anchor, vitalsRows) => _optionalChain([onCopyToNoteRef, 'access', _257 => _257.current, 'optionalCall', _258 => _258(text, anchor, vitalsRows)]),
|
|
4083
4190
|
[]
|
|
4084
4191
|
);
|
|
4085
4192
|
const stableCopyVitalsToNote = _react.useCallback.call(void 0,
|
|
4086
|
-
(text) => _optionalChain([onCopyVitalsToNoteRef, 'access',
|
|
4193
|
+
(text) => _optionalChain([onCopyVitalsToNoteRef, 'access', _259 => _259.current, 'optionalCall', _260 => _260(text)]),
|
|
4087
4194
|
[]
|
|
4088
4195
|
);
|
|
4089
4196
|
const stableToast = _react.useCallback.call(void 0,
|
|
4090
|
-
(message, type) => _optionalChain([onToastRef, 'access',
|
|
4197
|
+
(message, type) => _optionalChain([onToastRef, 'access', _261 => _261.current, 'optionalCall', _262 => _262(message, type)]),
|
|
4198
|
+
[]
|
|
4199
|
+
);
|
|
4200
|
+
const stableRenderScribeDocument = _react.useCallback.call(void 0,
|
|
4201
|
+
(args) => _nullishCoalesce(_optionalChain([renderScribeDocumentRef, 'access', _263 => _263.current, 'optionalCall', _264 => _264(args)]), () => ( null)),
|
|
4091
4202
|
[]
|
|
4092
4203
|
);
|
|
4093
4204
|
const attachToContext = _react.useCallback.call(void 0, (documentId, name, visitId) => {
|
|
4094
|
-
void _optionalChain([onAddToContextRef, 'access',
|
|
4205
|
+
void _optionalChain([onAddToContextRef, 'access', _265 => _265.current, 'optionalCall', _266 => _266([visitId ? { documentId, name, visitId } : { documentId, name }])]);
|
|
4095
4206
|
}, []);
|
|
4096
4207
|
const handleSelectCase = _react.useCallback.call(void 0,
|
|
4097
4208
|
(caseId) => {
|
|
@@ -4110,7 +4221,7 @@ function SmartRecordsViewInner({
|
|
|
4110
4221
|
}, [refresh, refreshCollection]);
|
|
4111
4222
|
const didInitRef = _react.useRef.call(void 0, false);
|
|
4112
4223
|
_react.useEffect.call(void 0, () => {
|
|
4113
|
-
if (didInitRef.current || recordsCount === 0) return;
|
|
4224
|
+
if (didInitRef.current || recordsCount === 0 || collectionItemCount === 0) return;
|
|
4114
4225
|
if (collectionStatus === "idle" || collectionStatus === "loading") return;
|
|
4115
4226
|
const first = newestSidebarRow(store.getState(), labelOf);
|
|
4116
4227
|
if (!first) return;
|
|
@@ -4120,7 +4231,7 @@ function SmartRecordsViewInner({
|
|
|
4120
4231
|
} else {
|
|
4121
4232
|
selectRecord(first.id, first.isSmart);
|
|
4122
4233
|
}
|
|
4123
|
-
}, [recordsCount, store, labelOf, handleSelectCase, selectRecord, collectionStatus]);
|
|
4234
|
+
}, [recordsCount, collectionItemCount, store, labelOf, handleSelectCase, selectRecord, collectionStatus]);
|
|
4124
4235
|
const openUpload = _react.useCallback.call(void 0, () => setUploadOpen(true), []);
|
|
4125
4236
|
const closeUpload = _react.useCallback.call(void 0, () => setUploadOpen(false), []);
|
|
4126
4237
|
const handleConfirmDelete = _react.useCallback.call(void 0, async () => {
|
|
@@ -4152,6 +4263,7 @@ function SmartRecordsViewInner({
|
|
|
4152
4263
|
[onUploadFiles, upload]
|
|
4153
4264
|
);
|
|
4154
4265
|
const hasCopyToNote = !!onCopyToNote;
|
|
4266
|
+
const hasScribeRenderer = !!renderScribeDocument;
|
|
4155
4267
|
const rootClass = `mr-sv${className ? ` ${className}` : ""}`;
|
|
4156
4268
|
const hideSidebar = mainView.kind === "original";
|
|
4157
4269
|
const actions = _react.useMemo.call(void 0,
|
|
@@ -4168,9 +4280,12 @@ function SmartRecordsViewInner({
|
|
|
4168
4280
|
back,
|
|
4169
4281
|
attachToContext: onAddToContext ? attachToContext : void 0,
|
|
4170
4282
|
requestDelete,
|
|
4171
|
-
onToast: stableToast
|
|
4283
|
+
onToast: stableToast,
|
|
4284
|
+
renderScribeDocument: hasScribeRenderer ? stableRenderScribeDocument : void 0
|
|
4172
4285
|
}),
|
|
4173
4286
|
[
|
|
4287
|
+
hasScribeRenderer,
|
|
4288
|
+
stableRenderScribeDocument,
|
|
4174
4289
|
stableCopyToNote,
|
|
4175
4290
|
hasCopyToNote,
|
|
4176
4291
|
hideOpenInNewTab,
|
|
@@ -4189,13 +4304,13 @@ function SmartRecordsViewInner({
|
|
|
4189
4304
|
]
|
|
4190
4305
|
);
|
|
4191
4306
|
if ((recordsStatus === "idle" || recordsStatus === "loading" || recordsStatus === "stale") && recordsCount === 0)
|
|
4192
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: rootClass, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4307
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: rootClass, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.RecordsLoadingState, { patientName }) });
|
|
4193
4308
|
if (recordsCount === 0)
|
|
4194
4309
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: rootClass, children: [
|
|
4195
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4310
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNTFOVMHNjs.NoRecordsState, { onUpload: allowUpload ? openUpload : void 0 }),
|
|
4196
4311
|
uploadOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Suspense, { fallback: null, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SmartUploadModal2, { onUpload: handleUpload, onClose: closeUpload }) })
|
|
4197
4312
|
] });
|
|
4198
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4313
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVA2ZDYP2js.SmartRecordsActionsContext.Provider, { value: actions, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { ref: rootRef, className: rootClass, children: [
|
|
4199
4314
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-sv__body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mr-sv__card", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4200
4315
|
!hideSidebar && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4201
4316
|
SmartRecordsSidebar,
|
|
@@ -4261,5 +4376,6 @@ function SmartRecordsViewInner({
|
|
|
4261
4376
|
|
|
4262
4377
|
|
|
4263
4378
|
|
|
4264
|
-
|
|
4379
|
+
|
|
4380
|
+
exports.Badge = _chunkNTFOVMHNjs.Badge_default; exports.CORE_SDK_AVAILABLE = _chunkNTFOVMHNjs.CORE_SDK_AVAILABLE; exports.FilterChip = _chunkNTFOVMHNjs.FilterChip_default; exports.IconButton = _chunkNTFOVMHNjs.IconButton; exports.PrescriptionPanel = PrescriptionPanel; exports.SHOW_CUSTOM_SECTIONS = SHOW_CUSTOM_SECTIONS; exports.ScribeDocumentPanel = ScribeDocumentPanel; exports.SdkProvider = SdkProvider; exports.SidebarItem = _chunkNTFOVMHNjs.SidebarItem_default; exports.Skeleton = _chunkNTFOVMHNjs.Skeleton; exports.SmartRecordsView = SmartRecordsView; exports.classifyResource = classifyResource; exports.convertPrescriptionBundle = convertPrescriptionBundle; exports.logoutMedicalRecords = _chunkNTFOVMHNjs.logoutMedicalRecords; exports.useCaseById = useCaseById2; exports.useCaseIds = useCaseIds2; exports.useCasesConnection = _chunkNTFOVMHNjs.useCasesConnection; exports.useCasesStatus = useCasesStatus2; exports.useCollectionConnection = useCollectionConnection; exports.useFilteredRecordIds = useFilteredRecordIds2; exports.useIsSelected = useIsSelected2; exports.useLogout = useLogout; exports.useRecordById = useRecordById2; exports.useRecordIdRange = useRecordIdRange2; exports.useRecordsConnection = useRecordsConnection; exports.useRecordsCount = useRecordsCount2; exports.useRecordsStatus = useRecordsStatus2; exports.useSdk = _chunkNTFOVMHNjs.useSdk; exports.useUploadConnection = useUploadConnection;
|
|
4265
4381
|
//# sourceMappingURL=index.js.map
|