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