@bahmni/registration-app 0.0.1-dev.349 → 0.0.1-dev.350

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,7 +1,7 @@
1
1
  import { jsx as r, jsxs as h, Fragment as x } from "react/jsx-runtime";
2
- import { f as G, u as W, o as X, z as Y, X as J, V as Z, Q as ee, d as te } from "./index-CTlXew_3.js";
2
+ import { m as G, u as W, o as X, R as Y, X as J, g as Z, Q as ee, a as te } from "./index-BDS_4RJN.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
- import { useState as l, useCallback as _, useEffect as D, useMemo as p } from "react";
4
+ import { useState as l, useCallback as _, useEffect as I, useMemo as p } 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,
@@ -18,13 +18,13 @@ const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTab
18
18
  uploadedBy: "DOCUMENTS_UPLOADED_BY",
19
19
  attachments: "DOCUMENTS_ATTACHMENTS"
20
20
  };
21
- function R(a) {
21
+ function v(a) {
22
22
  return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
23
23
  }
24
- function ie(a, E) {
24
+ function ie(a, g) {
25
25
  return a.map((s) => ({
26
26
  key: s,
27
- header: E(ue[s])
27
+ header: g(ue[s])
28
28
  }));
29
29
  }
30
30
  const Te = [
@@ -33,50 +33,50 @@ 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 }] : [], fe = ({ config: a, encounterUuids: E }) => {
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 }] : [], De = ({ config: a, encounterUuids: g }) => {
37
37
  const [s, w] = l(!1), [o, U] = l(
38
38
  null
39
- ), [V, I] = l(
39
+ ), [$, O] = l(
40
40
  /* @__PURE__ */ new Set()
41
- ), g = G(), { t: n } = W(), { addNotification: L } = X(), $ = Number(a?.pageSize) || 5, [O, C] = l(1), [u, k] = l($), [F, A] = l(void 0), M = _((e) => {
41
+ ), E = G(), { t: n } = W(), { addNotification: L } = X(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = _((e) => {
42
42
  U(e), w(!0);
43
43
  }, []), q = _(() => {
44
- w(!1), U(null), I(/* @__PURE__ */ new Set());
45
- }, []), v = _((e) => {
46
- I((t) => new Set(t).add(e));
44
+ w(!1), U(null), O(/* @__PURE__ */ new Set());
45
+ }, []), R = _((e) => {
46
+ O((t) => new Set(t).add(e));
47
47
  }, []), { data: i, isLoading: H, isError: b, error: y } = ae({
48
48
  queryKey: [
49
49
  "documents",
50
- g,
51
50
  E,
52
- O,
51
+ g,
52
+ f,
53
53
  u
54
54
  ],
55
- enabled: !!g,
55
+ enabled: !!E,
56
56
  queryFn: () => Y(
57
- g,
58
57
  E,
58
+ g,
59
59
  u,
60
- O
60
+ f
61
61
  )
62
62
  });
63
- D(() => {
63
+ I(() => {
64
64
  i && A(i.total);
65
- }, [i]), D(() => {
65
+ }, [i]), I(() => {
66
66
  C(1), A(void 0);
67
- }, [g]), D(() => {
67
+ }, [E]), I(() => {
68
68
  b && L({
69
69
  title: n("ERROR_DEFAULT_TITLE"),
70
70
  message: y?.message ?? "",
71
71
  type: "error"
72
72
  });
73
- }, [b, y, L, n]), D(() => {
73
+ }, [b, y, L, n]), I(() => {
74
74
  const e = new AbortController();
75
75
  return (async () => {
76
76
  if (!s || !o) return;
77
77
  const t = /* @__PURE__ */ new Set(), m = B(o);
78
78
  for (let c = 0; c < m.length; c++) {
79
- const S = R(m[c].url);
79
+ const S = v(m[c].url);
80
80
  try {
81
81
  (await fetch(S, {
82
82
  method: "HEAD",
@@ -86,23 +86,23 @@ const Te = [
86
86
  N instanceof Error && N.name !== "AbortError" && t.add(c);
87
87
  }
88
88
  }
89
- e.signal.aborted || I(t);
89
+ e.signal.aborted || O(t);
90
90
  })(), () => e.abort();
91
91
  }, [s, o]);
92
- const z = _(
92
+ const Q = _(
93
93
  (e, t) => {
94
- t !== u ? (k(t), C(1), A(void 0)) : C(e);
94
+ t !== u ? (V(t), C(1), A(void 0)) : C(e);
95
95
  },
96
96
  [u]
97
- ), f = p(
97
+ ), D = p(
98
98
  () => a?.fields ?? Te,
99
99
  [a?.fields]
100
- ), Q = 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]), j = p(() => ie(f, n), [f, n]), P = p(
101
- () => f.map((e) => ({
100
+ ), j = 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]), P = p(() => ie(D, n), [D, n]), z = p(
101
+ () => D.map((e) => ({
102
102
  key: e,
103
103
  sortable: e !== "attachments"
104
104
  })),
105
- [f]
105
+ [D]
106
106
  ), T = p(
107
107
  () => o ? B(o) : [],
108
108
  [o]
@@ -141,20 +141,20 @@ const Te = [
141
141
  /* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
142
142
  ee,
143
143
  {
144
- headers: j,
144
+ headers: P,
145
145
  ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
146
- rows: Q,
146
+ rows: j,
147
147
  loading: H,
148
148
  errorStateMessage: b ? y?.message : null,
149
- sortable: P,
149
+ sortable: z,
150
150
  emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
151
151
  renderCell: K,
152
152
  className: d.documentsTableBody,
153
153
  dataTestId: "documents-table",
154
154
  pageSize: u,
155
155
  totalItems: F,
156
- page: O,
157
- onPageChange: z
156
+ page: f,
157
+ onPageChange: Q
158
158
  }
159
159
  ) }),
160
160
  s && o && /* @__PURE__ */ r(
@@ -169,7 +169,7 @@ 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 ?? ""), N = V.has(t);
172
+ const m = v(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), N = $.has(t);
173
173
  return m === "#" || N ? /* @__PURE__ */ h(
174
174
  "div",
175
175
  {
@@ -202,7 +202,7 @@ const Te = [
202
202
  src: m,
203
203
  alt: o.documentIdentifier,
204
204
  className: d.documentImage,
205
- onError: () => v(t)
205
+ onError: () => R(t)
206
206
  }
207
207
  ) : /* @__PURE__ */ r(
208
208
  "iframe",
@@ -210,7 +210,7 @@ const Te = [
210
210
  src: c ? `${m}#toolbar=0` : m,
211
211
  className: d.documentIframe,
212
212
  title: o.documentIdentifier,
213
- onError: () => v(t)
213
+ onError: () => R(t)
214
214
  }
215
215
  )
216
216
  ]
@@ -223,5 +223,5 @@ const Te = [
223
223
  ] });
224
224
  };
225
225
  export {
226
- fe as default
226
+ De as default
227
227
  };
@@ -1,61 +1,61 @@
1
- import { jsx as i, jsxs as Q, Fragment as he } from "react/jsx-runtime";
2
- import { u as ge, f as pe, a as Ne, M as Oe, r as Te, C as be, w as Ee, _ as Ie, b as _e, G as Ae, c as ve, S as Fe, n as z, V as Me, E as K, e as x, X as Se, Q as P, g as Ce, Y as Re, d as Le, T as Ue, W as Be } from "./index-CTlXew_3.js";
3
- import { useQueryClient as De, useQuery as T } from "@tanstack/react-query";
4
- import { useState as X, useMemo as d, useCallback as l } from "react";
5
- const qe = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_modalHeading__wnTmA", we = "FormsTable-module_customAccordianItem__isszs", b = {
6
- formsTableBody: qe,
7
- modalHeading: ke,
1
+ import { jsx as i, jsxs as z, Fragment as ge } from "react/jsx-runtime";
2
+ import { u as ye, m as be, b as pe, M as Oe, c as Ne, L as Te, v as Ee, O as Ie, l as Ae, G as ve, d as _e, k as Fe, n as G, g as Me, E as K, e as x, X as Le, Q as P, Y as Se, J as Ce, a as Re, T as Be, f as Ue } from "./index-BDS_4RJN.js";
3
+ import { useQueryClient as De, useQuery as N } from "@tanstack/react-query";
4
+ import { useState as Y, useMemo as d, useCallback as l } from "react";
5
+ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_modalHeading__wnTmA", we = "FormsTable-module_customAccordianItem__isszs", T = {
6
+ formsTableBody: ke,
7
+ modalHeading: qe,
8
8
  customAccordianItem: we
9
- }, Ve = "startConsultation", Qe = ({
10
- episodeOfCareUuids: S,
9
+ }, He = "startConsultation", ze = ({
10
+ episodeOfCareUuids: L,
11
11
  encounterUuids: u,
12
- config: Y,
13
- disableActions: W = !1,
14
- activeEncounterUuid: h = null
12
+ config: X,
13
+ disableActions: J = !1,
14
+ activeEncounterUuid: g = null
15
15
  }) => {
16
- const { t: n } = ge(), c = pe(), [g, C] = X(!1), [s, R] = X(null), {
16
+ const { t: n } = ye(), c = be(), [y, S] = Y(!1), [s, C] = Y(null), {
17
17
  numberOfVisits: Z,
18
- hideThumbnail: J = !1,
19
- forms: p
20
- } = Y ?? {}, ee = Ne(
21
- Be.EDIT_OBSERVATIONS
22
- ), { userPrivileges: N } = Oe(), E = ee && !W && !!h, L = Te(
23
- S,
18
+ hideThumbnail: W = !1,
19
+ forms: b
20
+ } = X ?? {}, ee = pe(
21
+ Ue.EDIT_OBSERVATIONS
22
+ ), { userPrivileges: p } = Oe(), E = ee && !J && !!g, R = Ne(
23
+ L,
24
24
  u
25
25
  ), re = De(), {
26
- data: U = [],
27
- isLoading: B,
26
+ data: B = [],
27
+ isLoading: U,
28
28
  isError: D,
29
29
  error: ae,
30
30
  refetch: oe
31
- } = T({
32
- queryKey: ["forms", c, S],
33
- queryFn: () => be(c, void 0, Z),
34
- enabled: !!c && !L
35
- }), q = d(() => {
36
- let e = U;
31
+ } = N({
32
+ queryKey: ["forms", c, L],
33
+ queryFn: () => Te(c, void 0, Z),
34
+ enabled: !!c && !R
35
+ }), k = d(() => {
36
+ let e = B;
37
37
  return u && u.length > 0 && (e = e.filter(
38
38
  (r) => u.includes(r.encounterUuid)
39
- )), Array.isArray(p) && p.length > 0 && (e = e.filter(
40
- (r) => p.some((a) => a.toLowerCase() === r.formName.toLowerCase())
39
+ )), Array.isArray(b) && b.length > 0 && (e = e.filter(
40
+ (r) => b.some((a) => a.toLowerCase() === r.formName.toLowerCase())
41
41
  )), e;
42
- }, [U, u, p]), { data: O = [] } = T({
42
+ }, [B, u, b]), { data: O = [] } = N({
43
43
  queryKey: ["observationForms"],
44
44
  queryFn: () => Ee()
45
- }), k = l(
45
+ }), q = l(
46
46
  (e) => {
47
47
  const r = O.find((o) => o.name === e);
48
48
  if (!r?.privileges || r.privileges.length === 0) return !0;
49
- if (!N || N.length === 0) return !1;
50
- const a = new Set(N.map((o) => o.name));
49
+ if (!p || p.length === 0) return !1;
50
+ const a = new Set(p.map((o) => o.name));
51
51
  return r.privileges.some(
52
52
  (o) => a.has(o.privilegeName) && o.editable
53
53
  );
54
54
  },
55
- [O, N]
55
+ [O, p]
56
56
  ), f = l(
57
- (e) => !h || e.encounterUuid !== h ? !1 : k(e.formName),
58
- [h, k]
57
+ (e) => !g || e.encounterUuid !== g ? !1 : q(e.formName),
58
+ [g, q]
59
59
  ), w = l(
60
60
  (e) => O.find((r) => r.name === e)?.uuid,
61
61
  [O]
@@ -66,28 +66,28 @@ const qe = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
66
66
  data: m,
67
67
  isLoading: te,
68
68
  isError: se,
69
- error: _
70
- } = T({
69
+ error: A
70
+ } = N({
71
71
  queryKey: ["formMetadata", I],
72
72
  queryFn: () => Ie(I),
73
- enabled: !!I && g
73
+ enabled: !!I && y
74
74
  }), {
75
- data: A,
75
+ data: v,
76
76
  isLoading: ne,
77
77
  isError: ie,
78
- error: v
79
- } = T({
78
+ error: _
79
+ } = N({
80
80
  queryKey: ["formsEncounterFHIR", s?.encounterUuid],
81
- queryFn: () => _e(s.encounterUuid),
82
- enabled: !!s?.encounterUuid && g
81
+ queryFn: () => Ae(s.encounterUuid),
82
+ enabled: !!s?.encounterUuid && y
83
83
  });
84
- Ae(
84
+ ve(
85
85
  (e) => {
86
86
  e.patientUUID === c && e.updatedConcepts.size > 0 && (oe(), re.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
87
87
  },
88
88
  [c]
89
89
  );
90
- const de = d(() => !A?.entry || !s?.formName ? [] : A.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => ve(e) ? Fe(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [A, s?.formName]), le = d(() => {
90
+ const de = d(() => !v?.entry || !s?.formName ? [] : v.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => _e(e) ? Fe(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [v, s?.formName]), le = d(() => {
91
91
  if (!m?.schema) return;
92
92
  const e = [], r = (a) => {
93
93
  (a ?? []).forEach((o) => {
@@ -113,30 +113,30 @@ const qe = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
113
113
  null
114
114
  ), Object.keys(e).length > 0 ? e : void 0;
115
115
  }, [m]), ue = d(() => {
116
+ if (A)
117
+ return G(A).message;
116
118
  if (_)
117
- return z(_).message;
118
- if (v)
119
- return z(v).message;
120
- }, [_, v]), y = d(
119
+ return G(_).message;
120
+ }, [A, _]), h = d(
121
121
  () => [
122
122
  { key: "recordedOn", header: n("RECORDED_ON") },
123
123
  { key: "recordedBy", header: n("RECORDED_BY") }
124
124
  ],
125
125
  [n]
126
- ), V = d(
127
- () => [...y, { key: "actions", header: n("ACTIONS") }],
128
- [y, n]
126
+ ), H = d(
127
+ () => [...h, { key: "actions", header: n("ACTIONS") }],
128
+ [h, n]
129
129
  ), ce = l(
130
- (e) => E && e.some((r) => f(r)) ? V : y,
131
- [E, f, V, y]
132
- ), fe = y, ye = d(
130
+ (e) => E && e.some((r) => f(r)) ? H : h,
131
+ [E, f, H, h]
132
+ ), fe = h, he = d(
133
133
  () => [
134
134
  { key: "recordedOn", sortable: !0 },
135
135
  { key: "recordedBy", sortable: !0 }
136
136
  ],
137
137
  []
138
- ), H = d(() => {
139
- const e = q.reduce(
138
+ ), V = d(() => {
139
+ const e = k.reduce(
140
140
  (r, a) => {
141
141
  const o = a.formName;
142
142
  r[o] ??= [];
@@ -160,13 +160,13 @@ const qe = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
160
160
  )
161
161
  })
162
162
  ).sort((r, a) => r.formName.localeCompare(a.formName));
163
- }, [q, n]), G = l((e) => {
164
- R(e), C(!0);
163
+ }, [k, n]), Q = l((e) => {
164
+ C(e), S(!0);
165
165
  }, []), $ = l(() => {
166
- C(!1), R(null);
166
+ S(!1), C(null);
167
167
  }, []), F = l((e) => {
168
168
  globalThis.dispatchEvent(
169
- new CustomEvent(Ve, {
169
+ new CustomEvent(He, {
170
170
  detail: {
171
171
  editOnly: "observationForms",
172
172
  editTitle: "EDIT_OBSERVATION_FORM_TITLE",
@@ -180,7 +180,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
180
180
  (e, r) => {
181
181
  switch (r) {
182
182
  case "recordedOn":
183
- return /* @__PURE__ */ i(Se, { onClick: () => G(e), children: e.recordedOn });
183
+ return /* @__PURE__ */ i(Le, { onClick: () => Q(e), children: e.recordedOn });
184
184
  case "recordedBy":
185
185
  return e.recordedBy;
186
186
  case "actions":
@@ -199,29 +199,29 @@ const qe = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
199
199
  return null;
200
200
  }
201
201
  },
202
- [G, F, f, n]
202
+ [Q, F, f, n]
203
203
  );
204
- return /* @__PURE__ */ Q(he, { children: [
205
- /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: B || D || H.length === 0 || L ? /* @__PURE__ */ i(
204
+ return /* @__PURE__ */ z(ge, { children: [
205
+ /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 || R ? /* @__PURE__ */ i(
206
206
  P,
207
207
  {
208
208
  headers: fe,
209
209
  ariaLabel: n("FORMS_HEADING"),
210
210
  rows: [],
211
- loading: B,
211
+ loading: U,
212
212
  errorStateMessage: D ? ae?.message : void 0,
213
213
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
214
214
  renderCell: j,
215
- className: b.formsTableBody,
215
+ className: T.formsTableBody,
216
216
  dataTestId: "forms-table"
217
217
  }
218
- ) : /* @__PURE__ */ i(Ce, { align: "start", children: H.map((e, r) => {
218
+ ) : /* @__PURE__ */ i(Se, { align: "start", children: V.map((e, r) => {
219
219
  const { formName: a, records: o } = e, t = ce(o);
220
220
  return /* @__PURE__ */ i(
221
- Re,
221
+ Ce,
222
222
  {
223
223
  title: a,
224
- className: b.customAccordianItem,
224
+ className: T.customAccordianItem,
225
225
  testId: `accordian-title-${a}`,
226
226
  open: r === 0,
227
227
  children: /* @__PURE__ */ i(
@@ -232,10 +232,10 @@ const qe = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
232
232
  rows: o,
233
233
  loading: !1,
234
234
  errorStateMessage: "",
235
- sortable: ye,
235
+ sortable: he,
236
236
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
237
237
  renderCell: j,
238
- className: b.formsTableBody,
238
+ className: T.formsTableBody,
239
239
  dataTestId: `forms-table-${a}`
240
240
  }
241
241
  )
@@ -243,14 +243,14 @@ const qe = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
243
243
  a
244
244
  );
245
245
  }) }) }),
246
- g && s && /* @__PURE__ */ i(
247
- Le,
246
+ y && s && /* @__PURE__ */ i(
247
+ Re,
248
248
  {
249
249
  id: "modalIdForActionAreaLayout",
250
250
  portalId: "main-display-area",
251
- open: g,
251
+ open: y,
252
252
  onRequestClose: $,
253
- modalHeading: /* @__PURE__ */ Q("div", { className: b.modalHeading, children: [
253
+ modalHeading: /* @__PURE__ */ z("div", { className: T.modalHeading, children: [
254
254
  /* @__PURE__ */ i("span", { children: s.formName }),
255
255
  E && f(s) && /* @__PURE__ */ i(
256
256
  K,
@@ -271,7 +271,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
271
271
  size: "md",
272
272
  testId: "form-details-modal",
273
273
  children: /* @__PURE__ */ i(
274
- Ue,
274
+ Be,
275
275
  {
276
276
  observations: de,
277
277
  isLoading: te || ne,
@@ -279,7 +279,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
279
279
  errorMessage: ue,
280
280
  emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
281
281
  testIdPrefix: s.formName,
282
- hideThumbnail: J,
282
+ hideThumbnail: W,
283
283
  controlOrder: le,
284
284
  sectionMap: me
285
285
  }
@@ -289,5 +289,5 @@ const qe = "FormsTable-module_formsTableBody__SvGha", ke = "FormsTable-module_mo
289
289
  ] });
290
290
  };
291
291
  export {
292
- Qe as default
292
+ ze as default
293
293
  };
@@ -1,9 +1,9 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BfNWpVcW.js";
2
- import { p, q as d, t as e } from "./index-CTlXew_3.js";
3
- var f = (a) => {
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CcL3-QBD.js";
2
+ import { t as d, w as f, x as e } from "./index-BDS_4RJN.js";
3
+ var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
6
- }), n = p(), s = d(() => {
6
+ }), n = d(), s = f(() => {
7
7
  const o = r.theme_preference || l;
8
8
  return o !== "system" ? o : n();
9
9
  });
@@ -27,7 +27,7 @@ var f = (a) => {
27
27
  });
28
28
  }
29
29
  });
30
- }, C = f;
30
+ }, C = p;
31
31
  export {
32
32
  C as default
33
33
  };
@@ -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-BfNWpVcW.js";
2
- import { p as v, q as C, t as e } from "./index-CTlXew_3.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-CcL3-QBD.js";
2
+ import { t as v, w as C, x as e } from "./index-BDS_4RJN.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -36,7 +36,7 @@ var h = (t) => {
36
36
  });
37
37
  }
38
38
  });
39
- }, g = h;
39
+ }, p = h;
40
40
  export {
41
- g as default
41
+ p as default
42
42
  };
@@ -1,9 +1,9 @@
1
- import { jsxs as N, jsx as u } from "react/jsx-runtime";
2
- import { f as Q, o as V, u as S, A as K, N as G, G as M, Z as j, k as w, B as x, O as H, Q as Z, $ as z, s as q, I as P, h as J, i as X, j as Y, l as W, m as ee } from "./index-CTlXew_3.js";
1
+ import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
+ import { m as V, o as K, u as N, z as k, h as G, G as j, F as z, j as M, U as P, i as w, Q as x, B as H, p as q, P as Z, q as J, r as X, I as Y, s as W, Z as ee } from "./index-BDS_4RJN.js";
3
3
  import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
4
- import { useRef as se, useEffect as I, useMemo as O } from "react";
4
+ import { useRef as se, useEffect as $, useMemo as T } from "react";
5
5
  const L = (a, n, d, l, b, r) => {
6
- const t = P(a, n, b), s = t.value, o = J(s);
6
+ const t = Z(a, n, b), s = t.value, o = J(s);
7
7
  let i = s;
8
8
  o === "Image" && (i = /* @__PURE__ */ u(
9
9
  Y,
@@ -59,9 +59,9 @@ const L = (a, n, d, l, b, r) => {
59
59
  title: n = "",
60
60
  hideThumbnail: d
61
61
  }) => {
62
- const { t: l } = S(), b = (r, t, s) => {
63
- const o = z(r.encounterDetails, l);
64
- return /* @__PURE__ */ N(
62
+ const { t: l } = N(), b = (r, t, s) => {
63
+ const o = H(r.encounterDetails, l);
64
+ return /* @__PURE__ */ S(
65
65
  q,
66
66
  {
67
67
  title: o,
@@ -105,7 +105,7 @@ const L = (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", I = {
109
109
  observations: ie,
110
110
  title: ne
111
111
  }, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
@@ -113,77 +113,77 @@ const L = (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 } = V(), { t: o } = S(), i = ae({
116
+ } = n, r = se(/* @__PURE__ */ new Set()), t = V(), { addNotification: s } = K(), { t: o } = N(), i = ae({
117
117
  queries: d.map((e) => ({
118
118
  queryKey: de(e),
119
- queryFn: () => K(e),
119
+ queryFn: () => k(e),
120
120
  enabled: !!e
121
121
  }))
122
122
  });
123
- I(() => {
123
+ $(() => {
124
124
  i.forEach((e, h) => {
125
125
  if (e.isError && !r.current.has(h)) {
126
- const k = d[h];
126
+ const Q = d[h];
127
127
  s({
128
128
  title: o("ERROR_DEFAULT_TITLE"),
129
- message: o("ERROR_FETCHING_CONCEPT", { conceptName: k }),
129
+ message: o("ERROR_FETCHING_CONCEPT", { conceptName: Q }),
130
130
  type: "error"
131
131
  }), r.current.add(h);
132
132
  } else e.isError || r.current.delete(h);
133
133
  });
134
134
  }, [i, d]);
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]), {
135
+ const m = T(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = T(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = T(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
136
136
  data: c,
137
- isLoading: A,
137
+ isLoading: F,
138
138
  isError: R,
139
- refetch: T
139
+ refetch: O
140
140
  } = te({
141
141
  queryKey: le(t, p),
142
142
  queryFn: () => G(t, p),
143
143
  enabled: !!t && p.length > 0 && y
144
144
  });
145
- M(
145
+ j(
146
146
  (e) => {
147
147
  e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
148
148
  (h) => p.includes(h)
149
- ) && T();
149
+ ) && O();
150
150
  },
151
- [t, T]
152
- ), I(() => {
151
+ [t, O]
152
+ ), $(() => {
153
153
  R && s({
154
154
  title: o("ERROR_DEFAULT_TITLE"),
155
155
  message: o("ERROR_FETCHING_OBSERVATIONS"),
156
156
  type: "error"
157
157
  });
158
158
  }, [R]);
159
- const f = O(() => {
159
+ const f = T(() => {
160
160
  if (!c) return [];
161
- const e = j(c), h = w(e);
162
- return x(h);
161
+ const e = z(c), h = M(e);
162
+ return P(h);
163
163
  }, [c]), D = [
164
164
  { key: "name", header: "name" },
165
165
  { key: "value", header: "value" },
166
166
  { key: "form", header: "form" }
167
- ], $ = A || !y, g = R && y, F = (!c || c.entry?.length === 0 || p.length === 0) && y, B = g ? o("ERROR_FETCHING_OBSERVATIONS") : null, C = F ? o("NO_OBSERVATIONS_FOUND") : void 0, U = f.length > 0 && !$ && !g, E = n.titleTranslationKey, v = E ? o(E) : "";
168
- return /* @__PURE__ */ N(
167
+ ], g = F || !y, _ = R && y, U = (!c || c.entry?.length === 0 || p.length === 0) && y, A = _ ? o("ERROR_FETCHING_OBSERVATIONS") : null, B = U ? o("NO_OBSERVATIONS_FOUND") : void 0, C = 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: _.observations,
174
+ className: I.observations,
175
175
  children: [
176
176
  /* @__PURE__ */ u(
177
- H,
177
+ w,
178
178
  {
179
179
  id: "observations-title",
180
180
  testId: E ? `observations-title-${v}` : "observations-title",
181
181
  title: v,
182
- className: _.title,
182
+ className: I.title,
183
183
  children: /* @__PURE__ */ u("p", { children: v })
184
184
  }
185
185
  ),
186
- U ? /* @__PURE__ */ u(
186
+ C ? /* @__PURE__ */ u(
187
187
  oe,
188
188
  {
189
189
  groupedData: f,
@@ -191,14 +191,14 @@ const L = (a, n, d, l, b, r) => {
191
191
  hideThumbnail: b
192
192
  }
193
193
  ) : /* @__PURE__ */ u(
194
- Z,
194
+ x,
195
195
  {
196
196
  headers: D,
197
197
  rows: [],
198
198
  ariaLabel: o("OBSERVATIONS"),
199
- loading: $,
200
- errorStateMessage: B,
201
- emptyStateMessage: C,
199
+ loading: g,
200
+ errorStateMessage: A,
201
+ emptyStateMessage: B,
202
202
  dataTestId: "observations-table"
203
203
  }
204
204
  )
@@ -1,4 +1,4 @@
1
- import { v as we, x as z, y as xt, D as B, q, t as y, P as Ro, F as ye, H as R, J as _, K as k, L as N, R as A, U as bs, a0 as ir, a1 as $e, a2 as U, a3 as Hn, a4 as Vn, a5 as dt, a6 as D, a7 as xs, a8 as cn, a9 as Be, aa as ws, ab as qt, ac as zt, ad as $s, ae as Cs, af as $n, ag as Ss, ah as Nr, ai as Bt, aj as zo, ak as ks, al as Es, am as j, an as Ur, ao as Ms, ap as Ds, aq as sr, ar as As, as as Ts, at as zn, au as Fs, av as Is, aw as Z, ax as Ps, ay as Ls } from "./index-CTlXew_3.js";
1
+ import { y as we, A as z, C as xt, D as B, w as q, x as y, H as Ro, K as ye, S as R, N as _, V as k, W as N, _ as A, $ as bs, a0 as ir, a1 as $e, a2 as U, a3 as Hn, a4 as Vn, a5 as dt, a6 as D, a7 as xs, a8 as cn, a9 as Be, aa as ws, ab as qt, ac as zt, ad as $s, ae as Cs, af as $n, ag as Ss, ah as Nr, ai as Bt, aj as zo, ak as ks, al as Es, am as j, an as Ur, ao as Ms, ap as Ds, aq as sr, ar as As, as as Ts, at as zn, au as Fs, av as Is, aw as Z, ax as Ps, ay as Ls } from "./index-BDS_4RJN.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -103151,15 +103151,15 @@ function wm0(t, e, r) {
103151
103151
  return n;
103152
103152
  };
103153
103153
  }
103154
- const Io = (t, e, r, n, a) => ({ name: t, applicantId: e, birthdate: r, age: n, sex: a }), gm0 = [
103155
- Io("John Doe", "APP-001", "1990-05-15", 34, "M"),
103156
- Io("Jane Smith", "APP-002", "1985-11-22", 39, "F"),
103157
- Io("Carlos Rivera", "APP-003", "1978-03-08", 46, "M"),
103158
- Io("Amina Yusuf", "APP-004", "1995-07-30", 29, "F"),
103159
- Io("Wei Zhang", "APP-005", "1982-12-01", 42, "M"),
103160
- Io("Sara Petrov", "APP-006", "1993-04-17", 31, "F"),
103161
- Io("James Okafor", "APP-007", "1975-09-25", 49, "M"),
103162
- Io("Leila Mansouri", "APP-008", "1988-06-11", 36, "F")
103154
+ const Io = (t, e, r, n, a, c) => ({ name: t, applicantId: e, birthdate: r, country: n, age: a, sex: c }), gm0 = [
103155
+ Io("John Doe", "APP-001", "1990-05-15", "US", 34, "M"),
103156
+ Io("Jane Smith", "APP-002", "1985-11-22", "UK", 39, "F"),
103157
+ Io("Carlos Rivera", "APP-003", "1978-03-08", "CA", 46, "M"),
103158
+ Io("Amina Yusuf", "APP-004", "1995-07-30", "CA", 29, "F"),
103159
+ Io("Wei Zhang", "APP-005", "1982-12-01", "CA", 42, "M"),
103160
+ Io("Sara Petrov", "APP-006", "2026-05-01", "CA", 31, "F"),
103161
+ Io("James Okafor", "APP-007", "2025-12-09", "CA", 49, "M"),
103162
+ Io("Leila Mansouri", "APP-008", "1988-06-11", "CA", 36, "F")
103163
103163
  ], vm0 = [
103164
103164
  { phone: "+251911234567", email: "john.doe@example.com" },
103165
103165
  { phone: "+251922345678", email: "jane.smith@example.com" },
@@ -106901,7 +106901,7 @@ Em0();
106901
106901
  const Mm0 = [];
106902
106902
  for (let t = 0; t < 256; ++t)
106903
106903
  Mm0.push((t + 256).toString(16).slice(1));
106904
- At(() => Promise.resolve().then(() => z50)), At(() => Promise.resolve().then(() => J50)), At(() => Promise.resolve().then(() => L80)), At(() => Promise.resolve().then(() => S80)), At(() => import("./DocumentsTable-CUERw540-hiymJz4s.js")), At(() => Promise.resolve().then(() => Ud0)), At(() => import("./FormsTable-BiSt9X9y-Cfr8ElHN.js")), At(() => Promise.resolve().then(() => gd0)), At(() => import("./Observations-DG-AmCpd-VsUHyURV.js")), At(
106904
+ At(() => Promise.resolve().then(() => z50)), At(() => Promise.resolve().then(() => J50)), At(() => Promise.resolve().then(() => L80)), At(() => Promise.resolve().then(() => S80)), At(() => import("./DocumentsTable-D07TTQvw-Bmh03NFq.js")), At(() => Promise.resolve().then(() => Ud0)), At(() => import("./FormsTable-CPV7G3yP-DFpRDhIm.js")), At(() => Promise.resolve().then(() => gd0)), At(() => import("./Observations-tLsS82qM-4GhJ-yuO.js")), At(
106905
106905
  () => Promise.resolve().then(() => Cu0)
106906
106906
  ), At(
106907
106907
  () => Promise.resolve().then(() => Z70)
@@ -192059,7 +192059,7 @@ var Gkt = (t, e = !1) => {
192059
192059
  const e = L52(() => {
192060
192060
  const r = this, [n] = this.#n, [a] = this.#o, [c] = this.#a, [i] = this.#c, [l] = this.#p, [s] = this.#t;
192061
192061
  let u;
192062
- return this.#i ? u = this.#i : (u = A52(() => import("./LNWAZHJI-BaSlUfMl.js")), this.#i = u), G52(this.#h, this.#r), b52(u, N52({
192062
+ return this.#i ? u = this.#i : (u = A52(() => import("./LNWAZHJI-BYZ1pDW7.js")), this.#i = u), G52(this.#h, this.#r), b52(u, N52({
192063
192063
  get queryFlavor() {
192064
192064
  return r.#d;
192065
192065
  },
@@ -192157,7 +192157,7 @@ var Gkt = (t, e = !1) => {
192157
192157
  const e = L52(() => {
192158
192158
  const r = this, [n] = this.#n, [a] = this.#o, [c] = this.#a, [i] = this.#c, [l] = this.#p, [s] = this.#t, [u] = this.#i;
192159
192159
  let d;
192160
- return this.#l ? d = this.#l : (d = A52(() => import("./MWZ6AO7Z-B-HVRYuJ.js")), this.#l = d), G52(this.#h, this.#r), b52(d, N52({
192160
+ return this.#l ? d = this.#l : (d = A52(() => import("./MWZ6AO7Z-CcKNuqFK.js")), this.#l = d), G52(this.#h, this.#r), b52(d, N52({
192161
192161
  get queryFlavor() {
192162
192162
  return r.#d;
192163
192163
  },
@@ -204498,35 +204498,35 @@ const nSt = new e92(FAt), eZt = () => {
204498
204498
  ] }) }) : /* @__PURE__ */ oe(p52, {});
204499
204499
  };
204500
204500
  export {
204501
- BSt as $,
204502
- DSt as A,
204503
- USt as B,
204504
- SSt as C,
204501
+ Ikt as $,
204502
+ E0 as A,
204503
+ BSt as B,
204504
+ yNt as C,
204505
204505
  E52 as D,
204506
204506
  Ns as E,
204507
- kkt as F,
204507
+ FSt as F,
204508
204508
  qr as G,
204509
- $kt as H,
204510
- PSt as I,
204511
- Zkt as J,
204512
- xv as K,
204513
- H3 as L,
204509
+ Bkt as H,
204510
+ FY2 as I,
204511
+ Ts as J,
204512
+ kkt as K,
204513
+ SSt as L,
204514
204514
  $a as M,
204515
- $St as N,
204516
- HM as O,
204517
- Bkt as P,
204515
+ Zkt as N,
204516
+ RSt as O,
204517
+ PSt as P,
204518
204518
  gt as Q,
204519
- WNt as R,
204520
- ISt as S,
204519
+ kSt as R,
204520
+ $kt as S,
204521
204521
  by as T,
204522
- Ikt as U,
204523
- d2 as V,
204524
- KSt as W,
204522
+ USt as U,
204523
+ xv as V,
204524
+ H3 as W,
204525
204525
  hl as X,
204526
- Ts as Y,
204527
- FSt as Z,
204528
- RSt as _,
204529
- yu as a,
204526
+ _s as Y,
204527
+ WY2 as Z,
204528
+ WNt as _,
204529
+ kt as a,
204530
204530
  jNt as a0,
204531
204531
  _kt as a1,
204532
204532
  cs as a2,
@@ -204565,29 +204565,29 @@ export {
204565
204565
  Pkt as ax,
204566
204566
  vNt as ay,
204567
204567
  eZt as az,
204568
- Q00 as b,
204569
- c22 as c,
204570
- kt as d,
204568
+ yu as b,
204569
+ Ss as c,
204570
+ c22 as d,
204571
204571
  Zv as e,
204572
- ir as f,
204573
- _s as g,
204574
- EHe as h,
204575
- fK2 as i,
204576
- FY2 as j,
204577
- jSt as k,
204578
- tJ2 as l,
204579
- WY2 as m,
204572
+ KSt as f,
204573
+ d2 as g,
204574
+ $St as h,
204575
+ HM as i,
204576
+ jSt as j,
204577
+ ISt as k,
204578
+ Q00 as l,
204579
+ ir as m,
204580
204580
  nr as n,
204581
204581
  F0 as o,
204582
- Qkt as p,
204583
- K0 as q,
204584
- Ss as r,
204585
- hSt as s,
204586
- b52 as t,
204582
+ hSt as p,
204583
+ EHe as q,
204584
+ fK2 as r,
204585
+ tJ2 as s,
204586
+ Qkt as t,
204587
204587
  j1 as u,
204588
- Lkt as v,
204589
- it0 as w,
204590
- E0 as x,
204591
- yNt as y,
204592
- kSt as z
204588
+ it0 as v,
204589
+ K0 as w,
204590
+ b52 as x,
204591
+ Lkt as y,
204592
+ DSt as z
204593
204593
  };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aB as s, az as E, aA as i } from "./index-CTlXew_3.js";
1
+ import { aB as s, az as E, aA as i } from "./index-BDS_4RJN.js";
2
2
  export {
3
3
  s as IDENTIFIER_TYPES_QUERY_KEY,
4
4
  E as RegistrationApp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/registration-app",
3
- "version": "0.0.1-dev.349",
3
+ "version": "0.0.1-dev.350",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",