@bahmni/appointments-app 0.0.1-dev.346 → 0.0.1-dev.348

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.
@@ -1,12 +1,12 @@
1
1
  import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
- import { V as Q, o as q, u as N, h as x, e as M, a as k, x as w, A as j, _ as G, W as H, Q as z, i as P, K as A, j as W, l as J, U as Y, q as X, E as Z, v as ee } from "./index-D7_tijMc.js";
2
+ import { f as Q, o as V, u as N, x as K, A as x, G, I as M, Z as j, k as w, O as H, Q as Z, S as z, l as q, $ as P, e as J, g as X, h as Y, i as W, j as ee } from "./index-O_QvEYsZ.js";
3
3
  import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
4
- import { useRef as se, useEffect as I, useMemo as R } from "react";
5
- const D = (a, n, d, l, b, r) => {
6
- const t = W(a, n, b), s = t.value, o = J(s);
4
+ import { useRef as se, useEffect as I, useMemo as O } from "react";
5
+ const L = (a, n, d, l, b, r) => {
6
+ const t = P(a, n, b), s = t.value, o = J(s);
7
7
  let i = s;
8
8
  o === "Image" && (i = /* @__PURE__ */ u(
9
- X,
9
+ Y,
10
10
  {
11
11
  imageSrc: s,
12
12
  alt: s,
@@ -14,7 +14,7 @@ const D = (a, n, d, l, b, r) => {
14
14
  hideThumbnail: r
15
15
  }
16
16
  )), o === "Video" && (i = /* @__PURE__ */ u(
17
- Z,
17
+ W,
18
18
  {
19
19
  id: `${s}-video`,
20
20
  videoSrc: s,
@@ -23,9 +23,9 @@ const D = (a, n, d, l, b, r) => {
23
23
  )), o === "PDF" && (i = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
24
24
  const m = b("OBSERVATIONS_RECORDED_BY", {
25
25
  provider: t.provider
26
- }), p = a.display, v = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${v}-${p}-${d}-${n}` : `${v}-${p}-${d}-${n}`;
26
+ }), p = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
27
27
  return /* @__PURE__ */ u(
28
- Y,
28
+ X,
29
29
  {
30
30
  header: t.header,
31
31
  value: i,
@@ -37,13 +37,13 @@ const D = (a, n, d, l, b, r) => {
37
37
  `obs-${a.id}`
38
38
  );
39
39
  }, re = (a, n, d, l, b, r, t) => /* @__PURE__ */ u(
40
- A,
40
+ q,
41
41
  {
42
42
  title: a.display,
43
43
  id: `grouped-obs-${a.display}-${l}`,
44
44
  open: d,
45
45
  children: a.members?.map(
46
- (s, o) => D(
46
+ (s, o) => L(
47
47
  s,
48
48
  o,
49
49
  b,
@@ -60,16 +60,16 @@ const D = (a, n, d, l, b, r) => {
60
60
  hideThumbnail: d
61
61
  }) => {
62
62
  const { t: l } = N(), b = (r, t, s) => {
63
- const o = P(r.encounterDetails, l);
63
+ const o = z(r.encounterDetails, l);
64
64
  return /* @__PURE__ */ S(
65
- A,
65
+ q,
66
66
  {
67
67
  title: o,
68
68
  id: `encounter-${r.encounterId}`,
69
69
  open: t,
70
70
  children: [
71
71
  r.observations.map(
72
- (i, m) => D(
72
+ (i, m) => L(
73
73
  i,
74
74
  m,
75
75
  s,
@@ -105,7 +105,7 @@ const D = (a, n, d, l, b, r) => {
105
105
  )
106
106
  }
107
107
  );
108
- }, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", $ = {
108
+ }, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", _ = {
109
109
  observations: ie,
110
110
  title: ne
111
111
  }, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
@@ -113,10 +113,10 @@ const D = (a, n, d, l, b, r) => {
113
113
  conceptNames: d = [],
114
114
  conceptUuid: l = [],
115
115
  hideThumbnail: b = !1
116
- } = n, r = se(/* @__PURE__ */ new Set()), t = Q(), { addNotification: s } = q(), { t: o } = N(), i = ae({
116
+ } = n, r = se(/* @__PURE__ */ new Set()), t = Q(), { addNotification: s } = V(), { t: o } = N(), i = ae({
117
117
  queries: d.map((e) => ({
118
118
  queryKey: de(e),
119
- queryFn: () => x(e),
119
+ queryFn: () => K(e),
120
120
  enabled: !!e
121
121
  }))
122
122
  });
@@ -132,73 +132,73 @@ const D = (a, n, d, l, b, r) => {
132
132
  } else e.isError || r.current.delete(h);
133
133
  });
134
134
  }, [i, d]);
135
- const m = R(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = R(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), v = R(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
135
+ const m = O(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = O(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = O(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
136
136
  data: c,
137
- isLoading: F,
138
- isError: T,
139
- refetch: g
137
+ isLoading: A,
138
+ isError: R,
139
+ refetch: T
140
140
  } = te({
141
141
  queryKey: le(t, p),
142
- queryFn: () => M(t, p),
143
- enabled: !!t && p.length > 0 && v
142
+ queryFn: () => x(t, p),
143
+ enabled: !!t && p.length > 0 && y
144
144
  });
145
- k(
145
+ G(
146
146
  (e) => {
147
147
  e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
148
148
  (h) => p.includes(h)
149
- ) && g();
149
+ ) && T();
150
150
  },
151
- [t, g]
151
+ [t, T]
152
152
  ), I(() => {
153
- T && s({
153
+ R && s({
154
154
  title: o("ERROR_DEFAULT_TITLE"),
155
155
  message: o("ERROR_FETCHING_OBSERVATIONS"),
156
156
  type: "error"
157
157
  });
158
- }, [T]);
159
- const O = R(() => {
158
+ }, [R]);
159
+ const f = O(() => {
160
160
  if (!c) return [];
161
- const e = w(c), h = j(e);
162
- return G(h);
163
- }, [c]), L = [
161
+ const e = M(c), h = j(e);
162
+ return w(h);
163
+ }, [c]), D = [
164
164
  { key: "name", header: "name" },
165
165
  { key: "value", header: "value" },
166
166
  { key: "form", header: "form" }
167
- ], _ = F || !v, f = T && v, U = (!c || c.entry?.length === 0 || p.length === 0) && v, V = f ? o("ERROR_FETCHING_OBSERVATIONS") : null, C = U ? o("NO_OBSERVATIONS_FOUND") : void 0, K = O.length > 0 && !_ && !f, E = n.titleTranslationKey, y = E ? o(E) : "";
167
+ ], g = A || !y, $ = R && y, F = (!c || c.entry?.length === 0 || p.length === 0) && y, C = $ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = F ? o("NO_OBSERVATIONS_FOUND") : void 0, k = f.length > 0 && !g && !$, E = n.titleTranslationKey, v = E ? o(E) : "";
168
168
  return /* @__PURE__ */ S(
169
169
  "div",
170
170
  {
171
171
  id: "observations",
172
- "data-testid": E ? `observations-${y}` : "observations",
172
+ "data-testid": E ? `observations-${v}` : "observations",
173
173
  "aria-label": "observations-aria-label",
174
- className: $.observations,
174
+ className: _.observations,
175
175
  children: [
176
176
  /* @__PURE__ */ u(
177
177
  H,
178
178
  {
179
179
  id: "observations-title",
180
- testId: E ? `observations-title-${y}` : "observations-title",
181
- title: y,
182
- className: $.title,
183
- children: /* @__PURE__ */ u("p", { children: y })
180
+ testId: E ? `observations-title-${v}` : "observations-title",
181
+ title: v,
182
+ className: _.title,
183
+ children: /* @__PURE__ */ u("p", { children: v })
184
184
  }
185
185
  ),
186
- K ? /* @__PURE__ */ u(
186
+ k ? /* @__PURE__ */ u(
187
187
  oe,
188
188
  {
189
- groupedData: O,
190
- title: y,
189
+ groupedData: f,
190
+ title: v,
191
191
  hideThumbnail: b
192
192
  }
193
193
  ) : /* @__PURE__ */ u(
194
- z,
194
+ Z,
195
195
  {
196
- headers: L,
196
+ headers: D,
197
197
  rows: [],
198
198
  ariaLabel: o("OBSERVATIONS"),
199
- loading: _,
200
- errorStateMessage: V,
201
- emptyStateMessage: C,
199
+ loading: g,
200
+ errorStateMessage: C,
201
+ emptyStateMessage: U,
202
202
  dataTestId: "observations-table"
203
203
  }
204
204
  )
@@ -1,4 +1,4 @@
1
- import { al as we, am as z, an as xt, ao as B, aj as q, ak as y, ap as Ro, aq as ye, ar as R, as as _, at as k, au as N, av as A, aw as bs, ax as ir, ay as $e, az as U, aA as Hn, aB as Vn, aC as dt, aD as D, aE as xs, aF as cn, aG as Be, aH as ws, aI as qt, aJ as zt, aK as $s, aL as Cs, aM as $n, aN as Ss, aO as Nr, aP as Bt, aQ as zo, aR as ks, aS as Es, aT as j, aU as Ur, aV as Ms, aW as Ds, aX as sr, aY as As, aZ as Ts, a_ as zn, a$ as Fs, b0 as Is, b1 as Z, b2 as Ps, b3 as Ls } from "./index-D7_tijMc.js";
1
+ import { al as we, am as z, an as xt, ao as B, aj as q, ak as y, ap as Ro, aq as ye, ar as R, as as _, at as k, au as N, av as A, aw as bs, ax as ir, ay as $e, az as U, aA as Hn, aB as Vn, aC as dt, aD as D, aE as xs, aF as cn, aG as Be, aH as ws, aI as qt, aJ as zt, aK as $s, aL as Cs, aM as $n, aN as Ss, aO as Nr, aP as Bt, aQ as zo, aR as ks, aS as Es, aT as j, aU as Ur, aV as Ms, aW as Ds, aX as sr, aY as As, aZ as Ts, a_ as zn, a$ as Fs, b0 as Is, b1 as Z, b2 as Ps, b3 as Ls } from "./index-O_QvEYsZ.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1,12 +1,12 @@
1
1
  import { jsx as i, jsxs as f } from "react/jsx-runtime";
2
- import { R as V, s as O, u as C, F as P, S as B, o as h, B as G, y as L, C as x, D as U, G as q, H as F, I as H, T as Q, J as j, L as k, N as $ } from "./index-D7_tijMc.js";
2
+ import { q as V, p as O, u as C, F as P, s as h, o as B, M as G, t as L, v as x, w as q, y as U, z as F, B as H, D as j, E as Q, U as k, H as w } from "./index-O_QvEYsZ.js";
3
3
  import { useState as I, useMemo as _ } from "react";
4
- import { useQueryClient as w, useQuery as K } from "@tanstack/react-query";
5
- const W = V(
4
+ import { useQueryClient as W, useQuery as $ } from "@tanstack/react-query";
5
+ const K = V(
6
6
  O,
7
7
  "useAppointmentsConfig",
8
8
  "AppointmentsConfigProvider"
9
- ), Y = ({
9
+ ), z = ({
10
10
  serviceName: e,
11
11
  isDeleting: a,
12
12
  onConfirm: t,
@@ -36,7 +36,7 @@ const W = V(
36
36
  "speciality",
37
37
  "durationMins",
38
38
  "description"
39
- ], Z = "app:appointments:manageServices", z = "app:appointments:adminTab", J = "index-module_page__Gsfbu", X = "index-module_noPrivilegeContainer__Pu5WZ", ee = "index-module_table__GAPmb", d = {
39
+ ], Y = "app:appointments:manageServices", Z = "app:appointments:adminTab", J = "index-module_page__Gsfbu", X = "index-module_noPrivilegeContainer__Pu5WZ", ee = "index-module_table__GAPmb", d = {
40
40
  page: J,
41
41
  noPrivilegeContainer: X,
42
42
  table: ee
@@ -49,7 +49,7 @@ function ae(e, a) {
49
49
  ...e.map((t) => ({
50
50
  key: t,
51
51
  header: a(
52
- `ADMIN_ALL_SERVICES_COLUMN_${B(t)}`
52
+ `ADMIN_ALL_SERVICES_COLUMN_${h(t)}`
53
53
  )
54
54
  })),
55
55
  {
@@ -75,19 +75,19 @@ function ie(e, a) {
75
75
  }));
76
76
  }
77
77
  const oe = () => {
78
- const { t: e } = C(), a = w(), { addNotification: t } = h(), { userPrivileges: s } = G(), { appointmentsConfig: n } = W(), [E, c] = I(null), [b, p] = I(!1), l = n?.serviceTableFields ?? [
78
+ const { t: e } = C(), a = W(), { addNotification: t } = B(), { userPrivileges: s } = G(), { appointmentsConfig: n } = K(), [E, c] = I(null), [M, p] = I(!1), l = n?.serviceTableFields ?? [
79
79
  ...u
80
- ], S = L(s, z), M = L(
80
+ ], S = L(s, Z), b = L(
81
81
  s,
82
- Z
82
+ Y
83
83
  ), m = _(
84
84
  () => te(l),
85
85
  [l]
86
- ), { data: A, isLoading: R, isError: v } = K({
86
+ ), { data: A, isLoading: v, isError: D } = $({
87
87
  queryKey: ["allAppointmentServices"],
88
88
  queryFn: x,
89
89
  enabled: S
90
- }), D = _(
90
+ }), R = _(
91
91
  () => ae(l, e),
92
92
  [l]
93
93
  ), N = _(
@@ -96,7 +96,7 @@ const oe = () => {
96
96
  ), g = async () => {
97
97
  p(!0);
98
98
  try {
99
- await $(E.id), t({
99
+ await w(E.id), t({
100
100
  title: e("ADMIN_ALL_SERVICES_DELETE_SUCCESS_TITLE"),
101
101
  message: e("ADMIN_ALL_SERVICES_DELETE_SUCCESS_MESSAGE"),
102
102
  type: "success",
@@ -112,25 +112,25 @@ const oe = () => {
112
112
  p(!1);
113
113
  }
114
114
  }, T = (r, o) => o === "actions" ? /* @__PURE__ */ i(
115
- j,
115
+ Q,
116
116
  {
117
117
  id: `delete-service-${r.id}-btn`,
118
118
  testId: `delete-service-${r.id}-btn-test-id`,
119
119
  "aria-label": `delete-service-${r.id}-btn-aria-label`,
120
120
  kind: "ghost",
121
121
  label: e("ADMIN_ALL_SERVICES_DELETE_ICON_LABEL"),
122
- disabled: !M,
122
+ disabled: !b,
123
123
  onClick: () => c(r),
124
124
  children: /* @__PURE__ */ i(k, {})
125
125
  }
126
126
  ) : u.includes(o) ? r[o] ?? "-" : r.attributes[o] ?? "-", y = [
127
- { id: "home", label: e("BREADCRUMB_HOME"), href: U },
127
+ { id: "home", label: e("BREADCRUMB_HOME"), href: q },
128
128
  { id: "admin", label: e("BREADCRUMB_ADMIN"), isCurrentPage: !0 }
129
129
  ];
130
130
  return /* @__PURE__ */ i(
131
- q,
131
+ U,
132
132
  {
133
- header: /* @__PURE__ */ i(H, { breadcrumbItems: y, userMenu: /* @__PURE__ */ i(Q, {}) }),
133
+ header: /* @__PURE__ */ i(H, { breadcrumbItems: y, userMenu: /* @__PURE__ */ i(j, {}) }),
134
134
  main: S ? /* @__PURE__ */ f(
135
135
  "div",
136
136
  {
@@ -144,21 +144,21 @@ const oe = () => {
144
144
  {
145
145
  id: "all-services",
146
146
  title: e("ADMIN_ALL_SERVICES_TITLE"),
147
- headers: D,
147
+ headers: R,
148
148
  rows: N,
149
149
  ariaLabel: "all-services-table",
150
- loading: R,
151
- errorStateMessage: v ? e("ADMIN_ALL_SERVICES_ERROR_MESSAGE") : null,
150
+ loading: v,
151
+ errorStateMessage: D ? e("ADMIN_ALL_SERVICES_ERROR_MESSAGE") : null,
152
152
  emptyStateMessage: e("ADMIN_ALL_SERVICES_EMPTY_MESSAGE"),
153
153
  renderCell: T,
154
154
  className: d.table
155
155
  }
156
156
  ),
157
157
  E && /* @__PURE__ */ i(
158
- Y,
158
+ z,
159
159
  {
160
160
  serviceName: E.name,
161
- isDeleting: b,
161
+ isDeleting: M,
162
162
  onConfirm: g,
163
163
  onCancel: () => c(null)
164
164
  }