@bahmni/widgets 0.0.1-dev.210 → 0.0.1-dev.212

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 s, jsxs as _, Fragment as K } from "react/jsx-runtime";
2
- import { u as Z, a as Q, T as W, X as J, Z as x, h as ee, b as te } from "./index-BuDLotQZ.js";
2
+ import { u as Q, a as W, P as J, X as Z, n as x, h as ee, b as te } from "./index-C54J8oRw.js";
3
3
  import { useQuery as ne } from "@tanstack/react-query";
4
4
  import { useState as l, useCallback as p, useEffect as N, useMemo as f } from "react";
5
5
  import { useTranslation as ae } from "react-i18next";
@@ -19,13 +19,13 @@ const oe = "_documentsTableBody_1voj8_1", re = "_viewAttachmentsLink_1voj8_11",
19
19
  uploadedBy: "DOCUMENTS_UPLOADED_BY",
20
20
  action: "DOCUMENTS_ACTION"
21
21
  };
22
- function j(n) {
22
+ function P(n) {
23
23
  return !n || n.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${n}`;
24
24
  }
25
- function he(n, T) {
25
+ function he(n, E) {
26
26
  return n.map((d) => ({
27
27
  key: d,
28
- header: T(ue[d])
28
+ header: E(ue[d])
29
29
  }));
30
30
  }
31
31
  const _e = [
@@ -34,12 +34,12 @@ const _e = [
34
34
  "uploadedOn",
35
35
  "uploadedBy",
36
36
  "action"
37
- ], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, R = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], Ne = ({ config: n, encounterUuids: T }) => {
37
+ ], pe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, j = (n) => n.attachments.length > 0 ? n.attachments : n.documentUrl ? [{ url: n.documentUrl, contentType: n.contentType }] : [], Ne = ({ config: n, encounterUuids: E }) => {
38
38
  const [d, M] = l(!1), [r, U] = l(
39
39
  null
40
- ), [P, A] = l(
40
+ ), [R, A] = l(
41
41
  /* @__PURE__ */ new Set()
42
- ), E = Z(), { t: o } = ae(), { addNotification: w } = Q(), F = Number(n?.pageSize) || 5, [D, O] = l(1), [m, $] = l(F), [k, C] = l(void 0), b = p((e) => {
42
+ ), T = Q(), { t: o } = ae(), { addNotification: w } = W(), F = Number(n?.pageSize) || 5, [D, O] = l(1), [m, $] = l(F), [k, C] = l(void 0), b = p((e) => {
43
43
  U(e), M(!0);
44
44
  }, []), V = p(() => {
45
45
  M(!1), U(null), A(/* @__PURE__ */ new Set());
@@ -48,15 +48,15 @@ const _e = [
48
48
  }, []), { data: u, isLoading: z, isError: S, error: y } = ne({
49
49
  queryKey: [
50
50
  "documents",
51
- E,
52
51
  T,
52
+ E,
53
53
  D,
54
54
  m
55
55
  ],
56
- enabled: !!E,
57
- queryFn: () => W(
58
- E,
56
+ enabled: !!T,
57
+ queryFn: () => J(
59
58
  T,
59
+ E,
60
60
  m,
61
61
  D
62
62
  )
@@ -65,7 +65,7 @@ const _e = [
65
65
  u && C(u.total);
66
66
  }, [u]), N(() => {
67
67
  O(1), C(void 0);
68
- }, [E]), N(() => {
68
+ }, [T]), N(() => {
69
69
  S && w({
70
70
  title: o("ERROR_DEFAULT_TITLE"),
71
71
  message: y?.message ?? "",
@@ -75,9 +75,9 @@ const _e = [
75
75
  const e = new AbortController();
76
76
  return (async () => {
77
77
  if (!d || !r) return;
78
- const a = /* @__PURE__ */ new Set(), I = R(r);
78
+ const a = /* @__PURE__ */ new Set(), I = j(r);
79
79
  for (let i = 0; i < I.length; i++) {
80
- const v = j(I[i].url);
80
+ const v = P(I[i].url);
81
81
  try {
82
82
  (await fetch(v, {
83
83
  method: "HEAD",
@@ -105,7 +105,7 @@ const _e = [
105
105
  })),
106
106
  [g]
107
107
  ), h = f(
108
- () => r ? R(r) : [],
108
+ () => r ? j(r) : [],
109
109
  [r]
110
110
  ), Y = p(
111
111
  (e, t) => {
@@ -124,7 +124,7 @@ const _e = [
124
124
  return e.uploadedBy ?? o("DOCUMENTS_NOT_AVAILABLE");
125
125
  case "action":
126
126
  return e.attachments.length > 0 || !!e.documentUrl ? /* @__PURE__ */ s(
127
- J,
127
+ Z,
128
128
  {
129
129
  onClick: () => b(e),
130
130
  className: c.viewAttachmentsLink,
@@ -170,7 +170,7 @@ const _e = [
170
170
  size: "lg",
171
171
  testId: "document-view-modal",
172
172
  children: /* @__PURE__ */ s("div", { className: c.documentViewerContainer, children: h.map((e, t) => {
173
- const a = j(e.url), I = e.contentType?.toLowerCase().includes("pdf"), i = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), v = P.has(t);
173
+ const a = P(e.url), I = e.contentType?.toLowerCase().includes("pdf"), i = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), v = R.has(t);
174
174
  return a === "#" || v ? /* @__PURE__ */ _(
175
175
  "div",
176
176
  {
@@ -1,9 +1,9 @@
1
1
  import { jsxs as b, jsx as o, Fragment as j } from "react/jsx-runtime";
2
- import { f as K, c as R, d as ae, e as oe, m as se, g as ne, i as de, E as ie, u as le, r as ce, l as me, j as ue, k as pe, t as be, R as fe, Z as _e, X as he, h as P, J as ye, n as $e, b as ge, F as ve, o as k } from "./index-BuDLotQZ.js";
2
+ import { f as K, c as R, d as ae, e as oe, m as se, g as ne, i as de, R as ie, u as le, j as ce, k as me, l as ue, p as pe, o as be, A as fe, n as _e, X as he, h as P, J as ye, q as $e, b as ge, F as ve, r as k } from "./index-C54J8oRw.js";
3
3
  import { useQueryClient as Ne, useQuery as O } from "@tanstack/react-query";
4
4
  import { useState as H, useMemo as g, useCallback as L } from "react";
5
5
  import { useTranslation as V } from "react-i18next";
6
- const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le = "_formContent_1pd36_18", Re = "_formDetailsContainer_1pd36_25", Me = "_observation_1pd36_30", Ce = "_groupContainer_1pd36_39", De = "_rowContainer_1pd36_43", Te = "_groupLabel_1pd36_48", Ve = "_rowLabel_1pd36_58", Ee = "_rowValue_1pd36_67", we = "_groupMembers_1pd36_75", Ie = "_memberRow_1pd36_81", Be = "_memberLabel_1pd36_86", Ae = "_memberValue_1pd36_94", Ge = "_abnormalValue_1pd36_102", Se = "_commentSection_1pd36_110", qe = "_commentText_1pd36_116", Ue = "_nestedGroup_1pd36_125", xe = "_nestedGroupLabel_1pd36_132", Pe = "_nestedGroupMembers_1pd36_141", s = {
6
+ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le = "_formContent_1pd36_18", Re = "_formDetailsContainer_1pd36_25", Me = "_observation_1pd36_30", Ce = "_groupContainer_1pd36_39", De = "_rowContainer_1pd36_43", Te = "_groupLabel_1pd36_48", Ve = "_rowLabel_1pd36_58", we = "_rowValue_1pd36_67", Ie = "_groupMembers_1pd36_75", Ae = "_memberRow_1pd36_81", Ee = "_memberLabel_1pd36_86", Be = "_memberValue_1pd36_94", Ge = "_abnormalValue_1pd36_102", Se = "_commentSection_1pd36_110", qe = "_commentText_1pd36_116", Ue = "_nestedGroup_1pd36_125", xe = "_nestedGroupLabel_1pd36_132", Pe = "_nestedGroupMembers_1pd36_141", s = {
7
7
  formsTableBody: Fe,
8
8
  customAccordianItem: Oe,
9
9
  formContent: Le,
@@ -13,11 +13,11 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
13
13
  rowContainer: De,
14
14
  groupLabel: Te,
15
15
  rowLabel: Ve,
16
- rowValue: Ee,
17
- groupMembers: we,
18
- memberRow: Ie,
19
- memberLabel: Be,
20
- memberValue: Ae,
16
+ rowValue: we,
17
+ groupMembers: Ie,
18
+ memberRow: Ae,
19
+ memberLabel: Ee,
20
+ memberValue: Be,
21
21
  abnormalValue: Ge,
22
22
  commentSection: Se,
23
23
  commentText: qe,
@@ -245,7 +245,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
245
245
  ].filter(
246
246
  ({ formFieldPath: d }) => !d || d.includes(r)
247
247
  );
248
- }, Ye = ({
248
+ }, Ze = ({
249
249
  episodeOfCareUuids: e,
250
250
  encounterUuids: r,
251
251
  config: a
@@ -258,30 +258,30 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
258
258
  isLoading: v,
259
259
  isError: N,
260
260
  error: J,
261
- refetch: Z
261
+ refetch: W
262
262
  } = O({
263
263
  queryKey: ["forms", d, e],
264
264
  queryFn: () => me(d, void 0, $),
265
265
  enabled: !!d && !f
266
- }), E = g(() => !r || r.length === 0 ? h : h.filter(
266
+ }), w = g(() => !r || r.length === 0 ? h : h.filter(
267
267
  (l) => r.includes(l.encounterUuid)
268
- ), [h, r]), { data: w = [] } = O({
268
+ ), [h, r]), { data: I = [] } = O({
269
269
  queryKey: ["observationForms"],
270
270
  queryFn: () => ue()
271
- }), I = L(
272
- (l) => w.find((m) => m.name === l)?.uuid,
273
- [w]
271
+ }), A = L(
272
+ (l) => I.find((m) => m.name === l)?.uuid,
273
+ [I]
274
274
  ), M = g(() => {
275
275
  if (t)
276
- return I(t.formName);
277
- }, [t, I]), { isLoading: W, error: B } = O({
276
+ return A(t.formName);
277
+ }, [t, A]), { isLoading: Y, error: E } = O({
278
278
  queryKey: ["formMetadata", M],
279
279
  queryFn: () => pe(M),
280
280
  enabled: !!M && i
281
281
  }), {
282
282
  data: C,
283
- isLoading: Y,
284
- error: A
283
+ isLoading: Z,
284
+ error: B
285
285
  } = O({
286
286
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
287
287
  queryFn: () => be(t.encounterUuid),
@@ -289,7 +289,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
289
289
  });
290
290
  fe(
291
291
  (l) => {
292
- l.patientUUID === d && l.updatedConcepts.size > 0 && (Z(), _.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
292
+ l.patientUUID === d && l.updatedConcepts.size > 0 && (W(), _.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
293
293
  },
294
294
  [d]
295
295
  );
@@ -309,7 +309,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
309
309
  ],
310
310
  []
311
311
  ), q = g(() => {
312
- const l = E.reduce(
312
+ const l = w.reduce(
313
313
  (m, p) => {
314
314
  const F = p.formName;
315
315
  m[F] ??= [];
@@ -333,7 +333,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
333
333
  )
334
334
  })
335
335
  ).sort((m, p) => m.formName.localeCompare(p.formName));
336
- }, [E, n]), U = L((l) => {
336
+ }, [w, n]), U = L((l) => {
337
337
  c(l), u(!0);
338
338
  }, []), re = L(() => {
339
339
  u(!1), c(null);
@@ -404,7 +404,7 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
404
404
  passiveModal: !0,
405
405
  size: "md",
406
406
  testId: "form-details-modal",
407
- children: /* @__PURE__ */ o("div", { className: s.formContent, children: W || Y ? /* @__PURE__ */ o(ve, { width: "100%", lineCount: 3 }) : B ? /* @__PURE__ */ o("div", { children: k(B).message ?? n("ERROR_FETCHING_FORM_METADATA") }) : A ? /* @__PURE__ */ o("div", { children: k(A).message ?? n("ERROR_FETCHING_FORM_DATA") }) : G.length > 0 ? /* @__PURE__ */ o("div", { className: s.formDetailsContainer, children: G.map(({ obs: l, comment: y }, m) => /* @__PURE__ */ o(
407
+ children: /* @__PURE__ */ o("div", { className: s.formContent, children: Y || Z ? /* @__PURE__ */ o(ve, { width: "100%", lineCount: 3 }) : E ? /* @__PURE__ */ o("div", { children: k(E).message ?? n("ERROR_FETCHING_FORM_METADATA") }) : B ? /* @__PURE__ */ o("div", { children: k(B).message ?? n("ERROR_FETCHING_FORM_DATA") }) : G.length > 0 ? /* @__PURE__ */ o("div", { className: s.formDetailsContainer, children: G.map(({ obs: l, comment: y }, m) => /* @__PURE__ */ o(
408
408
  ke,
409
409
  {
410
410
  observation: l,
@@ -419,5 +419,5 @@ const Fe = "_formsTableBody_1pd36_1", Oe = "_customAccordianItem_1pd36_6", Le =
419
419
  ] });
420
420
  };
421
421
  export {
422
- Ye as default
422
+ Ze as default
423
423
  };
@@ -1,15 +1,15 @@
1
1
  import { jsx as d, jsxs as S } from "react/jsx-runtime";
2
- import { p as M, q as C, s as V, d as k, v as w, e as K, m as Q, g as G, u as P, a as H, w as j, x as z, R as X, i as Y, y as J, z as W, L as Z, h as x } from "./index-BuDLotQZ.js";
2
+ import { s as V, t as C, v as k, d as q, w, e as K, m as Q, g as G, u as P, a as H, x as j, y as z, A as Y, i as J, z as W, B as X, L as Z, h as x } from "./index-C54J8oRw.js";
3
3
  import { useQueries as ee, useQuery as te } from "@tanstack/react-query";
4
4
  import { useRef as se, useEffect as $, useMemo as E } from "react";
5
5
  import { useTranslation as D } from "react-i18next";
6
6
  const U = (t, c, i, l, r) => {
7
- const s = V(t, c, r), o = s.value, a = k(o);
7
+ const s = k(t, c, r), o = s.value, a = q(o);
8
8
  let n = o;
9
9
  a === "Image" && (n = /* @__PURE__ */ d(K, { imageSrc: o, alt: o, id: `${o}-img` })), a === "Video" && (n = /* @__PURE__ */ d(Q, { id: `${o}-video`, videoSrc: o })), a === "PDF" && (n = /* @__PURE__ */ d(G, { id: `${o}-pdf`, src: o }));
10
10
  const u = r("OBSERVATIONS_RECORDED_BY", {
11
11
  provider: s.provider
12
- }), b = t.display, p = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", f = l ? `${l}-${p}-${b}-${i}-${c}` : `${p}-${b}-${i}-${c}`;
12
+ }), b = t.display, m = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", f = l ? `${l}-${m}-${b}-${i}-${c}` : `${m}-${b}-${i}-${c}`;
13
13
  return /* @__PURE__ */ d(
14
14
  w,
15
15
  {
@@ -38,7 +38,7 @@ const U = (t, c, i, l, r) => {
38
38
  title: c = ""
39
39
  }) => {
40
40
  const { t: i } = D(), l = (r, s, o) => {
41
- const a = M(r.encounterDetails, i);
41
+ const a = V(r.encounterDetails, i);
42
42
  return /* @__PURE__ */ S(
43
43
  C,
44
44
  {
@@ -78,7 +78,7 @@ const U = (t, c, i, l, r) => {
78
78
  }, ae = "_observations_kfbhq_1", ne = "_title_kfbhq_12", N = {
79
79
  observations: ae,
80
80
  title: ne
81
- }, ie = (t) => ["conceptUuid", t], ce = (t, c) => ["observations", t, ...c], me = ({ config: t }) => {
81
+ }, ie = (t) => ["conceptUuid", t], ce = (t, c) => ["observations", t, ...c], pe = ({ config: t }) => {
82
82
  const c = t, { conceptNames: i = [], conceptUuid: l = [] } = c, r = se(/* @__PURE__ */ new Set()), s = P(), { addNotification: o } = H(), { t: a } = D(), n = ee({
83
83
  queries: i.map((e) => ({
84
84
  queryKey: ie(e),
@@ -87,19 +87,19 @@ const U = (t, c, i, l, r) => {
87
87
  }))
88
88
  });
89
89
  $(() => {
90
- n.forEach((e, m) => {
91
- if (e.isError && !r.current.has(m)) {
92
- const O = i[m];
90
+ n.forEach((e, p) => {
91
+ if (e.isError && !r.current.has(p)) {
92
+ const O = i[p];
93
93
  o({
94
94
  title: a("ERROR_DEFAULT_TITLE"),
95
95
  message: a("ERROR_FETCHING_CONCEPT", { conceptName: O }),
96
96
  type: "error"
97
- }), r.current.add(m);
98
- } else e.isError || r.current.delete(m);
97
+ }), r.current.add(p);
98
+ } else e.isError || r.current.delete(p);
99
99
  });
100
100
  }, [n, i]);
101
101
  const u = E(() => n.map((e) => e.data?.uuid).filter((e) => !!e), [n]), b = E(() => [.../* @__PURE__ */ new Set([...u, ...l])], [u, l]), v = E(() => i.length === 0 ? !0 : n.every((e) => !e.isLoading), [n, i.length]), {
102
- data: p,
102
+ data: m,
103
103
  isLoading: f,
104
104
  isError: g,
105
105
  refetch: R
@@ -108,7 +108,7 @@ const U = (t, c, i, l, r) => {
108
108
  queryFn: () => z(s, b),
109
109
  enabled: !!s && b.length > 0 && v
110
110
  });
111
- X(
111
+ Y(
112
112
  (e) => {
113
113
  e.patientUUID === s && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
114
114
  (O) => b.includes(O)
@@ -123,19 +123,19 @@ const U = (t, c, i, l, r) => {
123
123
  });
124
124
  }, [g]);
125
125
  const T = E(() => {
126
- if (!p) return [];
127
- const e = Y(p), m = J(e);
128
- return W(m);
129
- }, [p]), B = [
126
+ if (!m) return [];
127
+ const e = J(m), p = W(e);
128
+ return X(p);
129
+ }, [m]), A = [
130
130
  { key: "name", header: "name" },
131
131
  { key: "value", header: "value" },
132
132
  { key: "form", header: "form" }
133
- ], I = f || !v, _ = g && v, L = (!p || p.entry?.length === 0 || b.length === 0) && v, A = _ ? a("ERROR_FETCHING_OBSERVATIONS") : null, F = L ? a("NO_OBSERVATIONS_FOUND") : void 0, q = T.length > 0 && !I && !_, h = c.titleTranslationKey, y = h ? a(h) : "";
133
+ ], I = f || !v, _ = g && v, B = (!m || m.entry?.length === 0 || b.length === 0) && v, L = _ ? a("ERROR_FETCHING_OBSERVATIONS") : null, F = B ? a("NO_OBSERVATIONS_FOUND") : void 0, M = T.length > 0 && !I && !_, y = c.titleTranslationKey, h = y ? a(y) : "";
134
134
  return /* @__PURE__ */ S(
135
135
  "div",
136
136
  {
137
137
  id: "observations",
138
- "data-testid": h ? `observations-${y}` : "observations",
138
+ "data-testid": y ? `observations-${h}` : "observations",
139
139
  "aria-label": "observations-aria-label",
140
140
  className: N.observations,
141
141
  children: [
@@ -143,20 +143,20 @@ const U = (t, c, i, l, r) => {
143
143
  Z,
144
144
  {
145
145
  id: "observations-title",
146
- testId: h ? `observations-title-${y}` : "observations-title",
147
- title: y,
146
+ testId: y ? `observations-title-${h}` : "observations-title",
147
+ title: h,
148
148
  className: N.title,
149
- children: /* @__PURE__ */ d("p", { children: y })
149
+ children: /* @__PURE__ */ d("p", { children: h })
150
150
  }
151
151
  ),
152
- q ? /* @__PURE__ */ d(re, { groupedData: T, title: y }) : /* @__PURE__ */ d(
152
+ M ? /* @__PURE__ */ d(re, { groupedData: T, title: h }) : /* @__PURE__ */ d(
153
153
  x,
154
154
  {
155
- headers: B,
155
+ headers: A,
156
156
  rows: [],
157
157
  ariaLabel: a("OBSERVATIONS"),
158
158
  loading: I,
159
- errorStateMessage: A,
159
+ errorStateMessage: L,
160
160
  emptyStateMessage: F,
161
161
  dataTestId: "observations-table"
162
162
  }
@@ -167,6 +167,6 @@ const U = (t, c, i, l, r) => {
167
167
  };
168
168
  export {
169
169
  ie as conceptUuidQueryKeys,
170
- me as default,
170
+ pe as default,
171
171
  ce as observationsQueryKeys
172
172
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AppointmentsTable.d.ts","sourceRoot":"","sources":["../../src/appointments/AppointmentsTable.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAYhD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA0J5C,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"AppointmentsTable.d.ts","sourceRoot":"","sources":["../../src/appointments/AppointmentsTable.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAYhD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAyJ5C,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -13,6 +13,10 @@ interface AppointmentTabContentProps {
13
13
  sortable: boolean;
14
14
  }>;
15
15
  renderCell: (row: FormattedAppointment, key: string) => React.ReactNode;
16
+ pageSize?: number;
17
+ page?: number;
18
+ totalItems?: number;
19
+ onPageChange?: (page: number, pageSize: number) => void;
16
20
  }
17
21
  declare const AppointmentTabContent: React.FC<AppointmentTabContentProps>;
18
22
  export default AppointmentTabContent;
@@ -1 +1 @@
1
- {"version":3,"file":"AppointmentTabContent.d.ts","sourceRoot":"","sources":["../../../src/appointments/components/AppointmentTabContent.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,UAAU,0BAA0B;IAClC,YAAY,EAAE,oBAAoB,EAAE,CAAC;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChD,QAAQ,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACpD,UAAU,EAAE,CAAC,GAAG,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;CACzE;AAED,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAyB/D,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"AppointmentTabContent.d.ts","sourceRoot":"","sources":["../../../src/appointments/components/AppointmentTabContent.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,UAAU,0BAA0B;IAClC,YAAY,EAAE,oBAAoB,EAAE,CAAC;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChD,QAAQ,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACpD,UAAU,EAAE,CAAC,GAAG,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzD;AAED,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAiC/D,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -2,7 +2,7 @@ import { default as React } from 'react';
2
2
  import { FormattedAppointment } from '../utils';
3
3
  interface PastAppointmentsProps {
4
4
  patientUUID: string;
5
- numberOfPastAppointments?: number;
5
+ pageSize: number;
6
6
  headers: Array<{
7
7
  key: string;
8
8
  header: string;
@@ -1 +1 @@
1
- {"version":3,"file":"PastAppointments.d.ts","sourceRoot":"","sources":["../../../src/appointments/components/PastAppointments.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGrD,UAAU,qBAAqB;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,OAAO,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChD,QAAQ,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACpD,UAAU,EAAE,CAAC,GAAG,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;CACzE;AAED,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA4BrD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"PastAppointments.d.ts","sourceRoot":"","sources":["../../../src/appointments/components/PastAppointments.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGrD,UAAU,qBAAqB;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChD,QAAQ,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACpD,UAAU,EAAE,CAAC,GAAG,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;CACzE;AAED,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAoCrD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -2,6 +2,7 @@ import { default as React } from 'react';
2
2
  import { FormattedAppointment } from '../utils';
3
3
  interface UpcomingAppointmentsProps {
4
4
  patientUUID: string;
5
+ pageSize: number;
5
6
  headers: Array<{
6
7
  key: string;
7
8
  header: string;
@@ -1 +1 @@
1
- {"version":3,"file":"UpcomingAppointments.d.ts","sourceRoot":"","sources":["../../../src/appointments/components/UpcomingAppointments.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGrD,UAAU,yBAAyB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChD,QAAQ,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACpD,UAAU,EAAE,CAAC,GAAG,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;CACzE;AAED,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA2B7D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"UpcomingAppointments.d.ts","sourceRoot":"","sources":["../../../src/appointments/components/UpcomingAppointments.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGrD,UAAU,yBAAyB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChD,QAAQ,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACpD,UAAU,EAAE,CAAC,GAAG,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;CACzE;AAED,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAqC7D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"appointmentComponentTestHelper.d.ts","sourceRoot":"","sources":["../../../../src/appointments/components/__tests__/appointmentComponentTestHelper.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,eAAO,MAAM,mBAAmB;kBACJ,IAAI,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC;wBACxB,IAAI,CAAC,cAAc,CACvD,OAAO,cAAc,CACtB;yBACuC,IAAI,CAAC,cAAc,CACzD,OAAO,eAAe,CACvB;CACD,CAAC;AAEH,eAAO,MAAM,qBAAqB,GAChC,OAAO,UAAU,CAAC,OAAO,mBAAmB,CAAC,6BAqB9C,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,QAAQ;IACN,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACjC,EACD,OAAO,UAAU,CAAC,OAAO,mBAAmB,CAAC;;;;CAwC9C,CAAC"}
1
+ {"version":3,"file":"appointmentComponentTestHelper.d.ts","sourceRoot":"","sources":["../../../../src/appointments/components/__tests__/appointmentComponentTestHelper.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,eAAO,MAAM,mBAAmB;kBACJ,IAAI,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC;wBACxB,IAAI,CAAC,cAAc,CACvD,OAAO,cAAc,CACtB;yBACuC,IAAI,CAAC,cAAc,CACzD,OAAO,eAAe,CACvB;CACD,CAAC;AAEH,eAAO,MAAM,qBAAqB,GAChC,OAAO,UAAU,CAAC,OAAO,mBAAmB,CAAC,6BAqB9C,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,QAAQ;IACN,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACjC,EACD,OAAO,UAAU,CAAC,OAAO,mBAAmB,CAAC;;;;CA+C9C,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { AppointmentPage } from '@bahmni/services';
2
+ import { FormattedAppointment } from '../utils';
3
+ interface UsePaginatedAppointmentsOptions {
4
+ queryKeyPrefix: string;
5
+ patientUUID: string;
6
+ pageSize: number;
7
+ idPrefix: string;
8
+ queryFn: (count: number, page: number) => Promise<AppointmentPage>;
9
+ }
10
+ interface UsePaginatedAppointmentsResult {
11
+ formattedAppointments: FormattedAppointment[];
12
+ isLoading: boolean;
13
+ currentPage: number;
14
+ selectedPageSize: number;
15
+ serverTotal: number | undefined;
16
+ handlePageChange: (page: number, pageSize: number) => void;
17
+ }
18
+ export declare const usePaginatedAppointments: ({ queryKeyPrefix, patientUUID, pageSize, idPrefix, queryFn, }: UsePaginatedAppointmentsOptions) => UsePaginatedAppointmentsResult;
19
+ export {};
20
+ //# sourceMappingURL=usePaginatedAppointments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePaginatedAppointments.d.ts","sourceRoot":"","sources":["../../../src/appointments/hooks/usePaginatedAppointments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,kBAAkB,CAAC;AAIxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGhD,UAAU,+BAA+B;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;CACpE;AAED,UAAU,8BAA8B;IACtC,qBAAqB,EAAE,oBAAoB,EAAE,CAAC;IAC9C,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5D;AAED,eAAO,MAAM,wBAAwB,GAAI,+DAMtC,+BAA+B,KAAG,8BA4DpC,CAAC"}