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