@mieweb/ui 0.9.0-dev.1 → 0.9.0-dev.2
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/{chunk-ODYQYLO2.js → chunk-2KQWEROH.js} +7 -3
- package/dist/chunk-2KQWEROH.js.map +1 -0
- package/dist/{chunk-6XDPJWSC.cjs → chunk-ADUEASXF.cjs} +7 -3
- package/dist/chunk-ADUEASXF.cjs.map +1 -0
- package/dist/{chunk-DGRXAIWK.js → chunk-KI5ES4GR.js} +17 -2
- package/dist/chunk-KI5ES4GR.js.map +1 -0
- package/dist/{chunk-CXDMZT45.cjs → chunk-XRKBHECB.cjs} +17 -2
- package/dist/chunk-XRKBHECB.cjs.map +1 -0
- package/dist/esheet.cjs +4 -4
- package/dist/esheet.js +1 -1
- package/dist/index.cjs +344 -249
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +315 -221
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind-preset.cjs +4 -4
- package/dist/tailwind-preset.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-6XDPJWSC.cjs.map +0 -1
- package/dist/chunk-CXDMZT45.cjs.map +0 -1
- package/dist/chunk-DGRXAIWK.js.map +0 -1
- package/dist/chunk-ODYQYLO2.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -68,7 +68,7 @@ var chunkX4LBUPJO_cjs = require('./chunk-X4LBUPJO.cjs');
|
|
|
68
68
|
require('./chunk-AT732HC6.cjs');
|
|
69
69
|
var chunkC7RVKV25_cjs = require('./chunk-C7RVKV25.cjs');
|
|
70
70
|
var chunkL7YQBSEL_cjs = require('./chunk-L7YQBSEL.cjs');
|
|
71
|
-
var
|
|
71
|
+
var chunkXRKBHECB_cjs = require('./chunk-XRKBHECB.cjs');
|
|
72
72
|
var chunkVROIMIHB_cjs = require('./chunk-VROIMIHB.cjs');
|
|
73
73
|
var chunkNYJIXR4Y_cjs = require('./chunk-NYJIXR4Y.cjs');
|
|
74
74
|
var chunkYJP6DUFO_cjs = require('./chunk-YJP6DUFO.cjs');
|
|
@@ -76,7 +76,7 @@ var chunkPJ6CC53R_cjs = require('./chunk-PJ6CC53R.cjs');
|
|
|
76
76
|
var chunkW4Q4UEXA_cjs = require('./chunk-W4Q4UEXA.cjs');
|
|
77
77
|
var chunkOCV33S5Q_cjs = require('./chunk-OCV33S5Q.cjs');
|
|
78
78
|
var chunkRI56YPED_cjs = require('./chunk-RI56YPED.cjs');
|
|
79
|
-
var
|
|
79
|
+
var chunkADUEASXF_cjs = require('./chunk-ADUEASXF.cjs');
|
|
80
80
|
var chunkBSDBI6H7_cjs = require('./chunk-BSDBI6H7.cjs');
|
|
81
81
|
var chunkBVMABVC4_cjs = require('./chunk-BVMABVC4.cjs');
|
|
82
82
|
var chunkG7EQ3JPX_cjs = require('./chunk-G7EQ3JPX.cjs');
|
|
@@ -7485,8 +7485,8 @@ function ConcernRow({
|
|
|
7485
7485
|
]
|
|
7486
7486
|
}
|
|
7487
7487
|
),
|
|
7488
|
-
!readOnly && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7489
|
-
|
|
7488
|
+
!readOnly && /* @__PURE__ */ jsxRuntime.jsx(chunkADUEASXF_cjs.RowActionToolbar, { label: `Actions for ${current.text}`, align: "top", children: visibleActions.map((action) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7489
|
+
chunkADUEASXF_cjs.RowIconButton,
|
|
7490
7490
|
{
|
|
7491
7491
|
label: ACTION_META[action].label,
|
|
7492
7492
|
icon: ACTION_META[action].icon,
|
|
@@ -7855,11 +7855,11 @@ function OrderRow({
|
|
|
7855
7855
|
"aria-label": `Edit order ${order.display}`,
|
|
7856
7856
|
className: "flex flex-1 flex-wrap items-center gap-1.5",
|
|
7857
7857
|
children: [
|
|
7858
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7859
|
-
|
|
7858
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-40 flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7859
|
+
chunkZ5S5JEJD_cjs.Input,
|
|
7860
7860
|
{
|
|
7861
|
-
type: "text",
|
|
7862
7861
|
autoFocus: true,
|
|
7862
|
+
size: "sm",
|
|
7863
7863
|
value: editing.display,
|
|
7864
7864
|
onChange: (e) => setEditing(
|
|
7865
7865
|
(prev) => prev ? { ...prev, display: e.target.value } : prev
|
|
@@ -7869,17 +7869,13 @@ function OrderRow({
|
|
|
7869
7869
|
else if (e.key === "Escape") setEditing(null);
|
|
7870
7870
|
},
|
|
7871
7871
|
"aria-label": "Order description",
|
|
7872
|
-
className:
|
|
7873
|
-
"border-border bg-background text-foreground",
|
|
7874
|
-
"h-7 min-w-40 flex-1 rounded-md border px-2 text-sm",
|
|
7875
|
-
"focus:ring-ring focus:ring-2 focus:outline-none"
|
|
7876
|
-
)
|
|
7872
|
+
className: "h-7"
|
|
7877
7873
|
}
|
|
7878
|
-
),
|
|
7879
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7880
|
-
|
|
7874
|
+
) }),
|
|
7875
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-40", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7876
|
+
chunkZ5S5JEJD_cjs.Input,
|
|
7881
7877
|
{
|
|
7882
|
-
|
|
7878
|
+
size: "sm",
|
|
7883
7879
|
value: editing.detail,
|
|
7884
7880
|
onChange: (e) => setEditing(
|
|
7885
7881
|
(prev) => prev ? { ...prev, detail: e.target.value } : prev
|
|
@@ -7890,13 +7886,9 @@ function OrderRow({
|
|
|
7890
7886
|
},
|
|
7891
7887
|
placeholder: "detail (sig, timing\u2026)",
|
|
7892
7888
|
"aria-label": "Order detail",
|
|
7893
|
-
className:
|
|
7894
|
-
"border-border bg-background text-foreground placeholder:text-muted-foreground",
|
|
7895
|
-
"h-7 w-40 rounded-md border px-2 text-xs",
|
|
7896
|
-
"focus:ring-ring focus:ring-2 focus:outline-none"
|
|
7897
|
-
)
|
|
7889
|
+
className: "h-7 text-xs"
|
|
7898
7890
|
}
|
|
7899
|
-
),
|
|
7891
|
+
) }),
|
|
7900
7892
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7901
7893
|
chunkIINZWUGK_cjs.Button,
|
|
7902
7894
|
{
|
|
@@ -7923,13 +7915,13 @@ function OrderRow({
|
|
|
7923
7915
|
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7924
7916
|
/* @__PURE__ */ jsxRuntime.jsx(OrderContent, { order }),
|
|
7925
7917
|
interactive && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7926
|
-
|
|
7918
|
+
chunkADUEASXF_cjs.RowActionToolbar,
|
|
7927
7919
|
{
|
|
7928
7920
|
label: `Actions for ${order.display}`,
|
|
7929
7921
|
group: "order",
|
|
7930
7922
|
children: [
|
|
7931
7923
|
canEdit && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7932
|
-
|
|
7924
|
+
chunkADUEASXF_cjs.RowIconButton,
|
|
7933
7925
|
{
|
|
7934
7926
|
label: "Edit",
|
|
7935
7927
|
icon: chunkL7L5S2HO_cjs.Pencil,
|
|
@@ -7997,7 +7989,7 @@ function OrderRow({
|
|
|
7997
7989
|
}
|
|
7998
7990
|
),
|
|
7999
7991
|
controls?.remove && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8000
|
-
|
|
7992
|
+
chunkADUEASXF_cjs.RowIconButton,
|
|
8001
7993
|
{
|
|
8002
7994
|
label: "Remove",
|
|
8003
7995
|
icon: chunkL7L5S2HO_cjs.Trash2,
|
|
@@ -8015,6 +8007,7 @@ function OrderRow({
|
|
|
8015
8007
|
);
|
|
8016
8008
|
}
|
|
8017
8009
|
function AddOrderForm({
|
|
8010
|
+
id,
|
|
8018
8011
|
problemText,
|
|
8019
8012
|
onSubmit,
|
|
8020
8013
|
onCancel,
|
|
@@ -8049,6 +8042,7 @@ function AddOrderForm({
|
|
|
8049
8042
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8050
8043
|
"div",
|
|
8051
8044
|
{
|
|
8045
|
+
id,
|
|
8052
8046
|
role: "form",
|
|
8053
8047
|
"aria-label": `Add order for ${problemText}`,
|
|
8054
8048
|
className: "border-border bg-muted/40 ms-2.5 mt-1.5 flex flex-wrap items-center gap-1.5 rounded-md border border-dashed p-2",
|
|
@@ -8087,12 +8081,11 @@ function AddOrderForm({
|
|
|
8087
8081
|
});
|
|
8088
8082
|
}
|
|
8089
8083
|
}) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8090
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8091
|
-
|
|
8084
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-48 flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8085
|
+
chunkZ5S5JEJD_cjs.Input,
|
|
8092
8086
|
{
|
|
8093
8087
|
ref: inputRef,
|
|
8094
|
-
|
|
8095
|
-
"data-slot": "input",
|
|
8088
|
+
size: "sm",
|
|
8096
8089
|
value: display,
|
|
8097
8090
|
onChange: (e) => setDisplay(e.target.value),
|
|
8098
8091
|
onKeyDown: (e) => {
|
|
@@ -8100,14 +8093,9 @@ function AddOrderForm({
|
|
|
8100
8093
|
else if (e.key === "Escape") onCancel();
|
|
8101
8094
|
},
|
|
8102
8095
|
placeholder: "e.g. lisinopril 10 mg tablet \u2014 1 po daily",
|
|
8103
|
-
"aria-label": "Order description"
|
|
8104
|
-
className: chunkS5RVSXDV_cjs.cn(
|
|
8105
|
-
"border-border bg-background text-foreground placeholder:text-muted-foreground",
|
|
8106
|
-
"h-8 min-w-48 flex-1 rounded-md border px-2.5 text-sm",
|
|
8107
|
-
"focus:ring-ring focus:ring-2 focus:outline-none"
|
|
8108
|
-
)
|
|
8096
|
+
"aria-label": "Order description"
|
|
8109
8097
|
}
|
|
8110
|
-
),
|
|
8098
|
+
) }),
|
|
8111
8099
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8112
8100
|
chunkIINZWUGK_cjs.Button,
|
|
8113
8101
|
{
|
|
@@ -8144,6 +8132,7 @@ var Assessment = React12__namespace.forwardRef(
|
|
|
8144
8132
|
showPlan = true,
|
|
8145
8133
|
onShowPlanChange,
|
|
8146
8134
|
onAction,
|
|
8135
|
+
onRemoveAssessment,
|
|
8147
8136
|
onAddOrder,
|
|
8148
8137
|
onAddAssessment,
|
|
8149
8138
|
onLinkOrder,
|
|
@@ -8160,6 +8149,7 @@ var Assessment = React12__namespace.forwardRef(
|
|
|
8160
8149
|
"data-testid": dataTestId,
|
|
8161
8150
|
...props
|
|
8162
8151
|
}, ref) => {
|
|
8152
|
+
const instanceId = React12__namespace.useId();
|
|
8163
8153
|
const [addingFor, setAddingFor] = React12__namespace.useState(null);
|
|
8164
8154
|
const [addMode, setAddMode] = React12__namespace.useState(
|
|
8165
8155
|
defaultAddMode
|
|
@@ -8168,7 +8158,7 @@ var Assessment = React12__namespace.forwardRef(
|
|
|
8168
8158
|
null
|
|
8169
8159
|
);
|
|
8170
8160
|
const [announcement, setAnnouncement] = chunkYVPC65ZJ_cjs.useLiveAnnouncement();
|
|
8171
|
-
const ambientCodeLookup =
|
|
8161
|
+
const ambientCodeLookup = chunkADUEASXF_cjs.useCodeLookupConfig();
|
|
8172
8162
|
const effectiveRenderOrderSearch = renderOrderSearch === false ? void 0 : renderOrderSearch ?? (ambientCodeLookup ? contextOrderSearch(ambientCodeLookup) : void 0);
|
|
8173
8163
|
const concernById = React12__namespace.useMemo(
|
|
8174
8164
|
() => new Map(concerns.map((c) => [c.concernId, c])),
|
|
@@ -8360,18 +8350,15 @@ var Assessment = React12__namespace.forwardRef(
|
|
|
8360
8350
|
children: [
|
|
8361
8351
|
title !== null && /* @__PURE__ */ jsxRuntime.jsxs(chunkMJWFNV3L_cjs.CardHeader, { className: "border-border bg-muted/50 flex flex-row items-center justify-between border-b px-4 py-3", children: [
|
|
8362
8352
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-foreground text-sm font-semibold tracking-wide uppercase", children: title }),
|
|
8363
|
-
onShowPlanChange && /* @__PURE__ */ jsxRuntime.
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
),
|
|
8373
|
-
"Show plan"
|
|
8374
|
-
] })
|
|
8353
|
+
onShowPlanChange && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8354
|
+
chunk7AECNMYV_cjs.Checkbox,
|
|
8355
|
+
{
|
|
8356
|
+
size: "sm",
|
|
8357
|
+
checked: showPlan,
|
|
8358
|
+
onChange: (e) => onShowPlanChange(e.target.checked),
|
|
8359
|
+
label: "Show plan"
|
|
8360
|
+
}
|
|
8361
|
+
)
|
|
8375
8362
|
] }),
|
|
8376
8363
|
/* @__PURE__ */ jsxRuntime.jsxs(chunkMJWFNV3L_cjs.CardContent, { className: "space-y-4 px-4 py-4", children: [
|
|
8377
8364
|
items.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: "No problems assessed this visit." }),
|
|
@@ -8383,6 +8370,7 @@ var Assessment = React12__namespace.forwardRef(
|
|
|
8383
8370
|
);
|
|
8384
8371
|
const bp = blockProps(item.concernId);
|
|
8385
8372
|
const formOpen = addingFor === item.concernId;
|
|
8373
|
+
const addOrderFormId = `${instanceId}-add-order-${item.concernId}`;
|
|
8386
8374
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8387
8375
|
"li",
|
|
8388
8376
|
{
|
|
@@ -8423,36 +8411,62 @@ var Assessment = React12__namespace.forwardRef(
|
|
|
8423
8411
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground font-medium", children: assertion.text }),
|
|
8424
8412
|
assertion.verificationStatus !== "confirmed" && /* @__PURE__ */ jsxRuntime.jsx(chunkYVL3XATO_cjs.Badge, { variant: "warning", size: "sm", children: assertion.verificationStatus }),
|
|
8425
8413
|
/* @__PURE__ */ jsxRuntime.jsx(CodingChips, { coding: assertion.coding }),
|
|
8426
|
-
!readOnly && /* @__PURE__ */ jsxRuntime.
|
|
8427
|
-
|
|
8414
|
+
!readOnly && (onAction || onAddOrder || onRemoveAssessment) && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8415
|
+
chunkADUEASXF_cjs.RowActionToolbar,
|
|
8428
8416
|
{
|
|
8429
8417
|
label: `Actions for ${assertion.text}`,
|
|
8430
8418
|
align: "top",
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8419
|
+
className: chunkS5RVSXDV_cjs.cn(
|
|
8420
|
+
"pointer-fine:group-has-[[data-order-id]:hover]:pointer-events-none",
|
|
8421
|
+
"pointer-fine:group-has-[[data-order-id]:hover]:opacity-0",
|
|
8422
|
+
"pointer-fine:group-has-[[data-order-id]:focus-within]:pointer-events-none",
|
|
8423
|
+
"pointer-fine:group-has-[[data-order-id]:focus-within]:opacity-0"
|
|
8424
|
+
),
|
|
8425
|
+
children: [
|
|
8426
|
+
Object.keys(ACTION_META2).map(
|
|
8427
|
+
(action) => {
|
|
8428
|
+
const meta = ACTION_META2[action];
|
|
8429
|
+
if (action !== "add-order" && !onAction)
|
|
8430
|
+
return null;
|
|
8431
|
+
if (action === "add-order" && !onAddOrder && !onAction)
|
|
8432
|
+
return null;
|
|
8433
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8434
|
+
chunkADUEASXF_cjs.RowIconButton,
|
|
8435
|
+
{
|
|
8436
|
+
label: meta.label,
|
|
8437
|
+
icon: meta.icon,
|
|
8438
|
+
size: "sm",
|
|
8439
|
+
expanded: action === "add-order" && onAddOrder ? addingFor === item.concernId : void 0,
|
|
8440
|
+
controls: action === "add-order" && onAddOrder ? addOrderFormId : void 0,
|
|
8441
|
+
onClick: () => {
|
|
8442
|
+
if (action === "add-order" && onAddOrder) {
|
|
8443
|
+
setAddingFor(
|
|
8444
|
+
(prev) => prev === item.concernId ? null : item.concernId
|
|
8445
|
+
);
|
|
8446
|
+
} else {
|
|
8447
|
+
onAction?.(item, action);
|
|
8448
|
+
}
|
|
8449
8449
|
}
|
|
8450
|
-
}
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8450
|
+
},
|
|
8451
|
+
action
|
|
8452
|
+
);
|
|
8453
|
+
}
|
|
8454
|
+
),
|
|
8455
|
+
onRemoveAssessment && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8456
|
+
chunkADUEASXF_cjs.RowIconButton,
|
|
8457
|
+
{
|
|
8458
|
+
label: `Remove ${assertion.text} from assessment`,
|
|
8459
|
+
icon: chunkL7L5S2HO_cjs.Trash2,
|
|
8460
|
+
size: "sm",
|
|
8461
|
+
onClick: () => {
|
|
8462
|
+
onRemoveAssessment(item);
|
|
8463
|
+
setAnnouncement(
|
|
8464
|
+
`${assertion.text} removed from assessment`
|
|
8465
|
+
);
|
|
8466
|
+
}
|
|
8467
|
+
}
|
|
8468
|
+
)
|
|
8469
|
+
]
|
|
8456
8470
|
}
|
|
8457
8471
|
)
|
|
8458
8472
|
]
|
|
@@ -8478,8 +8492,15 @@ var Assessment = React12__namespace.forwardRef(
|
|
|
8478
8492
|
!readOnly && onAddOrder && addingFor === item.concernId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8479
8493
|
AddOrderForm,
|
|
8480
8494
|
{
|
|
8495
|
+
id: addOrderFormId,
|
|
8481
8496
|
problemText: assertion.text,
|
|
8482
|
-
onSubmit: (order) =>
|
|
8497
|
+
onSubmit: (order) => {
|
|
8498
|
+
onAddOrder(item, order);
|
|
8499
|
+
setAnnouncement(
|
|
8500
|
+
`${order.display} added to ${assertion.text}`
|
|
8501
|
+
);
|
|
8502
|
+
setAddingFor(null);
|
|
8503
|
+
},
|
|
8483
8504
|
onCancel: () => setAddingFor(null),
|
|
8484
8505
|
renderSearch: effectiveRenderOrderSearch
|
|
8485
8506
|
}
|
|
@@ -11977,13 +11998,24 @@ var RELATIONSHIP_OPTIONS = [
|
|
|
11977
11998
|
];
|
|
11978
11999
|
var SEVERITIES = ["mild", "moderate", "severe"];
|
|
11979
12000
|
var CONFIDENCES = ["low", "medium", "high"];
|
|
11980
|
-
function
|
|
12001
|
+
function normalizeConditionCodingSystem(codetype) {
|
|
11981
12002
|
const ct = codetype.toUpperCase().replace(/[^A-Z0-9]/g, "");
|
|
11982
12003
|
if (ct === "ICD10" || ct === "ICD10CM") return "ICD-10-CM";
|
|
11983
12004
|
if (ct === "ICD11") return "ICD-11";
|
|
11984
|
-
if (ct === "SNOMED" || ct === "SNOMEDCT"
|
|
12005
|
+
if (ct === "SNOMED" || ct === "SNOMEDCT" || ct === "SNOMEDUS") {
|
|
12006
|
+
return "SNOMED";
|
|
12007
|
+
}
|
|
11985
12008
|
return codetype;
|
|
11986
12009
|
}
|
|
12010
|
+
function withSinglePrimary(coding) {
|
|
12011
|
+
if (coding.length === 0) return coding;
|
|
12012
|
+
const primaryIndex = coding.findIndex((entry) => entry.primary);
|
|
12013
|
+
const selectedIndex = primaryIndex >= 0 ? primaryIndex : 0;
|
|
12014
|
+
return coding.map((entry, index) => ({
|
|
12015
|
+
...entry,
|
|
12016
|
+
primary: index === selectedIndex
|
|
12017
|
+
}));
|
|
12018
|
+
}
|
|
11987
12019
|
function contextConditionCodeSearch(ctx) {
|
|
11988
12020
|
const ContextConditionCodeSearch = ({
|
|
11989
12021
|
placeholder,
|
|
@@ -12037,7 +12069,7 @@ function FieldFlag({
|
|
|
12037
12069
|
),
|
|
12038
12070
|
className: chunkS5RVSXDV_cjs.cn(
|
|
12039
12071
|
"rounded-full border px-2 py-0.5 text-[11px] font-medium transition-colors",
|
|
12040
|
-
unknown ? "border-
|
|
12072
|
+
unknown ? "border-warning/50 bg-warning/10 text-warning-800 dark:text-warning-200" : "border-border text-muted-foreground hover:text-foreground"
|
|
12041
12073
|
),
|
|
12042
12074
|
children: "Unknown"
|
|
12043
12075
|
}
|
|
@@ -12093,7 +12125,7 @@ function ConditionEditor({
|
|
|
12093
12125
|
"data-testid": dataTestId
|
|
12094
12126
|
}) {
|
|
12095
12127
|
const prior = concern ? currentAssertion(concern) : void 0;
|
|
12096
|
-
const ambientCodeLookup =
|
|
12128
|
+
const ambientCodeLookup = chunkADUEASXF_cjs.useCodeLookupConfig();
|
|
12097
12129
|
const effectiveRenderCodeSearch = renderCodeSearch === false ? void 0 : renderCodeSearch ?? (ambientCodeLookup ? contextConditionCodeSearch(ambientCodeLookup) : void 0);
|
|
12098
12130
|
const [text, setText] = React12__namespace.useState("");
|
|
12099
12131
|
const [coding, setCoding] = React12__namespace.useState([]);
|
|
@@ -12110,13 +12142,14 @@ function ConditionEditor({
|
|
|
12110
12142
|
React12__namespace.useEffect(() => {
|
|
12111
12143
|
if (!open) return;
|
|
12112
12144
|
setText(prior?.text ?? "");
|
|
12113
|
-
setCoding(prior?.coding ?? []);
|
|
12145
|
+
setCoding(withSinglePrimary(prior?.coding ?? []));
|
|
12114
12146
|
setVerification(
|
|
12115
12147
|
mode === "add" ? "unconfirmed" : prior?.verificationStatus ?? "confirmed"
|
|
12116
12148
|
);
|
|
12117
12149
|
setSeverity(prior?.severity);
|
|
12118
|
-
|
|
12119
|
-
|
|
12150
|
+
const priorOnsetDate = prior?.onset?.date;
|
|
12151
|
+
setOnsetDate(priorOnsetDate ? chunkCW75IKA6_cjs.dateToDisplayFormat(priorOnsetDate) : "");
|
|
12152
|
+
setOnsetFuzzy(priorOnsetDate ? "" : prior?.onset?.fuzzy ?? "");
|
|
12120
12153
|
setNote("");
|
|
12121
12154
|
setProgression(false);
|
|
12122
12155
|
setFields(prior?.uncertainty?.fields ?? {});
|
|
@@ -12132,18 +12165,14 @@ function ConditionEditor({
|
|
|
12132
12165
|
});
|
|
12133
12166
|
const updateCoding = (i, patch) => setCoding((prev) => prev.map((c, j) => j === i ? { ...c, ...patch } : c));
|
|
12134
12167
|
const codingUnknown = fields.coding?.known === false;
|
|
12168
|
+
const hasInvalidOnsetDate = fields.onset?.known !== false && Boolean(onsetDate) && !chunkCW75IKA6_cjs.isValidDate(onsetDate);
|
|
12135
12169
|
const handleCodePick = (pick) => {
|
|
12136
|
-
const system =
|
|
12170
|
+
const system = normalizeConditionCodingSystem(pick.codetype);
|
|
12137
12171
|
setCoding(
|
|
12138
|
-
(prev) => prev.some((c) => c.system === system && c.code === pick.fullcode) ? prev : [
|
|
12172
|
+
(prev) => prev.some((c) => c.system === system && c.code === pick.fullcode) ? prev : withSinglePrimary([
|
|
12139
12173
|
...prev,
|
|
12140
|
-
{
|
|
12141
|
-
|
|
12142
|
-
code: pick.fullcode,
|
|
12143
|
-
display: pick.label,
|
|
12144
|
-
primary: prev.length === 0
|
|
12145
|
-
}
|
|
12146
|
-
]
|
|
12174
|
+
{ system, code: pick.fullcode, display: pick.label }
|
|
12175
|
+
])
|
|
12147
12176
|
);
|
|
12148
12177
|
setText((prev) => prev || pick.label);
|
|
12149
12178
|
setFields((prev) => {
|
|
@@ -12166,7 +12195,7 @@ function ConditionEditor({
|
|
|
12166
12195
|
onOpenChange(false);
|
|
12167
12196
|
return;
|
|
12168
12197
|
}
|
|
12169
|
-
if (!text.trim()) return;
|
|
12198
|
+
if (!text.trim() || hasInvalidOnsetDate) return;
|
|
12170
12199
|
if (observation.trim()) onAddObservation?.(observation.trim());
|
|
12171
12200
|
const uncertainty = Object.keys(fields).length > 0 ? { fields } : void 0;
|
|
12172
12201
|
onSave?.({
|
|
@@ -12175,41 +12204,46 @@ function ConditionEditor({
|
|
|
12175
12204
|
// checks downstream. A field marked explicitly unknown must not carry a
|
|
12176
12205
|
// value (e.g. one seeded from the prior assertion): value + "unknown"
|
|
12177
12206
|
// would be contradictory, so unknown wins and the value is dropped.
|
|
12178
|
-
coding: fields.coding?.known === false ? [] :
|
|
12179
|
-
|
|
12180
|
-
|
|
12181
|
-
|
|
12182
|
-
|
|
12183
|
-
|
|
12207
|
+
coding: fields.coding?.known === false ? [] : withSinglePrimary(
|
|
12208
|
+
coding.filter((c) => c.code.trim()).map((c) => ({
|
|
12209
|
+
...c,
|
|
12210
|
+
code: c.code.trim(),
|
|
12211
|
+
display: c.display?.trim() || void 0,
|
|
12212
|
+
mappedFrom: c.mappedFrom?.trim() || void 0
|
|
12213
|
+
}))
|
|
12214
|
+
),
|
|
12184
12215
|
verificationStatus: verification,
|
|
12185
12216
|
changeType: mode === "refine" ? progression ? "progression" : "refinement" : MODE_META[mode].changeType,
|
|
12186
12217
|
supersedes: prior?.id,
|
|
12187
12218
|
severity: fields.severity?.known === false ? void 0 : severity,
|
|
12188
|
-
onset: fields.onset?.known === false ? void 0 : onsetDate || onsetFuzzy ? {
|
|
12219
|
+
onset: fields.onset?.known === false ? void 0 : onsetDate || onsetFuzzy ? {
|
|
12220
|
+
date: onsetDate ? chunkCW75IKA6_cjs.displayFormatToDateString(onsetDate) : void 0,
|
|
12221
|
+
fuzzy: onsetFuzzy || void 0
|
|
12222
|
+
} : void 0,
|
|
12189
12223
|
uncertainty,
|
|
12190
12224
|
note: note.trim() || void 0
|
|
12191
12225
|
});
|
|
12192
12226
|
onOpenChange(false);
|
|
12193
12227
|
};
|
|
12194
|
-
const saveDisabled = mode === "relate" ? !relTarget : mode === "observe" ? !observation.trim() : !text.trim();
|
|
12228
|
+
const saveDisabled = mode === "relate" ? !relTarget : mode === "observe" ? !observation.trim() : !text.trim() || hasInvalidOnsetDate;
|
|
12195
12229
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12196
12230
|
chunkL52N6BEN_cjs.Modal,
|
|
12197
12231
|
{
|
|
12198
12232
|
open,
|
|
12199
12233
|
onOpenChange,
|
|
12200
|
-
size: "
|
|
12234
|
+
size: "2xl",
|
|
12201
12235
|
className,
|
|
12202
12236
|
children: [
|
|
12203
12237
|
/* @__PURE__ */ jsxRuntime.jsx(chunkL52N6BEN_cjs.ModalHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkL52N6BEN_cjs.ModalTitle, { children: [
|
|
12204
12238
|
MODE_META[mode].title,
|
|
12205
12239
|
prior ? ` \u2014 ${prior.text}` : ""
|
|
12206
12240
|
] }) }),
|
|
12207
|
-
/* @__PURE__ */ jsxRuntime.jsx(chunkL52N6BEN_cjs.ModalBody, { "data-testid": dataTestId, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-
|
|
12241
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkL52N6BEN_cjs.ModalBody, { "data-testid": dataTestId, className: "space-y-5", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-5", children: [
|
|
12208
12242
|
mode === "revise" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12209
12243
|
"div",
|
|
12210
12244
|
{
|
|
12211
12245
|
role: "alert",
|
|
12212
|
-
className: "flex items-start gap-2 rounded-md border
|
|
12246
|
+
className: "border-warning/30 bg-warning/10 text-warning-800 dark:text-warning-200 flex items-start gap-2 rounded-md border px-3 py-2 text-sm",
|
|
12213
12247
|
children: [
|
|
12214
12248
|
/* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.AlertTriangle, { size: 16 }),
|
|
12215
12249
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
@@ -12282,21 +12316,19 @@ function ConditionEditor({
|
|
|
12282
12316
|
placeholder: "e.g. Type 1 diabetes mellitus with neuropathy"
|
|
12283
12317
|
}
|
|
12284
12318
|
),
|
|
12285
|
-
mode === "refine" && /* @__PURE__ */ jsxRuntime.
|
|
12286
|
-
|
|
12287
|
-
|
|
12288
|
-
|
|
12289
|
-
|
|
12290
|
-
|
|
12291
|
-
|
|
12292
|
-
|
|
12293
|
-
|
|
12294
|
-
|
|
12295
|
-
|
|
12296
|
-
|
|
12297
|
-
|
|
12298
|
-
/* @__PURE__ */ jsxRuntime.jsxs("legend", { className: "flex w-full items-center justify-between text-sm font-medium", children: [
|
|
12299
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2", children: [
|
|
12319
|
+
mode === "refine" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12320
|
+
chunk7AECNMYV_cjs.Checkbox,
|
|
12321
|
+
{
|
|
12322
|
+
size: "sm",
|
|
12323
|
+
checked: progression,
|
|
12324
|
+
onChange: (e) => setProgression(e.target.checked),
|
|
12325
|
+
label: "Disease progressed (e.g. new complication) rather than a more specific diagnosis"
|
|
12326
|
+
}
|
|
12327
|
+
),
|
|
12328
|
+
/* @__PURE__ */ jsxRuntime.jsxs("fieldset", { className: "space-y-3", children: [
|
|
12329
|
+
/* @__PURE__ */ jsxRuntime.jsx("legend", { className: "sr-only", children: "Coding" }),
|
|
12330
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
12331
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex flex-wrap items-center gap-2 text-sm font-medium", children: [
|
|
12300
12332
|
"Coding",
|
|
12301
12333
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12302
12334
|
FieldFlag,
|
|
@@ -12323,82 +12355,136 @@ function ConditionEditor({
|
|
|
12323
12355
|
}
|
|
12324
12356
|
]),
|
|
12325
12357
|
leftIcon: /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Plus, { size: 12 }),
|
|
12326
|
-
className: "h-
|
|
12358
|
+
className: "h-8 shrink-0 text-xs",
|
|
12327
12359
|
children: "Add code"
|
|
12328
12360
|
}
|
|
12329
12361
|
)
|
|
12330
12362
|
] }),
|
|
12331
|
-
effectiveRenderCodeSearch && !(mode === "add" && !text.trim()) && /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
12363
|
+
effectiveRenderCodeSearch && !(mode === "add" && !text.trim()) && /* @__PURE__ */ jsxRuntime.jsx("div", { children: effectiveRenderCodeSearch({
|
|
12332
12364
|
placeholder: "Search codes \u2014 ICD-10-CM / SNOMED\u2026",
|
|
12333
12365
|
onPick: handleCodePick,
|
|
12334
12366
|
onFreeText: (t) => setText((prev) => prev || t)
|
|
12335
12367
|
}) }),
|
|
12336
12368
|
coding.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-xs", children: "Optional \u2014 a name-only problem is valid. Codes can be added any time." }),
|
|
12337
|
-
coding.
|
|
12338
|
-
|
|
12339
|
-
|
|
12340
|
-
|
|
12341
|
-
|
|
12342
|
-
|
|
12343
|
-
|
|
12344
|
-
|
|
12345
|
-
})
|
|
12346
|
-
|
|
12347
|
-
|
|
12348
|
-
|
|
12349
|
-
|
|
12350
|
-
|
|
12351
|
-
|
|
12352
|
-
|
|
12353
|
-
|
|
12354
|
-
|
|
12355
|
-
|
|
12356
|
-
|
|
12357
|
-
|
|
12358
|
-
|
|
12359
|
-
|
|
12360
|
-
|
|
12361
|
-
|
|
12362
|
-
),
|
|
12363
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12364
|
-
chunkZ5S5JEJD_cjs.Input,
|
|
12365
|
-
{
|
|
12366
|
-
"aria-label": `Display ${i + 1}`,
|
|
12367
|
-
value: c.display ?? "",
|
|
12368
|
-
onChange: (e) => updateCoding(i, { display: e.target.value }),
|
|
12369
|
-
placeholder: "Display",
|
|
12370
|
-
disabled: codingUnknown,
|
|
12371
|
-
className: "min-w-32 flex-1"
|
|
12372
|
-
}
|
|
12373
|
-
),
|
|
12374
|
-
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-1 text-xs", children: [
|
|
12375
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12376
|
-
"input",
|
|
12377
|
-
{
|
|
12378
|
-
type: "radio",
|
|
12379
|
-
name: "primary-coding",
|
|
12380
|
-
checked: Boolean(c.primary),
|
|
12381
|
-
disabled: codingUnknown,
|
|
12382
|
-
onChange: () => setCoding(
|
|
12383
|
-
(prev) => prev.map((cc, j) => ({ ...cc, primary: j === i }))
|
|
12384
|
-
),
|
|
12385
|
-
className: "accent-primary-600"
|
|
12386
|
-
}
|
|
12369
|
+
coding.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12370
|
+
"div",
|
|
12371
|
+
{
|
|
12372
|
+
"aria-hidden": "true",
|
|
12373
|
+
"data-slot": "condition-coding-header",
|
|
12374
|
+
className: "text-muted-foreground hidden grid-cols-[minmax(8rem,1.1fr)_minmax(7rem,0.9fr)_minmax(10rem,1.5fr)_5.5rem_2.5rem] items-center gap-2 px-1 text-xs font-medium sm:!grid",
|
|
12375
|
+
children: [
|
|
12376
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "System" }),
|
|
12377
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Code" }),
|
|
12378
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Display" }),
|
|
12379
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-center", children: "Primary code" }),
|
|
12380
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Actions" })
|
|
12381
|
+
]
|
|
12382
|
+
}
|
|
12383
|
+
),
|
|
12384
|
+
coding.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12385
|
+
chunkG7EQ3JPX_cjs.RadioGroup,
|
|
12386
|
+
{
|
|
12387
|
+
name: "primary-coding",
|
|
12388
|
+
label: "Primary display code",
|
|
12389
|
+
value: String(
|
|
12390
|
+
Math.max(
|
|
12391
|
+
0,
|
|
12392
|
+
coding.findIndex((entry) => entry.primary)
|
|
12393
|
+
)
|
|
12387
12394
|
),
|
|
12388
|
-
|
|
12389
|
-
|
|
12390
|
-
|
|
12391
|
-
|
|
12392
|
-
|
|
12393
|
-
|
|
12394
|
-
|
|
12395
|
-
|
|
12396
|
-
|
|
12397
|
-
|
|
12398
|
-
|
|
12399
|
-
|
|
12400
|
-
|
|
12401
|
-
|
|
12395
|
+
onValueChange: (value) => {
|
|
12396
|
+
const selectedIndex = Number(value);
|
|
12397
|
+
setCoding(
|
|
12398
|
+
(prev) => prev.map((entry, index) => ({
|
|
12399
|
+
...entry,
|
|
12400
|
+
primary: index === selectedIndex
|
|
12401
|
+
}))
|
|
12402
|
+
);
|
|
12403
|
+
},
|
|
12404
|
+
size: "sm",
|
|
12405
|
+
className: "gap-2 [&_[data-slot=radio-group-items]]:gap-2 sm:[&_[data-slot=radio-group-legend]]:sr-only",
|
|
12406
|
+
children: coding.map((c, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12407
|
+
"div",
|
|
12408
|
+
{
|
|
12409
|
+
"data-slot": "condition-coding-row",
|
|
12410
|
+
className: "border-border/70 grid grid-cols-1 gap-2 rounded-md border p-2 sm:grid-cols-[minmax(8rem,1.1fr)_minmax(7rem,0.9fr)_minmax(10rem,1.5fr)_5.5rem_2.5rem] sm:items-center sm:border-0 sm:p-0",
|
|
12411
|
+
children: [
|
|
12412
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
12413
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-xs sm:hidden", children: "System" }),
|
|
12414
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12415
|
+
chunkXEEVDZDK_cjs.Select,
|
|
12416
|
+
{
|
|
12417
|
+
"aria-label": `Coding system ${i + 1}`,
|
|
12418
|
+
options: CODING_SYSTEMS.map((s) => ({
|
|
12419
|
+
value: s,
|
|
12420
|
+
label: s
|
|
12421
|
+
})),
|
|
12422
|
+
value: c.system,
|
|
12423
|
+
onValueChange: (v) => updateCoding(i, { system: v }),
|
|
12424
|
+
disabled: codingUnknown
|
|
12425
|
+
}
|
|
12426
|
+
)
|
|
12427
|
+
] }),
|
|
12428
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
12429
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-xs sm:hidden", children: "Code" }),
|
|
12430
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12431
|
+
chunkZ5S5JEJD_cjs.Input,
|
|
12432
|
+
{
|
|
12433
|
+
"aria-label": `Code ${i + 1}`,
|
|
12434
|
+
value: c.code,
|
|
12435
|
+
onChange: (e) => updateCoding(i, { code: e.target.value }),
|
|
12436
|
+
placeholder: "Code",
|
|
12437
|
+
disabled: codingUnknown,
|
|
12438
|
+
className: "font-mono"
|
|
12439
|
+
}
|
|
12440
|
+
)
|
|
12441
|
+
] }),
|
|
12442
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
12443
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-xs sm:hidden", children: "Display" }),
|
|
12444
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12445
|
+
chunkZ5S5JEJD_cjs.Input,
|
|
12446
|
+
{
|
|
12447
|
+
"aria-label": `Display ${i + 1}`,
|
|
12448
|
+
value: c.display ?? "",
|
|
12449
|
+
onChange: (e) => updateCoding(i, { display: e.target.value }),
|
|
12450
|
+
placeholder: "Display",
|
|
12451
|
+
disabled: codingUnknown
|
|
12452
|
+
}
|
|
12453
|
+
)
|
|
12454
|
+
] }),
|
|
12455
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-10 items-center gap-1.5 text-xs sm:justify-center", children: [
|
|
12456
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12457
|
+
chunkG7EQ3JPX_cjs.Radio,
|
|
12458
|
+
{
|
|
12459
|
+
value: String(i),
|
|
12460
|
+
"aria-label": `Primary code: ${c.system} ${c.code || `row ${i + 1}`}`,
|
|
12461
|
+
disabled: codingUnknown
|
|
12462
|
+
}
|
|
12463
|
+
),
|
|
12464
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sm:sr-only", children: "Primary code" })
|
|
12465
|
+
] }),
|
|
12466
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12467
|
+
chunkIINZWUGK_cjs.Button,
|
|
12468
|
+
{
|
|
12469
|
+
variant: "ghost",
|
|
12470
|
+
size: "icon",
|
|
12471
|
+
"aria-label": `Remove code ${i + 1}`,
|
|
12472
|
+
disabled: codingUnknown,
|
|
12473
|
+
onClick: () => setCoding(
|
|
12474
|
+
(prev) => withSinglePrimary(
|
|
12475
|
+
prev.filter((_, index) => index !== i)
|
|
12476
|
+
)
|
|
12477
|
+
),
|
|
12478
|
+
className: "h-10 w-10 justify-self-start sm:justify-self-center",
|
|
12479
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkL7L5S2HO_cjs.Trash2, { size: 14 })
|
|
12480
|
+
}
|
|
12481
|
+
)
|
|
12482
|
+
]
|
|
12483
|
+
},
|
|
12484
|
+
i
|
|
12485
|
+
))
|
|
12486
|
+
}
|
|
12487
|
+
)
|
|
12402
12488
|
] }),
|
|
12403
12489
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12404
12490
|
chunkXEEVDZDK_cjs.Select,
|
|
@@ -12409,9 +12495,39 @@ function ConditionEditor({
|
|
|
12409
12495
|
onValueChange: (v) => setVerification(v)
|
|
12410
12496
|
}
|
|
12411
12497
|
),
|
|
12412
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "
|
|
12413
|
-
/* @__PURE__ */ jsxRuntime.jsxs("
|
|
12414
|
-
"Severity",
|
|
12498
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-end gap-x-4 gap-y-2", children: [
|
|
12499
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
12500
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-sm font-medium", children: "Severity" }),
|
|
12501
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12502
|
+
"div",
|
|
12503
|
+
{
|
|
12504
|
+
role: "group",
|
|
12505
|
+
"aria-label": "Severity",
|
|
12506
|
+
className: "border-border inline-flex items-center overflow-hidden rounded-md border",
|
|
12507
|
+
children: SEVERITIES.map((s) => {
|
|
12508
|
+
const active = severity === s;
|
|
12509
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12510
|
+
"button",
|
|
12511
|
+
{
|
|
12512
|
+
type: "button",
|
|
12513
|
+
"aria-pressed": active,
|
|
12514
|
+
disabled: fields.severity?.known === false,
|
|
12515
|
+
onClick: () => setSeverity(active ? void 0 : s),
|
|
12516
|
+
className: chunkS5RVSXDV_cjs.cn(
|
|
12517
|
+
"border-border border-s px-2.5 py-1 text-xs font-medium capitalize transition-colors first:border-s-0",
|
|
12518
|
+
"disabled:opacity-40",
|
|
12519
|
+
active ? "bg-primary-600 text-white" : "bg-background text-muted-foreground hover:text-foreground"
|
|
12520
|
+
),
|
|
12521
|
+
children: s
|
|
12522
|
+
},
|
|
12523
|
+
s
|
|
12524
|
+
);
|
|
12525
|
+
})
|
|
12526
|
+
}
|
|
12527
|
+
)
|
|
12528
|
+
] }),
|
|
12529
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
12530
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-sm font-medium", children: "Certainty" }),
|
|
12415
12531
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12416
12532
|
FieldFlag,
|
|
12417
12533
|
{
|
|
@@ -12421,34 +12537,7 @@ function ConditionEditor({
|
|
|
12421
12537
|
hasValue: Boolean(severity)
|
|
12422
12538
|
}
|
|
12423
12539
|
)
|
|
12424
|
-
] })
|
|
12425
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12426
|
-
"div",
|
|
12427
|
-
{
|
|
12428
|
-
role: "group",
|
|
12429
|
-
"aria-label": "Severity",
|
|
12430
|
-
className: "border-border inline-flex items-center overflow-hidden rounded-md border",
|
|
12431
|
-
children: SEVERITIES.map((s) => {
|
|
12432
|
-
const active = severity === s;
|
|
12433
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12434
|
-
"button",
|
|
12435
|
-
{
|
|
12436
|
-
type: "button",
|
|
12437
|
-
"aria-pressed": active,
|
|
12438
|
-
disabled: fields.severity?.known === false,
|
|
12439
|
-
onClick: () => setSeverity(active ? void 0 : s),
|
|
12440
|
-
className: chunkS5RVSXDV_cjs.cn(
|
|
12441
|
-
"border-border border-s px-2.5 py-1 text-xs font-medium capitalize transition-colors first:border-s-0",
|
|
12442
|
-
"disabled:opacity-40",
|
|
12443
|
-
active ? "bg-primary-600 text-white" : "bg-background text-muted-foreground hover:text-foreground"
|
|
12444
|
-
),
|
|
12445
|
-
children: s
|
|
12446
|
-
},
|
|
12447
|
-
s
|
|
12448
|
-
);
|
|
12449
|
-
})
|
|
12450
|
-
}
|
|
12451
|
-
)
|
|
12540
|
+
] })
|
|
12452
12541
|
] }),
|
|
12453
12542
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
12454
12543
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
@@ -12463,28 +12552,33 @@ function ConditionEditor({
|
|
|
12463
12552
|
}
|
|
12464
12553
|
)
|
|
12465
12554
|
] }),
|
|
12466
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "
|
|
12555
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 items-end gap-2 sm:grid-cols-[minmax(10rem,0.8fr)_auto_minmax(14rem,1.2fr)]", children: [
|
|
12467
12556
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12468
|
-
|
|
12557
|
+
chunkSRA2L3SQ_cjs.DateInput,
|
|
12469
12558
|
{
|
|
12470
|
-
type: "date",
|
|
12471
12559
|
"aria-label": "Onset date (exact)",
|
|
12472
12560
|
value: onsetDate,
|
|
12473
|
-
onChange: (
|
|
12561
|
+
onChange: (value) => {
|
|
12562
|
+
setOnsetDate(value);
|
|
12563
|
+
if (value) setOnsetFuzzy("");
|
|
12564
|
+
},
|
|
12474
12565
|
disabled: fields.onset?.known === false,
|
|
12475
|
-
|
|
12566
|
+
validateOnBlur: true,
|
|
12567
|
+
width: "full"
|
|
12476
12568
|
}
|
|
12477
12569
|
),
|
|
12478
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-xs", children: "or" }),
|
|
12570
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground pb-3 text-center text-xs", children: "or" }),
|
|
12479
12571
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12480
12572
|
chunkZ5S5JEJD_cjs.Input,
|
|
12481
12573
|
{
|
|
12482
12574
|
"aria-label": "Onset (fuzzy)",
|
|
12483
12575
|
value: onsetFuzzy,
|
|
12484
|
-
onChange: (e) =>
|
|
12576
|
+
onChange: (e) => {
|
|
12577
|
+
setOnsetFuzzy(e.target.value);
|
|
12578
|
+
if (e.target.value) setOnsetDate("");
|
|
12579
|
+
},
|
|
12485
12580
|
disabled: fields.onset?.known === false,
|
|
12486
|
-
placeholder: 'Fuzzy \u2014 "since her twenties", "~3 months ago"'
|
|
12487
|
-
className: "min-w-48 flex-1"
|
|
12581
|
+
placeholder: 'Fuzzy \u2014 "since her twenties", "~3 months ago"'
|
|
12488
12582
|
}
|
|
12489
12583
|
)
|
|
12490
12584
|
] })
|
|
@@ -12505,7 +12599,7 @@ function ConditionEditor({
|
|
|
12505
12599
|
"Uncertainty recorded:",
|
|
12506
12600
|
" ",
|
|
12507
12601
|
Object.entries(fields).map(
|
|
12508
|
-
([k, f]) => f?.known === false ? `${k} unknown` : `${
|
|
12602
|
+
([k, f]) => f?.known === false ? `${k} unknown` : `${f?.confidence ?? "unspecified"} confidence in ${k}`
|
|
12509
12603
|
).join(", ")
|
|
12510
12604
|
] })
|
|
12511
12605
|
] })
|
|
@@ -27918,7 +28012,7 @@ var defaultOrderTabs = [
|
|
|
27918
28012
|
{ id: "rejected", label: "Rejected", statuses: ["rejected", "cancelled"] }
|
|
27919
28013
|
];
|
|
27920
28014
|
function orderToMedication(order) {
|
|
27921
|
-
const sig = order.detail ?
|
|
28015
|
+
const sig = order.detail ? chunkADUEASXF_cjs.parseSig(order.detail) : void 0;
|
|
27922
28016
|
return {
|
|
27923
28017
|
id: order.orderId,
|
|
27924
28018
|
name: order.display,
|
|
@@ -27926,7 +28020,7 @@ function orderToMedication(order) {
|
|
|
27926
28020
|
status: "unreconciled",
|
|
27927
28021
|
indication: order.indication,
|
|
27928
28022
|
pharmacyNotes: order.notes,
|
|
27929
|
-
...
|
|
28023
|
+
...chunkADUEASXF_cjs.labelToMedicationFields(order.display),
|
|
27930
28024
|
...sig && {
|
|
27931
28025
|
route: sig.route,
|
|
27932
28026
|
frequency: sig.frequency,
|
|
@@ -27997,7 +28091,7 @@ function BaseOrderEditor({
|
|
|
27997
28091
|
onSave
|
|
27998
28092
|
}) {
|
|
27999
28093
|
const config = TYPE_CONFIG[type];
|
|
28000
|
-
const ambientCodeLookup =
|
|
28094
|
+
const ambientCodeLookup = chunkADUEASXF_cjs.useCodeLookupConfig();
|
|
28001
28095
|
const effectiveCodeLookup = codeLookup === false ? void 0 : codeLookup ?? ambientCodeLookup ?? void 0;
|
|
28002
28096
|
const [draft, setDraft] = React12__namespace.useState(
|
|
28003
28097
|
() => order ?? {
|
|
@@ -28196,7 +28290,7 @@ function OrderEditor({
|
|
|
28196
28290
|
display: ""
|
|
28197
28291
|
};
|
|
28198
28292
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
28199
|
-
|
|
28293
|
+
chunkADUEASXF_cjs.MedicationEditor,
|
|
28200
28294
|
{
|
|
28201
28295
|
open,
|
|
28202
28296
|
medication: order ? orderToMedication(order) : void 0,
|
|
@@ -30852,7 +30946,7 @@ function RelevanceControl({
|
|
|
30852
30946
|
{
|
|
30853
30947
|
role: "toolbar",
|
|
30854
30948
|
"aria-label": `Relevance for ${labelPrefix}`,
|
|
30855
|
-
onKeyDown:
|
|
30949
|
+
onKeyDown: chunkADUEASXF_cjs.toolbarKeyNav,
|
|
30856
30950
|
className: "border-border flex shrink-0 items-center overflow-hidden rounded-md border",
|
|
30857
30951
|
children: RELEVANCE_ORDER.map((relevance) => {
|
|
30858
30952
|
const active = value === relevance;
|
|
@@ -45087,11 +45181,11 @@ Object.defineProperty(exports, "unformatPhoneNumber", {
|
|
|
45087
45181
|
});
|
|
45088
45182
|
Object.defineProperty(exports, "miewebUIPreset", {
|
|
45089
45183
|
enumerable: true,
|
|
45090
|
-
get: function () { return
|
|
45184
|
+
get: function () { return chunkXRKBHECB_cjs.miewebUIPreset; }
|
|
45091
45185
|
});
|
|
45092
45186
|
Object.defineProperty(exports, "miewebUISafelist", {
|
|
45093
45187
|
enumerable: true,
|
|
45094
|
-
get: function () { return
|
|
45188
|
+
get: function () { return chunkXRKBHECB_cjs.miewebUISafelist; }
|
|
45095
45189
|
});
|
|
45096
45190
|
Object.defineProperty(exports, "Accordion", {
|
|
45097
45191
|
enumerable: true,
|
|
@@ -45187,67 +45281,67 @@ Object.defineProperty(exports, "isApplicable", {
|
|
|
45187
45281
|
});
|
|
45188
45282
|
Object.defineProperty(exports, "ALLERGY_TYPE_LABELS", {
|
|
45189
45283
|
enumerable: true,
|
|
45190
|
-
get: function () { return
|
|
45284
|
+
get: function () { return chunkADUEASXF_cjs.ALLERGY_TYPE_LABELS; }
|
|
45191
45285
|
});
|
|
45192
45286
|
Object.defineProperty(exports, "AllergyList", {
|
|
45193
45287
|
enumerable: true,
|
|
45194
|
-
get: function () { return
|
|
45288
|
+
get: function () { return chunkADUEASXF_cjs.AllergyList; }
|
|
45195
45289
|
});
|
|
45196
45290
|
Object.defineProperty(exports, "AllergyManager", {
|
|
45197
45291
|
enumerable: true,
|
|
45198
|
-
get: function () { return
|
|
45292
|
+
get: function () { return chunkADUEASXF_cjs.AllergyManager; }
|
|
45199
45293
|
});
|
|
45200
45294
|
Object.defineProperty(exports, "CodeLookupProvider", {
|
|
45201
45295
|
enumerable: true,
|
|
45202
|
-
get: function () { return
|
|
45296
|
+
get: function () { return chunkADUEASXF_cjs.CodeLookupProvider; }
|
|
45203
45297
|
});
|
|
45204
45298
|
Object.defineProperty(exports, "MEDICATION_STATUS_LABELS", {
|
|
45205
45299
|
enumerable: true,
|
|
45206
|
-
get: function () { return
|
|
45300
|
+
get: function () { return chunkADUEASXF_cjs.MEDICATION_STATUS_LABELS; }
|
|
45207
45301
|
});
|
|
45208
45302
|
Object.defineProperty(exports, "MedicationEditor", {
|
|
45209
45303
|
enumerable: true,
|
|
45210
|
-
get: function () { return
|
|
45304
|
+
get: function () { return chunkADUEASXF_cjs.MedicationEditor; }
|
|
45211
45305
|
});
|
|
45212
45306
|
Object.defineProperty(exports, "MedicationList", {
|
|
45213
45307
|
enumerable: true,
|
|
45214
|
-
get: function () { return
|
|
45308
|
+
get: function () { return chunkADUEASXF_cjs.MedicationList; }
|
|
45215
45309
|
});
|
|
45216
45310
|
Object.defineProperty(exports, "MedicationReconciliation", {
|
|
45217
45311
|
enumerable: true,
|
|
45218
|
-
get: function () { return
|
|
45312
|
+
get: function () { return chunkADUEASXF_cjs.MedicationReconciliation; }
|
|
45219
45313
|
});
|
|
45220
45314
|
Object.defineProperty(exports, "RowActionToolbar", {
|
|
45221
45315
|
enumerable: true,
|
|
45222
|
-
get: function () { return
|
|
45316
|
+
get: function () { return chunkADUEASXF_cjs.RowActionToolbar; }
|
|
45223
45317
|
});
|
|
45224
45318
|
Object.defineProperty(exports, "RowIconButton", {
|
|
45225
45319
|
enumerable: true,
|
|
45226
|
-
get: function () { return
|
|
45320
|
+
get: function () { return chunkADUEASXF_cjs.RowIconButton; }
|
|
45227
45321
|
});
|
|
45228
45322
|
Object.defineProperty(exports, "labelToMedicationFields", {
|
|
45229
45323
|
enumerable: true,
|
|
45230
|
-
get: function () { return
|
|
45324
|
+
get: function () { return chunkADUEASXF_cjs.labelToMedicationFields; }
|
|
45231
45325
|
});
|
|
45232
45326
|
Object.defineProperty(exports, "lookupToMedicationFields", {
|
|
45233
45327
|
enumerable: true,
|
|
45234
|
-
get: function () { return
|
|
45328
|
+
get: function () { return chunkADUEASXF_cjs.lookupToMedicationFields; }
|
|
45235
45329
|
});
|
|
45236
45330
|
Object.defineProperty(exports, "parseMedicationLabel", {
|
|
45237
45331
|
enumerable: true,
|
|
45238
|
-
get: function () { return
|
|
45332
|
+
get: function () { return chunkADUEASXF_cjs.parseMedicationLabel; }
|
|
45239
45333
|
});
|
|
45240
45334
|
Object.defineProperty(exports, "parseSig", {
|
|
45241
45335
|
enumerable: true,
|
|
45242
|
-
get: function () { return
|
|
45336
|
+
get: function () { return chunkADUEASXF_cjs.parseSig; }
|
|
45243
45337
|
});
|
|
45244
45338
|
Object.defineProperty(exports, "toolbarKeyNav", {
|
|
45245
45339
|
enumerable: true,
|
|
45246
|
-
get: function () { return
|
|
45340
|
+
get: function () { return chunkADUEASXF_cjs.toolbarKeyNav; }
|
|
45247
45341
|
});
|
|
45248
45342
|
Object.defineProperty(exports, "useCodeLookupConfig", {
|
|
45249
45343
|
enumerable: true,
|
|
45250
|
-
get: function () { return
|
|
45344
|
+
get: function () { return chunkADUEASXF_cjs.useCodeLookupConfig; }
|
|
45251
45345
|
});
|
|
45252
45346
|
Object.defineProperty(exports, "Textarea", {
|
|
45253
45347
|
enumerable: true,
|
|
@@ -46664,6 +46758,7 @@ exports.labelClusters = labelClusters;
|
|
|
46664
46758
|
exports.loadWhatPrints = loadWhatPrints;
|
|
46665
46759
|
exports.medicationToOrder = medicationToOrder;
|
|
46666
46760
|
exports.mergeTurns = mergeTurns;
|
|
46761
|
+
exports.normalizeConditionCodingSystem = normalizeConditionCodingSystem;
|
|
46667
46762
|
exports.openRollingRecorder = openRollingRecorder;
|
|
46668
46763
|
exports.orderToMedication = orderToMedication;
|
|
46669
46764
|
exports.orderTypeForCodetype = orderTypeForCodetype;
|