@bahmni/appointments-app 0.0.1-dev.247 → 0.0.1-dev.259

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,5 +1,5 @@
1
1
  import { jsx as r, jsxs as p, Fragment as Y } from "react/jsx-runtime";
2
- import { c as K, u as Q, d as W, a as J, l as X, m as Z, b as ee, w as te, E as ae } from "./index-ztXJIVM5.js";
2
+ import { c as K, u as Q, d as W, a as J, l as X, m as Z, b as ee, w as te, y as ae } from "./index-D86omKT7.js";
3
3
  import { useState as l, useCallback as h, useEffect as f, useMemo as T } from "react";
4
4
  const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11", re = "_documentViewerContainer_1voj8_15", de = "_attachmentItem_1voj8_23", se = "_attachmentCounter_1voj8_27", ce = "_attachmentError_1voj8_36", ie = "_documentIframe_1voj8_44", le = "_documentImage_1voj8_50", d = {
5
5
  documentsTableBody: ne,
@@ -20,10 +20,10 @@ const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11",
20
20
  function j(a) {
21
21
  return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
22
22
  }
23
- function ue(a, E) {
23
+ function ue(a, g) {
24
24
  return a.map((s) => ({
25
25
  key: s,
26
- header: E(me[s])
26
+ header: g(me[s])
27
27
  }));
28
28
  }
29
29
  const _e = [
@@ -32,12 +32,12 @@ const _e = [
32
32
  "uploadedOn",
33
33
  "uploadedBy",
34
34
  "action"
35
- ], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], ge = ({ config: a, encounterUuids: E }) => {
35
+ ], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ee = ({ config: a, encounterUuids: g }) => {
36
36
  const [s, S] = l(!1), [o, L] = l(
37
37
  null
38
38
  ), [R, I] = l(
39
39
  /* @__PURE__ */ new Set()
40
- ), g = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, A] = l(1), [m, k] = l($), [V, y] = l(void 0), b = h((e) => {
40
+ ), E = K(), { t: n } = Q(), { addNotification: U } = W(), $ = Number(a?.pageSize) || 5, [C, y] = l(1), [m, k] = l($), [V, A] = l(void 0), b = h((e) => {
41
41
  L(e), S(!0);
42
42
  }, []), F = h(() => {
43
43
  S(!1), L(null), I(/* @__PURE__ */ new Set());
@@ -46,24 +46,24 @@ const _e = [
46
46
  }, []), { data: u, isLoading: H, isError: D, error: v } = J({
47
47
  queryKey: [
48
48
  "documents",
49
- g,
50
49
  E,
50
+ g,
51
51
  C,
52
52
  m
53
53
  ],
54
- enabled: !!g,
54
+ enabled: !!E,
55
55
  queryFn: () => ae(
56
- g,
57
56
  E,
57
+ g,
58
58
  m,
59
59
  C
60
60
  )
61
61
  });
62
62
  f(() => {
63
- u && y(u.total);
63
+ u && A(u.total);
64
64
  }, [u]), f(() => {
65
- A(1), y(void 0);
66
- }, [g]), f(() => {
65
+ y(1), A(void 0);
66
+ }, [E]), f(() => {
67
67
  D && U({
68
68
  title: n("ERROR_DEFAULT_TITLE"),
69
69
  message: v?.message ?? "",
@@ -90,7 +90,7 @@ const _e = [
90
90
  }, [s, o]);
91
91
  const q = h(
92
92
  (e, t) => {
93
- t !== m ? (k(t), A(1), y(void 0)) : A(e);
93
+ t !== m ? (k(t), y(1), A(void 0)) : y(e);
94
94
  },
95
95
  [m]
96
96
  ), N = T(
@@ -222,5 +222,5 @@ const _e = [
222
222
  ] });
223
223
  };
224
224
  export {
225
- ge as default
225
+ Ee as default
226
226
  };
@@ -1,5 +1,5 @@
1
- import { jsx as s, jsxs as J, Fragment as W } from "react/jsx-runtime";
2
- import { u as Z, c as ee, e as re, f as ae, a as c, X as te, L as U, m as oe, l as se, b as S, x as ne, N as de, w as ie, $ as ue, p as me, v as le, g as ce, h as fe, i as ye } from "./index-ztXJIVM5.js";
1
+ import { jsx as s, jsxs as W, Fragment as J } from "react/jsx-runtime";
2
+ import { u as Z, c as ee, e as re, f as ae, a as c, X as te, L as U, m as oe, l as se, b as S, x as ne, N as de, w as ie, $ as ue, g as me, E as le, h as ce, v as fe, i as ye } from "./index-D86omKT7.js";
3
3
  import { useState as q, useMemo as d, useCallback as f } from "react";
4
4
  const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", O = {
5
5
  formsTableBody: pe,
@@ -11,20 +11,20 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", O = {
11
11
  encounterUuids: n,
12
12
  config: C
13
13
  }) => {
14
- const { t: o } = Z(), m = ee(), [l, A] = q(!1), [t, I] = q(null), { numberOfVisits: k, hideThumbnail: w = !1 } = C ?? {}, L = re(
14
+ const { t: o } = Z(), m = ee(), [l, A] = q(!1), [t, I] = q(null), { numberOfVisits: k, hideThumbnail: w = !1 } = C ?? {}, E = re(
15
15
  u,
16
16
  n
17
17
  ), x = ae(), {
18
18
  data: y = [],
19
- isLoading: T,
20
- isError: B,
19
+ isLoading: B,
20
+ isError: L,
21
21
  error: $,
22
22
  refetch: H
23
23
  } = c({
24
24
  queryKey: ["forms", m, u],
25
25
  queryFn: () => le(m, void 0, k),
26
- enabled: !!m && !L
27
- }), E = d(() => !n || n.length === 0 ? y : y.filter(
26
+ enabled: !!m && !E
27
+ }), T = d(() => !n || n.length === 0 ? y : y.filter(
28
28
  (e) => n.includes(e.encounterUuid)
29
29
  ), [y, n]), { data: _ = [] } = c({
30
30
  queryKey: ["observationForms"],
@@ -67,7 +67,7 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", O = {
67
67
  return U(b).message;
68
68
  if (N)
69
69
  return U(N).message;
70
- }, [b, N]), D = d(
70
+ }, [b, N]), F = d(
71
71
  () => [
72
72
  { key: "recordedOn", header: o("RECORDED_ON") },
73
73
  { key: "recordedBy", header: o("RECORDED_BY") }
@@ -79,8 +79,8 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", O = {
79
79
  { key: "recordedBy", sortable: !0 }
80
80
  ],
81
81
  []
82
- ), F = d(() => {
83
- const e = E.reduce(
82
+ ), M = d(() => {
83
+ const e = T.reduce(
84
84
  (r, a) => {
85
85
  const i = a.formName;
86
86
  r[i] ??= [];
@@ -104,7 +104,7 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", O = {
104
104
  )
105
105
  })
106
106
  ).sort((r, a) => r.formName.localeCompare(a.formName));
107
- }, [E, o]), M = f((e) => {
107
+ }, [T, o]), D = f((e) => {
108
108
  I(e), A(!0);
109
109
  }, []), X = f(() => {
110
110
  A(!1), I(null);
@@ -112,30 +112,30 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", O = {
112
112
  (e, r) => {
113
113
  switch (r) {
114
114
  case "recordedOn":
115
- return /* @__PURE__ */ s(se, { onClick: () => M(e), children: e.recordedOn });
115
+ return /* @__PURE__ */ s(se, { onClick: () => D(e), children: e.recordedOn });
116
116
  case "recordedBy":
117
117
  return e.recordedBy;
118
118
  default:
119
119
  return null;
120
120
  }
121
121
  },
122
- [M]
122
+ [D]
123
123
  );
124
- return /* @__PURE__ */ J(W, { children: [
125
- /* @__PURE__ */ s("div", { "data-testid": "forms-table", children: T || B || F.length === 0 || L ? /* @__PURE__ */ s(
124
+ return /* @__PURE__ */ W(J, { children: [
125
+ /* @__PURE__ */ s("div", { "data-testid": "forms-table", children: B || L || M.length === 0 || E ? /* @__PURE__ */ s(
126
126
  S,
127
127
  {
128
- headers: D,
128
+ headers: F,
129
129
  ariaLabel: o("FORMS_HEADING"),
130
130
  rows: [],
131
- loading: T,
132
- errorStateMessage: B ? $?.message : void 0,
131
+ loading: B,
132
+ errorStateMessage: L ? $?.message : void 0,
133
133
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
134
134
  renderCell: R,
135
135
  className: O.formsTableBody,
136
136
  dataTestId: "forms-table"
137
137
  }
138
- ) : /* @__PURE__ */ s(ne, { align: "start", children: F.map((e, r) => {
138
+ ) : /* @__PURE__ */ s(ne, { align: "start", children: M.map((e, r) => {
139
139
  const { formName: a, records: i } = e;
140
140
  return /* @__PURE__ */ s(
141
141
  de,
@@ -147,7 +147,7 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", O = {
147
147
  children: /* @__PURE__ */ s(
148
148
  S,
149
149
  {
150
- headers: D,
150
+ headers: F,
151
151
  ariaLabel: o("FORMS_HEADING"),
152
152
  rows: i,
153
153
  loading: !1,
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Dj5J6UJi.js";
2
- import { V as d, W as f, Y as e } from "./index-ztXJIVM5.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-J-XUnkui.js";
2
+ import { V as d, W as f, Z as e } from "./index-D86omKT7.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
- import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-Dj5J6UJi.js";
2
- import { V as v, W as C, Y as e } from "./index-ztXJIVM5.js";
1
+ import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-J-XUnkui.js";
2
+ import { V as v, W as C, Z as e } from "./index-D86omKT7.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,8 +1,8 @@
1
1
  import { jsxs as N, jsx as u } from "react/jsx-runtime";
2
- import { c as H, d as K, u as S, j as V, k as M, a as Q, X, M as x, n as j, o as w, H as G, b as z, q as P, K as A, r as Y, s as J, R as W, t as Z, y as ee, z as ae, A as te } from "./index-ztXJIVM5.js";
2
+ import { c as V, d as H, u as S, j as K, p as M, a as Q, X, k as x, n as j, z as w, H as z, b as G, o as Y, Y as A, M as P, q as J, R as W, r as Z, s as ee, t as ae, A as te } from "./index-D86omKT7.js";
3
3
  import { useRef as se, useEffect as $, useMemo as R } from "react";
4
4
  const D = (a, n, d, l, b, r) => {
5
- const t = Y(a, n, b), s = t.value, o = J(s);
5
+ const t = P(a, n, b), s = t.value, o = J(s);
6
6
  let i = s;
7
7
  o === "Image" && (i = /* @__PURE__ */ u(
8
8
  Z,
@@ -59,7 +59,7 @@ const D = (a, n, d, l, b, r) => {
59
59
  hideThumbnail: d
60
60
  }) => {
61
61
  const { t: l } = S(), b = (r, t, s) => {
62
- const o = P(r.encounterDetails, l);
62
+ const o = Y(r.encounterDetails, l);
63
63
  return /* @__PURE__ */ N(
64
64
  A,
65
65
  {
@@ -112,7 +112,7 @@ const D = (a, n, d, l, b, r) => {
112
112
  conceptNames: d = [],
113
113
  conceptUuid: l = [],
114
114
  hideThumbnail: b = !1
115
- } = n, r = se(/* @__PURE__ */ new Set()), t = H(), { addNotification: s } = K(), { t: o } = S(), i = V({
115
+ } = n, r = se(/* @__PURE__ */ new Set()), t = V(), { addNotification: s } = H(), { t: o } = S(), i = K({
116
116
  queries: d.map((e) => ({
117
117
  queryKey: de(e),
118
118
  queryFn: () => M(e),
@@ -134,8 +134,8 @@ const D = (a, n, d, l, b, r) => {
134
134
  const p = R(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), m = R(() => [.../* @__PURE__ */ new Set([...p, ...l])], [p, l]), y = R(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
135
135
  data: c,
136
136
  isLoading: F,
137
- isError: f,
138
- refetch: T
137
+ isError: T,
138
+ refetch: f
139
139
  } = Q({
140
140
  queryKey: le(t, m),
141
141
  queryFn: () => te(t, m),
@@ -145,25 +145,25 @@ const D = (a, n, d, l, b, r) => {
145
145
  (e) => {
146
146
  e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
147
147
  (h) => m.includes(h)
148
- ) && T();
148
+ ) && f();
149
149
  },
150
- [t, T]
150
+ [t, f]
151
151
  ), $(() => {
152
- f && s({
152
+ T && s({
153
153
  title: o("ERROR_DEFAULT_TITLE"),
154
154
  message: o("ERROR_FETCHING_OBSERVATIONS"),
155
155
  type: "error"
156
156
  });
157
- }, [f]);
157
+ }, [T]);
158
158
  const g = R(() => {
159
159
  if (!c) return [];
160
160
  const e = x(c), h = j(e);
161
161
  return w(h);
162
- }, [c]), L = [
162
+ }, [c]), q = [
163
163
  { key: "name", header: "name" },
164
164
  { key: "value", header: "value" },
165
165
  { key: "form", header: "form" }
166
- ], O = F || !y, _ = f && y, k = (!c || c.entry?.length === 0 || m.length === 0) && y, q = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, C = k ? o("NO_OBSERVATIONS_FOUND") : void 0, U = g.length > 0 && !O && !_, E = n.titleTranslationKey, v = E ? o(E) : "";
166
+ ], O = F || !y, _ = T && y, L = (!c || c.entry?.length === 0 || m.length === 0) && y, k = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, C = L ? o("NO_OBSERVATIONS_FOUND") : void 0, U = g.length > 0 && !O && !_, E = n.titleTranslationKey, v = E ? o(E) : "";
167
167
  return /* @__PURE__ */ N(
168
168
  "div",
169
169
  {
@@ -173,7 +173,7 @@ const D = (a, n, d, l, b, r) => {
173
173
  className: I.observations,
174
174
  children: [
175
175
  /* @__PURE__ */ u(
176
- G,
176
+ z,
177
177
  {
178
178
  id: "observations-title",
179
179
  testId: E ? `observations-title-${v}` : "observations-title",
@@ -190,13 +190,13 @@ const D = (a, n, d, l, b, r) => {
190
190
  hideThumbnail: b
191
191
  }
192
192
  ) : /* @__PURE__ */ u(
193
- z,
193
+ G,
194
194
  {
195
- headers: L,
195
+ headers: q,
196
196
  rows: [],
197
197
  ariaLabel: o("OBSERVATIONS"),
198
198
  loading: O,
199
- errorStateMessage: q,
199
+ errorStateMessage: k,
200
200
  emptyStateMessage: C,
201
201
  dataTestId: "observations-table"
202
202
  }
@@ -1,4 +1,4 @@
1
- import { _ as we, a0 as z, a1 as xt, a2 as B, W as q, Y as y, a3 as Ro, a4 as ye, a5 as R, a6 as _, a7 as k, a8 as N, a9 as A, aa as bs, ab as ir, ac as $e, ad as G, ae as Hn, af as Vn, ag as dt, ah as D, ai as xs, aj as cn, ak as Be, al as ws, am as qt, an as zt, ao as $s, ap as Cs, aq as $n, ar as Ss, as as Nr, at as Bt, au as zo, av as ks, aw as Es, ax as j, ay as Gr, az as Ms, aA as Ds, aB as sr, aC as As, aD as Ts, aE as zn, aF as Fs, aG as Is, aH as Z, aI as Ps, aJ as Ls } from "./index-ztXJIVM5.js";
1
+ import { _ as we, a0 as z, a1 as xt, a2 as B, W as q, Z as y, a3 as Ro, a4 as ye, a5 as R, a6 as _, a7 as k, a8 as N, a9 as A, aa as bs, ab as ir, ac as $e, ad as G, ae as Hn, af as Vn, ag as dt, ah as D, ai as xs, aj as cn, ak as Be, al as ws, am as qt, an as zt, ao as $s, ap as Cs, aq as $n, ar as Ss, as as Nr, at as Bt, au as zo, av as ks, aw as Es, ax as j, ay as Gr, az as Ms, aA as Ds, aB as sr, aC as As, aD as Ts, aE as zn, aF as Fs, aG as Is, aH as Z, aI as Ps, aJ as Ls } from "./index-D86omKT7.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1,7 +1,7 @@
1
1
  import { jsx as n, jsxs as f } from "react/jsx-runtime";
2
- import { O as V, B as O, u as C, C as h, G as P, f as B, d as G, U, Z as A, a as x, I as q, D as F, F as k, J as $, P as Q, Q as j, S as w, T as H } from "./index-ztXJIVM5.js";
2
+ import { B as V, C as O, u as C, D as h, K as P, f as B, d as G, U, F as A, a as x, G as q, I as F, J as K, O as $, P as k, Q, S as j, T as w } from "./index-D86omKT7.js";
3
3
  import { useState as I, useMemo as _ } from "react";
4
- const K = V(
4
+ const H = V(
5
5
  O,
6
6
  "useAppointmentsConfig",
7
7
  "AppointmentsConfigProvider"
@@ -35,10 +35,10 @@ const K = V(
35
35
  "speciality",
36
36
  "durationMins",
37
37
  "description"
38
- ], Y = "app:appointments:manageServices", Z = "app:appointments:adminTab", J = "_page_10v94_1", z = "_noPrivilegeContainer_10v94_1", X = "_table_10v94_18", d = {
39
- page: J,
40
- noPrivilegeContainer: z,
41
- table: X
38
+ ], Y = "app:appointments:manageServices", J = "app:appointments:adminTab", z = "_page_10v94_1", X = "_noPrivilegeContainer_10v94_1", Z = "_table_10v94_18", d = {
39
+ page: z,
40
+ noPrivilegeContainer: X,
41
+ table: Z
42
42
  };
43
43
  function ee(e) {
44
44
  return e.filter((a) => !p.includes(a));
@@ -74,9 +74,9 @@ function ae(e, a) {
74
74
  }));
75
75
  }
76
76
  const re = () => {
77
- const { t: e } = C(), a = B(), { addNotification: t } = G(), { userPrivileges: s } = U(), { appointmentsConfig: i } = K(), [E, c] = I(null), [v, S] = I(!1), l = i?.serviceTableFields ?? [
77
+ const { t: e } = C(), a = B(), { addNotification: t } = G(), { userPrivileges: s } = U(), { appointmentsConfig: i } = H(), [E, c] = I(null), [v, S] = I(!1), l = i?.serviceTableFields ?? [
78
78
  ...p
79
- ], u = A(s, Z), M = A(
79
+ ], u = A(s, J), M = A(
80
80
  s,
81
81
  Y
82
82
  ), m = _(
@@ -84,7 +84,7 @@ const re = () => {
84
84
  [l]
85
85
  ), { data: L, isLoading: D, isError: b } = x({
86
86
  queryKey: ["allAppointmentServices"],
87
- queryFn: H,
87
+ queryFn: w,
88
88
  enabled: u
89
89
  }), N = _(
90
90
  () => te(l, e),
@@ -95,7 +95,7 @@ const re = () => {
95
95
  ), g = async () => {
96
96
  S(!0);
97
97
  try {
98
- await w(E.id), t({
98
+ await j(E.id), t({
99
99
  title: e("ADMIN_ALL_SERVICES_DELETE_SUCCESS_TITLE"),
100
100
  message: e("ADMIN_ALL_SERVICES_DELETE_SUCCESS_MESSAGE"),
101
101
  type: "success",
@@ -111,7 +111,7 @@ const re = () => {
111
111
  S(!1);
112
112
  }
113
113
  }, T = (r, o) => o === "actions" ? /* @__PURE__ */ n(
114
- Q,
114
+ k,
115
115
  {
116
116
  id: `delete-service-${r.id}-btn`,
117
117
  testId: `delete-service-${r.id}-btn-test-id`,
@@ -120,7 +120,7 @@ const re = () => {
120
120
  label: e("ADMIN_ALL_SERVICES_DELETE_ICON_LABEL"),
121
121
  disabled: !M,
122
122
  onClick: () => c(r),
123
- children: /* @__PURE__ */ n(j, {})
123
+ children: /* @__PURE__ */ n(Q, {})
124
124
  }
125
125
  ) : p.includes(o) ? r[o] ?? "-" : r.attributes[o] ?? "-", y = [
126
126
  { id: "home", label: e("BREADCRUMB_HOME"), href: q },
@@ -139,7 +139,7 @@ const re = () => {
139
139
  className: d.page,
140
140
  children: [
141
141
  /* @__PURE__ */ n(
142
- k,
142
+ K,
143
143
  {
144
144
  id: "all-services",
145
145
  title: e("ADMIN_ALL_SERVICES_TITLE"),