@argusoft/medplat-product-management 1.0.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/BrandsPage-DCMCVvDY.js +334 -0
- package/dist/BrandsPage-DCMCVvDY.js.map +1 -0
- package/dist/CategoriesPage-BpRhwfrc.js +284 -0
- package/dist/CategoriesPage-BpRhwfrc.js.map +1 -0
- package/dist/DashboardPage-BNKUQj46.js +436 -0
- package/dist/DashboardPage-BNKUQj46.js.map +1 -0
- package/dist/FacilityPicker-Coi8I3yE.js +79 -0
- package/dist/FacilityPicker-Coi8I3yE.js.map +1 -0
- package/dist/InventoryPage-BR6jOzg2.js +517 -0
- package/dist/InventoryPage-BR6jOzg2.js.map +1 -0
- package/dist/MemberProfileCard-DbHZCS5n.js +272 -0
- package/dist/MemberProfileCard-DbHZCS5n.js.map +1 -0
- package/dist/PaymentCreatePage-Ci3ERnby.js +487 -0
- package/dist/PaymentCreatePage-Ci3ERnby.js.map +1 -0
- package/dist/PaymentsPage-sdg902zX.js +157 -0
- package/dist/PaymentsPage-sdg902zX.js.map +1 -0
- package/dist/PickupCreatePage-CieMsgWV.js +310 -0
- package/dist/PickupCreatePage-CieMsgWV.js.map +1 -0
- package/dist/PickupsPage-Ci2Ll0Kn.js +566 -0
- package/dist/PickupsPage-Ci2Ll0Kn.js.map +1 -0
- package/dist/PmGuard-CjJBisaN.js +1195 -0
- package/dist/PmGuard-CjJBisaN.js.map +1 -0
- package/dist/PmTable-BuXZQZCU.js +302 -0
- package/dist/PmTable-BuXZQZCU.js.map +1 -0
- package/dist/ProductEditPage-DL8gy85Y.js +666 -0
- package/dist/ProductEditPage-DL8gy85Y.js.map +1 -0
- package/dist/ProductsPage-BANTKxLb.js +221 -0
- package/dist/ProductsPage-BANTKxLb.js.map +1 -0
- package/dist/PurchaseCreatePage-C3KMfBxJ.js +626 -0
- package/dist/PurchaseCreatePage-C3KMfBxJ.js.map +1 -0
- package/dist/PurchaseRequestDetailPage-C0GYFJDl.js +586 -0
- package/dist/PurchaseRequestDetailPage-C0GYFJDl.js.map +1 -0
- package/dist/PurchaseRequestsPage-DvFH_tWe.js +265 -0
- package/dist/PurchaseRequestsPage-DvFH_tWe.js.map +1 -0
- package/dist/PurchasesPage-BCvLvSp4.js +295 -0
- package/dist/PurchasesPage-BCvLvSp4.js.map +1 -0
- package/dist/SaleCreatePage-DpkQMoTq.js +548 -0
- package/dist/SaleCreatePage-DpkQMoTq.js.map +1 -0
- package/dist/SalesPage-DUwgkEO-.js +315 -0
- package/dist/SalesPage-DUwgkEO-.js.map +1 -0
- package/dist/SettingsPage-CusC0jqJ.js +710 -0
- package/dist/SettingsPage-CusC0jqJ.js.map +1 -0
- package/dist/StorageUnitsPage-BlC2AgrJ.js +469 -0
- package/dist/StorageUnitsPage-BlC2AgrJ.js.map +1 -0
- package/dist/TransactionsPage-DDaK4VyY.js +714 -0
- package/dist/TransactionsPage-DDaK4VyY.js.map +1 -0
- package/dist/TransferCreatePage-BxudLfhS.js +363 -0
- package/dist/TransferCreatePage-BxudLfhS.js.map +1 -0
- package/dist/TransfersPage-zgmt7teZ.js +480 -0
- package/dist/TransfersPage-zgmt7teZ.js.map +1 -0
- package/dist/VialsPage-CjqPfgpV.js +855 -0
- package/dist/VialsPage-CjqPfgpV.js.map +1 -0
- package/dist/constants-BrA_hfAI.js +254 -0
- package/dist/constants-BrA_hfAI.js.map +1 -0
- package/dist/currency-BDDCDgeE.js +169 -0
- package/dist/currency-BDDCDgeE.js.map +1 -0
- package/dist/format-UOyOu75i.js +52 -0
- package/dist/format-UOyOu75i.js.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/useFieldErrors-hDG8ox_x.js +29 -0
- package/dist/useFieldErrors-hDG8ox_x.js.map +1 -0
- package/dist/validation-Ba7puFIO.js +109 -0
- package/dist/validation-Ba7puFIO.js.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,666 @@
|
|
|
1
|
+
import { S as e, a as t, c as n, k as ee, n as r, r as te, st as ne, t as i, w as a, x as o } from "./PmGuard-CjJBisaN.js";
|
|
2
|
+
import { c as s, g as re, h as ie, m as c, p as ae, r as l, s as oe, t as se } from "./validation-Ba7puFIO.js";
|
|
3
|
+
import { t as ce } from "./useFieldErrors-hDG8ox_x.js";
|
|
4
|
+
import { i as le, l as ue, u as de } from "./constants-BrA_hfAI.js";
|
|
5
|
+
import { useEffect as u, useMemo as d, useState as f } from "react";
|
|
6
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
7
|
+
import { Alert as h, Box as fe, Button as g, Card as _, CardContent as v, Checkbox as y, Divider as b, FormControl as x, FormControlLabel as S, FormHelperText as C, Grid as w, InputLabel as T, MenuItem as E, Select as D, Stack as O, TextField as k, Typography as A } from "@mui/material";
|
|
8
|
+
import { showToast as j } from "@/common/toaster/toaster";
|
|
9
|
+
import { useNavigate as M, useParams as N } from "react-router-dom";
|
|
10
|
+
import P from "@mui/icons-material/SaveRounded";
|
|
11
|
+
//#region src/views/ProductEditPage.jsx
|
|
12
|
+
var F = {
|
|
13
|
+
vaccineCode: "",
|
|
14
|
+
vialVolumeMl: "",
|
|
15
|
+
adultDoseMl: "",
|
|
16
|
+
childDoseMl: "",
|
|
17
|
+
openVialValidityHours: 6,
|
|
18
|
+
maxConcurrentOpenVials: 2,
|
|
19
|
+
requiresReconstitution: !1,
|
|
20
|
+
reconstitutedValidityHours: "",
|
|
21
|
+
route: "",
|
|
22
|
+
storageTempMinCelsius: "",
|
|
23
|
+
storageTempMaxCelsius: "",
|
|
24
|
+
comments: ""
|
|
25
|
+
};
|
|
26
|
+
function I() {
|
|
27
|
+
let { productId: I } = N(), L = M(), [R, z] = f(!0), [B, V] = f(""), [H, pe] = f([]), [me, he] = f([]), [U, ge] = f([]), W = ce(), G = n()?.manageSales !== !1, [K, q] = f({
|
|
28
|
+
id: I,
|
|
29
|
+
name: "",
|
|
30
|
+
categoryId: "",
|
|
31
|
+
brandId: "",
|
|
32
|
+
description: "",
|
|
33
|
+
unit: "",
|
|
34
|
+
hasExpiry: !0,
|
|
35
|
+
needsStorageUnit: !1,
|
|
36
|
+
notForSale: !1,
|
|
37
|
+
isActive: !0,
|
|
38
|
+
imageUuids: [],
|
|
39
|
+
vaccineConfig: null
|
|
40
|
+
}), J = d(() => H.find((e) => e.id === K.categoryId), [H, K.categoryId]), Y = J?.code?.toUpperCase() === ue;
|
|
41
|
+
te("update.manage.productManagement.product", () => {
|
|
42
|
+
async function t() {
|
|
43
|
+
z(!0);
|
|
44
|
+
try {
|
|
45
|
+
let [t, n, r] = await Promise.all([
|
|
46
|
+
e(),
|
|
47
|
+
o(),
|
|
48
|
+
a().catch(() => [])
|
|
49
|
+
]);
|
|
50
|
+
pe(t), he(n), ge(r);
|
|
51
|
+
try {
|
|
52
|
+
let e = await ee(I);
|
|
53
|
+
q({
|
|
54
|
+
id: e.id,
|
|
55
|
+
name: e.name ?? "",
|
|
56
|
+
categoryId: e.categoryId ?? "",
|
|
57
|
+
brandId: e.brandId ?? "",
|
|
58
|
+
description: e.description ?? "",
|
|
59
|
+
unit: e.unit ?? "PIECE",
|
|
60
|
+
hasExpiry: e.hasExpiry ?? !1,
|
|
61
|
+
needsStorageUnit: e.needsStorageUnit ?? !1,
|
|
62
|
+
notForSale: e.notForSale ?? !1,
|
|
63
|
+
isActive: e.isActive ?? !0,
|
|
64
|
+
imageUuids: e.imageUuids ?? [],
|
|
65
|
+
vaccineConfig: e.vaccineConfig ? {
|
|
66
|
+
vaccineCode: e.vaccineConfig.vaccineCode ?? "",
|
|
67
|
+
vialVolumeMl: e.vaccineConfig.vialVolumeMl ?? "",
|
|
68
|
+
adultDoseMl: e.vaccineConfig.adultDoseMl ?? "",
|
|
69
|
+
childDoseMl: e.vaccineConfig.childDoseMl ?? "",
|
|
70
|
+
openVialValidityHours: e.vaccineConfig.openVialValidityHours ?? 6,
|
|
71
|
+
maxConcurrentOpenVials: e.vaccineConfig.maxConcurrentOpenVials ?? 2,
|
|
72
|
+
requiresReconstitution: e.vaccineConfig.requiresReconstitution ?? !1,
|
|
73
|
+
reconstitutedValidityHours: e.vaccineConfig.reconstitutedValidityHours ?? "",
|
|
74
|
+
route: e.vaccineConfig.route ?? "",
|
|
75
|
+
storageTempMinCelsius: e.vaccineConfig.storageTempMinCelsius ?? "",
|
|
76
|
+
storageTempMaxCelsius: e.vaccineConfig.storageTempMaxCelsius ?? "",
|
|
77
|
+
comments: e.vaccineConfig.comments ?? ""
|
|
78
|
+
} : null
|
|
79
|
+
});
|
|
80
|
+
} catch {}
|
|
81
|
+
} catch (e) {
|
|
82
|
+
V(e?.response?.data?.message ?? e?.message ?? "Failed to load product");
|
|
83
|
+
} finally {
|
|
84
|
+
z(!1);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
t();
|
|
88
|
+
}, [I]), u(() => {
|
|
89
|
+
Y && q((e) => ({
|
|
90
|
+
...e,
|
|
91
|
+
unit: "VIAL",
|
|
92
|
+
needsStorageUnit: !0,
|
|
93
|
+
vaccineConfig: e.vaccineConfig ?? { ...F }
|
|
94
|
+
}));
|
|
95
|
+
}, [Y]);
|
|
96
|
+
function X(e, t) {
|
|
97
|
+
q((n) => ({
|
|
98
|
+
...n,
|
|
99
|
+
[e]: t
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
function Z(e, t) {
|
|
103
|
+
q((n) => ({
|
|
104
|
+
...n,
|
|
105
|
+
vaccineConfig: {
|
|
106
|
+
...n.vaccineConfig ?? F,
|
|
107
|
+
[e]: t
|
|
108
|
+
}
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
let Q = d(() => {
|
|
112
|
+
let e = {
|
|
113
|
+
name: c(K.name, "Product name"),
|
|
114
|
+
categoryId: c(K.categoryId, "Category"),
|
|
115
|
+
brandId: c(K.brandId, "Brand"),
|
|
116
|
+
unit: c(K.unit, "Unit")
|
|
117
|
+
};
|
|
118
|
+
if (Y && K.vaccineConfig) {
|
|
119
|
+
let t = K.vaccineConfig, n = ie(t.storageTempMinCelsius, t.storageTempMaxCelsius);
|
|
120
|
+
Object.assign(e, {
|
|
121
|
+
vaccineCode: c(t.vaccineCode, "Vaccine"),
|
|
122
|
+
vialVolumeMl: re(t.vialVolumeMl),
|
|
123
|
+
adultDoseMl: l(t.adultDoseMl, "Adult dose", t.vialVolumeMl),
|
|
124
|
+
childDoseMl: l(t.childDoseMl, "Child dose", t.vialVolumeMl),
|
|
125
|
+
openVialValidityHours: s(t.openVialValidityHours),
|
|
126
|
+
maxConcurrentOpenVials: oe(t.maxConcurrentOpenVials),
|
|
127
|
+
reconstitutedValidityHours: ae(t.reconstitutedValidityHours, t.requiresReconstitution),
|
|
128
|
+
storageTempMinCelsius: n.min,
|
|
129
|
+
storageTempMaxCelsius: n.max
|
|
130
|
+
}), !t.adultDoseMl && !t.childDoseMl && (e.adultDoseMl = e.adultDoseMl || "Provide at least one dose (adult or child)", e.childDoseMl = e.childDoseMl || "Provide at least one dose (adult or child)");
|
|
131
|
+
}
|
|
132
|
+
return e;
|
|
133
|
+
}, [K, Y]), $ = se(Q);
|
|
134
|
+
async function _e() {
|
|
135
|
+
if (!$) {
|
|
136
|
+
W.markAllTouched(), V("Please fix the highlighted fields and try again.");
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
try {
|
|
140
|
+
await ne({
|
|
141
|
+
id: K.id,
|
|
142
|
+
name: K.name.trim(),
|
|
143
|
+
categoryId: K.categoryId,
|
|
144
|
+
brandId: K.brandId,
|
|
145
|
+
description: K.description || null,
|
|
146
|
+
unit: K.unit,
|
|
147
|
+
hasExpiry: !!K.hasExpiry,
|
|
148
|
+
needsStorageUnit: !!K.needsStorageUnit,
|
|
149
|
+
notForSale: G ? !!K.notForSale : !1,
|
|
150
|
+
isActive: !!K.isActive,
|
|
151
|
+
imageUuids: K.imageUuids ?? [],
|
|
152
|
+
vaccineConfig: K.vaccineConfig ? {
|
|
153
|
+
vaccineCode: K.vaccineConfig.vaccineCode?.trim().toUpperCase(),
|
|
154
|
+
vialVolumeMl: Number(K.vaccineConfig.vialVolumeMl),
|
|
155
|
+
adultDoseMl: K.vaccineConfig.adultDoseMl === "" ? null : Number(K.vaccineConfig.adultDoseMl),
|
|
156
|
+
childDoseMl: K.vaccineConfig.childDoseMl === "" ? null : Number(K.vaccineConfig.childDoseMl),
|
|
157
|
+
openVialValidityHours: Number(K.vaccineConfig.openVialValidityHours ?? 6),
|
|
158
|
+
maxConcurrentOpenVials: Number(K.vaccineConfig.maxConcurrentOpenVials ?? 2),
|
|
159
|
+
requiresReconstitution: !!K.vaccineConfig.requiresReconstitution,
|
|
160
|
+
reconstitutedValidityHours: K.vaccineConfig.reconstitutedValidityHours === "" ? null : Number(K.vaccineConfig.reconstitutedValidityHours),
|
|
161
|
+
route: K.vaccineConfig.route || null,
|
|
162
|
+
storageTempMinCelsius: K.vaccineConfig.storageTempMinCelsius === "" ? null : Number(K.vaccineConfig.storageTempMinCelsius),
|
|
163
|
+
storageTempMaxCelsius: K.vaccineConfig.storageTempMaxCelsius === "" ? null : Number(K.vaccineConfig.storageTempMaxCelsius),
|
|
164
|
+
comments: K.vaccineConfig.comments || null
|
|
165
|
+
} : null
|
|
166
|
+
}), j({
|
|
167
|
+
message: "Product saved.",
|
|
168
|
+
type: "success"
|
|
169
|
+
}), L("/ui/medplat/manage/pm/products");
|
|
170
|
+
} catch (e) {
|
|
171
|
+
V(e?.response?.data?.message ?? e?.message ?? "Failed to save product");
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return /* @__PURE__ */ m(fe, { children: [/* @__PURE__ */ p(r, {}), /* @__PURE__ */ p(i, {
|
|
175
|
+
perm: "update.manage.productManagement.product",
|
|
176
|
+
title: "You don’t have permission to create or edit products",
|
|
177
|
+
children: /* @__PURE__ */ m(t, {
|
|
178
|
+
title: K.id ? "Edit Product" : "New Product",
|
|
179
|
+
subtitle: `Category: ${J?.code ?? "—"}`,
|
|
180
|
+
chips: Y ? ["Vaccine"] : ["Generic"],
|
|
181
|
+
actions: /* @__PURE__ */ m(O, {
|
|
182
|
+
direction: "row",
|
|
183
|
+
spacing: 1,
|
|
184
|
+
children: [/* @__PURE__ */ p(g, {
|
|
185
|
+
variant: "outlined",
|
|
186
|
+
onClick: () => L("/ui/medplat/manage/pm/products"),
|
|
187
|
+
children: "Cancel"
|
|
188
|
+
}), /* @__PURE__ */ p(g, {
|
|
189
|
+
variant: "contained",
|
|
190
|
+
startIcon: /* @__PURE__ */ p(P, {}),
|
|
191
|
+
disabled: !$,
|
|
192
|
+
onClick: () => void _e(),
|
|
193
|
+
children: "Save"
|
|
194
|
+
})]
|
|
195
|
+
}),
|
|
196
|
+
children: [
|
|
197
|
+
R ? /* @__PURE__ */ p(h, {
|
|
198
|
+
severity: "info",
|
|
199
|
+
children: "Loading…"
|
|
200
|
+
}) : null,
|
|
201
|
+
B ? /* @__PURE__ */ p(h, {
|
|
202
|
+
severity: "error",
|
|
203
|
+
sx: { mb: 2 },
|
|
204
|
+
children: B
|
|
205
|
+
}) : null,
|
|
206
|
+
/* @__PURE__ */ p(_, {
|
|
207
|
+
sx: {
|
|
208
|
+
borderRadius: 4,
|
|
209
|
+
mb: 2
|
|
210
|
+
},
|
|
211
|
+
children: /* @__PURE__ */ m(v, { children: [/* @__PURE__ */ p(A, {
|
|
212
|
+
variant: "h6",
|
|
213
|
+
sx: {
|
|
214
|
+
fontWeight: 800,
|
|
215
|
+
mb: 2
|
|
216
|
+
},
|
|
217
|
+
children: "Basic Details"
|
|
218
|
+
}), /* @__PURE__ */ m(w, {
|
|
219
|
+
container: !0,
|
|
220
|
+
spacing: 2,
|
|
221
|
+
children: [
|
|
222
|
+
/* @__PURE__ */ p(w, {
|
|
223
|
+
item: !0,
|
|
224
|
+
xs: 12,
|
|
225
|
+
md: 6,
|
|
226
|
+
children: /* @__PURE__ */ p(k, {
|
|
227
|
+
required: !0,
|
|
228
|
+
fullWidth: !0,
|
|
229
|
+
size: "small",
|
|
230
|
+
label: "Product Name",
|
|
231
|
+
value: K.name,
|
|
232
|
+
onChange: (e) => X("name", e.target.value),
|
|
233
|
+
onBlur: W.onBlur("name"),
|
|
234
|
+
error: W.show("name") && !!Q.name,
|
|
235
|
+
helperText: W.show("name") ? Q.name : ""
|
|
236
|
+
})
|
|
237
|
+
}),
|
|
238
|
+
/* @__PURE__ */ p(w, {
|
|
239
|
+
item: !0,
|
|
240
|
+
xs: 12,
|
|
241
|
+
md: 3,
|
|
242
|
+
children: /* @__PURE__ */ m(x, {
|
|
243
|
+
required: !0,
|
|
244
|
+
fullWidth: !0,
|
|
245
|
+
size: "small",
|
|
246
|
+
error: W.show("categoryId") && !!Q.categoryId,
|
|
247
|
+
children: [
|
|
248
|
+
/* @__PURE__ */ p(T, { children: "Category" }),
|
|
249
|
+
/* @__PURE__ */ p(D, {
|
|
250
|
+
label: "Category",
|
|
251
|
+
value: K.categoryId,
|
|
252
|
+
onChange: (e) => X("categoryId", e.target.value),
|
|
253
|
+
onBlur: W.onBlur("categoryId"),
|
|
254
|
+
children: H.map((e) => /* @__PURE__ */ m(E, {
|
|
255
|
+
value: e.id,
|
|
256
|
+
children: [
|
|
257
|
+
e.name,
|
|
258
|
+
" (",
|
|
259
|
+
e.code,
|
|
260
|
+
")"
|
|
261
|
+
]
|
|
262
|
+
}, e.id))
|
|
263
|
+
}),
|
|
264
|
+
W.show("categoryId") && Q.categoryId ? /* @__PURE__ */ p(C, { children: Q.categoryId }) : null
|
|
265
|
+
]
|
|
266
|
+
})
|
|
267
|
+
}),
|
|
268
|
+
/* @__PURE__ */ p(w, {
|
|
269
|
+
item: !0,
|
|
270
|
+
xs: 12,
|
|
271
|
+
md: 3,
|
|
272
|
+
children: /* @__PURE__ */ m(x, {
|
|
273
|
+
required: !0,
|
|
274
|
+
fullWidth: !0,
|
|
275
|
+
size: "small",
|
|
276
|
+
error: W.show("brandId") && !!Q.brandId,
|
|
277
|
+
children: [
|
|
278
|
+
/* @__PURE__ */ p(T, { children: "Brand" }),
|
|
279
|
+
/* @__PURE__ */ p(D, {
|
|
280
|
+
label: "Brand",
|
|
281
|
+
value: K.brandId,
|
|
282
|
+
onChange: (e) => X("brandId", e.target.value),
|
|
283
|
+
onBlur: W.onBlur("brandId"),
|
|
284
|
+
children: me.map((e) => /* @__PURE__ */ p(E, {
|
|
285
|
+
value: e.id,
|
|
286
|
+
children: e.name
|
|
287
|
+
}, e.id))
|
|
288
|
+
}),
|
|
289
|
+
W.show("brandId") && Q.brandId ? /* @__PURE__ */ p(C, { children: Q.brandId }) : null
|
|
290
|
+
]
|
|
291
|
+
})
|
|
292
|
+
}),
|
|
293
|
+
/* @__PURE__ */ p(w, {
|
|
294
|
+
item: !0,
|
|
295
|
+
xs: 12,
|
|
296
|
+
md: 3,
|
|
297
|
+
children: /* @__PURE__ */ m(x, {
|
|
298
|
+
required: !0,
|
|
299
|
+
fullWidth: !0,
|
|
300
|
+
size: "small",
|
|
301
|
+
disabled: Y,
|
|
302
|
+
error: W.show("unit") && !!Q.unit,
|
|
303
|
+
children: [
|
|
304
|
+
/* @__PURE__ */ p(T, { children: "Unit" }),
|
|
305
|
+
/* @__PURE__ */ p(D, {
|
|
306
|
+
label: "Unit",
|
|
307
|
+
value: K.unit,
|
|
308
|
+
onChange: (e) => X("unit", e.target.value),
|
|
309
|
+
onBlur: W.onBlur("unit"),
|
|
310
|
+
children: le.map((e) => /* @__PURE__ */ p(E, {
|
|
311
|
+
value: e.value,
|
|
312
|
+
children: e.label
|
|
313
|
+
}, e.value))
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ p(C, { children: W.show("unit") && Q.unit ? Q.unit : Y ? "Vaccines must use VIAL" : "" })
|
|
316
|
+
]
|
|
317
|
+
})
|
|
318
|
+
}),
|
|
319
|
+
/* @__PURE__ */ p(w, {
|
|
320
|
+
item: !0,
|
|
321
|
+
xs: 6,
|
|
322
|
+
md: 3,
|
|
323
|
+
children: /* @__PURE__ */ p(S, {
|
|
324
|
+
control: /* @__PURE__ */ p(y, {
|
|
325
|
+
checked: !!K.hasExpiry,
|
|
326
|
+
disabled: Y,
|
|
327
|
+
onChange: (e) => X("hasExpiry", e.target.checked)
|
|
328
|
+
}),
|
|
329
|
+
label: Y ? "Has expiry (vaccine)" : "Has expiry"
|
|
330
|
+
})
|
|
331
|
+
}),
|
|
332
|
+
/* @__PURE__ */ p(w, {
|
|
333
|
+
item: !0,
|
|
334
|
+
xs: 6,
|
|
335
|
+
md: 3,
|
|
336
|
+
children: /* @__PURE__ */ p(S, {
|
|
337
|
+
control: /* @__PURE__ */ p(y, {
|
|
338
|
+
checked: !!K.needsStorageUnit,
|
|
339
|
+
disabled: Y,
|
|
340
|
+
onChange: (e) => X("needsStorageUnit", e.target.checked)
|
|
341
|
+
}),
|
|
342
|
+
label: Y ? "Needs storage unit (vaccine)" : "Needs storage unit"
|
|
343
|
+
})
|
|
344
|
+
}),
|
|
345
|
+
G ? /* @__PURE__ */ p(w, {
|
|
346
|
+
item: !0,
|
|
347
|
+
xs: 6,
|
|
348
|
+
md: 3,
|
|
349
|
+
children: /* @__PURE__ */ p(S, {
|
|
350
|
+
control: /* @__PURE__ */ p(y, {
|
|
351
|
+
checked: !!K.notForSale,
|
|
352
|
+
onChange: (e) => X("notForSale", e.target.checked)
|
|
353
|
+
}),
|
|
354
|
+
label: "Not for sale"
|
|
355
|
+
})
|
|
356
|
+
}) : null,
|
|
357
|
+
/* @__PURE__ */ p(w, {
|
|
358
|
+
item: !0,
|
|
359
|
+
xs: 6,
|
|
360
|
+
md: 3,
|
|
361
|
+
children: /* @__PURE__ */ p(S, {
|
|
362
|
+
control: /* @__PURE__ */ p(y, {
|
|
363
|
+
checked: !!K.isActive,
|
|
364
|
+
onChange: (e) => X("isActive", e.target.checked)
|
|
365
|
+
}),
|
|
366
|
+
label: "Active"
|
|
367
|
+
})
|
|
368
|
+
}),
|
|
369
|
+
/* @__PURE__ */ p(w, {
|
|
370
|
+
item: !0,
|
|
371
|
+
xs: 12,
|
|
372
|
+
children: /* @__PURE__ */ p(k, {
|
|
373
|
+
fullWidth: !0,
|
|
374
|
+
size: "small",
|
|
375
|
+
multiline: !0,
|
|
376
|
+
minRows: 2,
|
|
377
|
+
label: "Description",
|
|
378
|
+
value: K.description,
|
|
379
|
+
onChange: (e) => X("description", e.target.value)
|
|
380
|
+
})
|
|
381
|
+
})
|
|
382
|
+
]
|
|
383
|
+
})] })
|
|
384
|
+
}),
|
|
385
|
+
Y ? /* @__PURE__ */ p(_, {
|
|
386
|
+
sx: { borderRadius: 4 },
|
|
387
|
+
children: /* @__PURE__ */ m(v, { children: [
|
|
388
|
+
/* @__PURE__ */ m(O, {
|
|
389
|
+
direction: "row",
|
|
390
|
+
justifyContent: "space-between",
|
|
391
|
+
alignItems: "center",
|
|
392
|
+
sx: { mb: 2 },
|
|
393
|
+
children: [/* @__PURE__ */ p(A, {
|
|
394
|
+
variant: "h6",
|
|
395
|
+
sx: { fontWeight: 800 },
|
|
396
|
+
children: "Vaccine Configuration"
|
|
397
|
+
}), /* @__PURE__ */ p(A, {
|
|
398
|
+
variant: "caption",
|
|
399
|
+
color: "text.secondary",
|
|
400
|
+
children: "Required for vaccine products. Controls vial size, dosing, and shelf life rules."
|
|
401
|
+
})]
|
|
402
|
+
}),
|
|
403
|
+
/* @__PURE__ */ p(b, { sx: { mb: 2 } }),
|
|
404
|
+
/* @__PURE__ */ m(w, {
|
|
405
|
+
container: !0,
|
|
406
|
+
spacing: 2,
|
|
407
|
+
children: [
|
|
408
|
+
/* @__PURE__ */ p(w, {
|
|
409
|
+
item: !0,
|
|
410
|
+
xs: 12,
|
|
411
|
+
md: 3,
|
|
412
|
+
children: /* @__PURE__ */ m(x, {
|
|
413
|
+
required: !0,
|
|
414
|
+
fullWidth: !0,
|
|
415
|
+
size: "small",
|
|
416
|
+
error: W.show("vaccineCode") && !!Q.vaccineCode,
|
|
417
|
+
children: [
|
|
418
|
+
/* @__PURE__ */ p(T, { children: "Vaccine" }),
|
|
419
|
+
/* @__PURE__ */ m(D, {
|
|
420
|
+
label: "Vaccine",
|
|
421
|
+
value: K.vaccineConfig?.vaccineCode || "",
|
|
422
|
+
onChange: (e) => Z("vaccineCode", e.target.value),
|
|
423
|
+
onBlur: W.onBlur("vaccineCode"),
|
|
424
|
+
children: [U.length === 0 ? /* @__PURE__ */ p(E, {
|
|
425
|
+
value: "",
|
|
426
|
+
disabled: !0,
|
|
427
|
+
children: /* @__PURE__ */ p("em", { children: "No vaccines configured in immunization master" })
|
|
428
|
+
}) : null, U.map((e) => /* @__PURE__ */ m(E, {
|
|
429
|
+
value: e.vaccineCode,
|
|
430
|
+
children: [
|
|
431
|
+
e.vaccineName,
|
|
432
|
+
" (",
|
|
433
|
+
e.vaccineCode,
|
|
434
|
+
")"
|
|
435
|
+
]
|
|
436
|
+
}, e.id))]
|
|
437
|
+
}),
|
|
438
|
+
/* @__PURE__ */ p(C, { children: W.show("vaccineCode") && Q.vaccineCode ? Q.vaccineCode : "Sourced from medplat_immunization_master" })
|
|
439
|
+
]
|
|
440
|
+
})
|
|
441
|
+
}),
|
|
442
|
+
/* @__PURE__ */ p(w, {
|
|
443
|
+
item: !0,
|
|
444
|
+
xs: 12,
|
|
445
|
+
md: 3,
|
|
446
|
+
children: /* @__PURE__ */ p(k, {
|
|
447
|
+
required: !0,
|
|
448
|
+
fullWidth: !0,
|
|
449
|
+
size: "small",
|
|
450
|
+
type: "number",
|
|
451
|
+
inputProps: {
|
|
452
|
+
step: "0.01",
|
|
453
|
+
min: 0
|
|
454
|
+
},
|
|
455
|
+
label: "Vial Volume (ml)",
|
|
456
|
+
value: K.vaccineConfig?.vialVolumeMl ?? "",
|
|
457
|
+
onChange: (e) => Z("vialVolumeMl", e.target.value),
|
|
458
|
+
onBlur: W.onBlur("vialVolumeMl"),
|
|
459
|
+
error: W.show("vialVolumeMl") && !!Q.vialVolumeMl,
|
|
460
|
+
helperText: W.show("vialVolumeMl") ? Q.vialVolumeMl : ""
|
|
461
|
+
})
|
|
462
|
+
}),
|
|
463
|
+
/* @__PURE__ */ p(w, {
|
|
464
|
+
item: !0,
|
|
465
|
+
xs: 12,
|
|
466
|
+
md: 3,
|
|
467
|
+
children: /* @__PURE__ */ p(k, {
|
|
468
|
+
fullWidth: !0,
|
|
469
|
+
size: "small",
|
|
470
|
+
type: "number",
|
|
471
|
+
inputProps: {
|
|
472
|
+
step: "0.01",
|
|
473
|
+
min: 0
|
|
474
|
+
},
|
|
475
|
+
label: "Adult Dose (ml)",
|
|
476
|
+
value: K.vaccineConfig?.adultDoseMl ?? "",
|
|
477
|
+
onChange: (e) => Z("adultDoseMl", e.target.value),
|
|
478
|
+
onBlur: W.onBlur("adultDoseMl"),
|
|
479
|
+
error: W.show("adultDoseMl") && !!Q.adultDoseMl,
|
|
480
|
+
helperText: W.show("adultDoseMl") ? Q.adultDoseMl : ""
|
|
481
|
+
})
|
|
482
|
+
}),
|
|
483
|
+
/* @__PURE__ */ p(w, {
|
|
484
|
+
item: !0,
|
|
485
|
+
xs: 12,
|
|
486
|
+
md: 3,
|
|
487
|
+
children: /* @__PURE__ */ p(k, {
|
|
488
|
+
fullWidth: !0,
|
|
489
|
+
size: "small",
|
|
490
|
+
type: "number",
|
|
491
|
+
inputProps: {
|
|
492
|
+
step: "0.01",
|
|
493
|
+
min: 0
|
|
494
|
+
},
|
|
495
|
+
label: "Child Dose (ml)",
|
|
496
|
+
value: K.vaccineConfig?.childDoseMl ?? "",
|
|
497
|
+
onChange: (e) => Z("childDoseMl", e.target.value),
|
|
498
|
+
onBlur: W.onBlur("childDoseMl"),
|
|
499
|
+
error: W.show("childDoseMl") && !!Q.childDoseMl,
|
|
500
|
+
helperText: W.show("childDoseMl") ? Q.childDoseMl : ""
|
|
501
|
+
})
|
|
502
|
+
}),
|
|
503
|
+
/* @__PURE__ */ p(w, {
|
|
504
|
+
item: !0,
|
|
505
|
+
xs: 12,
|
|
506
|
+
md: 3,
|
|
507
|
+
children: /* @__PURE__ */ p(k, {
|
|
508
|
+
required: !0,
|
|
509
|
+
fullWidth: !0,
|
|
510
|
+
size: "small",
|
|
511
|
+
type: "number",
|
|
512
|
+
inputProps: {
|
|
513
|
+
min: 0,
|
|
514
|
+
max: 720
|
|
515
|
+
},
|
|
516
|
+
label: "Open vial validity (hours)",
|
|
517
|
+
value: K.vaccineConfig?.openVialValidityHours ?? "",
|
|
518
|
+
onChange: (e) => Z("openVialValidityHours", e.target.value),
|
|
519
|
+
onBlur: W.onBlur("openVialValidityHours"),
|
|
520
|
+
error: W.show("openVialValidityHours") && !!Q.openVialValidityHours,
|
|
521
|
+
helperText: W.show("openVialValidityHours") && Q.openVialValidityHours ? Q.openVialValidityHours : "0 = single-use; max 720 (~30 days)"
|
|
522
|
+
})
|
|
523
|
+
}),
|
|
524
|
+
/* @__PURE__ */ p(w, {
|
|
525
|
+
item: !0,
|
|
526
|
+
xs: 12,
|
|
527
|
+
md: 3,
|
|
528
|
+
children: /* @__PURE__ */ p(k, {
|
|
529
|
+
required: !0,
|
|
530
|
+
fullWidth: !0,
|
|
531
|
+
size: "small",
|
|
532
|
+
type: "number",
|
|
533
|
+
inputProps: {
|
|
534
|
+
min: 1,
|
|
535
|
+
max: 20
|
|
536
|
+
},
|
|
537
|
+
label: "Max concurrent open vials",
|
|
538
|
+
value: K.vaccineConfig?.maxConcurrentOpenVials ?? "",
|
|
539
|
+
onChange: (e) => Z("maxConcurrentOpenVials", e.target.value),
|
|
540
|
+
onBlur: W.onBlur("maxConcurrentOpenVials"),
|
|
541
|
+
error: W.show("maxConcurrentOpenVials") && !!Q.maxConcurrentOpenVials,
|
|
542
|
+
helperText: W.show("maxConcurrentOpenVials") ? Q.maxConcurrentOpenVials : ""
|
|
543
|
+
})
|
|
544
|
+
}),
|
|
545
|
+
/* @__PURE__ */ p(w, {
|
|
546
|
+
item: !0,
|
|
547
|
+
xs: 12,
|
|
548
|
+
md: 3,
|
|
549
|
+
children: /* @__PURE__ */ p(S, {
|
|
550
|
+
control: /* @__PURE__ */ p(y, {
|
|
551
|
+
checked: !!K.vaccineConfig?.requiresReconstitution,
|
|
552
|
+
onChange: (e) => Z("requiresReconstitution", e.target.checked)
|
|
553
|
+
}),
|
|
554
|
+
label: "Requires reconstitution"
|
|
555
|
+
})
|
|
556
|
+
}),
|
|
557
|
+
/* @__PURE__ */ p(w, {
|
|
558
|
+
item: !0,
|
|
559
|
+
xs: 12,
|
|
560
|
+
md: 3,
|
|
561
|
+
children: /* @__PURE__ */ p(k, {
|
|
562
|
+
fullWidth: !0,
|
|
563
|
+
size: "small",
|
|
564
|
+
type: "number",
|
|
565
|
+
inputProps: {
|
|
566
|
+
min: 1,
|
|
567
|
+
max: 720
|
|
568
|
+
},
|
|
569
|
+
required: !!K.vaccineConfig?.requiresReconstitution,
|
|
570
|
+
disabled: !K.vaccineConfig?.requiresReconstitution,
|
|
571
|
+
label: "Reconstituted validity (hours)",
|
|
572
|
+
value: K.vaccineConfig?.reconstitutedValidityHours ?? "",
|
|
573
|
+
onChange: (e) => Z("reconstitutedValidityHours", e.target.value),
|
|
574
|
+
onBlur: W.onBlur("reconstitutedValidityHours"),
|
|
575
|
+
error: W.show("reconstitutedValidityHours") && !!Q.reconstitutedValidityHours,
|
|
576
|
+
helperText: W.show("reconstitutedValidityHours") ? Q.reconstitutedValidityHours : ""
|
|
577
|
+
})
|
|
578
|
+
}),
|
|
579
|
+
/* @__PURE__ */ p(w, {
|
|
580
|
+
item: !0,
|
|
581
|
+
xs: 12,
|
|
582
|
+
md: 3,
|
|
583
|
+
children: /* @__PURE__ */ m(x, {
|
|
584
|
+
fullWidth: !0,
|
|
585
|
+
size: "small",
|
|
586
|
+
children: [/* @__PURE__ */ p(T, { children: "Route of Administration" }), /* @__PURE__ */ m(D, {
|
|
587
|
+
label: "Route of Administration",
|
|
588
|
+
value: K.vaccineConfig?.route || "",
|
|
589
|
+
onChange: (e) => Z("route", e.target.value),
|
|
590
|
+
children: [/* @__PURE__ */ p(E, {
|
|
591
|
+
value: "",
|
|
592
|
+
children: /* @__PURE__ */ p("em", { children: "—" })
|
|
593
|
+
}), de.map((e) => /* @__PURE__ */ p(E, {
|
|
594
|
+
value: e.value,
|
|
595
|
+
children: e.label
|
|
596
|
+
}, e.value))]
|
|
597
|
+
})]
|
|
598
|
+
})
|
|
599
|
+
}),
|
|
600
|
+
/* @__PURE__ */ p(w, {
|
|
601
|
+
item: !0,
|
|
602
|
+
xs: 12,
|
|
603
|
+
md: 3,
|
|
604
|
+
children: /* @__PURE__ */ p(k, {
|
|
605
|
+
fullWidth: !0,
|
|
606
|
+
size: "small",
|
|
607
|
+
type: "number",
|
|
608
|
+
inputProps: {
|
|
609
|
+
step: "0.1",
|
|
610
|
+
min: -90,
|
|
611
|
+
max: 30
|
|
612
|
+
},
|
|
613
|
+
label: "Storage temp min (°C)",
|
|
614
|
+
value: K.vaccineConfig?.storageTempMinCelsius ?? "",
|
|
615
|
+
onChange: (e) => Z("storageTempMinCelsius", e.target.value),
|
|
616
|
+
onBlur: W.onBlur("storageTempMinCelsius"),
|
|
617
|
+
error: W.show("storageTempMinCelsius") && !!Q.storageTempMinCelsius,
|
|
618
|
+
helperText: W.show("storageTempMinCelsius") && Q.storageTempMinCelsius ? Q.storageTempMinCelsius : "Allowed range: −90°C to +30°C"
|
|
619
|
+
})
|
|
620
|
+
}),
|
|
621
|
+
/* @__PURE__ */ p(w, {
|
|
622
|
+
item: !0,
|
|
623
|
+
xs: 12,
|
|
624
|
+
md: 3,
|
|
625
|
+
children: /* @__PURE__ */ p(k, {
|
|
626
|
+
fullWidth: !0,
|
|
627
|
+
size: "small",
|
|
628
|
+
type: "number",
|
|
629
|
+
inputProps: {
|
|
630
|
+
step: "0.1",
|
|
631
|
+
min: -90,
|
|
632
|
+
max: 30
|
|
633
|
+
},
|
|
634
|
+
label: "Storage temp max (°C)",
|
|
635
|
+
value: K.vaccineConfig?.storageTempMaxCelsius ?? "",
|
|
636
|
+
onChange: (e) => Z("storageTempMaxCelsius", e.target.value),
|
|
637
|
+
onBlur: W.onBlur("storageTempMaxCelsius"),
|
|
638
|
+
error: W.show("storageTempMaxCelsius") && !!Q.storageTempMaxCelsius,
|
|
639
|
+
helperText: W.show("storageTempMaxCelsius") && Q.storageTempMaxCelsius ? Q.storageTempMaxCelsius : "Allowed range: −90°C to +30°C"
|
|
640
|
+
})
|
|
641
|
+
}),
|
|
642
|
+
/* @__PURE__ */ p(w, {
|
|
643
|
+
item: !0,
|
|
644
|
+
xs: 12,
|
|
645
|
+
children: /* @__PURE__ */ p(k, {
|
|
646
|
+
fullWidth: !0,
|
|
647
|
+
size: "small",
|
|
648
|
+
multiline: !0,
|
|
649
|
+
minRows: 2,
|
|
650
|
+
label: "Comments",
|
|
651
|
+
value: K.vaccineConfig?.comments || "",
|
|
652
|
+
onChange: (e) => Z("comments", e.target.value)
|
|
653
|
+
})
|
|
654
|
+
})
|
|
655
|
+
]
|
|
656
|
+
})
|
|
657
|
+
] })
|
|
658
|
+
}) : null
|
|
659
|
+
]
|
|
660
|
+
})
|
|
661
|
+
})] });
|
|
662
|
+
}
|
|
663
|
+
//#endregion
|
|
664
|
+
export { I as default };
|
|
665
|
+
|
|
666
|
+
//# sourceMappingURL=ProductEditPage-DL8gy85Y.js.map
|