@bahmni/clinical-app 0.0.1-dev.323 → 0.0.1-dev.325

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.
Files changed (43) hide show
  1. package/dist/App.d.ts.map +1 -1
  2. package/dist/ConsultationPage-veadoKKn.js +143589 -0
  3. package/dist/{DocumentsTable-DJp5cpq1-C76ogudP.js → DocumentsTable-DEMSFjaR-4O-XPd0Q.js} +28 -28
  4. package/dist/{FormsTable-eYSyFNI4-DW7bVuul.js → FormsTable-DMc11j4e-CTExfA42.js} +60 -60
  5. package/dist/{LNWAZHJI-BVp9uP2k.js → LNWAZHJI-ChUeeDXZ.js} +8 -8
  6. package/dist/{MWZ6AO7Z-D-m17cE8.js → MWZ6AO7Z-DEy3kmtN.js} +7 -7
  7. package/dist/{Observations-DqC-iu2a-Bx-GIcJA.js → Observations-Cy5krW_v-BVQYtQCK.js} +35 -35
  8. package/dist/{YPM2AS64-CGrzz0tJ.js → YPM2AS64-CiGBMGOA.js} +1 -1
  9. package/dist/extensions/__tests__/__mocks__/extensionsMocks.d.ts +8 -0
  10. package/dist/extensions/__tests__/__mocks__/extensionsMocks.d.ts.map +1 -0
  11. package/dist/extensions/index.d.ts +3 -0
  12. package/dist/extensions/index.d.ts.map +1 -0
  13. package/dist/extensions/models.d.ts +15 -0
  14. package/dist/extensions/models.d.ts.map +1 -0
  15. package/dist/extensions/utils.d.ts +5 -0
  16. package/dist/extensions/utils.d.ts.map +1 -0
  17. package/dist/hook-By86Vcmq.js +10 -0
  18. package/dist/index-BMr_A7ej.js +189022 -0
  19. package/dist/index-CzGCg-Cz.js +78 -0
  20. package/dist/index-DyxK6V4W.js +90 -0
  21. package/dist/index.css +1 -1
  22. package/dist/index.js +2 -2
  23. package/dist/locales/locale_en.json +6 -0
  24. package/dist/locales/locale_es.json +6 -0
  25. package/dist/pages/list/__tests__/__mocks__/listMocks.d.ts +5 -0
  26. package/dist/pages/list/__tests__/__mocks__/listMocks.d.ts.map +1 -0
  27. package/dist/pages/list/constants.d.ts +4 -0
  28. package/dist/pages/list/constants.d.ts.map +1 -0
  29. package/dist/pages/list/extensions/searchHandler/__tests__/__mocks__/searchHandlerMocks.d.ts +6 -0
  30. package/dist/pages/list/extensions/searchHandler/__tests__/__mocks__/searchHandlerMocks.d.ts.map +1 -0
  31. package/dist/pages/list/extensions/searchHandler/index.d.ts +4 -0
  32. package/dist/pages/list/extensions/searchHandler/index.d.ts.map +1 -0
  33. package/dist/pages/list/index.d.ts +3 -0
  34. package/dist/pages/list/index.d.ts.map +1 -0
  35. package/dist/providers/clinicalConfig/models.d.ts +2 -0
  36. package/dist/providers/clinicalConfig/models.d.ts.map +1 -1
  37. package/dist/providers/clinicalConfig/schema.json.d.ts +27 -0
  38. package/dist/routes/index.d.ts +5 -0
  39. package/dist/routes/index.d.ts.map +1 -0
  40. package/dist/routes/model.d.ts +7 -0
  41. package/dist/routes/model.d.ts.map +1 -0
  42. package/package.json +1 -1
  43. package/dist/index-BEDG7eJr.js +0 -332295
@@ -1,7 +1,7 @@
1
- import { jsx as r, jsxs as h, Fragment as x } from "react/jsx-runtime";
2
- import { n as G, u as W, o as Y, U as J, a as X, g as Z, O as ee, h as te } from "./index-BEDG7eJr.js";
1
+ import { jsx as r, jsxs as p, Fragment as Q } from "react/jsx-runtime";
2
+ import { n as G, u as W, o as Y, c as J, a as X, g as Z, O as ee, p as te } from "./index-BMr_A7ej.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
- import { useState as l, useCallback as _, useEffect as N, useMemo as p } from "react";
4
+ import { useState as l, useCallback as h, useEffect as N, useMemo as _ } from "react";
5
5
  const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", re = "DocumentsTable-module_documentViewerContainer__F5m8D", de = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
6
6
  documentsTableBody: ne,
7
7
  viewAttachmentsLink: oe,
@@ -33,16 +33,16 @@ const Te = [
33
33
  "attachments",
34
34
  "uploadedOn",
35
35
  "uploadedBy"
36
- ], he = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Oe = ({ config: a, encounterUuids: g }) => {
37
- const [s, U] = l(!1), [o, w] = l(
36
+ ], 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 }] : [], Oe = ({ config: a, encounterUuids: g }) => {
37
+ const [s, w] = l(!1), [o, U] = l(
38
38
  null
39
39
  ), [$, D] = l(
40
40
  /* @__PURE__ */ new Set()
41
- ), E = G(), { t: n } = W(), { addNotification: M } = Y(), k = Number(a?.pageSize) || 5, [I, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), L = _((e) => {
42
- w(e), U(!0);
43
- }, []), H = _(() => {
44
- U(!1), w(null), D(/* @__PURE__ */ new Set());
45
- }, []), v = _((e) => {
41
+ ), E = G(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [I, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = h((e) => {
42
+ U(e), w(!0);
43
+ }, []), H = h(() => {
44
+ w(!1), U(null), D(/* @__PURE__ */ new Set());
45
+ }, []), v = h((e) => {
46
46
  D((t) => new Set(t).add(e));
47
47
  }, []), { data: i, isLoading: q, isError: b, error: y } = ae({
48
48
  queryKey: [
@@ -65,12 +65,12 @@ const Te = [
65
65
  }, [i]), N(() => {
66
66
  C(1), A(void 0);
67
67
  }, [E]), N(() => {
68
- b && M({
68
+ b && L({
69
69
  title: n("ERROR_DEFAULT_TITLE"),
70
70
  message: y?.message ?? "",
71
71
  type: "error"
72
72
  });
73
- }, [b, y, M, n]), N(() => {
73
+ }, [b, y, L, n]), N(() => {
74
74
  const e = new AbortController();
75
75
  return (async () => {
76
76
  if (!s || !o) return;
@@ -89,24 +89,24 @@ const Te = [
89
89
  e.signal.aborted || D(t);
90
90
  })(), () => e.abort();
91
91
  }, [s, o]);
92
- const j = _(
92
+ const j = h(
93
93
  (e, t) => {
94
94
  t !== u ? (V(t), C(1), A(void 0)) : C(e);
95
95
  },
96
96
  [u]
97
- ), O = p(
97
+ ), O = _(
98
98
  () => a?.fields ?? Te,
99
99
  [a?.fields]
100
- ), P = p(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), z = p(() => ie(O, n), [O, n]), K = p(
100
+ ), P = _(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), x = _(() => ie(O, n), [O, n]), z = _(
101
101
  () => O.map((e) => ({
102
102
  key: e,
103
103
  sortable: e !== "attachments"
104
104
  })),
105
105
  [O]
106
- ), T = p(
106
+ ), T = _(
107
107
  () => o ? B(o) : [],
108
108
  [o]
109
- ), Q = _(
109
+ ), K = h(
110
110
  (e, t) => {
111
111
  switch (t) {
112
112
  case "documentIdentifier":
@@ -125,7 +125,7 @@ const Te = [
125
125
  return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
126
126
  X,
127
127
  {
128
- onClick: () => L(e),
128
+ onClick: () => M(e),
129
129
  className: d.viewAttachmentsLink,
130
130
  "data-testid": `view-attachments-${e.id}`,
131
131
  children: n("DOCUMENTS_VIEW_ATTACHMENTS")
@@ -135,20 +135,20 @@ const Te = [
135
135
  return null;
136
136
  }
137
137
  },
138
- [L, n]
138
+ [M, n]
139
139
  );
140
- return /* @__PURE__ */ h(x, { children: [
140
+ return /* @__PURE__ */ p(Q, { children: [
141
141
  /* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
142
142
  ee,
143
143
  {
144
- headers: z,
144
+ headers: x,
145
145
  ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
146
146
  rows: P,
147
147
  loading: q,
148
148
  errorStateMessage: b ? y?.message : null,
149
- sortable: K,
149
+ sortable: z,
150
150
  emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
151
- renderCell: Q,
151
+ renderCell: K,
152
152
  className: d.documentsTableBody,
153
153
  dataTestId: "documents-table",
154
154
  pageSize: u,
@@ -169,14 +169,14 @@ const Te = [
169
169
  size: "lg",
170
170
  testId: "document-view-modal",
171
171
  children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: T.map((e, t) => {
172
- const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), f = $.has(t);
173
- return m === "#" || f ? /* @__PURE__ */ h(
172
+ const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || pe.test(e.url ?? ""), f = $.has(t);
173
+ return m === "#" || f ? /* @__PURE__ */ p(
174
174
  "div",
175
175
  {
176
176
  className: d.attachmentError,
177
177
  "data-testid": `attachment-error-${t}`,
178
178
  children: [
179
- T.length > 1 && /* @__PURE__ */ h("p", { className: d.attachmentCounter, children: [
179
+ T.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
180
180
  t + 1,
181
181
  "/",
182
182
  T.length
@@ -185,13 +185,13 @@ const Te = [
185
185
  ]
186
186
  },
187
187
  `${o.id}-${e.url}`
188
- ) : /* @__PURE__ */ h(
188
+ ) : /* @__PURE__ */ p(
189
189
  "div",
190
190
  {
191
191
  className: d.attachmentItem,
192
192
  "data-testid": `attachment-item-${t}`,
193
193
  children: [
194
- T.length > 1 && /* @__PURE__ */ h("p", { className: d.attachmentCounter, children: [
194
+ T.length > 1 && /* @__PURE__ */ p("p", { className: d.attachmentCounter, children: [
195
195
  t + 1,
196
196
  "/",
197
197
  T.length
@@ -1,79 +1,79 @@
1
1
  import { jsx as i, jsxs as re, Fragment as ae } from "react/jsx-runtime";
2
- import { u as te, n as oe, x as se, j as ne, B as de, F as ie, P as le, p as ue, D as q, g as me, a as ce, O as j, w as fe, v as ye, h as he, Q as pe, $ as be } from "./index-BEDG7eJr.js";
3
- import { useQueryClient as ge, useQuery as h } from "@tanstack/react-query";
2
+ import { u as te, n as oe, x as se, l as ne, i as de, s as ie, b as le, d as ue, D as x, g as me, a as ce, O as q, w as fe, v as ye, p as be, e as pe, r as ge } from "./index-BMr_A7ej.js";
3
+ import { useQueryClient as he, useQuery as b } from "@tanstack/react-query";
4
4
  import { useState as w, useMemo as d, useCallback as p } from "react";
5
- const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_customAccordianItem__isszs", M = {
5
+ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_customAccordianItem__isszs", v = {
6
6
  formsTableBody: Ne,
7
7
  customAccordianItem: Oe
8
8
  }, Ae = (m) => m ? m.extension?.find(
9
- (l) => l.url === be
10
- )?.valueString : void 0, Te = ({
9
+ (l) => l.url === ge
10
+ )?.valueString : void 0, Ee = ({
11
11
  episodeOfCareUuids: m,
12
12
  encounterUuids: l,
13
13
  config: k
14
14
  }) => {
15
- const { t: n } = te(), c = oe(), [f, v] = w(!1), [o, F] = w(null), {
16
- numberOfVisits: x,
17
- hideThumbnail: $ = !1,
15
+ const { t: n } = te(), c = oe(), [f, I] = w(!1), [o, T] = w(null), {
16
+ numberOfVisits: j,
17
+ hideThumbnail: H = !1,
18
18
  forms: y
19
- } = k ?? {}, I = se(
19
+ } = k ?? {}, D = se(
20
20
  m,
21
21
  l
22
- ), H = ge(), {
23
- data: T = [],
24
- isLoading: B,
25
- isError: D,
26
- error: K,
27
- refetch: Q
28
- } = h({
22
+ ), K = he(), {
23
+ data: E = [],
24
+ isLoading: F,
25
+ isError: L,
26
+ error: V,
27
+ refetch: $
28
+ } = b({
29
29
  queryKey: ["forms", c, m],
30
- queryFn: () => ne(c, void 0, x),
31
- enabled: !!c && !I
32
- }), E = d(() => {
33
- let e = T;
30
+ queryFn: () => ne(c, void 0, j),
31
+ enabled: !!c && !D
32
+ }), B = d(() => {
33
+ let e = E;
34
34
  return l && l.length > 0 && (e = e.filter(
35
35
  (r) => l.includes(r.encounterUuid)
36
36
  )), Array.isArray(y) && y.length > 0 && (e = e.filter(
37
37
  (r) => y.some((a) => a.toLowerCase() === r.formName.toLowerCase())
38
38
  )), e;
39
- }, [T, l, y]), { data: L = [] } = h({
39
+ }, [E, l, y]), { data: M = [] } = b({
40
40
  queryKey: ["observationForms"],
41
41
  queryFn: () => de()
42
42
  }), S = p(
43
- (e) => L.find((r) => r.name === e)?.uuid,
44
- [L]
45
- ), b = d(() => {
43
+ (e) => M.find((r) => r.name === e)?.uuid,
44
+ [M]
45
+ ), g = d(() => {
46
46
  if (o)
47
47
  return S(o.formName);
48
48
  }, [o, S]), {
49
49
  data: u,
50
- isLoading: V,
51
- isError: z,
52
- error: g
53
- } = h({
54
- queryKey: ["formMetadata", b],
55
- queryFn: () => ie(b),
56
- enabled: !!b && f
50
+ isLoading: z,
51
+ isError: G,
52
+ error: h
53
+ } = b({
54
+ queryKey: ["formMetadata", g],
55
+ queryFn: () => ie(g),
56
+ enabled: !!g && f
57
57
  }), {
58
58
  data: N,
59
- isLoading: G,
60
- isError: P,
59
+ isLoading: Q,
60
+ isError: Y,
61
61
  error: O
62
- } = h({
62
+ } = b({
63
63
  queryKey: ["formsEncounterFHIR", o?.encounterUuid],
64
64
  queryFn: () => le(o.encounterUuid),
65
65
  enabled: !!o?.encounterUuid && f
66
66
  });
67
67
  ue(
68
68
  (e) => {
69
- e.patientUUID === c && e.updatedConcepts.size > 0 && (Q(), H.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
69
+ e.patientUUID === c && e.updatedConcepts.size > 0 && ($(), K.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
70
70
  },
71
71
  [c]
72
72
  );
73
- const Y = d(() => !N?.entry || !o?.formName ? [] : N.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
73
+ const J = d(() => !N?.entry || !o?.formName ? [] : N.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => {
74
74
  const r = Ae(e);
75
75
  return !r || r.includes(o.formName);
76
- }), [N, o?.formName]), J = d(() => {
76
+ }), [N, o?.formName]), P = d(() => {
77
77
  if (!u?.schema) return;
78
78
  const e = [], r = (a) => {
79
79
  (a ?? []).forEach((s) => {
@@ -99,11 +99,11 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
99
99
  null
100
100
  ), Object.keys(e).length > 0 ? e : void 0;
101
101
  }, [u]), X = d(() => {
102
- if (g)
103
- return q(g).message;
102
+ if (h)
103
+ return x(h).message;
104
104
  if (O)
105
- return q(O).message;
106
- }, [g, O]), _ = d(
105
+ return x(O).message;
106
+ }, [h, O]), _ = d(
107
107
  () => [
108
108
  { key: "recordedOn", header: n("RECORDED_ON") },
109
109
  { key: "recordedBy", header: n("RECORDED_BY") }
@@ -116,7 +116,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
116
116
  ],
117
117
  []
118
118
  ), C = d(() => {
119
- const e = E.reduce(
119
+ const e = B.reduce(
120
120
  (r, a) => {
121
121
  const s = a.formName;
122
122
  r[s] ??= [];
@@ -140,10 +140,10 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
140
140
  )
141
141
  })
142
142
  ).sort((r, a) => r.formName.localeCompare(a.formName));
143
- }, [E, n]), R = p((e) => {
144
- F(e), v(!0);
143
+ }, [B, n]), R = p((e) => {
144
+ T(e), I(!0);
145
145
  }, []), ee = p(() => {
146
- v(!1), F(null);
146
+ I(!1), T(null);
147
147
  }, []), U = p(
148
148
  (e, r) => {
149
149
  switch (r) {
@@ -158,17 +158,17 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
158
158
  [R]
159
159
  );
160
160
  return /* @__PURE__ */ re(ae, { children: [
161
- /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: B || D || C.length === 0 || I ? /* @__PURE__ */ i(
162
- j,
161
+ /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: F || L || C.length === 0 || D ? /* @__PURE__ */ i(
162
+ q,
163
163
  {
164
164
  headers: _,
165
165
  ariaLabel: n("FORMS_HEADING"),
166
166
  rows: [],
167
- loading: B,
168
- errorStateMessage: D ? K?.message : void 0,
167
+ loading: F,
168
+ errorStateMessage: L ? V?.message : void 0,
169
169
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
170
170
  renderCell: U,
171
- className: M.formsTableBody,
171
+ className: v.formsTableBody,
172
172
  dataTestId: "forms-table"
173
173
  }
174
174
  ) : /* @__PURE__ */ i(fe, { align: "start", children: C.map((e, r) => {
@@ -177,11 +177,11 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
177
177
  ye,
178
178
  {
179
179
  title: a,
180
- className: M.customAccordianItem,
180
+ className: v.customAccordianItem,
181
181
  testId: `accordian-title-${a}`,
182
182
  open: r === 0,
183
183
  children: /* @__PURE__ */ i(
184
- j,
184
+ q,
185
185
  {
186
186
  headers: _,
187
187
  ariaLabel: n("FORMS_HEADING"),
@@ -191,7 +191,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
191
191
  sortable: Z,
192
192
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
193
193
  renderCell: U,
194
- className: M.formsTableBody,
194
+ className: v.formsTableBody,
195
195
  dataTestId: `forms-table-${a}`
196
196
  }
197
197
  )
@@ -200,7 +200,7 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
200
200
  );
201
201
  }) }) }),
202
202
  f && o && /* @__PURE__ */ i(
203
- he,
203
+ be,
204
204
  {
205
205
  id: "modalIdForActionAreaLayout",
206
206
  portalId: "main-display-area",
@@ -214,14 +214,14 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
214
214
  children: /* @__PURE__ */ i(
215
215
  pe,
216
216
  {
217
- observations: Y,
218
- isLoading: V || G,
219
- isError: z || P,
217
+ observations: J,
218
+ isLoading: z || Q,
219
+ isError: G || Y,
220
220
  errorMessage: X,
221
221
  emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
222
222
  testIdPrefix: o.formName,
223
- hideThumbnail: $,
224
- controlOrder: J,
223
+ hideThumbnail: H,
224
+ controlOrder: P,
225
225
  sectionMap: W
226
226
  }
227
227
  )
@@ -230,5 +230,5 @@ const Ne = "FormsTable-module_formsTableBody__SvGha", Oe = "FormsTable-module_cu
230
230
  ] });
231
231
  };
232
232
  export {
233
- Te as default
233
+ Ee as default
234
234
  };
@@ -1,23 +1,23 @@
1
- import { c, T as l, P as m, a as i, D as u, Q as v } from "./YPM2AS64-CGrzz0tJ.js";
2
- import { f, i as d, l as e } from "./index-BEDG7eJr.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CiGBMGOA.js";
2
+ import { bC as d, bD as f, bE as e } from "./index-BMr_A7ej.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
6
- }), n = f(), s = d(() => {
6
+ }), n = d(), s = f(() => {
7
7
  const o = r.theme_preference || l;
8
8
  return o !== "system" ? o : n();
9
9
  });
10
- return e(v.Provider, {
10
+ return e(i.Provider, {
11
11
  value: a,
12
12
  get children() {
13
13
  return e(m, {
14
14
  localStore: r,
15
15
  setLocalStore: t,
16
16
  get children() {
17
- return e(i.Provider, {
17
+ return e(u.Provider, {
18
18
  value: s,
19
19
  get children() {
20
- return e(u, {
20
+ return e(v, {
21
21
  localStore: r,
22
22
  setLocalStore: t
23
23
  });
@@ -27,7 +27,7 @@ var p = (a) => {
27
27
  });
28
28
  }
29
29
  });
30
- }, C = p;
30
+ }, P = p;
31
31
  export {
32
- C as default
32
+ P as default
33
33
  };
@@ -1,21 +1,21 @@
1
- import { c as s, T as c, P as i, a as u, b as m, C as P, Q as d } from "./YPM2AS64-CGrzz0tJ.js";
2
- import { f as v, i as C, l as e } from "./index-BEDG7eJr.js";
3
- var f = (t) => {
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-CiGBMGOA.js";
2
+ import { bC as C, bD as v, bE as e } from "./index-BMr_A7ej.js";
3
+ var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
6
- }), a = v(), l = C(() => {
6
+ }), a = C(), l = v(() => {
7
7
  const n = r.theme_preference || c;
8
8
  return n !== "system" ? n : a();
9
9
  });
10
10
  return e(d.Provider, {
11
11
  value: t,
12
12
  get children() {
13
- return e(i, {
13
+ return e(u, {
14
14
  disabled: !0,
15
15
  localStore: r,
16
16
  setLocalStore: o,
17
17
  get children() {
18
- return e(u.Provider, {
18
+ return e(i.Provider, {
19
19
  value: l,
20
20
  get children() {
21
21
  return e(m, {
@@ -36,7 +36,7 @@ var f = (t) => {
36
36
  });
37
37
  }
38
38
  });
39
- }, p = f;
39
+ }, p = h;
40
40
  export {
41
41
  p as default
42
42
  };
@@ -1,12 +1,12 @@
1
- import { jsxs as I, jsx as u } from "react/jsx-runtime";
2
- import { n as k, o as K, u as N, k as Q, Z as q, p as G, J as x, X as z, b as w, c as H, O as J, G as Y, E as M, Y as j, d as P, e as X, M as Z, S as W, z as ee } from "./index-BEDG7eJr.js";
1
+ import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
+ import { n as q, o as K, u as N, f as k, h as M, d as Q, m as w, j as z, k as j, q as G, O as H, t as P, I as C, y as Z, C as J, z as Y, A as W, Z as X, B as ee } from "./index-BMr_A7ej.js";
3
3
  import { useQueries as te, useQuery as ae } from "@tanstack/react-query";
4
4
  import { useRef as se, useEffect as $, useMemo as O } from "react";
5
- const D = (t, n, d, l, b, r) => {
6
- const a = j(t, n, b), s = a.value, o = P(s);
5
+ const x = (t, n, d, l, b, r) => {
6
+ const a = Z(t, n, b), s = a.value, o = J(s);
7
7
  let i = s;
8
8
  o === "Image" && (i = /* @__PURE__ */ u(
9
- Z,
9
+ W,
10
10
  {
11
11
  imageSrc: s,
12
12
  alt: s,
@@ -14,7 +14,7 @@ const D = (t, n, d, l, b, r) => {
14
14
  hideThumbnail: r
15
15
  }
16
16
  )), o === "Video" && (i = /* @__PURE__ */ u(
17
- W,
17
+ X,
18
18
  {
19
19
  id: `${s}-video`,
20
20
  videoSrc: s,
@@ -25,7 +25,7 @@ const D = (t, n, d, l, b, r) => {
25
25
  provider: a.provider
26
26
  }), p = t.display, y = t.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
27
27
  return /* @__PURE__ */ u(
28
- X,
28
+ Y,
29
29
  {
30
30
  header: a.header,
31
31
  value: i,
@@ -37,13 +37,13 @@ const D = (t, n, d, l, b, r) => {
37
37
  `obs-${t.id}`
38
38
  );
39
39
  }, re = (t, n, d, l, b, r, a) => /* @__PURE__ */ u(
40
- M,
40
+ C,
41
41
  {
42
42
  title: t.display,
43
43
  id: `grouped-obs-${t.display}-${l}`,
44
44
  open: d,
45
45
  children: t.members?.map(
46
- (s, o) => D(
46
+ (s, o) => x(
47
47
  s,
48
48
  o,
49
49
  b,
@@ -60,16 +60,16 @@ const D = (t, n, d, l, b, r) => {
60
60
  hideThumbnail: d
61
61
  }) => {
62
62
  const { t: l } = N(), b = (r, a, s) => {
63
- const o = Y(r.encounterDetails, l);
64
- return /* @__PURE__ */ I(
65
- M,
63
+ const o = P(r.encounterDetails, l);
64
+ return /* @__PURE__ */ S(
65
+ C,
66
66
  {
67
67
  title: o,
68
68
  id: `encounter-${r.encounterId}`,
69
69
  open: a,
70
70
  children: [
71
71
  r.observations.map(
72
- (i, m) => D(
72
+ (i, m) => x(
73
73
  i,
74
74
  m,
75
75
  s,
@@ -105,7 +105,7 @@ const D = (t, n, d, l, b, r) => {
105
105
  )
106
106
  }
107
107
  );
108
- }, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", S = {
108
+ }, ie = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", I = {
109
109
  observations: ie,
110
110
  title: ne
111
111
  }, de = (t) => ["conceptUuid", t], le = (t, n) => ["observations", t, ...n], pe = ({ config: t }) => {
@@ -113,10 +113,10 @@ const D = (t, 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()), a = k(), { addNotification: s } = K(), { t: o } = N(), i = te({
116
+ } = n, r = se(/* @__PURE__ */ new Set()), a = q(), { addNotification: s } = K(), { t: o } = N(), i = te({
117
117
  queries: d.map((e) => ({
118
118
  queryKey: de(e),
119
- queryFn: () => Q(e),
119
+ queryFn: () => k(e),
120
120
  enabled: !!e
121
121
  }))
122
122
  });
@@ -134,15 +134,15 @@ const D = (t, n, d, l, b, r) => {
134
134
  }, [i, d]);
135
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,
137
+ isLoading: A,
138
138
  isError: R,
139
139
  refetch: T
140
140
  } = ae({
141
141
  queryKey: le(a, p),
142
- queryFn: () => q(a, p),
142
+ queryFn: () => M(a, p),
143
143
  enabled: !!a && p.length > 0 && y
144
144
  });
145
- G(
145
+ Q(
146
146
  (e) => {
147
147
  e.patientUUID === a && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
148
148
  (h) => p.includes(h)
@@ -156,49 +156,49 @@ const D = (t, n, d, l, b, r) => {
156
156
  type: "error"
157
157
  });
158
158
  }, [R]);
159
- const g = O(() => {
159
+ const f = O(() => {
160
160
  if (!c) return [];
161
- const e = x(c), h = z(e);
162
- return w(h);
163
- }, [c]), L = [
161
+ const e = w(c), h = z(e);
162
+ return j(h);
163
+ }, [c]), D = [
164
164
  { key: "name", header: "name" },
165
165
  { key: "value", header: "value" },
166
166
  { key: "form", header: "form" }
167
- ], f = F || !y, _ = R && y, A = (!c || c.entry?.length === 0 || p.length === 0) && y, C = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, U = A ? o("NO_OBSERVATIONS_FOUND") : void 0, B = g.length > 0 && !f && !_, E = n.titleTranslationKey, v = E ? o(E) : "";
168
- return /* @__PURE__ */ I(
167
+ ], g = A || !y, _ = R && y, F = (!c || c.entry?.length === 0 || p.length === 0) && y, L = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, B = F ? o("NO_OBSERVATIONS_FOUND") : void 0, U = f.length > 0 && !g && !_, E = n.titleTranslationKey, v = E ? o(E) : "";
168
+ return /* @__PURE__ */ S(
169
169
  "div",
170
170
  {
171
171
  id: "observations",
172
172
  "data-testid": E ? `observations-${v}` : "observations",
173
173
  "aria-label": "observations-aria-label",
174
- className: S.observations,
174
+ className: I.observations,
175
175
  children: [
176
176
  /* @__PURE__ */ u(
177
- H,
177
+ G,
178
178
  {
179
179
  id: "observations-title",
180
180
  testId: E ? `observations-title-${v}` : "observations-title",
181
181
  title: v,
182
- className: S.title,
182
+ className: I.title,
183
183
  children: /* @__PURE__ */ u("p", { children: v })
184
184
  }
185
185
  ),
186
- B ? /* @__PURE__ */ u(
186
+ U ? /* @__PURE__ */ u(
187
187
  oe,
188
188
  {
189
- groupedData: g,
189
+ groupedData: f,
190
190
  title: v,
191
191
  hideThumbnail: b
192
192
  }
193
193
  ) : /* @__PURE__ */ u(
194
- J,
194
+ H,
195
195
  {
196
- headers: L,
196
+ headers: D,
197
197
  rows: [],
198
198
  ariaLabel: o("OBSERVATIONS"),
199
- loading: f,
200
- errorStateMessage: C,
201
- emptyStateMessage: U,
199
+ loading: g,
200
+ errorStateMessage: L,
201
+ emptyStateMessage: B,
202
202
  dataTestId: "observations-table"
203
203
  }
204
204
  )
@@ -1,4 +1,4 @@
1
- import { m as we, q as z, r as xt, s as B, i as q, l as y, t as Ro, y as ye, A as R, C as _, H as k, I as N, K as A, L as bs, N as ir, R as $e, T as U, V as Hn, W as Vn, _ as dt, a0 as D, a1 as xs, a2 as cn, a3 as Be, a4 as ws, a5 as qt, a6 as zt, a7 as $s, a8 as Cs, a9 as $n, aa as Ss, ab as Nr, ac as Bt, ad as zo, ae as ks, af as Es, ag as j, ah as Ur, ai as Ms, aj as Ds, ak as sr, al as As, am as Ts, an as zn, ao as Fs, ap as Is, aq as Z, ar as Ps, as as Ls } from "./index-BEDG7eJr.js";
1
+ import { bF as we, bG as z, bH as xt, bI as B, bD as q, bE as y, bJ as Ro, bK as ye, bL as R, bM as _, bN as k, bO as N, bP as A, bQ as bs, bR as ir, bS as $e, bT as U, bU as Hn, bV as Vn, bW as dt, bX as D, bY as xs, bZ as cn, b_ as Be, b$ as ws, c0 as qt, c1 as zt, c2 as $s, c3 as Cs, c4 as $n, c5 as Ss, c6 as Nr, c7 as Bt, c8 as zo, c9 as ks, ca as Es, cb as j, cc as Ur, cd as Ms, ce as Ds, cf as sr, cg as As, ch as Ts, ci as zn, cj as Fs, ck as Is, cl as Z, cm as Ps, cn as Ls } from "./index-BMr_A7ej.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -0,0 +1,8 @@
1
+ import { UserPrivilege } from '@bahmni/services';
2
+ import { Extension } from '../../models';
3
+ export declare const mockExtensionWithPrivilege: Extension;
4
+ export declare const mockExtensionWithMultiplePrivileges: Extension;
5
+ export declare const mockExtensionNoPrivileges: Extension;
6
+ export declare const mockExtensionWithDifferentPoint: Extension;
7
+ export declare const mockUserPrivileges: UserPrivilege[];
8
+ //# sourceMappingURL=extensionsMocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensionsMocks.d.ts","sourceRoot":"","sources":["../../../../src/extensions/__tests__/__mocks__/extensionsMocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,0BAA0B,EAAE,SAMxC,CAAC;AAEF,eAAO,MAAM,mCAAmC,EAAE,SAMjD,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,SAKvC,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,SAI7C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,aAAa,EAE7C,CAAC"}