pih-appointment-widget 0.0.37 → 0.0.39
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/README.md +70 -70
- package/babel.config.js +5 -5
- package/dist/App.js +10 -9
- package/dist/assets/icons/icdIcons.js +30 -0
- package/dist/components/AppointmentPage.js +87 -62
- package/dist/components/ICD10Assistant.js +144 -63
- package/dist/doctor-appointments-widget.umd.js +115 -119
- package/dist/doctor-appointments-widget.umd.min.js +1 -1
- package/dist/hooks/useClipboard.js +3 -3
- package/dist/pih-appointment-widget.umd.js +309 -208
- package/dist/pih-appointment-widget.umd.min.js +1 -1
- package/dist/services/appointmentService.js +20 -20
- package/dist/services/httpService.js +14 -18
- package/dist/services/icdService.js +21 -23
- package/package.json +67 -67
- package/public/index.html +43 -43
- package/public/manifest.json +25 -25
- package/public/robots.txt +3 -3
- package/rollup.config.js +43 -43
- package/src/App.js +50 -50
- package/src/Example.js +14 -14
- package/src/assets/icons/icdIcon.png +0 -0
- package/src/assets/icons/icdIcons.js +23 -0
- package/src/components/AppointmentPage.js +2502 -2498
- package/src/components/ICD10Assistant.jsx +923 -855
- package/src/constants/apiConfig.js +29 -29
- package/src/hooks/useClipboard.js +35 -35
- package/src/index.js +6 -6
- package/src/services/appointmentService.js +92 -92
- package/src/services/httpService.js +103 -103
- package/src/services/icdService.js +76 -76
|
@@ -7,11 +7,13 @@ exports.default = ICD10Assistant;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _icdService = require("../services/icdService");
|
|
9
9
|
var _useClipboard = require("../hooks/useClipboard");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*
|
|
10
|
+
var _icdIcons = require("../assets/icons/icdIcons");
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
/**
|
|
14
|
+
* ICD10Assistant.jsx
|
|
15
|
+
* AI-powered ICD-10 coding assistant panel.
|
|
16
|
+
* Floats as a pill button; expands into a full panel on click.
|
|
15
17
|
*/
|
|
16
18
|
|
|
17
19
|
// ─── Constants ───────────────────────────────────────────────────────────────
|
|
@@ -60,12 +62,12 @@ function Badge(_ref) {
|
|
|
60
62
|
}, children);
|
|
61
63
|
}
|
|
62
64
|
function Spinner() {
|
|
63
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("style", null,
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("style", null, `@keyframes icd-spin{to{transform:rotate(360deg)}}`), /*#__PURE__*/_react.default.createElement("div", {
|
|
64
66
|
style: {
|
|
65
67
|
width: 20,
|
|
66
68
|
height: 20,
|
|
67
69
|
border: "2.5px solid #d1d5db",
|
|
68
|
-
borderTop:
|
|
70
|
+
borderTop: `2.5px solid ${C.primary}`,
|
|
69
71
|
borderRadius: "50%",
|
|
70
72
|
animation: "icd-spin 0.8s linear infinite",
|
|
71
73
|
flexShrink: 0
|
|
@@ -83,7 +85,7 @@ function CopyButton(_ref2) {
|
|
|
83
85
|
const copied = copiedKey === copyKey;
|
|
84
86
|
return /*#__PURE__*/_react.default.createElement("button", {
|
|
85
87
|
onClick: () => copy(text, copyKey),
|
|
86
|
-
title: copied ? "Copied!" :
|
|
88
|
+
title: copied ? "Copied!" : `Copy ${label}`,
|
|
87
89
|
style: {
|
|
88
90
|
display: "inline-flex",
|
|
89
91
|
alignItems: "center",
|
|
@@ -92,7 +94,7 @@ function CopyButton(_ref2) {
|
|
|
92
94
|
fontSize: 11,
|
|
93
95
|
fontWeight: 600,
|
|
94
96
|
fontFamily: FONT,
|
|
95
|
-
border:
|
|
97
|
+
border: `1px solid ${copied ? C.success : C.border}`,
|
|
96
98
|
borderRadius: 5,
|
|
97
99
|
background: copied ? C.successLight : C.white,
|
|
98
100
|
color: copied ? C.success : C.muted,
|
|
@@ -100,7 +102,7 @@ function CopyButton(_ref2) {
|
|
|
100
102
|
transition: "all 0.15s ease",
|
|
101
103
|
whiteSpace: "nowrap"
|
|
102
104
|
}
|
|
103
|
-
}, copied ? "✓ Copied" :
|
|
105
|
+
}, copied ? "✓ Copied" : `⎘ ${label}`);
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
// ─── Result Card ──────────────────────────────────────────────────────────────
|
|
@@ -111,11 +113,11 @@ function ResultCard(_ref3) {
|
|
|
111
113
|
copy,
|
|
112
114
|
copiedKey
|
|
113
115
|
} = _ref3;
|
|
114
|
-
const cardCopyKey =
|
|
115
|
-
const fullText =
|
|
116
|
+
const cardCopyKey = `card-${index}`;
|
|
117
|
+
const fullText = `${match.code} — ${match.description}${match.reason ? `\nNote: ${match.reason}` : ""}`;
|
|
116
118
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
117
119
|
style: {
|
|
118
|
-
border:
|
|
120
|
+
border: `1px solid ${C.border}`,
|
|
119
121
|
borderRadius: 10,
|
|
120
122
|
padding: "14px 16px",
|
|
121
123
|
background: C.white,
|
|
@@ -162,7 +164,7 @@ function ResultCard(_ref3) {
|
|
|
162
164
|
lineHeight: 1.5,
|
|
163
165
|
paddingLeft: 2
|
|
164
166
|
}
|
|
165
|
-
}, "
|
|
167
|
+
}, _icdIcons.ICON.reason, " ", match.reason));
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
// ─── History Chip ─────────────────────────────────────────────────────────────
|
|
@@ -173,10 +175,10 @@ function HistoryChip(_ref4) {
|
|
|
173
175
|
} = _ref4;
|
|
174
176
|
return /*#__PURE__*/_react.default.createElement("button", {
|
|
175
177
|
onClick: () => onClick(item.query),
|
|
176
|
-
title:
|
|
178
|
+
title: `Re-run: ${item.query}`,
|
|
177
179
|
style: {
|
|
178
180
|
padding: "4px 10px",
|
|
179
|
-
border:
|
|
181
|
+
border: `1px solid ${C.border}`,
|
|
180
182
|
borderRadius: 999,
|
|
181
183
|
fontSize: 11,
|
|
182
184
|
fontFamily: FONT,
|
|
@@ -191,7 +193,7 @@ function HistoryChip(_ref4) {
|
|
|
191
193
|
},
|
|
192
194
|
onMouseEnter: e => e.currentTarget.style.borderColor = C.primary,
|
|
193
195
|
onMouseLeave: e => e.currentTarget.style.borderColor = C.border
|
|
194
|
-
}, "
|
|
196
|
+
}, _icdIcons.ICON.history, " ", item.query);
|
|
195
197
|
}
|
|
196
198
|
|
|
197
199
|
// ─── Mode Toggle (tab bar) ──────────────────────────────────────────────────
|
|
@@ -230,7 +232,7 @@ function ModeToggle(_ref5) {
|
|
|
230
232
|
gap: 2,
|
|
231
233
|
marginTop: 10
|
|
232
234
|
}
|
|
233
|
-
}, tab("nlm", "Quick Lookup", "
|
|
235
|
+
}, tab("nlm", "Quick Lookup", ""), tab("ai", "AI Suggest", ""));
|
|
234
236
|
}
|
|
235
237
|
|
|
236
238
|
// ─── NLM Lookup Panel ────────────────────────────────────────────────────────
|
|
@@ -249,10 +251,7 @@ function NLMLookupPanel(_ref6) {
|
|
|
249
251
|
const debounceRef = (0, _react.useRef)(null);
|
|
250
252
|
const inputRef = (0, _react.useRef)(null);
|
|
251
253
|
(0, _react.useEffect)(() => {
|
|
252
|
-
setTimeout(() =>
|
|
253
|
-
var _inputRef$current;
|
|
254
|
-
return (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
255
|
-
}, 80);
|
|
254
|
+
setTimeout(() => inputRef.current?.focus(), 80);
|
|
256
255
|
}, []);
|
|
257
256
|
const search = (0, _react.useCallback)(async term => {
|
|
258
257
|
if (term.length < 2) {
|
|
@@ -265,7 +264,7 @@ function NLMLookupPanel(_ref6) {
|
|
|
265
264
|
const data = await (0, _icdService.getICDSuggestions)(term, _icdService.ICD_MODE.ICD_ONLY);
|
|
266
265
|
const codes = (data.matches || []).map(m => [m.code, m.description]);
|
|
267
266
|
setResults(codes);
|
|
268
|
-
setStatus(codes.length === 0 ? "No matching codes found." :
|
|
267
|
+
setStatus(codes.length === 0 ? "No matching codes found." : `Showing ${codes.length} result${codes.length !== 1 ? "s" : ""}`);
|
|
269
268
|
} catch (err) {
|
|
270
269
|
setStatus(err.message || "Could not fetch results. Check your connection.");
|
|
271
270
|
setResults([]);
|
|
@@ -301,9 +300,9 @@ function NLMLookupPanel(_ref6) {
|
|
|
301
300
|
overflow: "hidden",
|
|
302
301
|
animation: "icd-slide-in 0.2s ease"
|
|
303
302
|
}
|
|
304
|
-
}, /*#__PURE__*/_react.default.createElement("style", null,
|
|
303
|
+
}, /*#__PURE__*/_react.default.createElement("style", null, `@keyframes icd-slide-in{from{opacity:0;transform:translateY(20px) scale(0.97)}to{opacity:1;transform:translateY(0) scale(1)}}`), /*#__PURE__*/_react.default.createElement("div", {
|
|
305
304
|
style: {
|
|
306
|
-
background:
|
|
305
|
+
background: `linear-gradient(135deg, ${C.primary} 0%, ${C.teal} 100%)`,
|
|
307
306
|
padding: "14px 18px",
|
|
308
307
|
flexShrink: 0
|
|
309
308
|
}
|
|
@@ -319,11 +318,15 @@ function NLMLookupPanel(_ref6) {
|
|
|
319
318
|
alignItems: "center",
|
|
320
319
|
gap: 10
|
|
321
320
|
}
|
|
322
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
321
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
322
|
+
src: _icdIcons.IMG.icdIcon,
|
|
323
|
+
alt: "ICD-10",
|
|
323
324
|
style: {
|
|
324
|
-
|
|
325
|
+
width: 32,
|
|
326
|
+
height: 32,
|
|
327
|
+
objectFit: "contain"
|
|
325
328
|
}
|
|
326
|
-
}
|
|
329
|
+
}), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
327
330
|
style: {
|
|
328
331
|
color: C.white,
|
|
329
332
|
fontWeight: 700,
|
|
@@ -374,7 +377,7 @@ function NLMLookupPanel(_ref6) {
|
|
|
374
377
|
padding: "10px 14px",
|
|
375
378
|
fontSize: 14,
|
|
376
379
|
fontFamily: FONT,
|
|
377
|
-
border:
|
|
380
|
+
border: `1.5px solid ${C.border}`,
|
|
378
381
|
borderRadius: 8,
|
|
379
382
|
outline: "none",
|
|
380
383
|
boxSizing: "border-box",
|
|
@@ -382,13 +385,77 @@ function NLMLookupPanel(_ref6) {
|
|
|
382
385
|
},
|
|
383
386
|
onFocus: e => e.target.style.borderColor = C.primary,
|
|
384
387
|
onBlur: e => e.target.style.borderColor = C.border
|
|
385
|
-
}),
|
|
388
|
+
}), /*#__PURE__*/_react.default.createElement("p", {
|
|
389
|
+
style: {
|
|
390
|
+
margin: 0,
|
|
391
|
+
fontSize: 11,
|
|
392
|
+
color: "#aaa",
|
|
393
|
+
lineHeight: 1.6,
|
|
394
|
+
borderLeft: `3px solid ${C.border}`,
|
|
395
|
+
paddingLeft: 8
|
|
396
|
+
}
|
|
397
|
+
}, /*#__PURE__*/_react.default.createElement("strong", null, "Note:"), " Use short, specific keywords for better results, or try", " ", /*#__PURE__*/_react.default.createElement("button", {
|
|
398
|
+
onClick: () => onModeChange("ai"),
|
|
399
|
+
style: {
|
|
400
|
+
background: "none",
|
|
401
|
+
border: "none",
|
|
402
|
+
padding: 0,
|
|
403
|
+
color: C.primary,
|
|
404
|
+
fontWeight: 700,
|
|
405
|
+
fontSize: 11,
|
|
406
|
+
cursor: "pointer",
|
|
407
|
+
textDecoration: "underline",
|
|
408
|
+
fontFamily: FONT
|
|
409
|
+
}
|
|
410
|
+
}, "AI Suggest"), " ", "for broader symptom-based recommendations."), status && results.length > 0 && /*#__PURE__*/_react.default.createElement("p", {
|
|
386
411
|
style: {
|
|
387
412
|
margin: 0,
|
|
388
413
|
fontSize: 12,
|
|
389
414
|
color: C.muted
|
|
390
415
|
}
|
|
391
|
-
}, status), /*#__PURE__*/_react.default.createElement("div", {
|
|
416
|
+
}, status), status === "No matching codes found." && results.length === 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
417
|
+
style: {
|
|
418
|
+
background: C.warnLight,
|
|
419
|
+
border: `1px solid #fcd34d`,
|
|
420
|
+
borderRadius: 10,
|
|
421
|
+
padding: "14px 16px",
|
|
422
|
+
display: "flex",
|
|
423
|
+
gap: 10,
|
|
424
|
+
alignItems: "flex-start"
|
|
425
|
+
}
|
|
426
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
427
|
+
style: {
|
|
428
|
+
fontSize: 18,
|
|
429
|
+
flexShrink: 0
|
|
430
|
+
}
|
|
431
|
+
}, "\uD83D\uDD0D"), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("p", {
|
|
432
|
+
style: {
|
|
433
|
+
margin: "0 0 4px",
|
|
434
|
+
fontSize: 13,
|
|
435
|
+
fontWeight: 700,
|
|
436
|
+
color: C.warn
|
|
437
|
+
}
|
|
438
|
+
}, "No results found"), /*#__PURE__*/_react.default.createElement("p", {
|
|
439
|
+
style: {
|
|
440
|
+
margin: 0,
|
|
441
|
+
fontSize: 12,
|
|
442
|
+
color: C.warn,
|
|
443
|
+
lineHeight: 1.6
|
|
444
|
+
}
|
|
445
|
+
}, "We couldn't find a match. Try using more accurate keywords or switch to", " ", /*#__PURE__*/_react.default.createElement("button", {
|
|
446
|
+
onClick: () => onModeChange("ai"),
|
|
447
|
+
style: {
|
|
448
|
+
background: "none",
|
|
449
|
+
border: "none",
|
|
450
|
+
padding: 0,
|
|
451
|
+
color: C.primary,
|
|
452
|
+
fontWeight: 700,
|
|
453
|
+
fontSize: 12,
|
|
454
|
+
cursor: "pointer",
|
|
455
|
+
textDecoration: "underline",
|
|
456
|
+
fontFamily: FONT
|
|
457
|
+
}
|
|
458
|
+
}, "AI Suggest"), " ", "for better results."))), /*#__PURE__*/_react.default.createElement("div", {
|
|
392
459
|
style: {
|
|
393
460
|
display: "flex",
|
|
394
461
|
flexDirection: "column",
|
|
@@ -404,7 +471,7 @@ function NLMLookupPanel(_ref6) {
|
|
|
404
471
|
alignItems: "center",
|
|
405
472
|
gap: 12,
|
|
406
473
|
padding: "10px 14px",
|
|
407
|
-
border:
|
|
474
|
+
border: `1px solid ${C.border}`,
|
|
408
475
|
borderRadius: 8,
|
|
409
476
|
cursor: "pointer",
|
|
410
477
|
background: C.white,
|
|
@@ -440,13 +507,13 @@ function NLMLookupPanel(_ref6) {
|
|
|
440
507
|
style: {
|
|
441
508
|
flexShrink: 0,
|
|
442
509
|
padding: "10px 18px",
|
|
443
|
-
borderTop:
|
|
510
|
+
borderTop: `1px solid ${C.border}`,
|
|
444
511
|
background: C.bg,
|
|
445
512
|
fontSize: 11,
|
|
446
513
|
color: "#aaa",
|
|
447
514
|
textAlign: "center"
|
|
448
515
|
}
|
|
449
|
-
}, "
|
|
516
|
+
}, _icdIcons.ICON.medical, " For reference only. Always verify codes with a certified medical coder."));
|
|
450
517
|
}
|
|
451
518
|
|
|
452
519
|
// ─── FloatingButton ───────────────────────────────────────────────────────────
|
|
@@ -469,7 +536,7 @@ function FloatingButton(_ref8) {
|
|
|
469
536
|
padding: "10px 18px",
|
|
470
537
|
borderRadius: 999,
|
|
471
538
|
border: "none",
|
|
472
|
-
background:
|
|
539
|
+
background: `linear-gradient(135deg, ${C.primary} 0%, ${C.teal} 100%)`,
|
|
473
540
|
color: C.white,
|
|
474
541
|
fontFamily: FONT,
|
|
475
542
|
fontWeight: 700,
|
|
@@ -486,17 +553,20 @@ function FloatingButton(_ref8) {
|
|
|
486
553
|
e.currentTarget.style.transform = "translateY(0)";
|
|
487
554
|
e.currentTarget.style.boxShadow = "0 4px 16px rgba(76,77,220,0.35)";
|
|
488
555
|
}
|
|
489
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
556
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
557
|
+
src: _icdIcons.IMG.icdIcon,
|
|
558
|
+
alt: "ICD-10",
|
|
490
559
|
style: {
|
|
491
|
-
|
|
560
|
+
width: 22,
|
|
561
|
+
height: 22,
|
|
562
|
+
objectFit: "contain"
|
|
492
563
|
}
|
|
493
|
-
}
|
|
564
|
+
}), "ICD-10 Assistant");
|
|
494
565
|
}
|
|
495
566
|
|
|
496
567
|
// ─── Panel ────────────────────────────────────────────────────────────────────
|
|
497
568
|
// Defined OUTSIDE the main component so its DOM is never torn down on re-render.
|
|
498
569
|
function Panel(_ref9) {
|
|
499
|
-
var _result$matches;
|
|
500
570
|
let {
|
|
501
571
|
panelRef,
|
|
502
572
|
textareaRef,
|
|
@@ -516,7 +586,7 @@ function Panel(_ref9) {
|
|
|
516
586
|
mode,
|
|
517
587
|
onModeChange
|
|
518
588
|
} = _ref9;
|
|
519
|
-
const allCodesText =
|
|
589
|
+
const allCodesText = result?.matches?.map(m => `${m.code} — ${m.description}`).join("\n") || "";
|
|
520
590
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
521
591
|
style: {
|
|
522
592
|
position: "fixed",
|
|
@@ -535,9 +605,14 @@ function Panel(_ref9) {
|
|
|
535
605
|
animation: "icd-slide-in 0.2s ease"
|
|
536
606
|
},
|
|
537
607
|
ref: panelRef
|
|
538
|
-
}, /*#__PURE__*/_react.default.createElement("style", null,
|
|
539
|
-
|
|
540
|
-
|
|
608
|
+
}, /*#__PURE__*/_react.default.createElement("style", null, `
|
|
609
|
+
@keyframes icd-slide-in {
|
|
610
|
+
from { opacity: 0; transform: translateY(20px) scale(0.97); }
|
|
611
|
+
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
612
|
+
}
|
|
613
|
+
`), /*#__PURE__*/_react.default.createElement("div", {
|
|
614
|
+
style: {
|
|
615
|
+
background: `linear-gradient(135deg, ${C.primary} 0%, ${C.teal} 100%)`,
|
|
541
616
|
padding: "14px 18px",
|
|
542
617
|
flexShrink: 0
|
|
543
618
|
}
|
|
@@ -553,11 +628,15 @@ function Panel(_ref9) {
|
|
|
553
628
|
alignItems: "center",
|
|
554
629
|
gap: 10
|
|
555
630
|
}
|
|
556
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
631
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
632
|
+
src: _icdIcons.IMG.icdIcon,
|
|
633
|
+
alt: "ICD-10",
|
|
557
634
|
style: {
|
|
558
|
-
|
|
635
|
+
width: 32,
|
|
636
|
+
height: 32,
|
|
637
|
+
objectFit: "contain"
|
|
559
638
|
}
|
|
560
|
-
}
|
|
639
|
+
}), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
561
640
|
style: {
|
|
562
641
|
color: C.white,
|
|
563
642
|
fontWeight: 700,
|
|
@@ -629,7 +708,7 @@ function Panel(_ref9) {
|
|
|
629
708
|
style: {
|
|
630
709
|
width: "100%",
|
|
631
710
|
padding: "10px 12px",
|
|
632
|
-
border:
|
|
711
|
+
border: `1.5px solid ${C.border}`,
|
|
633
712
|
borderRadius: 8,
|
|
634
713
|
fontSize: 13,
|
|
635
714
|
fontFamily: FONT,
|
|
@@ -655,7 +734,14 @@ function Panel(_ref9) {
|
|
|
655
734
|
borderRadius: 3,
|
|
656
735
|
fontFamily: "monospace"
|
|
657
736
|
}
|
|
658
|
-
}, "
|
|
737
|
+
}, "Enter"), " to submit \xB7 ", /*#__PURE__*/_react.default.createElement("kbd", {
|
|
738
|
+
style: {
|
|
739
|
+
background: "#f3f4f6",
|
|
740
|
+
padding: "1px 5px",
|
|
741
|
+
borderRadius: 3,
|
|
742
|
+
fontFamily: "monospace"
|
|
743
|
+
}
|
|
744
|
+
}, "Shift+Enter"), " for new line")), /*#__PURE__*/_react.default.createElement("div", {
|
|
659
745
|
style: {
|
|
660
746
|
display: "flex",
|
|
661
747
|
gap: 8
|
|
@@ -670,7 +756,7 @@ function Panel(_ref9) {
|
|
|
670
756
|
justifyContent: "center",
|
|
671
757
|
gap: 8,
|
|
672
758
|
padding: "10px 16px",
|
|
673
|
-
background: !query.trim() || loading ? "#d1d5db" :
|
|
759
|
+
background: !query.trim() || loading ? "#d1d5db" : `linear-gradient(135deg, ${C.primary} 0%, ${C.primaryDark} 100%)`,
|
|
674
760
|
color: C.white,
|
|
675
761
|
border: "none",
|
|
676
762
|
borderRadius: 8,
|
|
@@ -680,12 +766,12 @@ function Panel(_ref9) {
|
|
|
680
766
|
cursor: !query.trim() || loading ? "not-allowed" : "pointer",
|
|
681
767
|
transition: "background 0.15s"
|
|
682
768
|
}
|
|
683
|
-
}, loading ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Spinner, null), "Searching codes\u2026") : "
|
|
769
|
+
}, loading ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Spinner, null), "Searching codes\u2026") : "Find ICD-10 Codes"), (query || result) && /*#__PURE__*/_react.default.createElement("button", {
|
|
684
770
|
onClick: onClear,
|
|
685
771
|
style: {
|
|
686
772
|
padding: "10px 14px",
|
|
687
773
|
background: C.bg,
|
|
688
|
-
border:
|
|
774
|
+
border: `1px solid ${C.border}`,
|
|
689
775
|
borderRadius: 8,
|
|
690
776
|
fontSize: 13,
|
|
691
777
|
fontWeight: 600,
|
|
@@ -696,7 +782,7 @@ function Panel(_ref9) {
|
|
|
696
782
|
}, "Clear")), error && /*#__PURE__*/_react.default.createElement("div", {
|
|
697
783
|
style: {
|
|
698
784
|
background: C.errorLight,
|
|
699
|
-
border:
|
|
785
|
+
border: `1px solid #fca5a5`,
|
|
700
786
|
borderRadius: 8,
|
|
701
787
|
padding: "10px 14px",
|
|
702
788
|
fontSize: 13,
|
|
@@ -780,14 +866,14 @@ function Panel(_ref9) {
|
|
|
780
866
|
style: {
|
|
781
867
|
flexShrink: 0,
|
|
782
868
|
padding: "12px 18px",
|
|
783
|
-
borderTop:
|
|
869
|
+
borderTop: `1px solid ${C.border}`,
|
|
784
870
|
background: C.bg,
|
|
785
871
|
fontSize: 11,
|
|
786
872
|
color: "#aaa",
|
|
787
873
|
lineHeight: 1.5,
|
|
788
874
|
textAlign: "center"
|
|
789
875
|
}
|
|
790
|
-
}, "
|
|
876
|
+
}, _icdIcons.ICON.medical, " For reference only. Always verify codes with a certified medical coder. Not a substitute for clinical judgment or official coding guidelines."));
|
|
791
877
|
}
|
|
792
878
|
|
|
793
879
|
// ─── Main Component ────────────────────────────────────────────────────────────
|
|
@@ -809,10 +895,7 @@ function ICD10Assistant() {
|
|
|
809
895
|
// Focus textarea when panel opens
|
|
810
896
|
(0, _react.useEffect)(() => {
|
|
811
897
|
if (open && textareaRef.current) {
|
|
812
|
-
setTimeout(() =>
|
|
813
|
-
var _textareaRef$current;
|
|
814
|
-
return (_textareaRef$current = textareaRef.current) === null || _textareaRef$current === void 0 ? void 0 : _textareaRef$current.focus();
|
|
815
|
-
}, 80);
|
|
898
|
+
setTimeout(() => textareaRef.current?.focus(), 80);
|
|
816
899
|
}
|
|
817
900
|
}, [open]);
|
|
818
901
|
|
|
@@ -849,24 +932,22 @@ function ICD10Assistant() {
|
|
|
849
932
|
}
|
|
850
933
|
}, [query, loading]);
|
|
851
934
|
const handleKeyDown = (0, _react.useCallback)(e => {
|
|
852
|
-
if (
|
|
935
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
853
936
|
e.preventDefault();
|
|
854
937
|
handleSubmit();
|
|
855
938
|
}
|
|
856
939
|
}, [handleSubmit]);
|
|
857
940
|
const handleClear = (0, _react.useCallback)(() => {
|
|
858
|
-
var _textareaRef$current2;
|
|
859
941
|
setQuery("");
|
|
860
942
|
setResult(null);
|
|
861
943
|
setError(null);
|
|
862
|
-
|
|
944
|
+
textareaRef.current?.focus();
|
|
863
945
|
}, []);
|
|
864
946
|
const handleHistoryClick = (0, _react.useCallback)(q => {
|
|
865
|
-
var _textareaRef$current3;
|
|
866
947
|
setQuery(q);
|
|
867
948
|
setResult(null);
|
|
868
949
|
setError(null);
|
|
869
|
-
|
|
950
|
+
textareaRef.current?.focus();
|
|
870
951
|
}, []);
|
|
871
952
|
const handleQueryChange = (0, _react.useCallback)(e => setQuery(e.target.value), []);
|
|
872
953
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !open && /*#__PURE__*/_react.default.createElement(FloatingButton, {
|