@argusoft/medplat-product-management 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PickupCreatePage-CMGwoAXj.js +426 -0
- package/dist/PickupCreatePage-CMGwoAXj.js.map +1 -0
- package/dist/{PickupsPage-DCEr0LHK.js → PickupsPage-D66_Wta4.js} +144 -108
- package/dist/PickupsPage-D66_Wta4.js.map +1 -0
- package/dist/{PurchaseCreatePage-Dcsg4uoB.js → PurchaseCreatePage-CDfNDcKG.js} +138 -137
- package/dist/PurchaseCreatePage-CDfNDcKG.js.map +1 -0
- package/dist/{VialsPage-CcbY4v6H.js → VialsPage-BNPUwGCU.js} +291 -224
- package/dist/VialsPage-BNPUwGCU.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/PickupCreatePage-CE-oCXD_.js +0 -310
- package/dist/PickupCreatePage-CE-oCXD_.js.map +0 -1
- package/dist/PickupsPage-DCEr0LHK.js.map +0 -1
- package/dist/PurchaseCreatePage-Dcsg4uoB.js.map +0 -1
- package/dist/VialsPage-CcbY4v6H.js.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { B as e, F as t, L as n,
|
|
2
|
-
import { c as
|
|
3
|
-
import { m as
|
|
4
|
-
import { t as
|
|
5
|
-
import { n as
|
|
6
|
-
import { d as
|
|
7
|
-
import { useMemo as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { v4 as
|
|
10
|
-
import { Alert as
|
|
11
|
-
import
|
|
12
|
-
import { showToast as
|
|
13
|
-
import
|
|
1
|
+
import { B as e, F as t, L as n, R as r, Z as i, a, g as ee, i as o, j as te, l as s, n as ne, o as c, p as l, r as u } from "./currency-ClRLIEg2.js";
|
|
2
|
+
import { c as d, s as re, t as f } from "./PmTable-B9970kPY.js";
|
|
3
|
+
import { m as p, t as m, u as h } from "./validation-Ba7puFIO.js";
|
|
4
|
+
import { t as g } from "./useFieldErrors-hDG8ox_x.js";
|
|
5
|
+
import { n as _, r as v, t as ie } from "./format-UOyOu75i.js";
|
|
6
|
+
import { d as ae, f as oe, p as se } from "./constants-5ZCZo-Zm.js";
|
|
7
|
+
import { useMemo as ce, useState as y } from "react";
|
|
8
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
9
|
+
import { v4 as le } from "uuid";
|
|
10
|
+
import { Alert as C, Box as w, Button as T, Chip as E, Dialog as ue, DialogActions as de, DialogContent as fe, DialogTitle as pe, FormControl as me, FormHelperText as he, InputLabel as D, LinearProgress as ge, MenuItem as O, Radio as _e, Select as ve, Stack as k, Table as ye, TableBody as A, TableCell as j, TableContainer as be, TableHead as M, TableRow as N, TextField as xe, Tooltip as Se, Typography as P } from "@mui/material";
|
|
11
|
+
import Ce from "@mui/icons-material/RefreshRounded";
|
|
12
|
+
import { showToast as F } from "@/common/toaster/toaster";
|
|
13
|
+
import I from "@mui/icons-material/VaccinesRounded";
|
|
14
14
|
//#region src/views/VialsPage.jsx
|
|
15
15
|
function L(e) {
|
|
16
16
|
let t = e.expiresAt ? new Date(e.expiresAt).getTime() : Infinity, n = Infinity;
|
|
@@ -20,7 +20,7 @@ function L(e) {
|
|
|
20
20
|
}
|
|
21
21
|
return Math.min(t, n);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function we(e) {
|
|
24
24
|
return e.expiryDate ? new Date(e.expiryDate).getTime() : Infinity;
|
|
25
25
|
}
|
|
26
26
|
var R = {
|
|
@@ -30,6 +30,7 @@ var R = {
|
|
|
30
30
|
productId: "",
|
|
31
31
|
ownerType: "",
|
|
32
32
|
ownerId: "",
|
|
33
|
+
personalSource: "",
|
|
33
34
|
allVials: [],
|
|
34
35
|
allBatches: [],
|
|
35
36
|
sources: [],
|
|
@@ -40,49 +41,50 @@ var R = {
|
|
|
40
41
|
volumeMl: "",
|
|
41
42
|
loading: !1
|
|
42
43
|
};
|
|
43
|
-
function
|
|
44
|
-
let
|
|
44
|
+
function Te() {
|
|
45
|
+
let Te = a().has("update.manage.productManagement.vial"), [z, Ee] = y([]), [De, Oe] = y([]), [B, ke] = y([]), [Ae, je] = y([]), [V, Me] = y([]), Ne = s()?.allowPersonalPurchase !== !1, [Pe, Fe] = y(!1), [Ie, Le] = y(""), [H, U] = y({
|
|
45
46
|
open: !1,
|
|
46
47
|
vial: null,
|
|
47
48
|
reason: "TIME_EXPIRATION",
|
|
48
49
|
comments: ""
|
|
49
|
-
}), [W, G] =
|
|
50
|
+
}), [W, G] = y(R), K = g(), q = g();
|
|
50
51
|
async function J() {
|
|
51
|
-
|
|
52
|
+
Fe(!0), Le("");
|
|
52
53
|
try {
|
|
53
|
-
let [
|
|
54
|
+
let [i, a, ee, o, s] = await Promise.all([
|
|
54
55
|
e(),
|
|
55
56
|
t(),
|
|
56
|
-
|
|
57
|
-
n().catch(() => [])
|
|
57
|
+
te(),
|
|
58
|
+
n().catch(() => []),
|
|
59
|
+
r().catch(() => [])
|
|
58
60
|
]);
|
|
59
|
-
|
|
61
|
+
Ee(i), Oe(a), ke(ee), je(o), Me(s);
|
|
60
62
|
} catch (e) {
|
|
61
|
-
|
|
63
|
+
Le(e?.response?.data?.message ?? e?.message ?? "Failed to load"), F({
|
|
62
64
|
message: e?.message || "Failed to load",
|
|
63
65
|
type: "error"
|
|
64
66
|
});
|
|
65
67
|
} finally {
|
|
66
|
-
|
|
68
|
+
Fe(!1);
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
|
-
|
|
71
|
+
o("view.manage.productManagement.vial", () => {
|
|
70
72
|
J();
|
|
71
73
|
}, []);
|
|
72
|
-
let
|
|
73
|
-
async function
|
|
74
|
+
let Re = ce(() => B.filter((e) => e.categoryCode === "VACCINES" && e.isActive).sort((e, t) => e.name.localeCompare(t.name)), [B]), Y = { wastageReason: p(H.reason, "Reason") }, ze = m(Y);
|
|
75
|
+
async function Be() {
|
|
74
76
|
if (H.vial) {
|
|
75
|
-
if (!
|
|
77
|
+
if (!ze) {
|
|
76
78
|
K.markAllTouched();
|
|
77
79
|
return;
|
|
78
80
|
}
|
|
79
81
|
try {
|
|
80
|
-
await
|
|
81
|
-
id:
|
|
82
|
+
await ee({
|
|
83
|
+
id: le(),
|
|
82
84
|
openVialId: H.vial.id,
|
|
83
85
|
wastageReason: H.reason,
|
|
84
86
|
comments: H.comments || null
|
|
85
|
-
}),
|
|
87
|
+
}), F({
|
|
86
88
|
message: "Vial closed.",
|
|
87
89
|
type: "success"
|
|
88
90
|
}), U({
|
|
@@ -92,21 +94,21 @@ function Ce() {
|
|
|
92
94
|
comments: ""
|
|
93
95
|
}), await J();
|
|
94
96
|
} catch (e) {
|
|
95
|
-
|
|
97
|
+
F({
|
|
96
98
|
message: e?.response?.data?.message ?? e?.message ?? "Failed",
|
|
97
99
|
type: "error"
|
|
98
100
|
});
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
|
-
function
|
|
104
|
+
function Ve() {
|
|
103
105
|
q.reset(), G(R);
|
|
104
106
|
}
|
|
105
|
-
function
|
|
107
|
+
function He(e, t = De) {
|
|
106
108
|
let n = (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0);
|
|
107
|
-
return t.filter((t) => t.productId === e && t.qtyRemaining > 0 && !t.isQuarantined && (!t.expiryDate || new Date(t.expiryDate).getTime() >= n)).sort((e, t) =>
|
|
109
|
+
return t.filter((t) => t.productId === e && t.qtyRemaining > 0 && !t.isQuarantined && (!t.expiryDate || new Date(t.expiryDate).getTime() >= n)).sort((e, t) => we(e) - we(t));
|
|
108
110
|
}
|
|
109
|
-
async function
|
|
111
|
+
async function Ue() {
|
|
110
112
|
if (!W.productId) {
|
|
111
113
|
q.markAllTouched();
|
|
112
114
|
return;
|
|
@@ -116,23 +118,26 @@ function Ce() {
|
|
|
116
118
|
loading: !0
|
|
117
119
|
}));
|
|
118
120
|
try {
|
|
119
|
-
let [e,
|
|
120
|
-
|
|
121
|
-
t().catch(() =>
|
|
122
|
-
n().catch(() =>
|
|
121
|
+
let [e, r, a] = await Promise.all([
|
|
122
|
+
i(W.productId),
|
|
123
|
+
t().catch(() => De),
|
|
124
|
+
n().catch(() => Ae)
|
|
123
125
|
]);
|
|
124
|
-
|
|
125
|
-
let ee = Date.now(), o = e.filter((e) => e.status === "OPEN" && !e.expired && L(e) > ee && Number(e.volumeRemainingMl) > 0).sort((e, t) => L(e) - L(t)), te = e.reduce((e, t) => (t.status === "OPEN" && (e[t.batchId] = (e[t.batchId] || 0) + 1), e), {}), s = B.find((e) => e.id === W.productId)?.vaccineConfig, ne = s?.maxConcurrentOpenVials ?? 2, c =
|
|
126
|
-
function d(e, t, n) {
|
|
127
|
-
let
|
|
128
|
-
l.has(
|
|
129
|
-
key:
|
|
126
|
+
Oe(r), je(a);
|
|
127
|
+
let ee = Date.now(), o = e.filter((e) => e.status === "OPEN" && !e.expired && L(e) > ee && Number(e.volumeRemainingMl) > 0).sort((e, t) => L(e) - L(t)), te = e.reduce((e, t) => (t.status === "OPEN" && (e[t.batchId] = (e[t.batchId] || 0) + 1), e), {}), s = B.find((e) => e.id === W.productId)?.vaccineConfig, ne = s?.maxConcurrentOpenVials ?? 2, c = He(W.productId, r).filter((e) => (te[e.id] || 0) < ne), l = /* @__PURE__ */ new Set(), u = [];
|
|
128
|
+
function d(e, t, n, r = "") {
|
|
129
|
+
let i = `${e}::${t ?? ""}::${r ?? ""}`;
|
|
130
|
+
l.has(i) || (l.add(i), u.push({
|
|
131
|
+
key: i,
|
|
130
132
|
ownerType: e,
|
|
131
133
|
ownerId: t ?? null,
|
|
134
|
+
personalSource: r || null,
|
|
132
135
|
label: n
|
|
133
136
|
}));
|
|
134
137
|
}
|
|
135
|
-
(o.some((e) => e.ownerType === "USER") || c.some((e) => e.ownerType === "USER")) && d("USER", null, "Personal (
|
|
138
|
+
(o.some((e) => e.ownerType === "USER" && e.batchSourceType === "PICKUP") || c.some((e) => e.ownerType === "USER" && e.sourceType === "PICKUP")) && d("USER", null, "Personal (Outreach)", "OUTREACH");
|
|
139
|
+
let re = o.some((e) => e.ownerType === "USER" && e.batchSourceType === "PURCHASE") || c.some((e) => e.ownerType === "USER" && e.sourceType === "PURCHASE");
|
|
140
|
+
Ne && re && d("USER", null, "Personal (Purchase)", "PURCHASE");
|
|
136
141
|
let f = /* @__PURE__ */ new Set();
|
|
137
142
|
o.forEach((e) => {
|
|
138
143
|
e.ownerType === "FACILITY" && e.ownerId && f.add(e.ownerId);
|
|
@@ -141,50 +146,54 @@ function Ce() {
|
|
|
141
146
|
}), f.forEach((e) => {
|
|
142
147
|
d("FACILITY", e, `Facility — ${a.find((t) => t.id === e)?.name ?? e}`);
|
|
143
148
|
});
|
|
144
|
-
let p = u.length === 1 ? u[0] : null, m = p?.ownerType ?? "", h = p?.ownerId ?? "", g =
|
|
149
|
+
let p = u.length === 1 ? u[0] : null, m = p?.ownerType ?? "", h = p?.ownerId ?? "", g = p?.personalSource ?? "", _ = We(o, c, m, h, g), v = _.vials.length > 0 ? "use-existing" : "open-new";
|
|
145
150
|
G((e) => ({
|
|
146
151
|
...e,
|
|
147
152
|
loading: !1,
|
|
148
153
|
step: "select",
|
|
149
|
-
mode:
|
|
154
|
+
mode: v,
|
|
150
155
|
ownerType: m,
|
|
151
156
|
ownerId: h,
|
|
157
|
+
personalSource: g,
|
|
152
158
|
allVials: o,
|
|
153
159
|
allBatches: c,
|
|
154
160
|
sources: u,
|
|
155
|
-
vialCandidates:
|
|
156
|
-
batchCandidates:
|
|
157
|
-
selectedVialId:
|
|
158
|
-
selectedBatchId:
|
|
159
|
-
volumeMl:
|
|
161
|
+
vialCandidates: _.vials,
|
|
162
|
+
batchCandidates: _.batches,
|
|
163
|
+
selectedVialId: _.vials[0]?.id ?? "",
|
|
164
|
+
selectedBatchId: _.batches[0]?.id ?? "",
|
|
165
|
+
volumeMl: v === "use-existing" ? _.vials[0]?.adultDoseMl ?? s?.adultDoseMl ?? "" : s?.adultDoseMl ?? ""
|
|
160
166
|
}));
|
|
161
167
|
} catch (e) {
|
|
162
168
|
G((e) => ({
|
|
163
169
|
...e,
|
|
164
170
|
loading: !1
|
|
165
|
-
})),
|
|
171
|
+
})), F({
|
|
166
172
|
message: e?.response?.data?.message ?? e?.message ?? "Failed to load vials",
|
|
167
173
|
type: "error"
|
|
168
174
|
});
|
|
169
175
|
}
|
|
170
176
|
}
|
|
171
|
-
function
|
|
172
|
-
|
|
173
|
-
vials: e.filter((e) => e.ownerType === n && (n === "USER" || e.ownerId === r)),
|
|
174
|
-
batches: t.filter((e) => e.ownerType === n && (n === "USER" || e.ownerId === r))
|
|
175
|
-
} : {
|
|
177
|
+
function We(e, t, n, r, i) {
|
|
178
|
+
if (!n) return {
|
|
176
179
|
vials: [],
|
|
177
180
|
batches: []
|
|
178
181
|
};
|
|
182
|
+
let a = n === "USER" && i ? i === "OUTREACH" ? "PICKUP" : "PURCHASE" : null;
|
|
183
|
+
return {
|
|
184
|
+
vials: e.filter((e) => e.ownerType === n && (n === "USER" ? !a || e.batchSourceType === a : e.ownerId === r)),
|
|
185
|
+
batches: t.filter((e) => e.ownerType === n && (n === "USER" ? !a || e.sourceType === a : e.ownerId === r))
|
|
186
|
+
};
|
|
179
187
|
}
|
|
180
|
-
function
|
|
188
|
+
function Ge(e) {
|
|
181
189
|
let t = W.sources.find((t) => t.key === e);
|
|
182
190
|
if (!t) return;
|
|
183
|
-
let n =
|
|
191
|
+
let n = We(W.allVials, W.allBatches, t.ownerType, t.ownerId, t.personalSource), r = B.find((e) => e.id === W.productId)?.vaccineConfig, i = n.vials.length > 0 ? "use-existing" : "open-new";
|
|
184
192
|
G((e) => ({
|
|
185
193
|
...e,
|
|
186
194
|
ownerType: t.ownerType,
|
|
187
195
|
ownerId: t.ownerId ?? "",
|
|
196
|
+
personalSource: t.personalSource ?? "",
|
|
188
197
|
mode: i,
|
|
189
198
|
vialCandidates: n.vials,
|
|
190
199
|
batchCandidates: n.batches,
|
|
@@ -199,105 +208,116 @@ function Ce() {
|
|
|
199
208
|
mode: e
|
|
200
209
|
}));
|
|
201
210
|
}
|
|
202
|
-
let Z = W.vialCandidates.find((e) => e.id === W.selectedVialId),
|
|
203
|
-
if (W.step === "product") return { productId:
|
|
211
|
+
let Z = W.vialCandidates.find((e) => e.id === W.selectedVialId), Ke = W.batchCandidates.find((e) => e.id === W.selectedBatchId), Q = B.find((e) => e.id === W.productId)?.vaccineConfig, $ = (() => {
|
|
212
|
+
if (W.step === "product") return { productId: p(W.productId, "Vaccine") };
|
|
204
213
|
let e = {
|
|
205
|
-
ownerType:
|
|
206
|
-
volumeMl:
|
|
214
|
+
ownerType: p(W.ownerType, "Source"),
|
|
215
|
+
volumeMl: h(W.volumeMl, "Volume", { required: !0 })
|
|
207
216
|
};
|
|
208
217
|
if (W.mode === "use-existing") {
|
|
209
|
-
if (e.selectedVialId =
|
|
218
|
+
if (e.selectedVialId = p(W.selectedVialId, "Vial"), !e.volumeMl && Z) {
|
|
210
219
|
let t = Number(W.volumeMl), n = Number(Z.volumeRemainingMl);
|
|
211
220
|
t > n && (e.volumeMl = W.batchCandidates.length > 0 ? `Only ${n.toFixed(2)} ml remaining in this vial — open another vial instead.` : `Only ${n.toFixed(2)} ml remaining in this vial.`);
|
|
212
221
|
}
|
|
213
|
-
} else if (e.selectedBatchId =
|
|
222
|
+
} else if (e.selectedBatchId = p(W.selectedBatchId, "Batch"), !e.volumeMl && Q?.vialVolumeMl) {
|
|
214
223
|
let t = Number(W.volumeMl), n = Number(Q.vialVolumeMl);
|
|
215
224
|
t > n && (e.volumeMl = `A fresh vial holds ${n.toFixed(2)} ml`);
|
|
216
225
|
}
|
|
217
226
|
return e;
|
|
218
|
-
})(),
|
|
219
|
-
async function
|
|
220
|
-
if (!
|
|
227
|
+
})(), qe = m($);
|
|
228
|
+
async function Je() {
|
|
229
|
+
if (!qe) {
|
|
221
230
|
q.markAllTouched();
|
|
222
231
|
return;
|
|
223
232
|
}
|
|
224
233
|
try {
|
|
225
234
|
let e = {
|
|
226
|
-
id:
|
|
235
|
+
id: le(),
|
|
227
236
|
productId: W.productId,
|
|
228
237
|
volumeMl: Number(W.volumeMl),
|
|
229
238
|
ownerType: W.ownerType,
|
|
230
|
-
ownerId: W.ownerType === "FACILITY" && W.ownerId || null
|
|
239
|
+
ownerId: W.ownerType === "FACILITY" && W.ownerId || null,
|
|
240
|
+
personalSource: W.ownerType === "USER" && W.personalSource || null
|
|
231
241
|
};
|
|
232
|
-
W.mode === "use-existing" ? e.openVialId = Z.id : e.batchId =
|
|
242
|
+
W.mode === "use-existing" ? e.openVialId = Z.id : e.batchId = Ke.id, await l(e), F({
|
|
233
243
|
message: W.mode === "use-existing" ? "Dose administered." : "New vial opened and dose administered.",
|
|
234
244
|
type: "success"
|
|
235
|
-
}),
|
|
245
|
+
}), Ve(), await J();
|
|
236
246
|
} catch (e) {
|
|
237
|
-
|
|
247
|
+
F({
|
|
238
248
|
message: e?.response?.data?.message ?? e?.message ?? "Failed",
|
|
239
249
|
type: "error"
|
|
240
250
|
});
|
|
241
251
|
}
|
|
242
252
|
}
|
|
243
|
-
return /* @__PURE__ */
|
|
253
|
+
return /* @__PURE__ */ S(w, { children: [/* @__PURE__ */ x(u, {}), /* @__PURE__ */ S(ne, {
|
|
244
254
|
perm: "view.manage.productManagement.vial",
|
|
245
255
|
children: [
|
|
246
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ S(c, {
|
|
247
257
|
title: "Open Vials",
|
|
248
258
|
subtitle: "Open vaccine vials in use. Close them at the end of the day and record any waste.",
|
|
249
259
|
chips: ["Vaccine"],
|
|
250
|
-
actions: /* @__PURE__ */
|
|
260
|
+
actions: /* @__PURE__ */ S(k, {
|
|
251
261
|
direction: "row",
|
|
252
262
|
spacing: 1,
|
|
253
|
-
children: [/* @__PURE__ */
|
|
263
|
+
children: [/* @__PURE__ */ x(T, {
|
|
254
264
|
variant: "outlined",
|
|
255
|
-
startIcon: /* @__PURE__ */
|
|
265
|
+
startIcon: /* @__PURE__ */ x(Ce, {}),
|
|
256
266
|
onClick: () => void J(),
|
|
257
267
|
children: "Refresh"
|
|
258
|
-
}),
|
|
268
|
+
}), /* @__PURE__ */ x(T, {
|
|
269
|
+
variant: "contained",
|
|
270
|
+
startIcon: /* @__PURE__ */ x(I, {}),
|
|
271
|
+
onClick: () => {
|
|
272
|
+
q.reset(), G({
|
|
273
|
+
...R,
|
|
274
|
+
open: !0
|
|
275
|
+
});
|
|
276
|
+
},
|
|
277
|
+
children: "Administer Vaccine"
|
|
278
|
+
})]
|
|
259
279
|
}),
|
|
260
280
|
children: [
|
|
261
|
-
|
|
281
|
+
Ie ? /* @__PURE__ */ x(C, {
|
|
262
282
|
severity: "error",
|
|
263
283
|
sx: { mb: 2 },
|
|
264
|
-
children:
|
|
284
|
+
children: Ie
|
|
265
285
|
}) : null,
|
|
266
|
-
|
|
267
|
-
/* @__PURE__ */
|
|
286
|
+
Pe ? /* @__PURE__ */ x(ge, { sx: { mb: 2 } }) : null,
|
|
287
|
+
/* @__PURE__ */ x(d, {
|
|
268
288
|
eyebrow: "In use",
|
|
269
289
|
title: "Open vials",
|
|
270
|
-
subtitle:
|
|
271
|
-
children: /* @__PURE__ */
|
|
290
|
+
subtitle: Pe ? "Loading…" : `${z.length} ${z.length === 1 ? "vial" : "vials"} currently in use`,
|
|
291
|
+
children: /* @__PURE__ */ S(re, {
|
|
272
292
|
dense: !0,
|
|
273
|
-
children: [/* @__PURE__ */
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
-
/* @__PURE__ */
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
/* @__PURE__ */
|
|
293
|
+
children: [/* @__PURE__ */ x(M, { children: /* @__PURE__ */ S(N, { children: [
|
|
294
|
+
/* @__PURE__ */ x(j, { children: "Product" }),
|
|
295
|
+
/* @__PURE__ */ x(j, { children: "Lot" }),
|
|
296
|
+
/* @__PURE__ */ x(j, { children: "Owner" }),
|
|
297
|
+
/* @__PURE__ */ x(j, { children: "Opened" }),
|
|
298
|
+
/* @__PURE__ */ x(j, { children: "Expires" }),
|
|
299
|
+
/* @__PURE__ */ x(j, { children: "Volume remaining" }),
|
|
300
|
+
/* @__PURE__ */ x(j, { children: "Status" }),
|
|
301
|
+
/* @__PURE__ */ x(j, {
|
|
282
302
|
align: "right",
|
|
283
303
|
children: "Action"
|
|
284
304
|
})
|
|
285
|
-
] }) }), /* @__PURE__ */
|
|
305
|
+
] }) }), /* @__PURE__ */ x(A, { children: z.length === 0 && !Pe ? /* @__PURE__ */ x(f, {
|
|
286
306
|
colSpan: 8,
|
|
287
|
-
icon:
|
|
307
|
+
icon: I,
|
|
288
308
|
title: "No open vials",
|
|
289
309
|
hint: "Use Administer Vaccine to open and dose a vial."
|
|
290
310
|
}) : z.map((e) => {
|
|
291
311
|
let t = e.volumeTotalMl ? (1 - Number(e.volumeRemainingMl) / Number(e.volumeTotalMl)) * 100 : 0;
|
|
292
|
-
return /* @__PURE__ */
|
|
312
|
+
return /* @__PURE__ */ S(N, {
|
|
293
313
|
hover: !0,
|
|
294
314
|
children: [
|
|
295
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ x(j, { children: /* @__PURE__ */ x(P, {
|
|
296
316
|
variant: "body2",
|
|
297
317
|
sx: { fontWeight: 700 },
|
|
298
318
|
children: e.productName
|
|
299
319
|
}) }),
|
|
300
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ x(j, { children: e.lotNumber ? /* @__PURE__ */ x(w, {
|
|
301
321
|
component: "span",
|
|
302
322
|
sx: {
|
|
303
323
|
display: "inline-flex",
|
|
@@ -310,31 +330,31 @@ function Ce() {
|
|
|
310
330
|
fontWeight: 700
|
|
311
331
|
},
|
|
312
332
|
children: e.lotNumber
|
|
313
|
-
}) : /* @__PURE__ */
|
|
333
|
+
}) : /* @__PURE__ */ x(P, {
|
|
314
334
|
variant: "caption",
|
|
315
335
|
color: "text.disabled",
|
|
316
336
|
children: "—"
|
|
317
337
|
}) }),
|
|
318
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ S(j, { children: [/* @__PURE__ */ x(P, {
|
|
319
339
|
variant: "body2",
|
|
320
340
|
sx: { fontWeight: 700 },
|
|
321
341
|
children: e.ownerName || (e.ownerType === "USER" ? "Personal" : "Facility")
|
|
322
|
-
}), /* @__PURE__ */
|
|
342
|
+
}), /* @__PURE__ */ x(P, {
|
|
323
343
|
variant: "caption",
|
|
324
344
|
color: "text.secondary",
|
|
325
345
|
children: e.ownerType ?? "—"
|
|
326
346
|
})] }),
|
|
327
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ x(j, { children: /* @__PURE__ */ x(P, {
|
|
328
348
|
variant: "caption",
|
|
329
349
|
sx: { fontWeight: 600 },
|
|
330
|
-
children:
|
|
350
|
+
children: _(e.openedAt)
|
|
331
351
|
}) }),
|
|
332
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ x(j, { children: /* @__PURE__ */ x(Se, {
|
|
333
353
|
title: e.expired ? "Expired — close out immediately" : "",
|
|
334
|
-
children: /* @__PURE__ */
|
|
354
|
+
children: /* @__PURE__ */ x(E, {
|
|
335
355
|
size: "small",
|
|
336
356
|
color: e.expired ? "error" : "success",
|
|
337
|
-
label:
|
|
357
|
+
label: _(e.expiresAt),
|
|
338
358
|
sx: {
|
|
339
359
|
fontWeight: 700,
|
|
340
360
|
borderRadius: 1.5,
|
|
@@ -342,11 +362,11 @@ function Ce() {
|
|
|
342
362
|
}
|
|
343
363
|
})
|
|
344
364
|
}) }),
|
|
345
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ x(j, { children: /* @__PURE__ */ S(k, {
|
|
346
366
|
direction: "row",
|
|
347
367
|
alignItems: "center",
|
|
348
368
|
spacing: 1,
|
|
349
|
-
children: [/* @__PURE__ */
|
|
369
|
+
children: [/* @__PURE__ */ S(P, {
|
|
350
370
|
variant: "body2",
|
|
351
371
|
sx: {
|
|
352
372
|
fontWeight: 800,
|
|
@@ -354,15 +374,15 @@ function Ce() {
|
|
|
354
374
|
minWidth: 80
|
|
355
375
|
},
|
|
356
376
|
children: [
|
|
357
|
-
|
|
377
|
+
v(e.volumeRemainingMl),
|
|
358
378
|
" /",
|
|
359
379
|
" ",
|
|
360
|
-
|
|
380
|
+
v(e.volumeTotalMl),
|
|
361
381
|
" ml"
|
|
362
382
|
]
|
|
363
|
-
}), /* @__PURE__ */
|
|
383
|
+
}), /* @__PURE__ */ x(w, {
|
|
364
384
|
sx: { width: 80 },
|
|
365
|
-
children: /* @__PURE__ */
|
|
385
|
+
children: /* @__PURE__ */ x(ge, {
|
|
366
386
|
variant: "determinate",
|
|
367
387
|
value: t,
|
|
368
388
|
sx: {
|
|
@@ -373,19 +393,19 @@ function Ce() {
|
|
|
373
393
|
})
|
|
374
394
|
})]
|
|
375
395
|
}) }),
|
|
376
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ x(j, { children: /* @__PURE__ */ x(E, {
|
|
377
397
|
size: "small",
|
|
378
398
|
color: e.expired ? "error" : "info",
|
|
379
|
-
label: e.expired ? "Expired" :
|
|
399
|
+
label: e.expired ? "Expired" : se(ae, e.status),
|
|
380
400
|
sx: {
|
|
381
401
|
fontWeight: 700,
|
|
382
402
|
borderRadius: 1.5,
|
|
383
403
|
height: 22
|
|
384
404
|
}
|
|
385
405
|
}) }),
|
|
386
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ x(j, {
|
|
387
407
|
align: "right",
|
|
388
|
-
children:
|
|
408
|
+
children: Te ? /* @__PURE__ */ x(T, {
|
|
389
409
|
size: "small",
|
|
390
410
|
variant: "outlined",
|
|
391
411
|
color: "error",
|
|
@@ -407,24 +427,24 @@ function Ce() {
|
|
|
407
427
|
})
|
|
408
428
|
]
|
|
409
429
|
}),
|
|
410
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ S(ue, {
|
|
411
431
|
open: W.open,
|
|
412
|
-
onClose:
|
|
432
|
+
onClose: Ve,
|
|
413
433
|
fullWidth: !0,
|
|
414
434
|
maxWidth: "md",
|
|
415
435
|
children: [
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ x(pe, { children: W.step === "product" ? "Administer Vaccine — Select Vaccine" : W.mode === "use-existing" ? "Administer Vaccine — Select Open Vial" : "Administer Vaccine — Open & Administer" }),
|
|
437
|
+
/* @__PURE__ */ x(fe, {
|
|
418
438
|
dividers: !0,
|
|
419
|
-
children: W.step === "product" ? /* @__PURE__ */
|
|
439
|
+
children: W.step === "product" ? /* @__PURE__ */ S(me, {
|
|
420
440
|
required: !0,
|
|
421
441
|
fullWidth: !0,
|
|
422
442
|
size: "small",
|
|
423
443
|
sx: { mt: 1 },
|
|
424
444
|
error: q.show("productId") && !!$.productId,
|
|
425
445
|
children: [
|
|
426
|
-
/* @__PURE__ */
|
|
427
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ x(D, { children: "Vaccine" }),
|
|
447
|
+
/* @__PURE__ */ S(ve, {
|
|
428
448
|
label: "Vaccine",
|
|
429
449
|
value: W.productId,
|
|
430
450
|
onChange: (e) => G({
|
|
@@ -432,58 +452,105 @@ function Ce() {
|
|
|
432
452
|
productId: e.target.value
|
|
433
453
|
}),
|
|
434
454
|
onBlur: q.onBlur("productId"),
|
|
435
|
-
children: [
|
|
455
|
+
children: [Re.length === 0 ? /* @__PURE__ */ x(O, {
|
|
436
456
|
value: "",
|
|
437
457
|
disabled: !0,
|
|
438
|
-
children: /* @__PURE__ */
|
|
439
|
-
}) : null,
|
|
458
|
+
children: /* @__PURE__ */ x("em", { children: "No active vaccine products" })
|
|
459
|
+
}) : null, Re.map((e) => /* @__PURE__ */ S(O, {
|
|
440
460
|
value: e.id,
|
|
441
461
|
children: [e.name, e.vaccineConfig?.vaccineCode ? ` · ${e.vaccineConfig.vaccineCode}` : ""]
|
|
442
462
|
}, e.id))]
|
|
443
463
|
}),
|
|
444
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ x(he, { children: q.show("productId") && $.productId ? $.productId : "Open vials for this vaccine will be shown next. If none are open, a fresh vial can be opened on the same screen." })
|
|
445
465
|
]
|
|
446
|
-
}) : /* @__PURE__ */
|
|
466
|
+
}) : /* @__PURE__ */ S(k, {
|
|
447
467
|
spacing: 2,
|
|
448
468
|
sx: { pt: 1 },
|
|
449
469
|
children: [
|
|
450
|
-
W.loading ? /* @__PURE__ */
|
|
451
|
-
W.sources.length === 0 ? /* @__PURE__ */
|
|
470
|
+
W.loading ? /* @__PURE__ */ x(ge, {}) : null,
|
|
471
|
+
W.sources.length === 0 ? /* @__PURE__ */ x(C, {
|
|
452
472
|
severity: "warning",
|
|
453
473
|
children: "No stock available for this vaccine — neither in your personal stock nor at an assigned facility."
|
|
454
|
-
}) : W.sources.length > 1 ? /* @__PURE__ */
|
|
474
|
+
}) : W.sources.length > 1 ? /* @__PURE__ */ S(me, {
|
|
455
475
|
required: !0,
|
|
456
476
|
fullWidth: !0,
|
|
457
477
|
size: "small",
|
|
458
478
|
error: q.show("ownerType") && !!$.ownerType,
|
|
459
479
|
children: [
|
|
460
|
-
/* @__PURE__ */
|
|
461
|
-
/* @__PURE__ */
|
|
480
|
+
/* @__PURE__ */ x(D, { children: "Administer from" }),
|
|
481
|
+
/* @__PURE__ */ x(ve, {
|
|
462
482
|
label: "Administer from",
|
|
463
|
-
value: W.ownerType ? `${W.ownerType}::${W.ownerId ?? ""}` : "",
|
|
464
|
-
onChange: (e) =>
|
|
483
|
+
value: W.ownerType ? `${W.ownerType}::${W.ownerId ?? ""}::${W.personalSource ?? ""}` : "",
|
|
484
|
+
onChange: (e) => Ge(e.target.value),
|
|
465
485
|
onBlur: q.onBlur("ownerType"),
|
|
466
|
-
children: W.sources.map((e) => /* @__PURE__ */
|
|
486
|
+
children: W.sources.map((e) => /* @__PURE__ */ x(O, {
|
|
467
487
|
value: e.key,
|
|
468
488
|
children: e.label
|
|
469
489
|
}, e.key))
|
|
470
490
|
}),
|
|
471
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ x(he, { children: q.show("ownerType") && $.ownerType ? $.ownerType : "Personal stock (outreach) and facility stock are separate vial pools — pick which one this dose comes from." })
|
|
472
492
|
]
|
|
473
|
-
}) : /* @__PURE__ */
|
|
493
|
+
}) : /* @__PURE__ */ S(C, {
|
|
474
494
|
severity: "info",
|
|
475
495
|
children: [
|
|
476
496
|
"Administering from",
|
|
477
497
|
" ",
|
|
478
|
-
/* @__PURE__ */
|
|
498
|
+
/* @__PURE__ */ x("strong", { children: W.sources[0]?.label }),
|
|
479
499
|
"."
|
|
480
500
|
]
|
|
481
501
|
}),
|
|
482
|
-
W.
|
|
502
|
+
W.ownerType === "USER" && W.personalSource === "OUTREACH" && V[0] ? /* @__PURE__ */ S(w, {
|
|
503
|
+
sx: {
|
|
504
|
+
p: 1.5,
|
|
505
|
+
borderRadius: 2,
|
|
506
|
+
border: "1px solid",
|
|
507
|
+
borderColor: "divider",
|
|
508
|
+
bgcolor: (e) => e.palette.action.hover
|
|
509
|
+
},
|
|
510
|
+
children: [
|
|
511
|
+
/* @__PURE__ */ x(P, {
|
|
512
|
+
variant: "overline",
|
|
513
|
+
sx: {
|
|
514
|
+
fontWeight: 800,
|
|
515
|
+
letterSpacing: .6,
|
|
516
|
+
color: "text.secondary"
|
|
517
|
+
},
|
|
518
|
+
children: "Outreach session"
|
|
519
|
+
}),
|
|
520
|
+
/* @__PURE__ */ x(P, {
|
|
521
|
+
variant: "body2",
|
|
522
|
+
sx: { fontWeight: 800 },
|
|
523
|
+
children: V[0].sessionName || "—"
|
|
524
|
+
}),
|
|
525
|
+
V[0].sessionSite ? /* @__PURE__ */ S(P, {
|
|
526
|
+
variant: "caption",
|
|
527
|
+
color: "text.secondary",
|
|
528
|
+
sx: { display: "block" },
|
|
529
|
+
children: ["Site: ", V[0].sessionSite]
|
|
530
|
+
}) : null,
|
|
531
|
+
/* @__PURE__ */ S(P, {
|
|
532
|
+
variant: "caption",
|
|
533
|
+
color: "text.secondary",
|
|
534
|
+
sx: { display: "block" },
|
|
535
|
+
children: [V[0].sessionStartTime ? _(V[0].sessionStartTime) : "—", V[0].sessionExpectedEndTime ? ` → ${_(V[0].sessionExpectedEndTime)}` : ""]
|
|
536
|
+
}),
|
|
537
|
+
V[0].sessionDescription ? /* @__PURE__ */ x(P, {
|
|
538
|
+
variant: "caption",
|
|
539
|
+
color: "text.secondary",
|
|
540
|
+
sx: {
|
|
541
|
+
display: "block",
|
|
542
|
+
mt: .5,
|
|
543
|
+
whiteSpace: "pre-wrap"
|
|
544
|
+
},
|
|
545
|
+
children: V[0].sessionDescription
|
|
546
|
+
}) : null
|
|
547
|
+
]
|
|
548
|
+
}) : null,
|
|
549
|
+
W.mode === "use-existing" ? /* @__PURE__ */ S(b, { children: [W.ownerType ? (() => {
|
|
483
550
|
let e = Number(W.volumeMl), t = !Number.isNaN(e) && e > 0 && W.vialCandidates.some((t) => Number(t.volumeRemainingMl) >= e);
|
|
484
|
-
return /* @__PURE__ */
|
|
551
|
+
return /* @__PURE__ */ x(C, {
|
|
485
552
|
severity: "info",
|
|
486
|
-
action: t ? null : /* @__PURE__ */
|
|
553
|
+
action: t ? null : /* @__PURE__ */ x(T, {
|
|
487
554
|
color: "inherit",
|
|
488
555
|
size: "small",
|
|
489
556
|
onClick: () => X("open-new"),
|
|
@@ -491,56 +558,56 @@ function Ce() {
|
|
|
491
558
|
}),
|
|
492
559
|
children: t ? "Pick an open vial — earliest-expiry-first is preselected. An existing vial can hold the requested dose, so no new vial is needed." : "Pick an open vial — earliest-expiry-first is preselected. The requested dose does not fit in any open vial; you can open another vial from stock."
|
|
493
560
|
});
|
|
494
|
-
})() : /* @__PURE__ */
|
|
561
|
+
})() : /* @__PURE__ */ x(C, {
|
|
495
562
|
severity: "info",
|
|
496
563
|
children: "Pick an administration source above to see the available open vials."
|
|
497
|
-
}), /* @__PURE__ */
|
|
564
|
+
}), /* @__PURE__ */ x(be, { children: /* @__PURE__ */ S(ye, {
|
|
498
565
|
size: "small",
|
|
499
|
-
children: [/* @__PURE__ */
|
|
500
|
-
/* @__PURE__ */
|
|
501
|
-
/* @__PURE__ */
|
|
566
|
+
children: [/* @__PURE__ */ x(M, { children: /* @__PURE__ */ S(N, { children: [
|
|
567
|
+
/* @__PURE__ */ x(j, {}),
|
|
568
|
+
/* @__PURE__ */ x(j, {
|
|
502
569
|
sx: { fontWeight: 800 },
|
|
503
570
|
children: "Lot"
|
|
504
571
|
}),
|
|
505
|
-
/* @__PURE__ */
|
|
572
|
+
/* @__PURE__ */ x(j, {
|
|
506
573
|
sx: { fontWeight: 800 },
|
|
507
574
|
children: "Vial expires"
|
|
508
575
|
}),
|
|
509
|
-
/* @__PURE__ */
|
|
576
|
+
/* @__PURE__ */ x(j, {
|
|
510
577
|
sx: { fontWeight: 800 },
|
|
511
578
|
children: "Batch expires"
|
|
512
579
|
}),
|
|
513
|
-
/* @__PURE__ */
|
|
580
|
+
/* @__PURE__ */ x(j, {
|
|
514
581
|
sx: { fontWeight: 800 },
|
|
515
582
|
align: "right",
|
|
516
583
|
children: "Remaining (ml)"
|
|
517
584
|
})
|
|
518
|
-
] }) }), /* @__PURE__ */
|
|
585
|
+
] }) }), /* @__PURE__ */ x(A, { children: W.vialCandidates.length === 0 ? /* @__PURE__ */ x(N, { children: /* @__PURE__ */ x(j, {
|
|
519
586
|
colSpan: 5,
|
|
520
587
|
sx: {
|
|
521
588
|
py: 4,
|
|
522
589
|
textAlign: "center"
|
|
523
590
|
},
|
|
524
|
-
children: /* @__PURE__ */
|
|
591
|
+
children: /* @__PURE__ */ S(k, {
|
|
525
592
|
alignItems: "center",
|
|
526
593
|
spacing: 1,
|
|
527
594
|
children: [
|
|
528
|
-
/* @__PURE__ */
|
|
595
|
+
/* @__PURE__ */ x(I, { sx: {
|
|
529
596
|
fontSize: 36,
|
|
530
597
|
color: "text.disabled",
|
|
531
598
|
opacity: .7
|
|
532
599
|
} }),
|
|
533
|
-
/* @__PURE__ */
|
|
600
|
+
/* @__PURE__ */ x(P, {
|
|
534
601
|
variant: "body2",
|
|
535
602
|
sx: { fontWeight: 700 },
|
|
536
603
|
children: "No usable open vials for this vaccine"
|
|
537
604
|
}),
|
|
538
|
-
W.batchCandidates.length > 0 ? /* @__PURE__ */
|
|
605
|
+
W.batchCandidates.length > 0 ? /* @__PURE__ */ x(T, {
|
|
539
606
|
size: "small",
|
|
540
607
|
variant: "outlined",
|
|
541
608
|
onClick: () => X("open-new"),
|
|
542
609
|
children: "Open a new vial instead"
|
|
543
|
-
}) : /* @__PURE__ */
|
|
610
|
+
}) : /* @__PURE__ */ x(P, {
|
|
544
611
|
variant: "caption",
|
|
545
612
|
color: "text.secondary",
|
|
546
613
|
children: "No stock available either — receive a purchase first."
|
|
@@ -549,7 +616,7 @@ function Ce() {
|
|
|
549
616
|
})
|
|
550
617
|
}) }) : W.vialCandidates.map((e, t) => {
|
|
551
618
|
let n = W.selectedVialId === e.id;
|
|
552
|
-
return /* @__PURE__ */
|
|
619
|
+
return /* @__PURE__ */ S(N, {
|
|
553
620
|
hover: !0,
|
|
554
621
|
selected: n,
|
|
555
622
|
onClick: () => G({
|
|
@@ -559,76 +626,76 @@ function Ce() {
|
|
|
559
626
|
}),
|
|
560
627
|
sx: { cursor: "pointer" },
|
|
561
628
|
children: [
|
|
562
|
-
/* @__PURE__ */
|
|
629
|
+
/* @__PURE__ */ x(j, {
|
|
563
630
|
padding: "checkbox",
|
|
564
|
-
children: /* @__PURE__ */
|
|
631
|
+
children: /* @__PURE__ */ x(_e, { checked: n })
|
|
565
632
|
}),
|
|
566
|
-
/* @__PURE__ */
|
|
633
|
+
/* @__PURE__ */ S(j, {
|
|
567
634
|
sx: { fontFamily: "monospace" },
|
|
568
|
-
children: [e.lotNumber || "—", t === 0 ? /* @__PURE__ */
|
|
635
|
+
children: [e.lotNumber || "—", t === 0 ? /* @__PURE__ */ x(E, {
|
|
569
636
|
size: "small",
|
|
570
637
|
color: "primary",
|
|
571
638
|
label: "Use first",
|
|
572
639
|
sx: { ml: 1 }
|
|
573
640
|
}) : null]
|
|
574
641
|
}),
|
|
575
|
-
/* @__PURE__ */
|
|
576
|
-
/* @__PURE__ */
|
|
577
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ x(j, { children: _(e.expiresAt) }),
|
|
643
|
+
/* @__PURE__ */ x(j, { children: e.batchExpiryDate ? ie(e.batchExpiryDate) : "—" }),
|
|
644
|
+
/* @__PURE__ */ S(j, {
|
|
578
645
|
align: "right",
|
|
579
646
|
sx: { fontWeight: 700 },
|
|
580
647
|
children: [
|
|
581
|
-
|
|
648
|
+
v(e.volumeRemainingMl),
|
|
582
649
|
" /",
|
|
583
650
|
" ",
|
|
584
|
-
|
|
651
|
+
v(e.volumeTotalMl)
|
|
585
652
|
]
|
|
586
653
|
})
|
|
587
654
|
]
|
|
588
655
|
}, e.id);
|
|
589
656
|
}) })]
|
|
590
|
-
}) })] }) : /* @__PURE__ */ b
|
|
657
|
+
}) })] }) : /* @__PURE__ */ x(b, { children: W.ownerType ? W.batchCandidates.length === 0 ? /* @__PURE__ */ x(C, {
|
|
591
658
|
severity: "error",
|
|
592
|
-
action: W.vialCandidates.length > 0 ? /* @__PURE__ */
|
|
659
|
+
action: W.vialCandidates.length > 0 ? /* @__PURE__ */ x(T, {
|
|
593
660
|
color: "inherit",
|
|
594
661
|
size: "small",
|
|
595
662
|
onClick: () => X("use-existing"),
|
|
596
663
|
children: "Use an open vial"
|
|
597
664
|
}) : null,
|
|
598
665
|
children: "No batches available — every batch is either out of stock, expired, or already at the maximum concurrent open vials. Receive a purchase or finish the open vials first."
|
|
599
|
-
}) : /* @__PURE__ */
|
|
666
|
+
}) : /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(C, {
|
|
600
667
|
severity: "warning",
|
|
601
|
-
action: W.vialCandidates.length > 0 ? /* @__PURE__ */
|
|
668
|
+
action: W.vialCandidates.length > 0 ? /* @__PURE__ */ x(T, {
|
|
602
669
|
color: "inherit",
|
|
603
670
|
size: "small",
|
|
604
671
|
onClick: () => X("use-existing"),
|
|
605
672
|
children: "Use an open vial instead"
|
|
606
673
|
}) : null,
|
|
607
674
|
children: W.vialCandidates.length > 0 ? "Opening a new vial from stock. Existing open vials are still available if the dose fits." : "No open vials for this vaccine. A new vial will be opened from the selected batch and the dose recorded in one step."
|
|
608
|
-
}), /* @__PURE__ */
|
|
675
|
+
}), /* @__PURE__ */ x(be, { children: /* @__PURE__ */ S(ye, {
|
|
609
676
|
size: "small",
|
|
610
|
-
children: [/* @__PURE__ */
|
|
611
|
-
/* @__PURE__ */
|
|
612
|
-
/* @__PURE__ */
|
|
677
|
+
children: [/* @__PURE__ */ x(M, { children: /* @__PURE__ */ S(N, { children: [
|
|
678
|
+
/* @__PURE__ */ x(j, {}),
|
|
679
|
+
/* @__PURE__ */ x(j, {
|
|
613
680
|
sx: { fontWeight: 800 },
|
|
614
681
|
children: "Lot"
|
|
615
682
|
}),
|
|
616
|
-
/* @__PURE__ */
|
|
683
|
+
/* @__PURE__ */ x(j, {
|
|
617
684
|
sx: { fontWeight: 800 },
|
|
618
685
|
children: "Batch expires"
|
|
619
686
|
}),
|
|
620
|
-
/* @__PURE__ */
|
|
687
|
+
/* @__PURE__ */ x(j, {
|
|
621
688
|
sx: { fontWeight: 800 },
|
|
622
689
|
align: "right",
|
|
623
690
|
children: "Qty available"
|
|
624
691
|
}),
|
|
625
|
-
/* @__PURE__ */
|
|
692
|
+
/* @__PURE__ */ x(j, {
|
|
626
693
|
sx: { fontWeight: 800 },
|
|
627
694
|
children: "Storage"
|
|
628
695
|
})
|
|
629
|
-
] }) }), /* @__PURE__ */
|
|
696
|
+
] }) }), /* @__PURE__ */ x(A, { children: W.batchCandidates.map((e, t) => {
|
|
630
697
|
let n = W.selectedBatchId === e.id;
|
|
631
|
-
return /* @__PURE__ */
|
|
698
|
+
return /* @__PURE__ */ S(N, {
|
|
632
699
|
hover: !0,
|
|
633
700
|
selected: n,
|
|
634
701
|
onClick: () => G({
|
|
@@ -637,39 +704,39 @@ function Ce() {
|
|
|
637
704
|
}),
|
|
638
705
|
sx: { cursor: "pointer" },
|
|
639
706
|
children: [
|
|
640
|
-
/* @__PURE__ */
|
|
707
|
+
/* @__PURE__ */ x(j, {
|
|
641
708
|
padding: "checkbox",
|
|
642
|
-
children: /* @__PURE__ */
|
|
709
|
+
children: /* @__PURE__ */ x(_e, { checked: n })
|
|
643
710
|
}),
|
|
644
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ S(j, {
|
|
645
712
|
sx: { fontFamily: "monospace" },
|
|
646
|
-
children: [e.lotNumber || "—", t === 0 ? /* @__PURE__ */
|
|
713
|
+
children: [e.lotNumber || "—", t === 0 ? /* @__PURE__ */ x(E, {
|
|
647
714
|
size: "small",
|
|
648
715
|
color: "primary",
|
|
649
716
|
label: "Use first",
|
|
650
717
|
sx: { ml: 1 }
|
|
651
718
|
}) : null]
|
|
652
719
|
}),
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
-
/* @__PURE__ */
|
|
720
|
+
/* @__PURE__ */ x(j, { children: e.expiryDate ? ie(e.expiryDate) : "—" }),
|
|
721
|
+
/* @__PURE__ */ x(j, {
|
|
655
722
|
align: "right",
|
|
656
723
|
sx: { fontWeight: 700 },
|
|
657
724
|
children: e.qtyRemaining
|
|
658
725
|
}),
|
|
659
|
-
/* @__PURE__ */
|
|
726
|
+
/* @__PURE__ */ x(j, { children: e.storageUnitName || "—" })
|
|
660
727
|
]
|
|
661
728
|
}, e.id);
|
|
662
729
|
}) })]
|
|
663
|
-
}) })] }) : /* @__PURE__ */
|
|
730
|
+
}) })] }) : /* @__PURE__ */ x(C, {
|
|
664
731
|
severity: "info",
|
|
665
732
|
children: "Pick an administration source above to see the available batches."
|
|
666
733
|
}) }),
|
|
667
|
-
W.mode === "use-existing" && Z || W.mode === "open-new" &&
|
|
734
|
+
W.mode === "use-existing" && Z || W.mode === "open-new" && Ke ? /* @__PURE__ */ S(k, {
|
|
668
735
|
direction: "row",
|
|
669
736
|
spacing: 1,
|
|
670
737
|
alignItems: "center",
|
|
671
738
|
flexWrap: "wrap",
|
|
672
|
-
children: [W.mode === "use-existing" ? /* @__PURE__ */
|
|
739
|
+
children: [W.mode === "use-existing" ? /* @__PURE__ */ S(b, { children: [Z.adultDoseMl ? /* @__PURE__ */ S(T, {
|
|
673
740
|
size: "small",
|
|
674
741
|
onClick: () => G({
|
|
675
742
|
...W,
|
|
@@ -680,7 +747,7 @@ function Ce() {
|
|
|
680
747
|
Z.adultDoseMl,
|
|
681
748
|
" ml)"
|
|
682
749
|
]
|
|
683
|
-
}) : null, Z.childDoseMl ? /* @__PURE__ */
|
|
750
|
+
}) : null, Z.childDoseMl ? /* @__PURE__ */ S(T, {
|
|
684
751
|
size: "small",
|
|
685
752
|
onClick: () => G({
|
|
686
753
|
...W,
|
|
@@ -691,7 +758,7 @@ function Ce() {
|
|
|
691
758
|
Z.childDoseMl,
|
|
692
759
|
" ml)"
|
|
693
760
|
]
|
|
694
|
-
}) : null] }) : /* @__PURE__ */
|
|
761
|
+
}) : null] }) : /* @__PURE__ */ S(b, { children: [Q?.adultDoseMl ? /* @__PURE__ */ S(T, {
|
|
695
762
|
size: "small",
|
|
696
763
|
onClick: () => G({
|
|
697
764
|
...W,
|
|
@@ -702,7 +769,7 @@ function Ce() {
|
|
|
702
769
|
Q.adultDoseMl,
|
|
703
770
|
" ml)"
|
|
704
771
|
]
|
|
705
|
-
}) : null, Q?.childDoseMl ? /* @__PURE__ */
|
|
772
|
+
}) : null, Q?.childDoseMl ? /* @__PURE__ */ S(T, {
|
|
706
773
|
size: "small",
|
|
707
774
|
onClick: () => G({
|
|
708
775
|
...W,
|
|
@@ -713,7 +780,7 @@ function Ce() {
|
|
|
713
780
|
Q.childDoseMl,
|
|
714
781
|
" ml)"
|
|
715
782
|
]
|
|
716
|
-
}) : null] }), /* @__PURE__ */
|
|
783
|
+
}) : null] }), /* @__PURE__ */ x(xe, {
|
|
717
784
|
required: !0,
|
|
718
785
|
label: "Volume (ml)",
|
|
719
786
|
size: "small",
|
|
@@ -736,12 +803,12 @@ function Ce() {
|
|
|
736
803
|
]
|
|
737
804
|
})
|
|
738
805
|
}),
|
|
739
|
-
/* @__PURE__ */
|
|
740
|
-
/* @__PURE__ */
|
|
741
|
-
onClick:
|
|
806
|
+
/* @__PURE__ */ S(de, { children: [
|
|
807
|
+
/* @__PURE__ */ x(T, {
|
|
808
|
+
onClick: Ve,
|
|
742
809
|
children: "Cancel"
|
|
743
810
|
}),
|
|
744
|
-
W.step === "select" ? /* @__PURE__ */
|
|
811
|
+
W.step === "select" ? /* @__PURE__ */ x(T, {
|
|
745
812
|
onClick: () => G({
|
|
746
813
|
...R,
|
|
747
814
|
open: !0,
|
|
@@ -749,21 +816,21 @@ function Ce() {
|
|
|
749
816
|
}),
|
|
750
817
|
children: "Back"
|
|
751
818
|
}) : null,
|
|
752
|
-
W.step === "product" ? /* @__PURE__ */
|
|
819
|
+
W.step === "product" ? /* @__PURE__ */ x(T, {
|
|
753
820
|
variant: "contained",
|
|
754
821
|
disabled: !W.productId || W.loading,
|
|
755
|
-
onClick: () => void
|
|
822
|
+
onClick: () => void Ue(),
|
|
756
823
|
children: "Next"
|
|
757
|
-
}) : /* @__PURE__ */
|
|
824
|
+
}) : /* @__PURE__ */ x(T, {
|
|
758
825
|
variant: "contained",
|
|
759
|
-
disabled: !
|
|
760
|
-
onClick: () => void
|
|
826
|
+
disabled: !qe,
|
|
827
|
+
onClick: () => void Je(),
|
|
761
828
|
children: W.mode === "use-existing" ? "Administer" : "Open & Administer"
|
|
762
829
|
})
|
|
763
830
|
] })
|
|
764
831
|
]
|
|
765
832
|
}),
|
|
766
|
-
/* @__PURE__ */
|
|
833
|
+
/* @__PURE__ */ S(ue, {
|
|
767
834
|
open: H.open,
|
|
768
835
|
onClose: () => U({
|
|
769
836
|
open: !1,
|
|
@@ -774,31 +841,31 @@ function Ce() {
|
|
|
774
841
|
fullWidth: !0,
|
|
775
842
|
maxWidth: "sm",
|
|
776
843
|
children: [
|
|
777
|
-
/* @__PURE__ */
|
|
778
|
-
/* @__PURE__ */
|
|
844
|
+
/* @__PURE__ */ x(pe, { children: "Close Vial (record remaining as wastage)" }),
|
|
845
|
+
/* @__PURE__ */ x(fe, {
|
|
779
846
|
dividers: !0,
|
|
780
|
-
children: /* @__PURE__ */
|
|
847
|
+
children: /* @__PURE__ */ S(k, {
|
|
781
848
|
spacing: 2,
|
|
782
849
|
sx: { pt: 1 },
|
|
783
850
|
children: [
|
|
784
|
-
/* @__PURE__ */
|
|
851
|
+
/* @__PURE__ */ S(P, {
|
|
785
852
|
variant: "body2",
|
|
786
853
|
children: [
|
|
787
854
|
H.vial?.productName,
|
|
788
855
|
" ·",
|
|
789
856
|
" ",
|
|
790
|
-
|
|
857
|
+
v(H.vial?.volumeRemainingMl),
|
|
791
858
|
" ml will be marked as wasted."
|
|
792
859
|
]
|
|
793
860
|
}),
|
|
794
|
-
/* @__PURE__ */
|
|
861
|
+
/* @__PURE__ */ S(me, {
|
|
795
862
|
required: !0,
|
|
796
863
|
fullWidth: !0,
|
|
797
864
|
size: "small",
|
|
798
865
|
error: K.show("wastageReason") && !!Y.wastageReason,
|
|
799
866
|
children: [
|
|
800
|
-
/* @__PURE__ */
|
|
801
|
-
/* @__PURE__ */
|
|
867
|
+
/* @__PURE__ */ x(D, { children: "Reason" }),
|
|
868
|
+
/* @__PURE__ */ x(ve, {
|
|
802
869
|
label: "Reason",
|
|
803
870
|
value: H.reason,
|
|
804
871
|
onChange: (e) => U({
|
|
@@ -806,15 +873,15 @@ function Ce() {
|
|
|
806
873
|
reason: e.target.value
|
|
807
874
|
}),
|
|
808
875
|
onBlur: K.onBlur("wastageReason"),
|
|
809
|
-
children:
|
|
876
|
+
children: oe.map((e) => /* @__PURE__ */ x(O, {
|
|
810
877
|
value: e.value,
|
|
811
878
|
children: e.label
|
|
812
879
|
}, e.value))
|
|
813
880
|
}),
|
|
814
|
-
K.show("wastageReason") && Y.wastageReason ? /* @__PURE__ */
|
|
881
|
+
K.show("wastageReason") && Y.wastageReason ? /* @__PURE__ */ x(he, { children: Y.wastageReason }) : null
|
|
815
882
|
]
|
|
816
883
|
}),
|
|
817
|
-
/* @__PURE__ */
|
|
884
|
+
/* @__PURE__ */ x(xe, {
|
|
818
885
|
label: "Comments",
|
|
819
886
|
size: "small",
|
|
820
887
|
multiline: !0,
|
|
@@ -829,7 +896,7 @@ function Ce() {
|
|
|
829
896
|
]
|
|
830
897
|
})
|
|
831
898
|
}),
|
|
832
|
-
/* @__PURE__ */
|
|
899
|
+
/* @__PURE__ */ S(de, { children: [/* @__PURE__ */ x(T, {
|
|
833
900
|
onClick: () => U({
|
|
834
901
|
open: !1,
|
|
835
902
|
vial: null,
|
|
@@ -837,11 +904,11 @@ function Ce() {
|
|
|
837
904
|
comments: ""
|
|
838
905
|
}),
|
|
839
906
|
children: "Cancel"
|
|
840
|
-
}), /* @__PURE__ */
|
|
907
|
+
}), /* @__PURE__ */ x(T, {
|
|
841
908
|
variant: "contained",
|
|
842
909
|
color: "error",
|
|
843
|
-
disabled: !
|
|
844
|
-
onClick: () => void
|
|
910
|
+
disabled: !ze,
|
|
911
|
+
onClick: () => void Be(),
|
|
845
912
|
children: "Close Vial"
|
|
846
913
|
})] })
|
|
847
914
|
]
|
|
@@ -850,6 +917,6 @@ function Ce() {
|
|
|
850
917
|
})] });
|
|
851
918
|
}
|
|
852
919
|
//#endregion
|
|
853
|
-
export {
|
|
920
|
+
export { Te as default };
|
|
854
921
|
|
|
855
|
-
//# sourceMappingURL=VialsPage-
|
|
922
|
+
//# sourceMappingURL=VialsPage-BNPUwGCU.js.map
|