@alfadocs/ui-kit 1.146.0 → 1.147.0
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/_chunks/{prescription-history-CYCg6nxp.js → prescription-history-CFs3JMIE.js} +718 -717
- package/dist/agent-catalog.json +1 -1
- package/dist/browser-support.js +1 -1
- package/dist/i18n/locales/ar.d.ts +1 -0
- package/dist/i18n/locales/ar.js +1 -0
- package/dist/i18n/locales/de.d.ts +1 -0
- package/dist/i18n/locales/de.js +1 -0
- package/dist/i18n/locales/el.d.ts +1 -0
- package/dist/i18n/locales/el.js +1 -0
- package/dist/i18n/locales/en.d.ts +1 -0
- package/dist/i18n/locales/en.js +1 -0
- package/dist/i18n/locales/es.d.ts +1 -0
- package/dist/i18n/locales/es.js +1 -0
- package/dist/i18n/locales/fr.d.ts +1 -0
- package/dist/i18n/locales/fr.js +1 -0
- package/dist/i18n/locales/hi.d.ts +1 -0
- package/dist/i18n/locales/hi.js +1 -0
- package/dist/i18n/locales/it.d.ts +1 -0
- package/dist/i18n/locales/it.js +1 -0
- package/dist/i18n/locales/ja.d.ts +1 -0
- package/dist/i18n/locales/ja.js +1 -0
- package/dist/i18n/locales/nl.d.ts +1 -0
- package/dist/i18n/locales/nl.js +1 -0
- package/dist/i18n/locales/pl.d.ts +1 -0
- package/dist/i18n/locales/pl.js +1 -0
- package/dist/i18n/locales/pt.d.ts +1 -0
- package/dist/i18n/locales/pt.js +1 -0
- package/dist/i18n/locales/ro.d.ts +1 -0
- package/dist/i18n/locales/ro.js +1 -0
- package/dist/i18n/locales/ru.d.ts +1 -0
- package/dist/i18n/locales/ru.js +1 -0
- package/dist/i18n/locales/sq.d.ts +1 -0
- package/dist/i18n/locales/sq.js +1 -0
- package/dist/i18n/locales/sv.d.ts +1 -0
- package/dist/i18n/locales/sv.js +1 -0
- package/dist/i18n/locales/tr.d.ts +1 -0
- package/dist/i18n/locales/tr.js +1 -0
- package/dist/i18n/locales/zh.d.ts +1 -0
- package/dist/i18n/locales/zh.js +1 -0
- package/dist/index.js +1 -1
- package/dist/locales/ar.json +1 -0
- package/dist/locales/de.json +1 -0
- package/dist/locales/el.json +1 -0
- package/dist/locales/en.json +1 -0
- package/dist/locales/es.json +1 -0
- package/dist/locales/fr.json +1 -0
- package/dist/locales/hi.json +1 -0
- package/dist/locales/it.json +1 -0
- package/dist/locales/ja.json +1 -0
- package/dist/locales/nl.json +1 -0
- package/dist/locales/pl.json +1 -0
- package/dist/locales/pt.json +1 -0
- package/dist/locales/ro.json +1 -0
- package/dist/locales/ru.json +1 -0
- package/dist/locales/sq.json +1 -0
- package/dist/locales/sv.json +1 -0
- package/dist/locales/tr.json +1 -0
- package/dist/locales/zh.json +1 -0
- package/dist/patterns/prescription/index.js +1 -1
- package/dist/patterns/prescription/prescription-composer.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { A as
|
|
6
|
-
import { B as
|
|
7
|
-
import { E as
|
|
8
|
-
import { E as
|
|
9
|
-
import { F as
|
|
1
|
+
import { jsxs as v, jsx as r, Fragment as _e } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Oe, useId as ye, useState as Y, useRef as x, useEffect as $e, useCallback as P, useMemo as je, useImperativeHandle as Et } from "react";
|
|
3
|
+
import { c as j } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as ve } from "react-i18next";
|
|
5
|
+
import { A as be } from "./alert-C4WKViaS.js";
|
|
6
|
+
import { B as ze } from "./button-Dp4j9ygh.js";
|
|
7
|
+
import { E as Qt } from "./empty-state-5REM7oDM.js";
|
|
8
|
+
import { E as Yt } from "./error-summary-DxNhwf_G.js";
|
|
9
|
+
import { F as Ut } from "./field-array-kwUgFOIr.js";
|
|
10
10
|
import { F as pe } from "./form-field-CyHfOVKF.js";
|
|
11
11
|
import { S as Nt } from "./select-Bw5FvGJ7.js";
|
|
12
|
-
import { S as
|
|
13
|
-
import { P as
|
|
12
|
+
import { S as De } from "./skeleton-tTWJpvAq.js";
|
|
13
|
+
import { P as Xt } from "./patient-picker-Dm74jHIk.js";
|
|
14
14
|
import { p as ct } from "./privacy-mask-text-B8YfzB7L.js";
|
|
15
|
-
import { u as
|
|
16
|
-
import { u as
|
|
17
|
-
import { u as
|
|
18
|
-
import { C as
|
|
19
|
-
import { N as
|
|
15
|
+
import { u as Jt } from "./use-controllable-state-BiY4xTzM.js";
|
|
16
|
+
import { u as we } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
17
|
+
import { u as Zt, a as er } from "./use-error-summary-CecJZo6w.js";
|
|
18
|
+
import { C as tr } from "./checkbox-DV4sNDeB.js";
|
|
19
|
+
import { N as rr } from "./number-input-Bi5Yk6PX.js";
|
|
20
20
|
import { T as nt } from "./text-input-B6iAgCr3.js";
|
|
21
|
-
import { M as
|
|
22
|
-
import { a as
|
|
21
|
+
import { M as ir } from "./medication-search-CTUtXuPT.js";
|
|
22
|
+
import { a as sr, S as nr } from "./suggestion-chip-BNRWZL51.js";
|
|
23
23
|
import { V as lt } from "./visually-hidden-BHxEUGyT.js";
|
|
24
|
-
import { T as
|
|
25
|
-
import { I as
|
|
26
|
-
import { B as
|
|
27
|
-
import { D as
|
|
28
|
-
import { K as
|
|
29
|
-
import { a as
|
|
30
|
-
import { P as
|
|
31
|
-
import { a as
|
|
32
|
-
import { f as
|
|
24
|
+
import { T as ar } from "./timestamp-UMF1llBs.js";
|
|
25
|
+
import { I as or } from "./icon-button-u9VMQn3x.js";
|
|
26
|
+
import { B as cr } from "./button-group-N60L3HMa.js";
|
|
27
|
+
import { D as Fe } from "./dropdown-menu-Bm1KALnk.js";
|
|
28
|
+
import { K as lr, a as ne, S as St } from "./key-value-pair-BykhMTcP.js";
|
|
29
|
+
import { a as dr, M as pr } from "./medication-line-DFa5oFhf.js";
|
|
30
|
+
import { P as ur } from "./print-sheet-gaxObGcm.js";
|
|
31
|
+
import { a as mr } from "./whatsapp-button-XbozeDl_.js";
|
|
32
|
+
import { f as He } from "./intl-locale-FWh-Y5_3.js";
|
|
33
33
|
import { A as qt } from "./avatar-Dp5apm1d.js";
|
|
34
34
|
import { P as Ct } from "./printer-rkK0T1gi.js";
|
|
35
|
-
import { D as
|
|
36
|
-
import { M as
|
|
37
|
-
import { M as
|
|
38
|
-
import { C as
|
|
39
|
-
import { I as
|
|
40
|
-
import { T as
|
|
41
|
-
import { R as
|
|
42
|
-
import { e as
|
|
35
|
+
import { D as fr } from "./download-CfYKJO_j.js";
|
|
36
|
+
import { M as hr } from "./mail-BqXVF2zH.js";
|
|
37
|
+
import { M as br } from "./message-square-Bye4ATvx.js";
|
|
38
|
+
import { C as gr } from "./chevron-down-DWE7GSq9.js";
|
|
39
|
+
import { I as yr } from "./icon-button-group-DEAx9M5v.js";
|
|
40
|
+
import { T as vr } from "./tag-BNlcEJfE.js";
|
|
41
|
+
import { R as Ir } from "./row-actions-CA938TAd.js";
|
|
42
|
+
import { e as Nr } from "./data-grid-CujX-2tF.js";
|
|
43
43
|
import { D as de } from "./toolbar-z_6tE7zG.js";
|
|
44
|
-
import { B as
|
|
45
|
-
import { C as
|
|
46
|
-
import { L as
|
|
47
|
-
import { C as
|
|
48
|
-
import { E as
|
|
49
|
-
function
|
|
44
|
+
import { B as Sr } from "./badge-BUk4RjTS.js";
|
|
45
|
+
import { C as kr } from "./check-DrFSN__t.js";
|
|
46
|
+
import { L as xr } from "./loader-circle-BECIU_8N.js";
|
|
47
|
+
import { C as Tr } from "./circle-alert-rGDZ73Wh.js";
|
|
48
|
+
import { E as wr } from "./eye-BjhN2nYf.js";
|
|
49
|
+
function $r(e, n) {
|
|
50
50
|
const a = {};
|
|
51
51
|
if (e.patientId && n.patientId && (a.patientId = e.patientId), e.prescriberId && n.prescriberId && (a.prescriberId = e.prescriberId), e.treatmentId && n.treatmentId === e.treatmentId && (a.treatmentId = e.treatmentId), e.items && n.items && (a.items = e.items), e.itemErrors) {
|
|
52
52
|
const h = e.itemErrors.map(
|
|
53
|
-
(u,
|
|
53
|
+
(u, S) => {
|
|
54
54
|
var N;
|
|
55
|
-
const
|
|
56
|
-
if (!u || !
|
|
57
|
-
const
|
|
58
|
-
return u.medicationId &&
|
|
55
|
+
const g = (N = n.itemErrors) == null ? void 0 : N[S];
|
|
56
|
+
if (!u || !g) return;
|
|
57
|
+
const o = {};
|
|
58
|
+
return u.medicationId && g.medicationId && (o.medicationId = u.medicationId), u.dosage && g.dosage && (o.dosage = u.dosage), u.quantity && g.quantity && (o.quantity = u.quantity), Object.keys(o).length > 0 ? o : void 0;
|
|
59
59
|
}
|
|
60
60
|
);
|
|
61
61
|
h.some((u) => u !== void 0) && (a.itemErrors = h);
|
|
62
62
|
}
|
|
63
63
|
return a;
|
|
64
64
|
}
|
|
65
|
-
const
|
|
65
|
+
const Er = 5, qr = j(
|
|
66
66
|
"ds:@container/rxline ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
67
67
|
{
|
|
68
68
|
variants: {
|
|
@@ -74,65 +74,65 @@ const $r = 5, Er = _(
|
|
|
74
74
|
defaultVariants: { separated: !1 }
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
|
-
function
|
|
77
|
+
function Cr({
|
|
78
78
|
index: e,
|
|
79
79
|
item: n,
|
|
80
80
|
medication: a,
|
|
81
81
|
medicationFieldId: h,
|
|
82
82
|
dosageFieldId: u,
|
|
83
|
-
quantityFieldId:
|
|
84
|
-
medicationError:
|
|
85
|
-
dosageError:
|
|
83
|
+
quantityFieldId: S,
|
|
84
|
+
medicationError: g,
|
|
85
|
+
dosageError: o,
|
|
86
86
|
quantityError: N,
|
|
87
|
-
announceMedicationError:
|
|
88
|
-
announceDosageError:
|
|
89
|
-
announceQuantityError:
|
|
87
|
+
announceMedicationError: q,
|
|
88
|
+
announceDosageError: k,
|
|
89
|
+
announceQuantityError: G,
|
|
90
90
|
searchMedications: L,
|
|
91
|
-
codeLabel:
|
|
91
|
+
codeLabel: ae,
|
|
92
92
|
catalogueStatus: d,
|
|
93
|
-
onCatalogueRetry:
|
|
94
|
-
suggestions:
|
|
95
|
-
onMedicationChange:
|
|
96
|
-
onDosageChange:
|
|
97
|
-
onNotesChange:
|
|
98
|
-
onQuantityChange:
|
|
99
|
-
onDurationChange:
|
|
100
|
-
onNotSubstitutableChange:
|
|
101
|
-
medicationSearchId:
|
|
102
|
-
medicationRef:
|
|
103
|
-
dosageInputRef:
|
|
104
|
-
onSuggestionChosen:
|
|
93
|
+
onCatalogueRetry: X,
|
|
94
|
+
suggestions: F,
|
|
95
|
+
onMedicationChange: $,
|
|
96
|
+
onDosageChange: O,
|
|
97
|
+
onNotesChange: oe,
|
|
98
|
+
onQuantityChange: H,
|
|
99
|
+
onDurationChange: f,
|
|
100
|
+
onNotSubstitutableChange: T,
|
|
101
|
+
medicationSearchId: z,
|
|
102
|
+
medicationRef: A,
|
|
103
|
+
dosageInputRef: J,
|
|
104
|
+
onSuggestionChosen: Z
|
|
105
105
|
}) {
|
|
106
|
-
const { t:
|
|
107
|
-
return /* @__PURE__ */
|
|
106
|
+
const { t: w } = ve("ui"), c = e + 1, ee = `${h}-legend`, m = F.slice(0, Er), s = `${h}-hint`;
|
|
107
|
+
return /* @__PURE__ */ v(
|
|
108
108
|
"div",
|
|
109
109
|
{
|
|
110
110
|
role: "group",
|
|
111
|
-
"aria-labelledby":
|
|
111
|
+
"aria-labelledby": ee,
|
|
112
112
|
"data-slot": "prescription-item",
|
|
113
113
|
"data-index": e,
|
|
114
|
-
className:
|
|
114
|
+
className: qr({ separated: e > 0 }),
|
|
115
115
|
children: [
|
|
116
|
-
/* @__PURE__ */ r("p", { id:
|
|
116
|
+
/* @__PURE__ */ r("p", { id: ee, className: "type-label ds:text-foreground", children: w("prescription.composer.medicationLegend", { number: c }) }),
|
|
117
117
|
/* @__PURE__ */ r(
|
|
118
118
|
pe,
|
|
119
119
|
{
|
|
120
120
|
id: h,
|
|
121
|
-
label:
|
|
121
|
+
label: w("prescription.composer.medication"),
|
|
122
122
|
required: !0,
|
|
123
|
-
error:
|
|
124
|
-
announceError:
|
|
123
|
+
error: g,
|
|
124
|
+
announceError: q,
|
|
125
125
|
children: /* @__PURE__ */ r(
|
|
126
|
-
|
|
126
|
+
ir,
|
|
127
127
|
{
|
|
128
|
-
ref:
|
|
129
|
-
id:
|
|
128
|
+
ref: A,
|
|
129
|
+
id: z,
|
|
130
130
|
loadOptions: L,
|
|
131
131
|
value: a,
|
|
132
|
-
onValueChange:
|
|
133
|
-
codeLabel:
|
|
132
|
+
onValueChange: $,
|
|
133
|
+
codeLabel: ae,
|
|
134
134
|
status: d,
|
|
135
|
-
onRetry:
|
|
135
|
+
onRetry: X
|
|
136
136
|
}
|
|
137
137
|
)
|
|
138
138
|
}
|
|
@@ -141,115 +141,115 @@ function qr({
|
|
|
141
141
|
pe,
|
|
142
142
|
{
|
|
143
143
|
id: u,
|
|
144
|
-
label:
|
|
144
|
+
label: w("prescription.composer.dosage"),
|
|
145
145
|
required: !0,
|
|
146
|
-
error:
|
|
147
|
-
announceError:
|
|
146
|
+
error: o,
|
|
147
|
+
announceError: k,
|
|
148
148
|
children: /* @__PURE__ */ r(
|
|
149
149
|
nt,
|
|
150
150
|
{
|
|
151
|
-
ref:
|
|
151
|
+
ref: J,
|
|
152
152
|
dir: "auto",
|
|
153
153
|
value: n.dosage,
|
|
154
|
-
onChange: (
|
|
154
|
+
onChange: (b) => O(b.target.value)
|
|
155
155
|
}
|
|
156
156
|
)
|
|
157
157
|
}
|
|
158
158
|
),
|
|
159
|
-
a &&
|
|
159
|
+
a && m.length > 0 ? /* @__PURE__ */ v(
|
|
160
160
|
"div",
|
|
161
161
|
{
|
|
162
162
|
"data-slot": "dosage-suggestions",
|
|
163
163
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
164
164
|
children: [
|
|
165
|
-
/* @__PURE__ */ r("p", { id: s, className: "type-body-sm ds:text-muted-foreground", children:
|
|
165
|
+
/* @__PURE__ */ r("p", { id: s, className: "type-body-sm ds:text-muted-foreground", children: w("prescription.composer.dosageSuggestionsHint") }),
|
|
166
166
|
/* @__PURE__ */ r(
|
|
167
|
-
|
|
167
|
+
sr,
|
|
168
168
|
{
|
|
169
|
-
label:
|
|
169
|
+
label: w("prescription.composer.dosageSuggestions"),
|
|
170
170
|
"aria-describedby": s,
|
|
171
|
-
children:
|
|
172
|
-
|
|
171
|
+
children: m.map((b) => /* @__PURE__ */ r(
|
|
172
|
+
nr,
|
|
173
173
|
{
|
|
174
|
-
value:
|
|
174
|
+
value: b,
|
|
175
175
|
dir: "auto",
|
|
176
176
|
keepOnSelect: !0,
|
|
177
|
-
onSelect:
|
|
178
|
-
children:
|
|
177
|
+
onSelect: Z,
|
|
178
|
+
children: b
|
|
179
179
|
},
|
|
180
|
-
|
|
180
|
+
b
|
|
181
181
|
))
|
|
182
182
|
}
|
|
183
183
|
)
|
|
184
184
|
]
|
|
185
185
|
}
|
|
186
186
|
) : null,
|
|
187
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ v("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:@[576px]/rxline:grid-cols-[minmax(8rem,10rem)_minmax(0,1fr)_minmax(0,1fr)]", children: [
|
|
188
188
|
/* @__PURE__ */ r(
|
|
189
189
|
pe,
|
|
190
190
|
{
|
|
191
|
-
id:
|
|
192
|
-
label:
|
|
191
|
+
id: S,
|
|
192
|
+
label: w("prescription.composer.quantity"),
|
|
193
193
|
required: !0,
|
|
194
194
|
description: a == null ? void 0 : a.packsHint,
|
|
195
195
|
error: N,
|
|
196
|
-
announceError:
|
|
196
|
+
announceError: G,
|
|
197
197
|
children: /* @__PURE__ */ r(
|
|
198
|
-
|
|
198
|
+
rr,
|
|
199
199
|
{
|
|
200
200
|
min: 1,
|
|
201
201
|
max: a == null ? void 0 : a.maxPacks,
|
|
202
202
|
step: 1,
|
|
203
203
|
value: Number.isFinite(n.quantity) ? n.quantity : null,
|
|
204
|
-
onChange: (
|
|
204
|
+
onChange: (b) => H(b ?? Number.NaN)
|
|
205
205
|
}
|
|
206
206
|
)
|
|
207
207
|
}
|
|
208
208
|
),
|
|
209
|
-
/* @__PURE__ */ r(pe, { label:
|
|
209
|
+
/* @__PURE__ */ r(pe, { label: w("prescription.composer.notes"), optional: !0, children: /* @__PURE__ */ r(
|
|
210
210
|
nt,
|
|
211
211
|
{
|
|
212
212
|
dir: "auto",
|
|
213
213
|
value: n.notes,
|
|
214
|
-
onChange: (
|
|
214
|
+
onChange: (b) => oe(b.target.value)
|
|
215
215
|
}
|
|
216
216
|
) }),
|
|
217
|
-
/* @__PURE__ */ r(pe, { label:
|
|
217
|
+
/* @__PURE__ */ r(pe, { label: w("prescription.composer.duration"), optional: !0, children: /* @__PURE__ */ r(
|
|
218
218
|
nt,
|
|
219
219
|
{
|
|
220
220
|
dir: "auto",
|
|
221
221
|
value: n.duration,
|
|
222
|
-
onChange: (
|
|
222
|
+
onChange: (b) => f(b.target.value)
|
|
223
223
|
}
|
|
224
224
|
) })
|
|
225
225
|
] }),
|
|
226
226
|
/* @__PURE__ */ r(
|
|
227
|
-
|
|
227
|
+
tr,
|
|
228
228
|
{
|
|
229
|
-
label:
|
|
229
|
+
label: w("prescription.composer.notSubstitutable"),
|
|
230
230
|
checked: n.notSubstitutable,
|
|
231
231
|
disabled: !(a != null && a.code) && !n.notSubstitutable,
|
|
232
|
-
disabledReason:
|
|
233
|
-
onCheckedChange: (
|
|
232
|
+
disabledReason: w("prescription.composer.notSubstitutableNeedsCode"),
|
|
233
|
+
onCheckedChange: (b) => T(b === !0)
|
|
234
234
|
}
|
|
235
235
|
)
|
|
236
236
|
]
|
|
237
237
|
}
|
|
238
238
|
);
|
|
239
239
|
}
|
|
240
|
-
const
|
|
241
|
-
function
|
|
242
|
-
const a =
|
|
240
|
+
const Pr = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
241
|
+
function Ar(e, n) {
|
|
242
|
+
const a = Pr.exec(e);
|
|
243
243
|
if (!a) return e;
|
|
244
|
-
const h = Number(a[1]), u = Number(a[2]),
|
|
245
|
-
return
|
|
244
|
+
const h = Number(a[1]), u = Number(a[2]), S = Number(a[3]), g = new Date(2e3, u - 1, S);
|
|
245
|
+
return g.setFullYear(h), Number.isNaN(g.getTime()) || g.getMonth() !== u - 1 || g.getDate() !== S ? e : new Intl.DateTimeFormat(He(n), {
|
|
246
246
|
dateStyle: "long"
|
|
247
|
-
}).format(
|
|
247
|
+
}).format(g);
|
|
248
248
|
}
|
|
249
|
-
function
|
|
249
|
+
function Re(e) {
|
|
250
250
|
return e !== void 0 && e.trim() !== "";
|
|
251
251
|
}
|
|
252
|
-
const
|
|
252
|
+
const Mr = j("ds:@container/pblock ds:flex ds:items-start", {
|
|
253
253
|
variants: {
|
|
254
254
|
density: {
|
|
255
255
|
default: "ds:gap-[var(--spacing-md)]",
|
|
@@ -257,46 +257,46 @@ const Ar = _("ds:@container/pblock ds:flex ds:items-start", {
|
|
|
257
257
|
}
|
|
258
258
|
},
|
|
259
259
|
defaultVariants: { density: "default" }
|
|
260
|
-
}), dt =
|
|
260
|
+
}), dt = Oe(
|
|
261
261
|
({
|
|
262
262
|
patient: e,
|
|
263
263
|
privacyMode: n = !1,
|
|
264
264
|
density: a = "default",
|
|
265
265
|
showAvatar: h = !1,
|
|
266
266
|
className: u,
|
|
267
|
-
...
|
|
268
|
-
},
|
|
269
|
-
const { t:
|
|
270
|
-
/* @__PURE__ */ r(lt, { children:
|
|
267
|
+
...S
|
|
268
|
+
}, g) => {
|
|
269
|
+
const { t: o, i18n: N } = ve("ui"), q = () => /* @__PURE__ */ v(_e, { children: [
|
|
270
|
+
/* @__PURE__ */ r(lt, { children: o("calendarWorkspace.privacy.hidden") }),
|
|
271
271
|
/* @__PURE__ */ r("span", { "aria-hidden": "true", children: ct() })
|
|
272
|
-
] }),
|
|
273
|
-
|
|
272
|
+
] }), k = [];
|
|
273
|
+
Re(e.firstName) && k.push({
|
|
274
274
|
key: "firstName",
|
|
275
|
-
label:
|
|
276
|
-
value: n ?
|
|
277
|
-
}),
|
|
275
|
+
label: o("prescription.patient.firstName"),
|
|
276
|
+
value: n ? q() : /* @__PURE__ */ r("span", { dir: "auto", children: e.firstName })
|
|
277
|
+
}), Re(e.lastName) && k.push({
|
|
278
278
|
key: "lastName",
|
|
279
|
-
label:
|
|
280
|
-
value: n ?
|
|
281
|
-
}),
|
|
279
|
+
label: o("prescription.patient.lastName"),
|
|
280
|
+
value: n ? q() : /* @__PURE__ */ r("span", { dir: "auto", children: e.lastName })
|
|
281
|
+
}), Re(e.dateOfBirth) && k.push({
|
|
282
282
|
key: "dateOfBirth",
|
|
283
|
-
label:
|
|
284
|
-
value: n ?
|
|
285
|
-
}),
|
|
283
|
+
label: o("prescription.patient.dateOfBirth"),
|
|
284
|
+
value: n ? q() : Ar(e.dateOfBirth, N.language)
|
|
285
|
+
}), Re(e.fiscalCode) && k.push({
|
|
286
286
|
key: "fiscalCode",
|
|
287
|
-
label:
|
|
288
|
-
value: n ?
|
|
287
|
+
label: o("prescription.patient.fiscalCode"),
|
|
288
|
+
value: n ? q() : e.fiscalCode,
|
|
289
289
|
mono: !0
|
|
290
290
|
});
|
|
291
|
-
const
|
|
292
|
-
return /* @__PURE__ */
|
|
291
|
+
const G = `${e.firstName} ${e.lastName}`.trim();
|
|
292
|
+
return /* @__PURE__ */ v(
|
|
293
293
|
"div",
|
|
294
294
|
{
|
|
295
|
-
...
|
|
296
|
-
ref:
|
|
295
|
+
...S,
|
|
296
|
+
ref: g,
|
|
297
297
|
role: "group",
|
|
298
|
-
"aria-label":
|
|
299
|
-
className:
|
|
298
|
+
"aria-label": o("prescription.patient.details"),
|
|
299
|
+
className: Mr({ density: a, className: u }),
|
|
300
300
|
"data-component": "prescription-patient-block",
|
|
301
301
|
"data-density": a,
|
|
302
302
|
"data-privacy": n ? "masked" : void 0,
|
|
@@ -307,7 +307,7 @@ const Ar = _("ds:@container/pblock ds:flex ds:items-start", {
|
|
|
307
307
|
/* @__PURE__ */ r(
|
|
308
308
|
qt,
|
|
309
309
|
{
|
|
310
|
-
name: n ? "" :
|
|
310
|
+
name: n ? "" : G,
|
|
311
311
|
size: "md",
|
|
312
312
|
className: "ds:shrink-0",
|
|
313
313
|
"aria-hidden": "true",
|
|
@@ -317,13 +317,13 @@ const Ar = _("ds:@container/pblock ds:flex ds:items-start", {
|
|
|
317
317
|
)
|
|
318
318
|
) : null,
|
|
319
319
|
/* @__PURE__ */ r(
|
|
320
|
-
|
|
320
|
+
lr,
|
|
321
321
|
{
|
|
322
322
|
semantic: !0,
|
|
323
323
|
rowGap: a === "compact" ? "sm" : "md",
|
|
324
324
|
className: "ds:min-w-0 ds:flex-1 ds:@[448px]/pblock:grid-cols-[repeat(2,auto_fit-content(40%)_minmax(0,1fr))]",
|
|
325
|
-
children:
|
|
326
|
-
|
|
325
|
+
children: k.map((L) => /* @__PURE__ */ r(
|
|
326
|
+
ne,
|
|
327
327
|
{
|
|
328
328
|
label: L.label,
|
|
329
329
|
value: L.value,
|
|
@@ -340,7 +340,7 @@ const Ar = _("ds:@container/pblock ds:flex ds:items-start", {
|
|
|
340
340
|
}
|
|
341
341
|
);
|
|
342
342
|
dt.displayName = "PrescriptionPatientBlock";
|
|
343
|
-
const
|
|
343
|
+
const Ge = Object.freeze({
|
|
344
344
|
medicationId: "",
|
|
345
345
|
dosage: "",
|
|
346
346
|
notes: "",
|
|
@@ -348,60 +348,60 @@ const je = Object.freeze({
|
|
|
348
348
|
notSubstitutable: !1,
|
|
349
349
|
duration: ""
|
|
350
350
|
});
|
|
351
|
-
function
|
|
351
|
+
function Lr(e = "") {
|
|
352
352
|
return {
|
|
353
353
|
patientId: "",
|
|
354
354
|
prescriberId: e,
|
|
355
355
|
treatmentId: "",
|
|
356
|
-
items: [{ ...
|
|
356
|
+
items: [{ ...Ge }]
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function U(e) {
|
|
360
360
|
return e == null || e.trim() === "";
|
|
361
361
|
}
|
|
362
362
|
function ot(e) {
|
|
363
|
-
return
|
|
363
|
+
return U(e.medicationId) && U(e.dosage) && U(e.notes) && U(e.duration) && !e.notSubstitutable;
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function Vr(e, n) {
|
|
366
366
|
if (typeof e != "number" || Number.isNaN(e)) return "required";
|
|
367
367
|
if (!Number.isInteger(e) || e < 1) return "invalid";
|
|
368
368
|
if (n !== void 0 && e > n) return "tooMany";
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function Dr(e, {
|
|
371
371
|
treatmentOptions: n,
|
|
372
372
|
treatmentOptionsPatientId: a
|
|
373
373
|
}) {
|
|
374
|
-
if (
|
|
374
|
+
if (U(e.treatmentId)) return "required";
|
|
375
375
|
if (a !== void 0 && a !== e.patientId || n && !n.some((h) => h.id === e.treatmentId))
|
|
376
376
|
return "invalid";
|
|
377
377
|
}
|
|
378
378
|
function kt(e, n = {}) {
|
|
379
379
|
const a = {};
|
|
380
|
-
|
|
381
|
-
const h =
|
|
380
|
+
U(e.patientId) && (a.patientId = "required"), U(e.prescriberId) && (a.prescriberId = "required");
|
|
381
|
+
const h = Dr(e, n);
|
|
382
382
|
h && (a.treatmentId = h);
|
|
383
383
|
const u = e.items ?? [];
|
|
384
|
-
if (u.filter((
|
|
384
|
+
if (u.filter((o) => !ot(o)).length === 0)
|
|
385
385
|
return a.items = "required", u.length > 0 && (a.itemErrors = u.map(
|
|
386
|
-
(
|
|
386
|
+
(o, N) => N === 0 ? { medicationId: "required" } : void 0
|
|
387
387
|
)), a;
|
|
388
|
-
const
|
|
389
|
-
var
|
|
390
|
-
if (ot(
|
|
388
|
+
const g = u.map((o) => {
|
|
389
|
+
var k;
|
|
390
|
+
if (ot(o)) return;
|
|
391
391
|
const N = {};
|
|
392
|
-
|
|
393
|
-
const
|
|
394
|
-
|
|
395
|
-
|
|
392
|
+
U(o.medicationId) && (N.medicationId = "required"), U(o.dosage) && (N.dosage = "required");
|
|
393
|
+
const q = Vr(
|
|
394
|
+
o.quantity,
|
|
395
|
+
U(o.medicationId) || (k = n.maxPacksFor) == null ? void 0 : k.call(n, o.medicationId.trim())
|
|
396
396
|
);
|
|
397
|
-
return
|
|
397
|
+
return q && (N.quantity = q), Object.keys(N).length > 0 ? N : void 0;
|
|
398
398
|
});
|
|
399
|
-
return
|
|
399
|
+
return g.some((o) => o !== void 0) && (a.itemErrors = g), a;
|
|
400
400
|
}
|
|
401
401
|
function xt(e) {
|
|
402
402
|
return Object.keys(e).length === 0;
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function Fr(e) {
|
|
405
405
|
return {
|
|
406
406
|
patientId: e.patientId.trim(),
|
|
407
407
|
prescriberId: e.prescriberId.trim(),
|
|
@@ -416,72 +416,73 @@ function Dr(e) {
|
|
|
416
416
|
}))
|
|
417
417
|
};
|
|
418
418
|
}
|
|
419
|
-
const
|
|
419
|
+
const Rr = j(
|
|
420
420
|
"ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-lg)]"
|
|
421
421
|
);
|
|
422
422
|
function at(e) {
|
|
423
423
|
return `${e.firstName} ${e.lastName}`.trim();
|
|
424
424
|
}
|
|
425
425
|
function Tt(e) {
|
|
426
|
-
return e.items.length > 0 ? e : { ...e, items: [{ ...
|
|
426
|
+
return e.items.length > 0 ? e : { ...e, items: [{ ...Ge }] };
|
|
427
427
|
}
|
|
428
|
-
const
|
|
428
|
+
const zr = Oe(function({
|
|
429
429
|
patients: n,
|
|
430
430
|
searchPatients: a,
|
|
431
431
|
treatmentOptions: h,
|
|
432
432
|
treatmentOptionsPatientId: u,
|
|
433
|
-
prescribers:
|
|
434
|
-
defaultPrescriberId:
|
|
435
|
-
searchMedications:
|
|
433
|
+
prescribers: S,
|
|
434
|
+
defaultPrescriberId: g,
|
|
435
|
+
searchMedications: o,
|
|
436
436
|
resolveMedication: N,
|
|
437
|
-
suggestDosages:
|
|
438
|
-
codeLabel:
|
|
439
|
-
catalogueStatus:
|
|
437
|
+
suggestDosages: q,
|
|
438
|
+
codeLabel: k,
|
|
439
|
+
catalogueStatus: G = "ready",
|
|
440
440
|
onCatalogueRetry: L,
|
|
441
|
-
value:
|
|
441
|
+
value: ae,
|
|
442
442
|
defaultValue: d,
|
|
443
|
-
onChange:
|
|
444
|
-
onSubmit:
|
|
445
|
-
onPatientChange:
|
|
446
|
-
loading:
|
|
447
|
-
error:
|
|
448
|
-
privacyMode:
|
|
449
|
-
lockPatient:
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
443
|
+
onChange: X,
|
|
444
|
+
onSubmit: F,
|
|
445
|
+
onPatientChange: $,
|
|
446
|
+
loading: O = !1,
|
|
447
|
+
error: oe,
|
|
448
|
+
privacyMode: H = !1,
|
|
449
|
+
lockPatient: f = !1,
|
|
450
|
+
editing: T = !1,
|
|
451
|
+
submitLabel: z,
|
|
452
|
+
id: A,
|
|
453
|
+
className: J,
|
|
453
454
|
...Z
|
|
454
|
-
},
|
|
455
|
-
const { t:
|
|
456
|
-
() => d ??
|
|
457
|
-
|
|
455
|
+
}, w) {
|
|
456
|
+
const { t: c } = ve("ui"), ee = ye(), m = A ?? ee, [s] = Y(
|
|
457
|
+
() => d ?? Lr(
|
|
458
|
+
g && S.some((t) => t.id === g) ? g : ""
|
|
458
459
|
)
|
|
459
|
-
), [
|
|
460
|
-
value:
|
|
461
|
-
defaultValue:
|
|
462
|
-
onChange:
|
|
463
|
-
}),
|
|
464
|
-
|
|
465
|
-
|
|
460
|
+
), [b, V] = Jt({
|
|
461
|
+
value: ae,
|
|
462
|
+
defaultValue: s,
|
|
463
|
+
onChange: X
|
|
464
|
+
}), B = Tt(b ?? s), E = x(B);
|
|
465
|
+
we(() => {
|
|
466
|
+
E.current = B;
|
|
466
467
|
});
|
|
467
|
-
const [R, K] =
|
|
468
|
-
|
|
469
|
-
|
|
468
|
+
const [R, K] = Y({}), [Ee, te] = Y(!1), [Ie, re] = Y(!1), ue = x(!1), D = x(!0);
|
|
469
|
+
$e(() => (D.current = !0, () => {
|
|
470
|
+
D.current = !1;
|
|
470
471
|
}), []);
|
|
471
|
-
const [
|
|
472
|
-
|
|
473
|
-
|
|
472
|
+
const [Ke, We] = Y(() => /* @__PURE__ */ new Map()), [W, qe] = Y(() => /* @__PURE__ */ new Map()), Ne = x(/* @__PURE__ */ new Map()), me = x(N);
|
|
473
|
+
we(() => {
|
|
474
|
+
me.current = N;
|
|
474
475
|
});
|
|
475
|
-
const
|
|
476
|
+
const fe = P(
|
|
476
477
|
(t) => {
|
|
477
478
|
var i, l;
|
|
478
|
-
return (l =
|
|
479
|
+
return (l = Ne.current.get(t) ?? ((i = me.current) == null ? void 0 : i.call(me, t))) == null ? void 0 : l.maxPacks;
|
|
479
480
|
},
|
|
480
481
|
[]
|
|
481
|
-
),
|
|
482
|
+
), y = P(
|
|
482
483
|
(t) => {
|
|
483
|
-
for (const i of t)
|
|
484
|
-
|
|
484
|
+
for (const i of t) Ne.current.set(i.id, i);
|
|
485
|
+
qe((i) => {
|
|
485
486
|
if (t.every((p) => i.get(p.id) === p)) return i;
|
|
486
487
|
const l = new Map(i);
|
|
487
488
|
for (const p of t) l.set(p.id, p);
|
|
@@ -489,211 +490,211 @@ const Rr = Ge(function({
|
|
|
489
490
|
});
|
|
490
491
|
},
|
|
491
492
|
[]
|
|
492
|
-
),
|
|
493
|
-
|
|
494
|
-
|
|
493
|
+
), he = x(o);
|
|
494
|
+
we(() => {
|
|
495
|
+
he.current = o;
|
|
495
496
|
});
|
|
496
|
-
const
|
|
497
|
+
const Se = P(
|
|
497
498
|
async (t, i) => {
|
|
498
|
-
const l = await
|
|
499
|
-
return i.signal.aborted ||
|
|
499
|
+
const l = await he.current(t, i);
|
|
500
|
+
return i.signal.aborted || y(l), l;
|
|
500
501
|
},
|
|
501
|
-
[
|
|
502
|
-
),
|
|
503
|
-
|
|
504
|
-
|
|
502
|
+
[y]
|
|
503
|
+
), ke = x(a);
|
|
504
|
+
we(() => {
|
|
505
|
+
ke.current = a;
|
|
505
506
|
});
|
|
506
|
-
const
|
|
507
|
-
if (
|
|
507
|
+
const Ce = a !== void 0, At = je(() => {
|
|
508
|
+
if (Ce)
|
|
508
509
|
return async (t, i) => {
|
|
509
|
-
const l =
|
|
510
|
-
return i.signal.aborted ||
|
|
511
|
-
const
|
|
512
|
-
for (const le of p)
|
|
513
|
-
return
|
|
510
|
+
const l = ke.current, p = l ? await l(t, i) : [];
|
|
511
|
+
return i.signal.aborted || We((M) => {
|
|
512
|
+
const Q = new Map(M);
|
|
513
|
+
for (const le of p) Q.set(le.id, le);
|
|
514
|
+
return Q;
|
|
514
515
|
}), p.map((M) => ({ id: M.id, name: at(M) }));
|
|
515
516
|
};
|
|
516
|
-
}, [
|
|
517
|
+
}, [Ce]), ce = B.patientId, xe = ce ? (n == null ? void 0 : n.find((t) => t.id === ce)) ?? Ke.get(ce) : void 0, C = P(
|
|
517
518
|
(t) => {
|
|
518
|
-
|
|
519
|
-
(i) => Object.keys(i).length === 0 ? i :
|
|
519
|
+
E.current = t, V(t), K(
|
|
520
|
+
(i) => Object.keys(i).length === 0 ? i : $r(
|
|
520
521
|
i,
|
|
521
522
|
kt(t, {
|
|
522
523
|
treatmentOptions: h,
|
|
523
524
|
treatmentOptionsPatientId: u,
|
|
524
|
-
maxPacksFor:
|
|
525
|
+
maxPacksFor: fe
|
|
525
526
|
})
|
|
526
527
|
)
|
|
527
528
|
);
|
|
528
529
|
},
|
|
529
|
-
[
|
|
530
|
-
), Qe =
|
|
530
|
+
[V, h, u, fe]
|
|
531
|
+
), Qe = P(
|
|
531
532
|
(t) => {
|
|
532
|
-
const i =
|
|
533
|
-
t !== i.patientId && (K({}),
|
|
533
|
+
const i = E.current;
|
|
534
|
+
t !== i.patientId && (K({}), te(!1), C({
|
|
534
535
|
patientId: t,
|
|
535
536
|
prescriberId: i.prescriberId,
|
|
536
537
|
treatmentId: "",
|
|
537
|
-
items: [{ ...
|
|
538
|
-
}),
|
|
538
|
+
items: [{ ...Ge }]
|
|
539
|
+
}), $ == null || $(t));
|
|
539
540
|
},
|
|
540
|
-
[
|
|
541
|
-
), pt =
|
|
541
|
+
[C, $]
|
|
542
|
+
), pt = x(!1), Ye = P(
|
|
542
543
|
(t) => {
|
|
543
|
-
pt.current = !0,
|
|
544
|
+
pt.current = !0, C({ ...E.current, prescriberId: t });
|
|
544
545
|
},
|
|
545
|
-
[
|
|
546
|
-
), ut =
|
|
547
|
-
|
|
548
|
-
if (ut.current || pt.current || !
|
|
546
|
+
[C]
|
|
547
|
+
), ut = x(!1);
|
|
548
|
+
$e(() => {
|
|
549
|
+
if (ut.current || pt.current || !g || !S.some((i) => i.id === g))
|
|
549
550
|
return;
|
|
550
551
|
ut.current = !0;
|
|
551
|
-
const t =
|
|
552
|
-
t.prescriberId === "" &&
|
|
553
|
-
}, [
|
|
554
|
-
const Ue =
|
|
555
|
-
(t) =>
|
|
556
|
-
[
|
|
557
|
-
),
|
|
552
|
+
const t = E.current;
|
|
553
|
+
t.prescriberId === "" && C({ ...t, prescriberId: g });
|
|
554
|
+
}, [g, S, C]);
|
|
555
|
+
const Ue = P(
|
|
556
|
+
(t) => C({ ...E.current, treatmentId: t }),
|
|
557
|
+
[C]
|
|
558
|
+
), ie = P(
|
|
558
559
|
(t, i) => {
|
|
559
|
-
const l =
|
|
560
|
-
t < 0 || t >= l.items.length ||
|
|
560
|
+
const l = E.current;
|
|
561
|
+
t < 0 || t >= l.items.length || C({
|
|
561
562
|
...l,
|
|
562
563
|
items: l.items.map((p, M) => {
|
|
563
564
|
if (M !== t) return p;
|
|
564
|
-
const
|
|
565
|
+
const Q = i.medicationId !== void 0 && i.medicationId !== p.medicationId;
|
|
565
566
|
return {
|
|
566
567
|
...p,
|
|
567
|
-
...
|
|
568
|
+
...Q ? { notSubstitutable: !1 } : {},
|
|
568
569
|
...i
|
|
569
570
|
};
|
|
570
571
|
})
|
|
571
572
|
});
|
|
572
573
|
},
|
|
573
|
-
[
|
|
574
|
-
), Xe =
|
|
574
|
+
[C]
|
|
575
|
+
), Xe = P(
|
|
575
576
|
(t) => {
|
|
576
|
-
const i =
|
|
577
|
-
return
|
|
577
|
+
const i = E.current;
|
|
578
|
+
return C({
|
|
578
579
|
...i,
|
|
579
|
-
items: [...i.items, { ...
|
|
580
|
+
items: [...i.items, { ...Ge, ...t }]
|
|
580
581
|
}), i.items.length;
|
|
581
582
|
},
|
|
582
|
-
[
|
|
583
|
-
), Je =
|
|
583
|
+
[C]
|
|
584
|
+
), Je = P(
|
|
584
585
|
(t) => {
|
|
585
|
-
const i =
|
|
586
|
-
i.items.length <= 1 || t < 0 || t >= i.items.length ||
|
|
586
|
+
const i = E.current;
|
|
587
|
+
i.items.length <= 1 || t < 0 || t >= i.items.length || C({
|
|
587
588
|
...i,
|
|
588
589
|
items: i.items.filter((l, p) => p !== t)
|
|
589
590
|
});
|
|
590
591
|
},
|
|
591
|
-
[
|
|
592
|
-
), mt =
|
|
593
|
-
|
|
592
|
+
[C]
|
|
593
|
+
), mt = x(null), Ze = x(/* @__PURE__ */ new Map()), et = x(/* @__PURE__ */ new Map()), [ge, Pe] = Y(null);
|
|
594
|
+
$e(() => {
|
|
594
595
|
var t, i, l, p;
|
|
595
|
-
|
|
596
|
-
}, [
|
|
597
|
-
const
|
|
598
|
-
const i =
|
|
599
|
-
Je(t), !(i <= 1) &&
|
|
596
|
+
ge && (ge.kind === "medication" ? (t = Ze.current.get(ge.index)) == null || t.focus() : ge.kind === "dosage" ? (i = et.current.get(ge.index)) == null || i.focus() : (p = (l = document.getElementById(`${m}-items`)) == null ? void 0 : l.querySelector(":scope > button")) == null || p.focus(), Pe(null));
|
|
597
|
+
}, [ge, m]);
|
|
598
|
+
const Mt = (t) => {
|
|
599
|
+
const i = E.current.items.length;
|
|
600
|
+
Je(t), !(i <= 1) && Pe(
|
|
600
601
|
i - 1 === 1 ? { kind: "add" } : { kind: "medication", index: Math.min(t, i - 2) }
|
|
601
602
|
);
|
|
602
603
|
}, ft = (t) => {
|
|
603
604
|
var i;
|
|
604
|
-
return
|
|
605
|
-
max:
|
|
605
|
+
return c("prescription.composer.errors.quantityMax", {
|
|
606
|
+
max: fe(((i = B.items[t]) == null ? void 0 : i.medicationId) ?? "")
|
|
606
607
|
});
|
|
607
|
-
},
|
|
608
|
+
}, se = (t) => {
|
|
608
609
|
var M;
|
|
609
610
|
if (t === "patient")
|
|
610
|
-
return R.patientId ?
|
|
611
|
+
return R.patientId ? c("prescription.composer.errors.patient") : void 0;
|
|
611
612
|
if (t === "prescriber")
|
|
612
|
-
return R.prescriberId ?
|
|
613
|
+
return R.prescriberId ? c("prescription.composer.errors.prescriber") : void 0;
|
|
613
614
|
if (t === "treatment")
|
|
614
|
-
return R.treatmentId ? R.treatmentId === "invalid" ?
|
|
615
|
+
return R.treatmentId ? R.treatmentId === "invalid" ? c("prescription.composer.errors.treatmentInvalid") : c("prescription.composer.errors.treatment") : void 0;
|
|
615
616
|
if (t === "items")
|
|
616
|
-
return R.items ?
|
|
617
|
+
return R.items ? c("prescription.composer.errors.items") : void 0;
|
|
617
618
|
const [i, l] = t.split(":"), p = (M = R.itemErrors) == null ? void 0 : M[Number(l)];
|
|
618
|
-
return i === "medication" ? p != null && p.medicationId && !R.items ?
|
|
619
|
-
},
|
|
619
|
+
return i === "medication" ? p != null && p.medicationId && !R.items ? c("prescription.composer.errors.medication") : void 0 : i === "quantity" ? p != null && p.quantity ? p.quantity === "tooMany" ? ft(Number(l)) : p.quantity === "invalid" ? c("prescription.composer.errors.quantityInvalid") : c("prescription.composer.errors.quantity") : void 0 : p != null && p.dosage ? c("prescription.composer.errors.dosage") : void 0;
|
|
620
|
+
}, Lt = [
|
|
620
621
|
"patient",
|
|
621
622
|
"treatment",
|
|
622
623
|
"prescriber",
|
|
623
624
|
"items",
|
|
624
|
-
...
|
|
625
|
+
...B.items.flatMap((t, i) => [
|
|
625
626
|
`medication:${i}`,
|
|
626
627
|
`dosage:${i}`,
|
|
627
628
|
`quantity:${i}`
|
|
628
629
|
])
|
|
629
|
-
],
|
|
630
|
-
if (t === "items") return `${
|
|
630
|
+
], _ = Zt(Lt, se), ht = _.listed.length > 0, Vt = (t) => {
|
|
631
|
+
if (t === "items") return `${m}-medication-0`;
|
|
631
632
|
const [i, l] = t.split(":");
|
|
632
|
-
return l === void 0 ? `${
|
|
633
|
-
},
|
|
634
|
-
var p, M,
|
|
633
|
+
return l === void 0 ? `${m}-${t}` : `${m}-${i}-${l}`;
|
|
634
|
+
}, Dt = (t) => {
|
|
635
|
+
var p, M, Q, le;
|
|
635
636
|
const [i, l] = t.split(":");
|
|
636
|
-
return i === "medication" ?
|
|
637
|
+
return i === "medication" ? c("prescription.composer.errors.medicationLine", {
|
|
637
638
|
number: Number(l) + 1
|
|
638
|
-
}) : i === "dosage" ?
|
|
639
|
+
}) : i === "dosage" ? c("prescription.composer.errors.dosageLine", {
|
|
639
640
|
number: Number(l) + 1
|
|
640
|
-
}) : i === "quantity" ? ((M = (p = R.itemErrors) == null ? void 0 : p[Number(l)]) == null ? void 0 : M.quantity) === "tooMany" ? ft(Number(l)) : ((le = (
|
|
641
|
+
}) : i === "quantity" ? ((M = (p = R.itemErrors) == null ? void 0 : p[Number(l)]) == null ? void 0 : M.quantity) === "tooMany" ? ft(Number(l)) : ((le = (Q = R.itemErrors) == null ? void 0 : Q[Number(l)]) == null ? void 0 : le.quantity) === "invalid" ? c("prescription.composer.errors.quantityInvalidLine", {
|
|
641
642
|
number: Number(l) + 1
|
|
642
|
-
}) :
|
|
643
|
+
}) : c("prescription.composer.errors.quantityLine", {
|
|
643
644
|
number: Number(l) + 1
|
|
644
|
-
}) :
|
|
645
|
-
},
|
|
645
|
+
}) : se(t) ?? "";
|
|
646
|
+
}, Ae = P(
|
|
646
647
|
(t) => {
|
|
647
|
-
K(t),
|
|
648
|
+
K(t), _.open();
|
|
648
649
|
},
|
|
649
650
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
650
|
-
[
|
|
651
|
-
),
|
|
652
|
-
() => kt(
|
|
651
|
+
[_.open]
|
|
652
|
+
), Me = P(
|
|
653
|
+
() => kt(E.current, {
|
|
653
654
|
treatmentOptions: h,
|
|
654
655
|
treatmentOptionsPatientId: u,
|
|
655
|
-
maxPacksFor:
|
|
656
|
+
maxPacksFor: fe
|
|
656
657
|
}),
|
|
657
|
-
[h, u,
|
|
658
|
-
), bt =
|
|
659
|
-
|
|
660
|
-
bt.current =
|
|
658
|
+
[h, u, fe]
|
|
659
|
+
), bt = x(F);
|
|
660
|
+
we(() => {
|
|
661
|
+
bt.current = F;
|
|
661
662
|
});
|
|
662
|
-
const tt =
|
|
663
|
-
if (
|
|
664
|
-
const t =
|
|
663
|
+
const tt = P(async () => {
|
|
664
|
+
if (ue.current) return;
|
|
665
|
+
const t = Me();
|
|
665
666
|
if (!xt(t)) {
|
|
666
|
-
|
|
667
|
+
Ae(t);
|
|
667
668
|
return;
|
|
668
669
|
}
|
|
669
|
-
K({}),
|
|
670
|
+
K({}), te(!1), ue.current = !0, re(!0);
|
|
670
671
|
try {
|
|
671
672
|
return await bt.current(
|
|
672
|
-
|
|
673
|
+
Fr(E.current)
|
|
673
674
|
) ?? void 0;
|
|
674
675
|
} catch {
|
|
675
|
-
|
|
676
|
+
D.current && te(!0);
|
|
676
677
|
return;
|
|
677
678
|
} finally {
|
|
678
|
-
|
|
679
|
+
ue.current = !1, D.current && re(!1);
|
|
679
680
|
}
|
|
680
|
-
}, [
|
|
681
|
-
const t =
|
|
682
|
-
K({}),
|
|
683
|
-
}, [
|
|
681
|
+
}, [Me, Ae]), gt = P(() => {
|
|
682
|
+
const t = E.current;
|
|
683
|
+
K({}), te(!1), C(Tt(s)), t.patientId !== s.patientId && ($ == null || $(s.patientId));
|
|
684
|
+
}, [C, s, $]);
|
|
684
685
|
Et(
|
|
685
|
-
|
|
686
|
+
w,
|
|
686
687
|
() => ({
|
|
687
|
-
getDraft: () =>
|
|
688
|
+
getDraft: () => E.current,
|
|
688
689
|
setPatient: Qe,
|
|
689
690
|
setPrescriber: Ye,
|
|
690
691
|
setTreatment: Ue,
|
|
691
692
|
addItem: Xe,
|
|
692
|
-
updateItem:
|
|
693
|
+
updateItem: ie,
|
|
693
694
|
removeItem: Je,
|
|
694
695
|
validate: () => {
|
|
695
|
-
const t =
|
|
696
|
-
return xt(t) ? K({}) :
|
|
696
|
+
const t = Me();
|
|
697
|
+
return xt(t) ? K({}) : Ae(t), t;
|
|
697
698
|
},
|
|
698
699
|
submit: tt,
|
|
699
700
|
reset: gt,
|
|
@@ -707,36 +708,36 @@ const Rr = Ge(function({
|
|
|
707
708
|
Ye,
|
|
708
709
|
Ue,
|
|
709
710
|
Xe,
|
|
710
|
-
|
|
711
|
+
ie,
|
|
711
712
|
Je,
|
|
713
|
+
Me,
|
|
712
714
|
Ae,
|
|
713
|
-
Pe,
|
|
714
715
|
tt,
|
|
715
716
|
gt
|
|
716
717
|
]
|
|
717
718
|
);
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
}, [
|
|
722
|
-
const
|
|
719
|
+
const Le = oe ?? (Ee ? c("prescription.composer.errors.submit") : void 0), Ft = er(Le, ht), Rt = f && xe !== void 0, yt = `${m}-message`, [zt, Bt] = Y("");
|
|
720
|
+
$e(() => {
|
|
721
|
+
Bt(O ? c("prescription.composer.loading") : "");
|
|
722
|
+
}, [O, c]);
|
|
723
|
+
const _t = {
|
|
723
724
|
...Z,
|
|
724
725
|
"data-component": "prescription-composer",
|
|
725
|
-
"data-component-id":
|
|
726
|
+
"data-component-id": A,
|
|
726
727
|
"data-has-patient": ce !== "" ? !0 : void 0,
|
|
727
|
-
"data-submitting":
|
|
728
|
-
},
|
|
728
|
+
"data-submitting": Ie ? !0 : void 0
|
|
729
|
+
}, jt = Rr({ className: J }), Gt = (n ?? []).map((t) => ({
|
|
729
730
|
id: t.id,
|
|
730
731
|
name: at(t)
|
|
731
|
-
})),
|
|
732
|
-
for (const t of
|
|
733
|
-
t.carePlan &&
|
|
732
|
+
})), Ot = !H && xe ? at(xe) : void 0, rt = u !== void 0 && u !== ce, Ve = rt ? [] : h ?? [], Te = [];
|
|
733
|
+
for (const t of Ve)
|
|
734
|
+
t.carePlan && !Te.some((i) => {
|
|
734
735
|
var l;
|
|
735
736
|
return i.id === ((l = t.carePlan) == null ? void 0 : l.id);
|
|
736
|
-
}) &&
|
|
737
|
-
const
|
|
738
|
-
const i =
|
|
739
|
-
return
|
|
737
|
+
}) && Te.push(t.carePlan);
|
|
738
|
+
const Ht = (t) => {
|
|
739
|
+
const i = Te.filter((p) => p.label === t.label), l = i.length > 1 ? `${t.label} (${i.findIndex((p) => p.id === t.id) + 1})` : t.label;
|
|
740
|
+
return c("prescription.composer.carePlanGroup", {
|
|
740
741
|
label: `${l}`
|
|
741
742
|
});
|
|
742
743
|
}, it = (t, i) => ({
|
|
@@ -744,134 +745,134 @@ const Rr = Ge(function({
|
|
|
744
745
|
label: t.label,
|
|
745
746
|
group: i,
|
|
746
747
|
dir: "auto"
|
|
747
|
-
}), vt =
|
|
748
|
-
|
|
749
|
-
(t) =>
|
|
748
|
+
}), vt = Te.length === 0 ? Ve.map((t) => it(t, void 0)) : [
|
|
749
|
+
...Te.flatMap(
|
|
750
|
+
(t) => Ve.filter((i) => {
|
|
750
751
|
var l;
|
|
751
752
|
return ((l = i.carePlan) == null ? void 0 : l.id) === t.id;
|
|
752
|
-
}).map((i) => it(i,
|
|
753
|
+
}).map((i) => it(i, Ht(t)))
|
|
753
754
|
),
|
|
754
|
-
...
|
|
755
|
+
...Ve.filter((t) => !t.carePlan).map(
|
|
755
756
|
(t) => it(
|
|
756
757
|
t,
|
|
757
|
-
|
|
758
|
+
c("prescription.composer.treatmentsStandalone")
|
|
758
759
|
)
|
|
759
760
|
)
|
|
760
|
-
],
|
|
761
|
+
], Kt = S.map((t) => ({
|
|
761
762
|
value: t.id,
|
|
762
763
|
label: t.name,
|
|
763
764
|
description: t.specialty,
|
|
764
765
|
dir: "auto"
|
|
765
|
-
})),
|
|
766
|
+
})), Wt = (t) => {
|
|
766
767
|
t.preventDefault(), tt();
|
|
767
|
-
}, It =
|
|
768
|
-
return /* @__PURE__ */
|
|
769
|
-
/* @__PURE__ */ r("div", { role: "status", className: "ds:sr-only", children:
|
|
770
|
-
|
|
768
|
+
}, It = Le ? /* @__PURE__ */ r(be, { id: yt, variant: "error", announce: Ft, children: /* @__PURE__ */ r(be.Description, { children: Le }) }) : null;
|
|
769
|
+
return /* @__PURE__ */ v("div", { ..._t, className: jt, children: [
|
|
770
|
+
/* @__PURE__ */ r("div", { role: "status", className: "ds:sr-only", children: zt }),
|
|
771
|
+
O ? /* @__PURE__ */ v(
|
|
771
772
|
"div",
|
|
772
773
|
{
|
|
773
774
|
"aria-hidden": "true",
|
|
774
775
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]",
|
|
775
776
|
children: [
|
|
776
|
-
/* @__PURE__ */ r(
|
|
777
|
-
/* @__PURE__ */ r(
|
|
778
|
-
/* @__PURE__ */ r(
|
|
779
|
-
/* @__PURE__ */ r(
|
|
777
|
+
/* @__PURE__ */ r(De, { variant: "rounded", size: "sm" }),
|
|
778
|
+
/* @__PURE__ */ r(De, { variant: "text", lines: 3 }),
|
|
779
|
+
/* @__PURE__ */ r(De, { variant: "rounded", size: "sm" }),
|
|
780
|
+
/* @__PURE__ */ r(De, { variant: "rounded", size: "lg" })
|
|
780
781
|
]
|
|
781
782
|
}
|
|
782
|
-
) : /* @__PURE__ */
|
|
783
|
+
) : /* @__PURE__ */ v(
|
|
783
784
|
"form",
|
|
784
785
|
{
|
|
785
786
|
noValidate: !0,
|
|
786
|
-
onSubmit:
|
|
787
|
-
"aria-labelledby": `${
|
|
787
|
+
onSubmit: Wt,
|
|
788
|
+
"aria-labelledby": `${m}-title`,
|
|
788
789
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]",
|
|
789
790
|
children: [
|
|
790
791
|
/* @__PURE__ */ r(
|
|
791
792
|
"h2",
|
|
792
793
|
{
|
|
793
794
|
ref: mt,
|
|
794
|
-
id: `${
|
|
795
|
+
id: `${m}-title`,
|
|
795
796
|
tabIndex: -1,
|
|
796
797
|
className: "type-title-section ds:m-0 ds:focus:outline-none",
|
|
797
|
-
children:
|
|
798
|
+
children: c(T ? "prescription.composer.editTitle" : "prescription.composer.title")
|
|
798
799
|
}
|
|
799
800
|
),
|
|
800
801
|
ht ? /* @__PURE__ */ r(
|
|
801
|
-
|
|
802
|
+
Yt,
|
|
802
803
|
{
|
|
803
|
-
ref:
|
|
804
|
-
title:
|
|
804
|
+
ref: _.ref,
|
|
805
|
+
title: c("prescription.composer.errorTitle"),
|
|
805
806
|
headingLevel: 3,
|
|
806
|
-
"aria-describedby":
|
|
807
|
-
errors:
|
|
807
|
+
"aria-describedby": Le ? yt : void 0,
|
|
808
|
+
errors: _.listed.map((t) => ({
|
|
808
809
|
field: t,
|
|
809
|
-
message:
|
|
810
|
-
targetId:
|
|
810
|
+
message: Dt(t),
|
|
811
|
+
targetId: Vt(t)
|
|
811
812
|
}))
|
|
812
813
|
}
|
|
813
814
|
) : null,
|
|
814
|
-
|
|
815
|
+
Rt ? null : /* @__PURE__ */ r(
|
|
815
816
|
pe,
|
|
816
817
|
{
|
|
817
|
-
id: `${
|
|
818
|
-
label:
|
|
818
|
+
id: `${m}-patient`,
|
|
819
|
+
label: c("prescription.composer.patient"),
|
|
819
820
|
required: !0,
|
|
820
|
-
description:
|
|
821
|
-
error:
|
|
822
|
-
announceError: !
|
|
821
|
+
description: H && ce !== "" ? c("calendarWorkspace.privacy.hidden") : void 0,
|
|
822
|
+
error: se("patient"),
|
|
823
|
+
announceError: !_.lists("patient"),
|
|
823
824
|
children: /* @__PURE__ */ r(
|
|
824
|
-
|
|
825
|
+
Xt,
|
|
825
826
|
{
|
|
826
827
|
value: ce,
|
|
827
828
|
onValueChange: Qe,
|
|
828
|
-
patients:
|
|
829
|
-
searchPatients:
|
|
830
|
-
selectedLabel:
|
|
831
|
-
privacyMask:
|
|
832
|
-
placeholder:
|
|
829
|
+
patients: Gt,
|
|
830
|
+
searchPatients: At,
|
|
831
|
+
selectedLabel: Ot,
|
|
832
|
+
privacyMask: H ? ct() : void 0,
|
|
833
|
+
placeholder: c("prescription.composer.patientPlaceholder")
|
|
833
834
|
}
|
|
834
835
|
)
|
|
835
836
|
}
|
|
836
837
|
),
|
|
837
|
-
ce === "" ? /* @__PURE__ */
|
|
838
|
+
ce === "" ? /* @__PURE__ */ v(_e, { children: [
|
|
838
839
|
/* @__PURE__ */ r(
|
|
839
|
-
|
|
840
|
+
Qt,
|
|
840
841
|
{
|
|
841
842
|
variant: "first-use",
|
|
842
843
|
size: "sm",
|
|
843
|
-
title:
|
|
844
|
-
description:
|
|
844
|
+
title: c("prescription.composer.choosePatientTitle"),
|
|
845
|
+
description: c("prescription.composer.choosePatientBody")
|
|
845
846
|
}
|
|
846
847
|
),
|
|
847
848
|
It
|
|
848
|
-
] }) : /* @__PURE__ */
|
|
849
|
-
|
|
849
|
+
] }) : /* @__PURE__ */ v(_e, { children: [
|
|
850
|
+
xe ? /* @__PURE__ */ r(
|
|
850
851
|
dt,
|
|
851
852
|
{
|
|
852
|
-
patient:
|
|
853
|
-
privacyMode:
|
|
853
|
+
patient: xe,
|
|
854
|
+
privacyMode: H,
|
|
854
855
|
showAvatar: !0
|
|
855
856
|
}
|
|
856
857
|
) : null,
|
|
857
858
|
/* @__PURE__ */ r(
|
|
858
859
|
pe,
|
|
859
860
|
{
|
|
860
|
-
id: `${
|
|
861
|
-
label:
|
|
861
|
+
id: `${m}-treatment`,
|
|
862
|
+
label: c("prescription.composer.treatment"),
|
|
862
863
|
required: !0,
|
|
863
|
-
description: vt.length === 0 && !rt ?
|
|
864
|
-
error:
|
|
865
|
-
announceError: !
|
|
864
|
+
description: vt.length === 0 && !rt ? c("prescription.composer.treatmentEmpty") : void 0,
|
|
865
|
+
error: se("treatment"),
|
|
866
|
+
announceError: !_.lists("treatment"),
|
|
866
867
|
children: /* @__PURE__ */ r(
|
|
867
868
|
Nt,
|
|
868
869
|
{
|
|
869
870
|
options: vt,
|
|
870
|
-
value:
|
|
871
|
+
value: B.treatmentId,
|
|
871
872
|
onValueChange: Ue,
|
|
872
|
-
id: `${
|
|
873
|
+
id: `${m}-treatment-select`,
|
|
873
874
|
disabled: rt,
|
|
874
|
-
placeholder:
|
|
875
|
+
placeholder: c("prescription.composer.treatmentPlaceholder")
|
|
875
876
|
}
|
|
876
877
|
)
|
|
877
878
|
}
|
|
@@ -879,77 +880,77 @@ const Rr = Ge(function({
|
|
|
879
880
|
/* @__PURE__ */ r(
|
|
880
881
|
pe,
|
|
881
882
|
{
|
|
882
|
-
id: `${
|
|
883
|
-
label:
|
|
883
|
+
id: `${m}-prescriber`,
|
|
884
|
+
label: c("prescription.composer.prescriber"),
|
|
884
885
|
required: !0,
|
|
885
|
-
error:
|
|
886
|
-
announceError: !
|
|
886
|
+
error: se("prescriber"),
|
|
887
|
+
announceError: !_.lists("prescriber"),
|
|
887
888
|
children: /* @__PURE__ */ r(
|
|
888
889
|
Nt,
|
|
889
890
|
{
|
|
890
|
-
options:
|
|
891
|
-
value:
|
|
891
|
+
options: Kt,
|
|
892
|
+
value: B.prescriberId,
|
|
892
893
|
onValueChange: Ye,
|
|
893
|
-
id: `${
|
|
894
|
-
placeholder:
|
|
894
|
+
id: `${m}-prescriber-select`,
|
|
895
|
+
placeholder: c("prescription.composer.prescriberPlaceholder"),
|
|
895
896
|
showDescriptions: !0
|
|
896
897
|
}
|
|
897
898
|
)
|
|
898
899
|
}
|
|
899
900
|
),
|
|
900
901
|
/* @__PURE__ */ r(
|
|
901
|
-
|
|
902
|
+
Ut,
|
|
902
903
|
{
|
|
903
|
-
id: `${
|
|
904
|
+
id: `${m}-items`,
|
|
904
905
|
className: "ds:gap-[var(--spacing-lg)] ds:[&>legend]:[--type-label-size:var(--type-title-item-size)] ds:[&>legend]:[--type-label-weight:var(--type-title-item-weight)] ds:[&>legend]:[--type-label-line-height:var(--type-title-item-line-height)]",
|
|
905
|
-
legend:
|
|
906
|
-
items:
|
|
906
|
+
legend: c("prescription.composer.medications"),
|
|
907
|
+
items: B.items,
|
|
907
908
|
min: 1,
|
|
908
|
-
addLabel:
|
|
909
|
-
removeItemLabel: (t) =>
|
|
909
|
+
addLabel: c("prescription.composer.addMedication"),
|
|
910
|
+
removeItemLabel: (t) => c("prescription.composer.removeMedication", {
|
|
910
911
|
number: t + 1
|
|
911
912
|
}),
|
|
912
913
|
onAdd: () => {
|
|
913
914
|
const t = Xe();
|
|
914
|
-
|
|
915
|
+
Pe({ kind: "medication", index: t });
|
|
915
916
|
},
|
|
916
|
-
onRemove:
|
|
917
|
+
onRemove: Mt,
|
|
917
918
|
renderItem: (t, i) => {
|
|
918
|
-
const l = t.medicationId ?
|
|
919
|
+
const l = t.medicationId ? W.get(t.medicationId) ?? (N == null ? void 0 : N(t.medicationId)) ?? null : null, p = `medication:${i}`, M = `dosage:${i}`, Q = `quantity:${i}`, le = i === 0 ? se("items") : void 0;
|
|
919
920
|
return /* @__PURE__ */ r(
|
|
920
|
-
|
|
921
|
+
Cr,
|
|
921
922
|
{
|
|
922
923
|
index: i,
|
|
923
924
|
item: t,
|
|
924
925
|
medication: l,
|
|
925
|
-
medicationFieldId: `${
|
|
926
|
-
dosageFieldId: `${
|
|
927
|
-
quantityFieldId: `${
|
|
928
|
-
medicationError: le ??
|
|
929
|
-
dosageError:
|
|
930
|
-
quantityError:
|
|
931
|
-
announceMedicationError: !
|
|
932
|
-
announceDosageError: !
|
|
933
|
-
announceQuantityError: !
|
|
934
|
-
searchMedications:
|
|
935
|
-
codeLabel:
|
|
936
|
-
catalogueStatus:
|
|
926
|
+
medicationFieldId: `${m}-medication-${i}`,
|
|
927
|
+
dosageFieldId: `${m}-dosage-${i}`,
|
|
928
|
+
quantityFieldId: `${m}-quantity-${i}`,
|
|
929
|
+
medicationError: le ?? se(p),
|
|
930
|
+
dosageError: se(M),
|
|
931
|
+
quantityError: se(Q),
|
|
932
|
+
announceMedicationError: !_.lists(le ? "items" : p),
|
|
933
|
+
announceDosageError: !_.lists(M),
|
|
934
|
+
announceQuantityError: !_.lists(Q),
|
|
935
|
+
searchMedications: Se,
|
|
936
|
+
codeLabel: k,
|
|
937
|
+
catalogueStatus: G,
|
|
937
938
|
onCatalogueRetry: L,
|
|
938
|
-
suggestions: l &&
|
|
939
|
+
suggestions: l && q ? q(l) : [],
|
|
939
940
|
onMedicationChange: (I) => {
|
|
940
|
-
I &&
|
|
941
|
+
I && y([I]);
|
|
941
942
|
const st = I == null ? void 0 : I.maxPacks;
|
|
942
|
-
|
|
943
|
+
ie(i, {
|
|
943
944
|
medicationId: (I == null ? void 0 : I.id) ?? "",
|
|
944
945
|
...st !== void 0 && t.quantity > st ? { quantity: st } : {}
|
|
945
946
|
});
|
|
946
947
|
},
|
|
947
|
-
onDosageChange: (I) =>
|
|
948
|
-
onNotesChange: (I) =>
|
|
949
|
-
onQuantityChange: (I) =>
|
|
950
|
-
onDurationChange: (I) =>
|
|
951
|
-
onNotSubstitutableChange: (I) =>
|
|
952
|
-
medicationSearchId: `${
|
|
948
|
+
onDosageChange: (I) => ie(i, { dosage: I }),
|
|
949
|
+
onNotesChange: (I) => ie(i, { notes: I }),
|
|
950
|
+
onQuantityChange: (I) => ie(i, { quantity: I }),
|
|
951
|
+
onDurationChange: (I) => ie(i, { duration: I }),
|
|
952
|
+
onNotSubstitutableChange: (I) => ie(i, { notSubstitutable: I }),
|
|
953
|
+
medicationSearchId: `${m}-medication-${i}-search`,
|
|
953
954
|
medicationRef: (I) => {
|
|
954
955
|
I ? Ze.current.set(i, I) : Ze.current.delete(i);
|
|
955
956
|
},
|
|
@@ -957,7 +958,7 @@ const Rr = Ge(function({
|
|
|
957
958
|
I ? et.current.set(i, I) : et.current.delete(i);
|
|
958
959
|
},
|
|
959
960
|
onSuggestionChosen: (I) => {
|
|
960
|
-
|
|
961
|
+
ie(i, { dosage: I }), Pe({ kind: "dosage", index: i });
|
|
961
962
|
}
|
|
962
963
|
}
|
|
963
964
|
);
|
|
@@ -966,12 +967,12 @@ const Rr = Ge(function({
|
|
|
966
967
|
),
|
|
967
968
|
It,
|
|
968
969
|
/* @__PURE__ */ r(
|
|
969
|
-
|
|
970
|
+
ze,
|
|
970
971
|
{
|
|
971
972
|
type: "submit",
|
|
972
|
-
loading:
|
|
973
|
+
loading: Ie,
|
|
973
974
|
className: "ds:self-start ds:min-h-[var(--min-target-size)]",
|
|
974
|
-
children:
|
|
975
|
+
children: z ?? c("prescription.composer.save")
|
|
975
976
|
}
|
|
976
977
|
)
|
|
977
978
|
] })
|
|
@@ -980,8 +981,8 @@ const Rr = Ge(function({
|
|
|
980
981
|
)
|
|
981
982
|
] });
|
|
982
983
|
});
|
|
983
|
-
|
|
984
|
-
const
|
|
984
|
+
zr.displayName = "PrescriptionComposer";
|
|
985
|
+
const Br = {
|
|
985
986
|
sent: "success",
|
|
986
987
|
sending: "info",
|
|
987
988
|
failed: "error"
|
|
@@ -989,16 +990,16 @@ const zr = {
|
|
|
989
990
|
function Pt({
|
|
990
991
|
status: e
|
|
991
992
|
}) {
|
|
992
|
-
const { t: n } =
|
|
993
|
-
|
|
993
|
+
const { t: n } = ve("ui"), a = e === "sent" ? /* @__PURE__ */ r(kr, { "aria-hidden": "true" }) : e === "sending" ? /* @__PURE__ */ r(
|
|
994
|
+
xr,
|
|
994
995
|
{
|
|
995
996
|
"aria-hidden": "true",
|
|
996
997
|
className: "ds:animate-spin ds:motion-reduce:animate-none"
|
|
997
998
|
}
|
|
998
|
-
) : /* @__PURE__ */ r(
|
|
999
|
-
return /* @__PURE__ */ r(
|
|
999
|
+
) : /* @__PURE__ */ r(Tr, { "aria-hidden": "true" });
|
|
1000
|
+
return /* @__PURE__ */ r(Sr, { size: "sm", variant: Br[e], leading: a, children: n(e === "sent" ? "prescription.status.sent" : e === "sending" ? "prescription.status.sending" : "prescription.status.failed") });
|
|
1000
1001
|
}
|
|
1001
|
-
const
|
|
1002
|
+
const _r = j("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]"), jr = j("ds:flex ds:flex-col", {
|
|
1002
1003
|
variants: {
|
|
1003
1004
|
density: {
|
|
1004
1005
|
default: "ds:gap-[var(--spacing-lg)]",
|
|
@@ -1007,7 +1008,7 @@ const Br = _("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]"), _r = _("ds:flex
|
|
|
1007
1008
|
},
|
|
1008
1009
|
defaultVariants: { density: "default" }
|
|
1009
1010
|
});
|
|
1010
|
-
function
|
|
1011
|
+
function Gr(e) {
|
|
1011
1012
|
if (typeof globalThis.reportError == "function") {
|
|
1012
1013
|
globalThis.reportError(e);
|
|
1013
1014
|
return;
|
|
@@ -1016,25 +1017,25 @@ function jr(e) {
|
|
|
1016
1017
|
throw e;
|
|
1017
1018
|
}, 0);
|
|
1018
1019
|
}
|
|
1019
|
-
function
|
|
1020
|
+
function Or({
|
|
1020
1021
|
label: e,
|
|
1021
1022
|
items: n,
|
|
1022
1023
|
blocked: a,
|
|
1023
1024
|
describedBy: h,
|
|
1024
1025
|
...u
|
|
1025
1026
|
}) {
|
|
1026
|
-
const [
|
|
1027
|
-
return /* @__PURE__ */
|
|
1028
|
-
|
|
1027
|
+
const [S, g] = Y(!1);
|
|
1028
|
+
return /* @__PURE__ */ v(
|
|
1029
|
+
Fe.Root,
|
|
1029
1030
|
{
|
|
1030
|
-
open:
|
|
1031
|
-
onOpenChange: (
|
|
1031
|
+
open: S && !a,
|
|
1032
|
+
onOpenChange: (o) => g(o && !a),
|
|
1032
1033
|
children: [
|
|
1033
|
-
/* @__PURE__ */ r(
|
|
1034
|
-
|
|
1034
|
+
/* @__PURE__ */ r(Fe.Trigger, { asChild: !0, children: /* @__PURE__ */ r(
|
|
1035
|
+
or,
|
|
1035
1036
|
{
|
|
1036
1037
|
...u,
|
|
1037
|
-
icon: /* @__PURE__ */ r(
|
|
1038
|
+
icon: /* @__PURE__ */ r(gr, { "aria-hidden": "true" }),
|
|
1038
1039
|
"aria-label": e,
|
|
1039
1040
|
"aria-haspopup": "menu",
|
|
1040
1041
|
"aria-disabled": a || void 0,
|
|
@@ -1043,188 +1044,188 @@ function Gr({
|
|
|
1043
1044
|
className: "ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]"
|
|
1044
1045
|
}
|
|
1045
1046
|
) }),
|
|
1046
|
-
/* @__PURE__ */ r(
|
|
1047
|
-
|
|
1047
|
+
/* @__PURE__ */ r(Fe.Content, { align: "end", children: n.map((o) => /* @__PURE__ */ r(
|
|
1048
|
+
Fe.Item,
|
|
1048
1049
|
{
|
|
1049
|
-
startIcon:
|
|
1050
|
-
"data-action":
|
|
1051
|
-
"aria-busy":
|
|
1050
|
+
startIcon: o.icon,
|
|
1051
|
+
"data-action": o.action,
|
|
1052
|
+
"aria-busy": o.busy || void 0,
|
|
1052
1053
|
onSelect: () => {
|
|
1053
|
-
|
|
1054
|
+
o.busy || o.run();
|
|
1054
1055
|
},
|
|
1055
|
-
children:
|
|
1056
|
+
children: o.label
|
|
1056
1057
|
},
|
|
1057
|
-
|
|
1058
|
+
o.action
|
|
1058
1059
|
)) })
|
|
1059
1060
|
]
|
|
1060
1061
|
}
|
|
1061
1062
|
);
|
|
1062
1063
|
}
|
|
1063
|
-
function
|
|
1064
|
+
function Hr(e) {
|
|
1064
1065
|
return typeof e == "object" && e !== null && typeof e.then == "function";
|
|
1065
1066
|
}
|
|
1066
|
-
const
|
|
1067
|
+
const Kr = Oe(
|
|
1067
1068
|
({
|
|
1068
1069
|
record: e,
|
|
1069
1070
|
practiceHeader: n,
|
|
1070
1071
|
size: a = "a4",
|
|
1071
1072
|
density: h = "default",
|
|
1072
1073
|
codeLabel: u,
|
|
1073
|
-
privacyMode:
|
|
1074
|
-
isolateBrowserPrint:
|
|
1075
|
-
numberLabel:
|
|
1074
|
+
privacyMode: S = !1,
|
|
1075
|
+
isolateBrowserPrint: g = !1,
|
|
1076
|
+
numberLabel: o,
|
|
1076
1077
|
pinLabel: N,
|
|
1077
|
-
printMode:
|
|
1078
|
-
onPrint:
|
|
1079
|
-
onDownloadPdf:
|
|
1078
|
+
printMode: q,
|
|
1079
|
+
onPrint: k,
|
|
1080
|
+
onDownloadPdf: G,
|
|
1080
1081
|
onSendEmail: L,
|
|
1081
|
-
onSendSms:
|
|
1082
|
+
onSendSms: ae,
|
|
1082
1083
|
onSendWhatsApp: d,
|
|
1083
|
-
onResend:
|
|
1084
|
-
onEdit:
|
|
1085
|
-
id:
|
|
1086
|
-
className:
|
|
1087
|
-
...
|
|
1088
|
-
},
|
|
1089
|
-
const { t:
|
|
1090
|
-
}),
|
|
1091
|
-
|
|
1092
|
-
const
|
|
1093
|
-
|
|
1094
|
-
const
|
|
1095
|
-
|
|
1096
|
-
const
|
|
1084
|
+
onResend: X,
|
|
1085
|
+
onEdit: F,
|
|
1086
|
+
id: $,
|
|
1087
|
+
className: O,
|
|
1088
|
+
...oe
|
|
1089
|
+
}, H) => {
|
|
1090
|
+
const { t: f, i18n: T } = ve("ui"), z = He(T.language), A = x(null), J = ye(), Z = ye(), w = ye(), c = ye(), ee = ye(), m = e.sendStatus, s = m === "sending" || m === "failed", V = (q ?? (m ? "host" : "sheet")) === "host", B = x(() => {
|
|
1091
|
+
}), E = x(V);
|
|
1092
|
+
E.current = V;
|
|
1093
|
+
const R = x(s);
|
|
1094
|
+
R.current = s;
|
|
1095
|
+
const K = x(e);
|
|
1096
|
+
K.current = e;
|
|
1097
|
+
const Ee = je(
|
|
1097
1098
|
() => ({
|
|
1098
1099
|
print: () => {
|
|
1099
|
-
var
|
|
1100
|
-
|
|
1100
|
+
var y;
|
|
1101
|
+
R.current || (E.current ? B.current() : (y = A.current) == null || y.print());
|
|
1101
1102
|
},
|
|
1102
|
-
getRecordId: () =>
|
|
1103
|
+
getRecordId: () => K.current.id,
|
|
1103
1104
|
focusTitle: () => {
|
|
1104
|
-
var
|
|
1105
|
-
return (
|
|
1105
|
+
var y;
|
|
1106
|
+
return (y = A.current) == null ? void 0 : y.focusTitle();
|
|
1106
1107
|
}
|
|
1107
1108
|
}),
|
|
1108
1109
|
[]
|
|
1109
1110
|
);
|
|
1110
|
-
Et(
|
|
1111
|
-
const [
|
|
1112
|
-
|
|
1113
|
-
|
|
1111
|
+
Et(H, () => Ee, [Ee]);
|
|
1112
|
+
const [te, Ie] = Y(() => /* @__PURE__ */ new Set()), re = x(/* @__PURE__ */ new Set()), ue = x(!0);
|
|
1113
|
+
$e(() => (ue.current = !0, () => {
|
|
1114
|
+
ue.current = !1;
|
|
1114
1115
|
}), []);
|
|
1115
|
-
const
|
|
1116
|
-
(
|
|
1117
|
-
if (!
|
|
1116
|
+
const D = P(
|
|
1117
|
+
(y, he) => {
|
|
1118
|
+
if (!he || re.current.has(y) || R.current && y !== "resend" && y !== "edit")
|
|
1118
1119
|
return;
|
|
1119
|
-
let
|
|
1120
|
+
let Se;
|
|
1120
1121
|
try {
|
|
1121
|
-
|
|
1122
|
-
} catch (
|
|
1123
|
-
|
|
1122
|
+
Se = he(K.current);
|
|
1123
|
+
} catch (Ce) {
|
|
1124
|
+
Gr(Ce);
|
|
1124
1125
|
return;
|
|
1125
1126
|
}
|
|
1126
|
-
if (!
|
|
1127
|
-
|
|
1128
|
-
const
|
|
1129
|
-
|
|
1127
|
+
if (!Hr(Se)) return;
|
|
1128
|
+
re.current.add(y), Ie(new Set(re.current));
|
|
1129
|
+
const ke = () => {
|
|
1130
|
+
re.current.delete(y), ue.current && Ie(new Set(re.current));
|
|
1130
1131
|
};
|
|
1131
|
-
|
|
1132
|
+
Se.then(ke, ke);
|
|
1132
1133
|
},
|
|
1133
1134
|
[]
|
|
1134
|
-
),
|
|
1135
|
-
var
|
|
1136
|
-
|
|
1137
|
-
}, [
|
|
1138
|
-
|
|
1139
|
-
const
|
|
1140
|
-
|
|
1135
|
+
), Ke = P(() => {
|
|
1136
|
+
var y;
|
|
1137
|
+
re.current.has("print") || (V || (y = A.current) == null || y.print(), D("print", k));
|
|
1138
|
+
}, [D, k, V]);
|
|
1139
|
+
B.current = () => D("print", k);
|
|
1140
|
+
const We = [
|
|
1141
|
+
k && {
|
|
1141
1142
|
action: "print",
|
|
1142
|
-
label:
|
|
1143
|
+
label: f("prescription.sheet.print"),
|
|
1143
1144
|
icon: /* @__PURE__ */ r(Ct, { "aria-hidden": "true" }),
|
|
1144
|
-
run:
|
|
1145
|
+
run: Ke
|
|
1145
1146
|
},
|
|
1146
|
-
|
|
1147
|
+
G && {
|
|
1147
1148
|
action: "downloadPdf",
|
|
1148
|
-
label:
|
|
1149
|
-
icon: /* @__PURE__ */ r(
|
|
1150
|
-
run: () =>
|
|
1149
|
+
label: f("prescription.sheet.downloadPdf"),
|
|
1150
|
+
icon: /* @__PURE__ */ r(fr, { "aria-hidden": "true" }),
|
|
1151
|
+
run: () => D("downloadPdf", G)
|
|
1151
1152
|
},
|
|
1152
1153
|
L && {
|
|
1153
1154
|
action: "sendEmail",
|
|
1154
|
-
label:
|
|
1155
|
-
icon: /* @__PURE__ */ r(
|
|
1156
|
-
run: () =>
|
|
1155
|
+
label: f("prescription.sheet.sendEmail"),
|
|
1156
|
+
icon: /* @__PURE__ */ r(hr, { "aria-hidden": "true" }),
|
|
1157
|
+
run: () => D("sendEmail", L)
|
|
1157
1158
|
},
|
|
1158
|
-
|
|
1159
|
+
ae && {
|
|
1159
1160
|
action: "sendSms",
|
|
1160
|
-
label:
|
|
1161
|
-
icon: /* @__PURE__ */ r(
|
|
1162
|
-
run: () =>
|
|
1161
|
+
label: f("prescription.sheet.sendSms"),
|
|
1162
|
+
icon: /* @__PURE__ */ r(br, { "aria-hidden": "true" }),
|
|
1163
|
+
run: () => D("sendSms", ae)
|
|
1163
1164
|
},
|
|
1164
1165
|
d && {
|
|
1165
1166
|
action: "sendWhatsApp",
|
|
1166
|
-
label:
|
|
1167
|
-
icon: /* @__PURE__ */ r(
|
|
1168
|
-
run: () =>
|
|
1167
|
+
label: f("prescription.sheet.sendWhatsApp"),
|
|
1168
|
+
icon: /* @__PURE__ */ r(mr, {}),
|
|
1169
|
+
run: () => D("sendWhatsApp", d)
|
|
1169
1170
|
}
|
|
1170
|
-
].filter((
|
|
1171
|
-
|
|
1171
|
+
].filter((y) => !!y), [W, ...qe] = We, Ne = W ? /* @__PURE__ */ r(
|
|
1172
|
+
ze,
|
|
1172
1173
|
{
|
|
1173
1174
|
type: "button",
|
|
1174
1175
|
intent: "outline",
|
|
1175
|
-
startIcon:
|
|
1176
|
-
loading:
|
|
1176
|
+
startIcon: W.icon,
|
|
1177
|
+
loading: te.has(W.action),
|
|
1177
1178
|
"aria-disabled": s || void 0,
|
|
1178
1179
|
"aria-describedby": [
|
|
1179
|
-
s ?
|
|
1180
|
-
|
|
1180
|
+
s ? c : void 0,
|
|
1181
|
+
V && W.action === "print" ? ee : void 0
|
|
1181
1182
|
].filter(Boolean).join(" ") || void 0,
|
|
1182
|
-
onClick: s ? void 0 :
|
|
1183
|
-
"data-action":
|
|
1183
|
+
onClick: s ? void 0 : W.run,
|
|
1184
|
+
"data-action": W.action,
|
|
1184
1185
|
className: "ds:min-h-[var(--min-target-size)]",
|
|
1185
|
-
children:
|
|
1186
|
+
children: W.label
|
|
1186
1187
|
}
|
|
1187
|
-
) : null,
|
|
1188
|
-
|
|
1188
|
+
) : null, me = W && qe.length > 0 ? /* @__PURE__ */ v(cr, { label: f("prescription.sheet.shareActions"), children: [
|
|
1189
|
+
Ne,
|
|
1189
1190
|
/* @__PURE__ */ r(
|
|
1190
|
-
|
|
1191
|
+
Or,
|
|
1191
1192
|
{
|
|
1192
1193
|
blocked: s,
|
|
1193
|
-
describedBy: s ?
|
|
1194
|
-
label:
|
|
1195
|
-
items:
|
|
1196
|
-
...
|
|
1197
|
-
busy:
|
|
1194
|
+
describedBy: s ? c : void 0,
|
|
1195
|
+
label: f("prescription.sheet.moreActions"),
|
|
1196
|
+
items: qe.map((y) => ({
|
|
1197
|
+
...y,
|
|
1198
|
+
busy: te.has(y.action)
|
|
1198
1199
|
}))
|
|
1199
1200
|
}
|
|
1200
1201
|
)
|
|
1201
|
-
] }) :
|
|
1202
|
-
return /* @__PURE__ */
|
|
1202
|
+
] }) : Ne, fe = me !== null;
|
|
1203
|
+
return /* @__PURE__ */ v(
|
|
1203
1204
|
"div",
|
|
1204
1205
|
{
|
|
1205
|
-
...
|
|
1206
|
-
id:
|
|
1207
|
-
className:
|
|
1206
|
+
...oe,
|
|
1207
|
+
id: $,
|
|
1208
|
+
className: _r({ className: O }),
|
|
1208
1209
|
"data-component": "prescription-sheet",
|
|
1209
|
-
"data-component-id":
|
|
1210
|
+
"data-component-id": $,
|
|
1210
1211
|
"data-prescription-id": e.id,
|
|
1211
1212
|
children: [
|
|
1212
|
-
|
|
1213
|
+
m ? /* @__PURE__ */ r(
|
|
1213
1214
|
"div",
|
|
1214
1215
|
{
|
|
1215
|
-
id:
|
|
1216
|
+
id: c,
|
|
1216
1217
|
"data-slot": "send-status",
|
|
1217
|
-
"data-send-status":
|
|
1218
|
+
"data-send-status": m,
|
|
1218
1219
|
className: "ds:mx-auto ds:flex ds:w-full ds:max-w-3xl ds:justify-center ds:print:hidden",
|
|
1219
|
-
children:
|
|
1220
|
+
children: m === "sent" ? /* @__PURE__ */ v("p", { className: "ds:m-0 ds:flex ds:flex-wrap ds:items-center ds:justify-center ds:gap-[var(--spacing-sm)] type-body-sm", children: [
|
|
1220
1221
|
/* @__PURE__ */ r(Pt, { status: "sent" }),
|
|
1221
|
-
e.sentAt ? /* @__PURE__ */
|
|
1222
|
-
|
|
1222
|
+
e.sentAt ? /* @__PURE__ */ v("span", { children: [
|
|
1223
|
+
f("prescription.sheet.sentAt"),
|
|
1223
1224
|
" ",
|
|
1224
1225
|
/* @__PURE__ */ r(
|
|
1225
|
-
|
|
1226
|
+
ar,
|
|
1226
1227
|
{
|
|
1227
|
-
locale:
|
|
1228
|
+
locale: z,
|
|
1228
1229
|
value: e.sentAt,
|
|
1229
1230
|
format: "absolute",
|
|
1230
1231
|
shape: "bare",
|
|
@@ -1235,37 +1236,37 @@ const Hr = Ge(
|
|
|
1235
1236
|
}
|
|
1236
1237
|
)
|
|
1237
1238
|
] }) : null
|
|
1238
|
-
] }) :
|
|
1239
|
-
/* @__PURE__ */ r(
|
|
1240
|
-
/* @__PURE__ */ r(
|
|
1241
|
-
|
|
1239
|
+
] }) : m === "sending" ? /* @__PURE__ */ r(be, { variant: "info", announce: "polite", className: "ds:w-full", children: /* @__PURE__ */ r(be.Title, { as: "p", children: f("prescription.sheet.sendingTitle") }) }) : /* @__PURE__ */ v(be, { variant: "error", className: "ds:w-full", children: [
|
|
1240
|
+
/* @__PURE__ */ r(be.Title, { as: "p", children: f("prescription.sheet.sendFailedTitle") }),
|
|
1241
|
+
/* @__PURE__ */ r(be.Description, { children: e.sendError ?? f("prescription.sheet.sendFailedBody") }),
|
|
1242
|
+
X || F ? /* @__PURE__ */ v(
|
|
1242
1243
|
"div",
|
|
1243
1244
|
{
|
|
1244
1245
|
"data-slot": "failed-actions",
|
|
1245
1246
|
className: "ds:mt-[var(--spacing-sm)] ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
1246
1247
|
children: [
|
|
1247
|
-
|
|
1248
|
-
|
|
1248
|
+
X ? /* @__PURE__ */ r(
|
|
1249
|
+
ze,
|
|
1249
1250
|
{
|
|
1250
1251
|
type: "button",
|
|
1251
1252
|
intent: "primary",
|
|
1252
|
-
loading:
|
|
1253
|
-
onClick: () =>
|
|
1253
|
+
loading: te.has("resend"),
|
|
1254
|
+
onClick: () => D("resend", X),
|
|
1254
1255
|
"data-action": "resend",
|
|
1255
1256
|
className: "ds:min-h-[var(--min-target-size)]",
|
|
1256
|
-
children:
|
|
1257
|
+
children: f("prescription.sheet.resend")
|
|
1257
1258
|
}
|
|
1258
1259
|
) : null,
|
|
1259
|
-
|
|
1260
|
-
|
|
1260
|
+
F ? /* @__PURE__ */ r(
|
|
1261
|
+
ze,
|
|
1261
1262
|
{
|
|
1262
1263
|
type: "button",
|
|
1263
1264
|
intent: "secondary",
|
|
1264
|
-
loading:
|
|
1265
|
-
onClick: () =>
|
|
1265
|
+
loading: te.has("edit"),
|
|
1266
|
+
onClick: () => D("edit", F),
|
|
1266
1267
|
"data-action": "edit",
|
|
1267
1268
|
className: "ds:min-h-[var(--min-target-size)]",
|
|
1268
|
-
children:
|
|
1269
|
+
children: f("prescription.sheet.edit")
|
|
1269
1270
|
}
|
|
1270
1271
|
) : null
|
|
1271
1272
|
]
|
|
@@ -1274,62 +1275,62 @@ const Hr = Ge(
|
|
|
1274
1275
|
] })
|
|
1275
1276
|
}
|
|
1276
1277
|
) : null,
|
|
1277
|
-
|
|
1278
|
+
fe ? /* @__PURE__ */ r(
|
|
1278
1279
|
"div",
|
|
1279
1280
|
{
|
|
1280
1281
|
role: "group",
|
|
1281
|
-
"aria-label":
|
|
1282
|
+
"aria-label": f("prescription.sheet.actions"),
|
|
1282
1283
|
"data-slot": "actions",
|
|
1283
1284
|
className: "ds:flex ds:flex-wrap ds:items-center ds:justify-center ds:gap-[var(--spacing-sm)] ds:print:hidden",
|
|
1284
|
-
children:
|
|
1285
|
+
children: me
|
|
1285
1286
|
}
|
|
1286
1287
|
) : null,
|
|
1287
|
-
|
|
1288
|
+
V ? (
|
|
1288
1289
|
/* Not print:hidden: when the page itself is printed (Ctrl or Cmd+P),
|
|
1289
1290
|
the summary prints with its note, right above the sheet. */
|
|
1290
1291
|
/* @__PURE__ */ r(
|
|
1291
1292
|
"p",
|
|
1292
1293
|
{
|
|
1293
|
-
id:
|
|
1294
|
+
id: ee,
|
|
1294
1295
|
"data-slot": "summary-note",
|
|
1295
1296
|
className: "ds:m-0 ds:text-center type-body-sm ds:text-[color:var(--muted-foreground)]",
|
|
1296
|
-
children:
|
|
1297
|
+
children: f("prescription.sheet.summaryNote")
|
|
1297
1298
|
}
|
|
1298
1299
|
)
|
|
1299
1300
|
) : null,
|
|
1300
1301
|
/* @__PURE__ */ r(
|
|
1301
|
-
|
|
1302
|
+
ur,
|
|
1302
1303
|
{
|
|
1303
|
-
ref:
|
|
1304
|
+
ref: A,
|
|
1304
1305
|
registerAgent: !1,
|
|
1305
|
-
id:
|
|
1306
|
+
id: $ ? `${$}-sheet` : void 0,
|
|
1306
1307
|
size: a,
|
|
1307
1308
|
density: h,
|
|
1308
|
-
isolateBrowserPrint:
|
|
1309
|
+
isolateBrowserPrint: V ? !1 : g,
|
|
1309
1310
|
header: n,
|
|
1310
|
-
title:
|
|
1311
|
+
title: f("prescription.sheet.title"),
|
|
1311
1312
|
date: e.createdAt,
|
|
1312
1313
|
signature: {
|
|
1313
1314
|
name: e.prescriber.name,
|
|
1314
1315
|
detail: e.prescriber.specialty
|
|
1315
1316
|
},
|
|
1316
|
-
children: /* @__PURE__ */
|
|
1317
|
-
/* @__PURE__ */
|
|
1317
|
+
children: /* @__PURE__ */ v("div", { className: jr({ density: h }), children: [
|
|
1318
|
+
/* @__PURE__ */ v(St, { children: [
|
|
1318
1319
|
e.number ? /* @__PURE__ */ r(
|
|
1319
|
-
|
|
1320
|
+
ne,
|
|
1320
1321
|
{
|
|
1321
|
-
label:
|
|
1322
|
+
label: o ?? f("prescription.sheet.number"),
|
|
1322
1323
|
value: /* @__PURE__ */ r("span", { dir: "ltr", children: e.number }),
|
|
1323
1324
|
mono: !0,
|
|
1324
1325
|
"data-field": "number"
|
|
1325
1326
|
}
|
|
1326
1327
|
) : null,
|
|
1327
1328
|
e.pin ? /* @__PURE__ */ r(
|
|
1328
|
-
|
|
1329
|
+
ne,
|
|
1329
1330
|
{
|
|
1330
|
-
label: N ??
|
|
1331
|
-
value:
|
|
1332
|
-
/* @__PURE__ */ r(lt, { children:
|
|
1331
|
+
label: N ?? f("prescription.sheet.pin"),
|
|
1332
|
+
value: S ? /* @__PURE__ */ v(_e, { children: [
|
|
1333
|
+
/* @__PURE__ */ r(lt, { children: f("calendarWorkspace.privacy.hidden") }),
|
|
1333
1334
|
/* @__PURE__ */ r("span", { "aria-hidden": "true", children: ct() })
|
|
1334
1335
|
] }) : /* @__PURE__ */ r("span", { dir: "ltr", children: e.pin }),
|
|
1335
1336
|
mono: !0,
|
|
@@ -1337,129 +1338,129 @@ const Hr = Ge(
|
|
|
1337
1338
|
}
|
|
1338
1339
|
) : null,
|
|
1339
1340
|
/* @__PURE__ */ r(
|
|
1340
|
-
|
|
1341
|
+
ne,
|
|
1341
1342
|
{
|
|
1342
|
-
label:
|
|
1343
|
+
label: f("prescription.sheet.treatment"),
|
|
1343
1344
|
value: /* @__PURE__ */ r("span", { dir: "auto", children: e.treatment.label }),
|
|
1344
1345
|
"data-field": "treatment"
|
|
1345
1346
|
}
|
|
1346
1347
|
),
|
|
1347
1348
|
e.treatment.carePlan ? /* @__PURE__ */ r(
|
|
1348
|
-
|
|
1349
|
+
ne,
|
|
1349
1350
|
{
|
|
1350
|
-
label:
|
|
1351
|
+
label: f("prescription.sheet.carePlan"),
|
|
1351
1352
|
value: /* @__PURE__ */ r("span", { dir: "auto", children: e.treatment.carePlan.label }),
|
|
1352
1353
|
"data-field": "carePlan"
|
|
1353
1354
|
}
|
|
1354
1355
|
) : null
|
|
1355
1356
|
] }),
|
|
1356
|
-
/* @__PURE__ */
|
|
1357
|
+
/* @__PURE__ */ v(
|
|
1357
1358
|
"section",
|
|
1358
1359
|
{
|
|
1359
|
-
"aria-labelledby":
|
|
1360
|
+
"aria-labelledby": J,
|
|
1360
1361
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
1361
1362
|
children: [
|
|
1362
1363
|
/* @__PURE__ */ r(
|
|
1363
1364
|
"h3",
|
|
1364
1365
|
{
|
|
1365
|
-
id:
|
|
1366
|
+
id: J,
|
|
1366
1367
|
className: "ds:m-0 type-title-item ds:break-after-avoid",
|
|
1367
|
-
children:
|
|
1368
|
+
children: f("prescription.sheet.patient")
|
|
1368
1369
|
}
|
|
1369
1370
|
),
|
|
1370
1371
|
/* @__PURE__ */ r(
|
|
1371
1372
|
dt,
|
|
1372
1373
|
{
|
|
1373
1374
|
patient: e.patient,
|
|
1374
|
-
privacyMode:
|
|
1375
|
+
privacyMode: S,
|
|
1375
1376
|
density: h
|
|
1376
1377
|
}
|
|
1377
1378
|
)
|
|
1378
1379
|
]
|
|
1379
1380
|
}
|
|
1380
1381
|
),
|
|
1381
|
-
/* @__PURE__ */
|
|
1382
|
+
/* @__PURE__ */ v(
|
|
1382
1383
|
"section",
|
|
1383
1384
|
{
|
|
1384
|
-
"aria-labelledby":
|
|
1385
|
+
"aria-labelledby": Z,
|
|
1385
1386
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
1386
1387
|
children: [
|
|
1387
1388
|
/* @__PURE__ */ r(
|
|
1388
1389
|
"h3",
|
|
1389
1390
|
{
|
|
1390
|
-
id:
|
|
1391
|
+
id: Z,
|
|
1391
1392
|
className: "ds:m-0 type-title-item ds:break-after-avoid",
|
|
1392
|
-
children:
|
|
1393
|
+
children: f("prescription.sheet.medications")
|
|
1393
1394
|
}
|
|
1394
1395
|
),
|
|
1395
1396
|
/* @__PURE__ */ r(
|
|
1396
|
-
|
|
1397
|
+
dr,
|
|
1397
1398
|
{
|
|
1398
1399
|
density: h,
|
|
1399
|
-
"aria-labelledby":
|
|
1400
|
-
children: e.items.map((
|
|
1401
|
-
|
|
1400
|
+
"aria-labelledby": Z,
|
|
1401
|
+
children: e.items.map((y, he) => /* @__PURE__ */ r(
|
|
1402
|
+
pr,
|
|
1402
1403
|
{
|
|
1403
1404
|
as: "li",
|
|
1404
|
-
medication:
|
|
1405
|
-
dosage:
|
|
1406
|
-
notes:
|
|
1407
|
-
quantity:
|
|
1408
|
-
duration:
|
|
1409
|
-
notSubstitutable:
|
|
1405
|
+
medication: y.medication,
|
|
1406
|
+
dosage: y.dosage,
|
|
1407
|
+
notes: y.notes,
|
|
1408
|
+
quantity: y.quantity,
|
|
1409
|
+
duration: y.duration,
|
|
1410
|
+
notSubstitutable: y.notSubstitutable,
|
|
1410
1411
|
codeLabel: u
|
|
1411
1412
|
},
|
|
1412
|
-
`${
|
|
1413
|
+
`${y.medication.id}-${he}`
|
|
1413
1414
|
))
|
|
1414
1415
|
}
|
|
1415
1416
|
)
|
|
1416
1417
|
]
|
|
1417
1418
|
}
|
|
1418
1419
|
),
|
|
1419
|
-
/* @__PURE__ */
|
|
1420
|
+
/* @__PURE__ */ v(
|
|
1420
1421
|
"section",
|
|
1421
1422
|
{
|
|
1422
|
-
"aria-labelledby":
|
|
1423
|
+
"aria-labelledby": w,
|
|
1423
1424
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
1424
1425
|
children: [
|
|
1425
1426
|
/* @__PURE__ */ r(
|
|
1426
1427
|
"h3",
|
|
1427
1428
|
{
|
|
1428
|
-
id:
|
|
1429
|
+
id: w,
|
|
1429
1430
|
className: "ds:m-0 type-title-item ds:break-after-avoid",
|
|
1430
|
-
children:
|
|
1431
|
+
children: f("prescription.sheet.prescriber")
|
|
1431
1432
|
}
|
|
1432
1433
|
),
|
|
1433
|
-
/* @__PURE__ */
|
|
1434
|
+
/* @__PURE__ */ v(St, { children: [
|
|
1434
1435
|
/* @__PURE__ */ r(
|
|
1435
|
-
|
|
1436
|
+
ne,
|
|
1436
1437
|
{
|
|
1437
|
-
label:
|
|
1438
|
+
label: f("prescription.sheet.prescriberName"),
|
|
1438
1439
|
value: /* @__PURE__ */ r("span", { dir: "auto", children: e.prescriber.name }),
|
|
1439
1440
|
"data-field": "prescriber"
|
|
1440
1441
|
}
|
|
1441
1442
|
),
|
|
1442
1443
|
e.prescriber.specialty ? /* @__PURE__ */ r(
|
|
1443
|
-
|
|
1444
|
+
ne,
|
|
1444
1445
|
{
|
|
1445
|
-
label:
|
|
1446
|
+
label: f("prescription.history.specialty"),
|
|
1446
1447
|
value: /* @__PURE__ */ r("span", { dir: "auto", children: e.prescriber.specialty }),
|
|
1447
1448
|
"data-field": "specialty"
|
|
1448
1449
|
}
|
|
1449
1450
|
) : null,
|
|
1450
1451
|
e.prescriber.fiscalCode ? /* @__PURE__ */ r(
|
|
1451
|
-
|
|
1452
|
+
ne,
|
|
1452
1453
|
{
|
|
1453
|
-
label:
|
|
1454
|
+
label: f("prescription.sheet.prescriberFiscalCode"),
|
|
1454
1455
|
value: /* @__PURE__ */ r("span", { dir: "ltr", children: e.prescriber.fiscalCode }),
|
|
1455
1456
|
mono: !0,
|
|
1456
1457
|
"data-field": "prescriberFiscalCode"
|
|
1457
1458
|
}
|
|
1458
1459
|
) : null,
|
|
1459
1460
|
e.prescriber.registrationNumber ? /* @__PURE__ */ r(
|
|
1460
|
-
|
|
1461
|
+
ne,
|
|
1461
1462
|
{
|
|
1462
|
-
label:
|
|
1463
|
+
label: f("prescription.sheet.registrationNumber"),
|
|
1463
1464
|
value: /* @__PURE__ */ r("span", { dir: "ltr", children: e.prescriber.registrationNumber }),
|
|
1464
1465
|
mono: !0,
|
|
1465
1466
|
"data-field": "registrationNumber"
|
|
@@ -1477,25 +1478,25 @@ const Hr = Ge(
|
|
|
1477
1478
|
);
|
|
1478
1479
|
}
|
|
1479
1480
|
);
|
|
1480
|
-
|
|
1481
|
-
const
|
|
1481
|
+
Kr.displayName = "PrescriptionSheet";
|
|
1482
|
+
const Wr = j("ds:block ds:min-w-0 ds:w-full"), Qr = j(
|
|
1482
1483
|
"ds:inline-flex ds:min-w-0 ds:items-center ds:gap-[var(--spacing-xs)]"
|
|
1483
|
-
),
|
|
1484
|
+
), Be = j("ds:min-w-0 ds:break-words"), Yr = j("ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]"), Ur = "11rem", Xr = j(
|
|
1484
1485
|
"ds:min-w-0 ds:break-words ds:text-[color:var(--muted-foreground)]"
|
|
1485
|
-
),
|
|
1486
|
+
), Jr = j("ds:font-mono ds:tabular-nums"), Zr = [
|
|
1486
1487
|
{ colId: "date", sort: "desc" }
|
|
1487
|
-
],
|
|
1488
|
+
], ei = {
|
|
1488
1489
|
dateStyle: "medium",
|
|
1489
1490
|
timeStyle: "short"
|
|
1490
1491
|
};
|
|
1491
1492
|
function wt(e, n) {
|
|
1492
1493
|
const a = new Date(e.createdAt);
|
|
1493
|
-
return Number.isNaN(a.getTime()) ? e.createdAt : new Intl.DateTimeFormat(
|
|
1494
|
+
return Number.isNaN(a.getTime()) ? e.createdAt : new Intl.DateTimeFormat(He(n), ei).format(
|
|
1494
1495
|
a
|
|
1495
1496
|
);
|
|
1496
1497
|
}
|
|
1497
1498
|
function $t({ name: e }) {
|
|
1498
|
-
return /* @__PURE__ */
|
|
1499
|
+
return /* @__PURE__ */ v("span", { className: Qr(), children: [
|
|
1499
1500
|
/* @__PURE__ */ r(
|
|
1500
1501
|
qt,
|
|
1501
1502
|
{
|
|
@@ -1507,38 +1508,38 @@ function $t({ name: e }) {
|
|
|
1507
1508
|
"aria-label": void 0
|
|
1508
1509
|
}
|
|
1509
1510
|
),
|
|
1510
|
-
/* @__PURE__ */ r("span", { dir: "auto", className:
|
|
1511
|
+
/* @__PURE__ */ r("span", { dir: "auto", className: Be(), children: e })
|
|
1511
1512
|
] });
|
|
1512
1513
|
}
|
|
1513
|
-
const
|
|
1514
|
+
const Yi = Oe(function({
|
|
1514
1515
|
records: n,
|
|
1515
1516
|
status: a = "ready",
|
|
1516
1517
|
onOpen: h,
|
|
1517
1518
|
onReprint: u,
|
|
1518
|
-
onRetry:
|
|
1519
|
-
caption:
|
|
1520
|
-
showPatient:
|
|
1519
|
+
onRetry: S,
|
|
1520
|
+
caption: g,
|
|
1521
|
+
showPatient: o = !1,
|
|
1521
1522
|
privacyMode: N = !1,
|
|
1522
|
-
showSendStatus:
|
|
1523
|
-
id:
|
|
1524
|
-
className:
|
|
1523
|
+
showSendStatus: q,
|
|
1524
|
+
id: k,
|
|
1525
|
+
className: G,
|
|
1525
1526
|
...L
|
|
1526
|
-
},
|
|
1527
|
-
const { t: d, i18n:
|
|
1528
|
-
const
|
|
1529
|
-
return h &&
|
|
1527
|
+
}, ae) {
|
|
1528
|
+
const { t: d, i18n: X } = ve("ui"), F = X.language || "en", $ = h !== void 0 || u !== void 0, O = q ?? n.some((T) => T.sendStatus !== void 0), oe = je(() => {
|
|
1529
|
+
const T = [];
|
|
1530
|
+
return h && T.push({
|
|
1530
1531
|
id: "open",
|
|
1531
|
-
icon: /* @__PURE__ */ r(
|
|
1532
|
+
icon: /* @__PURE__ */ r(wr, {}),
|
|
1532
1533
|
label: d("prescription.history.open"),
|
|
1533
1534
|
onClick: h
|
|
1534
|
-
}), u &&
|
|
1535
|
+
}), u && T.push({
|
|
1535
1536
|
id: "reprint",
|
|
1536
1537
|
icon: /* @__PURE__ */ r(Ct, {}),
|
|
1537
1538
|
label: d("prescription.history.reprint"),
|
|
1538
1539
|
onClick: u
|
|
1539
|
-
}),
|
|
1540
|
-
}, [d, h, u]),
|
|
1541
|
-
const
|
|
1540
|
+
}), T;
|
|
1541
|
+
}, [d, h, u]), H = je(() => {
|
|
1542
|
+
const T = new Intl.Collator(He(F)), z = (s) => wt(s, F), A = (s) => `${s.patient.lastName} ${s.patient.firstName}`.trim(), J = (s) => d(s === "sent" ? "prescription.status.sent" : s === "sending" ? "prescription.status.sending" : "prescription.status.failed"), Z = /* @__PURE__ */ r("span", { className: Xr(), children: d("prescription.history.noCarePlan") }), w = 3, c = 2, ee = o ? 2 : 1, m = [
|
|
1542
1543
|
{
|
|
1543
1544
|
id: "date",
|
|
1544
1545
|
header: d("prescription.history.date"),
|
|
@@ -1547,116 +1548,116 @@ const Qi = Ge(function({
|
|
|
1547
1548
|
sort: "date",
|
|
1548
1549
|
sortDescFirst: !0,
|
|
1549
1550
|
value: (s) => new Date(s.createdAt),
|
|
1550
|
-
exportValue:
|
|
1551
|
+
exportValue: z,
|
|
1551
1552
|
filter: { kind: "dateRange" },
|
|
1552
1553
|
search: !1,
|
|
1553
1554
|
size: 124,
|
|
1554
1555
|
wrap: !0,
|
|
1555
|
-
cell: (s) => /* @__PURE__ */ r("time", { dateTime: s.createdAt, children:
|
|
1556
|
+
cell: (s) => /* @__PURE__ */ r("time", { dateTime: s.createdAt, children: z(s) })
|
|
1556
1557
|
}
|
|
1557
1558
|
];
|
|
1558
|
-
if (
|
|
1559
|
+
if (O && (m.push({
|
|
1559
1560
|
id: "number",
|
|
1560
1561
|
header: d("prescription.history.number"),
|
|
1561
1562
|
headerLabel: d("prescription.history.number"),
|
|
1562
|
-
responsiveTier:
|
|
1563
|
+
responsiveTier: c,
|
|
1563
1564
|
sort: "text",
|
|
1564
1565
|
value: (s) => s.number ?? null,
|
|
1565
1566
|
exportValue: (s) => s.number ?? "",
|
|
1566
1567
|
filter: { kind: "text" },
|
|
1567
1568
|
size: 124,
|
|
1568
|
-
cell: (s) => s.number ? /* @__PURE__ */ r("span", { dir: "ltr", className:
|
|
1569
|
-
}),
|
|
1569
|
+
cell: (s) => s.number ? /* @__PURE__ */ r("span", { dir: "ltr", className: Jr(), children: s.number }) : null
|
|
1570
|
+
}), m.push({
|
|
1570
1571
|
id: "status",
|
|
1571
1572
|
header: d("prescription.history.status"),
|
|
1572
1573
|
headerLabel: d("prescription.history.status"),
|
|
1573
|
-
responsiveTier:
|
|
1574
|
+
responsiveTier: ee,
|
|
1574
1575
|
sort: "text",
|
|
1575
1576
|
value: (s) => s.sendStatus ?? null,
|
|
1576
|
-
exportValue: (s) => s.sendStatus ?
|
|
1577
|
+
exportValue: (s) => s.sendStatus ? J(s.sendStatus) : "",
|
|
1577
1578
|
filter: {
|
|
1578
1579
|
kind: "select",
|
|
1579
1580
|
options: ["sent", "sending", "failed"].map((s) => ({
|
|
1580
1581
|
value: s,
|
|
1581
|
-
label:
|
|
1582
|
+
label: J(s)
|
|
1582
1583
|
}))
|
|
1583
1584
|
},
|
|
1584
1585
|
search: !1,
|
|
1585
1586
|
size: 108,
|
|
1586
1587
|
cell: (s) => s.sendStatus ? /* @__PURE__ */ r(Pt, { status: s.sendStatus }) : null
|
|
1587
|
-
})),
|
|
1588
|
+
})), o && m.push({
|
|
1588
1589
|
id: "patient",
|
|
1589
1590
|
header: d("prescription.history.patient"),
|
|
1590
1591
|
headerLabel: d("prescription.history.patient"),
|
|
1591
1592
|
responsiveTier: 1,
|
|
1592
1593
|
wrap: !0,
|
|
1593
1594
|
privacy: "mask",
|
|
1594
|
-
sort: (s,
|
|
1595
|
-
value:
|
|
1596
|
-
exportValue:
|
|
1595
|
+
sort: (s, b) => T.compare(A(s), A(b)),
|
|
1596
|
+
value: A,
|
|
1597
|
+
exportValue: A,
|
|
1597
1598
|
filter: { kind: "text" },
|
|
1598
1599
|
size: 144,
|
|
1599
|
-
cell: (s) => /* @__PURE__ */ r($t, { name:
|
|
1600
|
-
}),
|
|
1600
|
+
cell: (s) => /* @__PURE__ */ r($t, { name: A(s) })
|
|
1601
|
+
}), m.push(
|
|
1601
1602
|
{
|
|
1602
1603
|
id: "treatment",
|
|
1603
1604
|
header: d("prescription.history.treatment"),
|
|
1604
1605
|
headerLabel: d("prescription.history.treatment"),
|
|
1605
|
-
responsiveTier:
|
|
1606
|
+
responsiveTier: w,
|
|
1606
1607
|
wrap: !0,
|
|
1607
1608
|
sort: "text",
|
|
1608
1609
|
value: (s) => s.treatment.label,
|
|
1609
1610
|
exportValue: (s) => s.treatment.label,
|
|
1610
1611
|
filter: { kind: "text" },
|
|
1611
1612
|
size: 136,
|
|
1612
|
-
cell: (s) => /* @__PURE__ */ r("span", { dir: "auto", className:
|
|
1613
|
+
cell: (s) => /* @__PURE__ */ r("span", { dir: "auto", className: Be(), children: s.treatment.label })
|
|
1613
1614
|
},
|
|
1614
1615
|
{
|
|
1615
1616
|
id: "carePlan",
|
|
1616
1617
|
header: d("prescription.history.carePlan"),
|
|
1617
1618
|
headerLabel: d("prescription.history.carePlan"),
|
|
1618
|
-
responsiveTier:
|
|
1619
|
+
responsiveTier: w,
|
|
1619
1620
|
wrap: !0,
|
|
1620
1621
|
sort: "text",
|
|
1621
1622
|
value: (s) => {
|
|
1622
|
-
var
|
|
1623
|
-
return ((
|
|
1623
|
+
var b;
|
|
1624
|
+
return ((b = s.treatment.carePlan) == null ? void 0 : b.label) ?? null;
|
|
1624
1625
|
},
|
|
1625
1626
|
exportValue: (s) => {
|
|
1626
|
-
var
|
|
1627
|
-
return ((
|
|
1627
|
+
var b;
|
|
1628
|
+
return ((b = s.treatment.carePlan) == null ? void 0 : b.label) ?? "";
|
|
1628
1629
|
},
|
|
1629
1630
|
filter: { kind: "select" },
|
|
1630
1631
|
size: 128,
|
|
1631
|
-
cell: (s) => s.treatment.carePlan ? /* @__PURE__ */ r("span", { dir: "auto", className:
|
|
1632
|
+
cell: (s) => s.treatment.carePlan ? /* @__PURE__ */ r("span", { dir: "auto", className: Be(), children: s.treatment.carePlan.label }) : Z
|
|
1632
1633
|
},
|
|
1633
1634
|
{
|
|
1634
1635
|
id: "medications",
|
|
1635
1636
|
header: d("prescription.history.medications"),
|
|
1636
1637
|
headerLabel: d("prescription.history.medications"),
|
|
1637
1638
|
wrap: !0,
|
|
1638
|
-
value: (s) => s.items.map((
|
|
1639
|
-
exportValue: (s) => s.items.map((
|
|
1639
|
+
value: (s) => s.items.map((b) => b.medication.name).join("; "),
|
|
1640
|
+
exportValue: (s) => s.items.map((b) => b.medication.name).join("; "),
|
|
1640
1641
|
/* The grid's filters read one scalar per row, so the drug filter is
|
|
1641
1642
|
a text "contains" on the names, not a list of drugs. */
|
|
1642
1643
|
filter: { kind: "text" },
|
|
1643
1644
|
size: 216,
|
|
1644
|
-
cell: (s) => /* @__PURE__ */ r("span", { className:
|
|
1645
|
-
|
|
1645
|
+
cell: (s) => /* @__PURE__ */ r("span", { className: Yr(), children: s.items.map((b, V) => /* @__PURE__ */ r(
|
|
1646
|
+
vr,
|
|
1646
1647
|
{
|
|
1647
|
-
label:
|
|
1648
|
+
label: b.medication.name,
|
|
1648
1649
|
size: "sm",
|
|
1649
1650
|
variant: "neutral",
|
|
1650
|
-
maxInlineSize:
|
|
1651
|
+
maxInlineSize: Ur
|
|
1651
1652
|
},
|
|
1652
|
-
`${
|
|
1653
|
+
`${b.medication.id}-${V}`
|
|
1653
1654
|
)) })
|
|
1654
1655
|
},
|
|
1655
1656
|
{
|
|
1656
1657
|
id: "prescriber",
|
|
1657
1658
|
header: d("prescription.history.prescriber"),
|
|
1658
1659
|
headerLabel: d("prescription.history.prescriber"),
|
|
1659
|
-
responsiveTier:
|
|
1660
|
+
responsiveTier: o ? w : c,
|
|
1660
1661
|
wrap: !0,
|
|
1661
1662
|
sort: "text",
|
|
1662
1663
|
value: (s) => s.prescriber.name,
|
|
@@ -1677,11 +1678,11 @@ const Qi = Ge(function({
|
|
|
1677
1678
|
exportValue: (s) => s.prescriber.specialty ?? "",
|
|
1678
1679
|
filter: { kind: "select" },
|
|
1679
1680
|
size: 140,
|
|
1680
|
-
cell: (s) => s.prescriber.specialty ? /* @__PURE__ */ r("span", { dir: "auto", className:
|
|
1681
|
+
cell: (s) => s.prescriber.specialty ? /* @__PURE__ */ r("span", { dir: "auto", className: Be(), children: s.prescriber.specialty }) : null
|
|
1681
1682
|
}
|
|
1682
|
-
),
|
|
1683
|
+
), $) {
|
|
1683
1684
|
const s = d("prescription.history.actions");
|
|
1684
|
-
|
|
1685
|
+
m.push({
|
|
1685
1686
|
id: "actions",
|
|
1686
1687
|
header: /* @__PURE__ */ r(lt, { children: s }),
|
|
1687
1688
|
headerLabel: s,
|
|
@@ -1696,24 +1697,24 @@ const Qi = Ge(function({
|
|
|
1696
1697
|
search: !1,
|
|
1697
1698
|
/* The kit RowActions leaf, menu only: one "Actions" button per row,
|
|
1698
1699
|
named by reference with the row's own name. */
|
|
1699
|
-
cell: (
|
|
1700
|
-
|
|
1700
|
+
cell: (b, V) => /* @__PURE__ */ r(
|
|
1701
|
+
Ir,
|
|
1701
1702
|
{
|
|
1702
|
-
row:
|
|
1703
|
-
actions:
|
|
1703
|
+
row: b,
|
|
1704
|
+
actions: oe,
|
|
1704
1705
|
maxInline: 0,
|
|
1705
|
-
"aria-labelledby":
|
|
1706
|
+
"aria-labelledby": V.inputLabelledBy
|
|
1706
1707
|
}
|
|
1707
1708
|
)
|
|
1708
1709
|
});
|
|
1709
1710
|
}
|
|
1710
|
-
return
|
|
1711
|
-
}, [d,
|
|
1712
|
-
/* @__PURE__ */
|
|
1711
|
+
return m;
|
|
1712
|
+
}, [d, F, $, o, O, oe]), f = /* @__PURE__ */ v(de, { children: [
|
|
1713
|
+
/* @__PURE__ */ v(de.FilterBar, { children: [
|
|
1713
1714
|
/* @__PURE__ */ r(de.QuickSearch, {}),
|
|
1714
1715
|
/* @__PURE__ */ r(de.FilterChips, {})
|
|
1715
1716
|
] }),
|
|
1716
|
-
/* @__PURE__ */ r(de.Actions, { children: /* @__PURE__ */
|
|
1717
|
+
/* @__PURE__ */ r(de.Actions, { children: /* @__PURE__ */ v(yr, { "aria-label": d("dataTable.tableActions"), children: [
|
|
1717
1718
|
/* @__PURE__ */ r(de.ExportMenu, {}),
|
|
1718
1719
|
/* @__PURE__ */ r(de.Print, {}),
|
|
1719
1720
|
/* @__PURE__ */ r(de.ColumnToggle, {})
|
|
@@ -1723,35 +1724,35 @@ const Qi = Ge(function({
|
|
|
1723
1724
|
"div",
|
|
1724
1725
|
{
|
|
1725
1726
|
...L,
|
|
1726
|
-
ref:
|
|
1727
|
+
ref: ae,
|
|
1727
1728
|
"data-component": "prescription-history",
|
|
1728
|
-
"data-component-id":
|
|
1729
|
-
className:
|
|
1729
|
+
"data-component-id": k,
|
|
1730
|
+
className: Wr({ className: G }),
|
|
1730
1731
|
children: /* @__PURE__ */ r(
|
|
1731
|
-
|
|
1732
|
+
Nr,
|
|
1732
1733
|
{
|
|
1733
|
-
columns:
|
|
1734
|
+
columns: H,
|
|
1734
1735
|
rows: n,
|
|
1735
|
-
getRowId: (
|
|
1736
|
-
getRowLabel: (
|
|
1737
|
-
const
|
|
1738
|
-
date: wt(
|
|
1736
|
+
getRowId: (T) => T.id,
|
|
1737
|
+
getRowLabel: (T) => {
|
|
1738
|
+
const z = d("prescription.history.rowLabel", {
|
|
1739
|
+
date: wt(T, F)
|
|
1739
1740
|
});
|
|
1740
|
-
return
|
|
1741
|
+
return o ? `${z}, ${T.patient.lastName} ${T.patient.firstName}` : z;
|
|
1741
1742
|
},
|
|
1742
1743
|
privacyMode: N,
|
|
1743
|
-
toolbar:
|
|
1744
|
-
caption:
|
|
1745
|
-
defaultSorting:
|
|
1744
|
+
toolbar: f,
|
|
1745
|
+
caption: g ?? d("prescription.history.caption"),
|
|
1746
|
+
defaultSorting: Zr,
|
|
1746
1747
|
status: a,
|
|
1747
|
-
gridId:
|
|
1748
|
+
gridId: k ? `${k}-grid` : void 0,
|
|
1748
1749
|
empty: {
|
|
1749
1750
|
title: d("prescription.history.emptyTitle"),
|
|
1750
1751
|
description: d("prescription.history.emptyBody")
|
|
1751
1752
|
},
|
|
1752
1753
|
error: {
|
|
1753
1754
|
title: d("prescription.history.errorTitle"),
|
|
1754
|
-
onRetry:
|
|
1755
|
+
onRetry: S
|
|
1755
1756
|
}
|
|
1756
1757
|
}
|
|
1757
1758
|
)
|
|
@@ -1759,14 +1760,14 @@ const Qi = Ge(function({
|
|
|
1759
1760
|
);
|
|
1760
1761
|
});
|
|
1761
1762
|
export {
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1763
|
+
Ge as E,
|
|
1764
|
+
zr as P,
|
|
1765
|
+
Yi as a,
|
|
1766
|
+
Kr as b,
|
|
1767
|
+
Lr as c,
|
|
1767
1768
|
xt as d,
|
|
1768
1769
|
ot as i,
|
|
1769
|
-
|
|
1770
|
+
Fr as n,
|
|
1770
1771
|
kt as v
|
|
1771
1772
|
};
|
|
1772
|
-
//# sourceMappingURL=prescription-history-
|
|
1773
|
+
//# sourceMappingURL=prescription-history-CFs3JMIE.js.map
|