@bahmni/registration-app 0.0.1-dev.145 → 0.0.1-dev.147

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
- import { jsx as t, jsxs as p, Fragment as Q } from "react/jsx-runtime";
2
- import { u as X, V as Y, h as J, n as Z, t as ee, r as re, e as ae, d as oe, w as te, $ as x, q as ne, W as se, F as de, _ as me, y as G, P as ie, a as v } from "./index-Bz9hJQp5.js";
1
+ import { jsx as t, jsxs as p, Fragment as Z } from "react/jsx-runtime";
2
+ import { u as J, b as Q, m as Y, p as X, a as ee, h as re, d as ae, c as oe, y as te, $ as U, U as ne, W as se, e as me, Z as de, f as x, K as ie, H as v } from "./index-DbgtnTLR.js";
3
3
  import { useQuery as h } from "@tanstack/react-query";
4
- import { useState as U, useMemo as $, useCallback as y } from "react";
4
+ import { useState as G, useMemo as $, useCallback as y } from "react";
5
5
  const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue = "_formContent_1pd36_18", pe = "_formDetailsContainer_1pd36_25", be = "_observation_1pd36_30", _e = "_groupContainer_1pd36_39", fe = "_rowContainer_1pd36_43", $e = "_groupLabel_1pd36_48", Ne = "_rowLabel_1pd36_58", ge = "_rowValue_1pd36_67", he = "_groupMembers_1pd36_75", ye = "_memberRow_1pd36_81", ve = "_memberLabel_1pd36_86", Ae = "_memberValue_1pd36_94", Me = "_abnormalValue_1pd36_102", Te = "_commentSection_1pd36_110", Le = "_commentText_1pd36_116", Ce = "_nestedGroup_1pd36_125", De = "_nestedGroupLabel_1pd36_132", Oe = "_nestedGroupMembers_1pd36_141", o = {
6
6
  formsTableBody: le,
7
7
  customAccordianItem: ce,
@@ -24,36 +24,36 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
24
24
  nestedGroupLabel: De,
25
25
  nestedGroupMembers: Oe
26
26
  }, Re = "ABNORMAL", q = (e) => {
27
- const s = e.concept?.units, m = e.concept?.lowNormal, r = e.concept?.hiNormal, u = m != null, d = r != null, c = u && d ? ` (${m} - ${r})` : u ? ` (>${m})` : d ? ` (<${r})` : "", a = e.interpretation && e.interpretation.toUpperCase() === Re;
27
+ const s = e.concept?.units, d = e.concept?.lowNormal, r = e.concept?.hiNormal, u = d != null, m = r != null, c = u && m ? ` (${d} - ${r})` : u ? ` (>${d})` : m ? ` (<${r})` : "", a = e.interpretation && e.interpretation.toUpperCase() === Re;
28
28
  return { units: s, rangeString: c, isAbnormal: a };
29
29
  }, k = ({
30
30
  member: e,
31
31
  depth: s = 0,
32
- memberIndex: m = 0,
32
+ memberIndex: d = 0,
33
33
  formName: r = ""
34
34
  }) => {
35
- const u = e.groupMembers && e.groupMembers.length > 0, d = e.conceptNameToDisplay ?? e.concept?.shortName ?? e.concept?.name, c = r ? `${r}-` : "";
35
+ const u = e.groupMembers && e.groupMembers.length > 0, m = e.conceptNameToDisplay ?? e.concept?.shortName ?? e.concept?.name, c = r ? `${r}-` : "";
36
36
  if (u)
37
37
  return /* @__PURE__ */ p(
38
38
  "div",
39
39
  {
40
40
  className: o.nestedGroup,
41
- "data-testid": `${c}obs-nested-group-${d}-${m}`,
41
+ "data-testid": `${c}obs-nested-group-${m}-${d}`,
42
42
  children: [
43
43
  /* @__PURE__ */ t(
44
44
  "div",
45
45
  {
46
46
  className: o.nestedGroupLabel,
47
- "data-testid": `${c}obs-nested-group-label-${d}-${m}`,
47
+ "data-testid": `${c}obs-nested-group-label-${m}-${d}`,
48
48
  style: { paddingLeft: `${s * 16}px` },
49
- children: d
49
+ children: m
50
50
  }
51
51
  ),
52
52
  /* @__PURE__ */ t(
53
53
  "div",
54
54
  {
55
55
  className: o.nestedGroupMembers,
56
- "data-testid": `${c}obs-nested-group-members-${d}-${m}`,
56
+ "data-testid": `${c}obs-nested-group-members-${m}-${d}`,
57
57
  children: e.groupMembers?.map((N, g) => /* @__PURE__ */ t(
58
58
  k,
59
59
  {
@@ -74,7 +74,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
74
74
  "div",
75
75
  {
76
76
  className: o.memberRow,
77
- "data-testid": `${c}obs-member-row-${d}-${m}`,
77
+ "data-testid": `${c}obs-member-row-${m}-${d}`,
78
78
  style: { paddingLeft: `${s * 16}px` },
79
79
  children: [
80
80
  /* @__PURE__ */ p(
@@ -84,9 +84,9 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
84
84
  o.memberLabel,
85
85
  _ ? o.abnormalValue : ""
86
86
  ),
87
- "data-testid": `${c}obs-member-label-${d}-${m}`,
87
+ "data-testid": `${c}obs-member-label-${m}-${d}`,
88
88
  children: [
89
- d,
89
+ m,
90
90
  b
91
91
  ]
92
92
  }
@@ -98,7 +98,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
98
98
  o.memberValue,
99
99
  _ ? o.abnormalValue : ""
100
100
  ),
101
- "data-testid": `${c}obs-member-value-${d}-${m}`,
101
+ "data-testid": `${c}obs-member-value-${m}-${d}`,
102
102
  children: [
103
103
  e.valueAsString,
104
104
  a && ` ${a}`
@@ -111,9 +111,9 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
111
111
  }, Fe = ({
112
112
  observation: e,
113
113
  index: s,
114
- formName: m = ""
114
+ formName: d = ""
115
115
  }) => {
116
- const r = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: d, isAbnormal: c } = q(e), a = m ? `${m}-` : "";
116
+ const r = e.groupMembers && e.groupMembers.length > 0, { units: u, rangeString: m, isAbnormal: c } = q(e), a = d ? `${d}-` : "";
117
117
  return /* @__PURE__ */ p(
118
118
  "div",
119
119
  {
@@ -136,7 +136,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
136
136
  "data-testid": `${a}observation-label-${e.conceptNameToDisplay}-${s}`,
137
137
  children: [
138
138
  e.conceptNameToDisplay,
139
- !r && d && /* @__PURE__ */ t("span", { className: o.rangeInfo, children: d })
139
+ !r && m && /* @__PURE__ */ t("span", { className: o.rangeInfo, children: m })
140
140
  ]
141
141
  }
142
142
  ),
@@ -151,7 +151,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
151
151
  member: b,
152
152
  depth: 0,
153
153
  memberIndex: _,
154
- formName: m
154
+ formName: d
155
155
  },
156
156
  `${b.concept.uuid}`
157
157
  ))
@@ -188,12 +188,12 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
188
188
  },
189
189
  `${e.concept.uuid}-${s}`
190
190
  );
191
- }, Be = ({
191
+ }, Ve = ({
192
192
  episodeOfCareUuids: e,
193
193
  encounterUuids: s,
194
- config: m
194
+ config: d
195
195
  }) => {
196
- const { t: r } = X(), u = Y(), [d, c] = U(!1), [a, b] = U(null), _ = m?.numberOfVisits, N = J(
196
+ const { t: r } = J(), u = Q(), [m, c] = G(!1), [a, b] = G(null), _ = d?.numberOfVisits, N = Y(
197
197
  e,
198
198
  s
199
199
  ), {
@@ -203,7 +203,7 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
203
203
  error: H
204
204
  } = h({
205
205
  queryKey: ["forms", u, e],
206
- queryFn: () => Z(u, void 0, _),
206
+ queryFn: () => X(u, void 0, _),
207
207
  enabled: !!u && !N
208
208
  }), D = $(() => !s || s.length === 0 ? g : g.filter(
209
209
  (n) => s.includes(n.encounterUuid)
@@ -218,12 +218,12 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
218
218
  return R(a.formName);
219
219
  }, [a, R]), {
220
220
  data: we,
221
- isLoading: P,
221
+ isLoading: K,
222
222
  error: F
223
223
  } = h({
224
224
  queryKey: ["formMetadata", A],
225
225
  queryFn: () => re(A),
226
- enabled: !!A && d
226
+ enabled: !!A && m
227
227
  }), {
228
228
  data: M,
229
229
  isLoading: j,
@@ -231,22 +231,22 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
231
231
  } = h({
232
232
  queryKey: ["formsEncounter", a?.encounterUuid],
233
233
  queryFn: () => ae(a.encounterUuid, !0),
234
- enabled: !!a?.encounterUuid && d
234
+ enabled: !!a?.encounterUuid && m
235
235
  }), I = $(() => !M?.observations || !a?.formName ? [] : M.observations.filter(
236
236
  (n) => "formFieldPath" in n && typeof n.formFieldPath == "string" && n.formFieldPath.includes(a.formName)
237
- ), [M?.observations, a?.formName]), V = $(
237
+ ), [M?.observations, a?.formName]), E = $(
238
238
  () => [
239
239
  { key: "recordedOn", header: r("FORM_RECORDED_ON") },
240
240
  { key: "recordedBy", header: r("FORM_RECORDED_BY") }
241
241
  ],
242
242
  [r]
243
- ), K = $(
243
+ ), P = $(
244
244
  () => [
245
245
  { key: "recordedOn", sortable: !0 },
246
246
  { key: "recordedBy", sortable: !0 }
247
247
  ],
248
248
  []
249
- ), E = $(() => {
249
+ ), S = $(() => {
250
250
  const n = D.reduce(
251
251
  (l, i) => {
252
252
  const f = i.formName;
@@ -271,38 +271,38 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
271
271
  )
272
272
  })
273
273
  ).sort((l, i) => l.formName.localeCompare(i.formName));
274
- }, [D, r]), S = y((n) => {
274
+ }, [D, r]), B = y((n) => {
275
275
  b(n), c(!0);
276
276
  }, []), z = y(() => {
277
277
  c(!1), b(null);
278
- }, []), B = y(
278
+ }, []), V = y(
279
279
  (n, l) => {
280
280
  switch (l) {
281
281
  case "recordedOn":
282
- return /* @__PURE__ */ t(te, { onClick: () => S(n), children: n.recordedOn });
282
+ return /* @__PURE__ */ t(te, { onClick: () => B(n), children: n.recordedOn });
283
283
  case "recordedBy":
284
284
  return n.recordedBy;
285
285
  default:
286
286
  return null;
287
287
  }
288
288
  },
289
- [S]
289
+ [B]
290
290
  );
291
- return /* @__PURE__ */ p(Q, { children: [
292
- /* @__PURE__ */ t("div", { "data-testid": "forms-table", children: L || C || E.length === 0 || N ? /* @__PURE__ */ t(
293
- x,
291
+ return /* @__PURE__ */ p(Z, { children: [
292
+ /* @__PURE__ */ t("div", { "data-testid": "forms-table", children: L || C || S.length === 0 || N ? /* @__PURE__ */ t(
293
+ U,
294
294
  {
295
- headers: V,
295
+ headers: E,
296
296
  ariaLabel: r("FORMS_HEADING"),
297
297
  rows: [],
298
298
  loading: L,
299
299
  errorStateMessage: C ? H?.message : void 0,
300
300
  emptyStateMessage: r("FORMS_UNAVAILABLE"),
301
- renderCell: B,
301
+ renderCell: V,
302
302
  className: o.formsTableBody,
303
303
  dataTestId: "forms-table"
304
304
  }
305
- ) : /* @__PURE__ */ t(ne, { align: "start", children: E.map((n, l) => {
305
+ ) : /* @__PURE__ */ t(ne, { align: "start", children: S.map((n, l) => {
306
306
  const { formName: i, records: f } = n;
307
307
  return /* @__PURE__ */ t(
308
308
  se,
@@ -312,16 +312,16 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
312
312
  testId: `accordian-title-${i}`,
313
313
  open: l === 0,
314
314
  children: /* @__PURE__ */ t(
315
- x,
315
+ U,
316
316
  {
317
- headers: V,
317
+ headers: E,
318
318
  ariaLabel: r("FORMS_HEADING"),
319
319
  rows: f,
320
320
  loading: !1,
321
321
  errorStateMessage: "",
322
- sortable: K,
322
+ sortable: P,
323
323
  emptyStateMessage: r("FORMS_UNAVAILABLE"),
324
- renderCell: B,
324
+ renderCell: V,
325
325
  className: o.formsTableBody,
326
326
  dataTestId: `forms-table-${i}`
327
327
  }
@@ -330,18 +330,18 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
330
330
  i
331
331
  );
332
332
  }) }) }),
333
- d && a && /* @__PURE__ */ t(
334
- de,
333
+ m && a && /* @__PURE__ */ t(
334
+ me,
335
335
  {
336
336
  id: "modalIdForActionAreaLayout",
337
- open: d,
337
+ open: m,
338
338
  onRequestClose: z,
339
339
  modalHeading: a.formName,
340
340
  modalLabel: `${a.recordedOn} | ${a.recordedBy}`,
341
341
  passiveModal: !0,
342
342
  size: "md",
343
343
  testId: "form-details-modal",
344
- children: /* @__PURE__ */ t("div", { className: o.formContent, children: P || j ? /* @__PURE__ */ t(me, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ t("div", { children: G(F).message ?? r("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ t("div", { children: G(w).message ?? r("ERROR_FETCHING_FORM_DATA") }) : I.length > 0 ? /* @__PURE__ */ t("div", { className: o.formDetailsContainer, children: I.map((n, l) => /* @__PURE__ */ t(
344
+ children: /* @__PURE__ */ t("div", { className: o.formContent, children: K || j ? /* @__PURE__ */ t(de, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ t("div", { children: x(F).message ?? r("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ t("div", { children: x(w).message ?? r("ERROR_FETCHING_FORM_DATA") }) : I.length > 0 ? /* @__PURE__ */ t("div", { className: o.formDetailsContainer, children: I.map((n, l) => /* @__PURE__ */ t(
345
345
  Fe,
346
346
  {
347
347
  observation: n,
@@ -355,5 +355,5 @@ const le = "_formsTableBody_1pd36_1", ce = "_customAccordianItem_1pd36_6", ue =
355
355
  ] });
356
356
  };
357
357
  export {
358
- Be as default
358
+ Ve as default
359
359
  };
@@ -1,25 +1,25 @@
1
- import { c, T as l, P as m, a as i, D as u, Q as v } from "./YPM2AS64-9Q9qiie5.js";
2
- import { g as d, i as f, j as e } from "./index-Bz9hJQp5.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CBxUINrF.js";
2
+ import { o as d, q as f, r as e } from "./index-DbgtnTLR.js";
3
3
  var p = (a) => {
4
- const [r, t] = c({
4
+ const [r, o] = c({
5
5
  prefix: "TanstackQueryDevtools"
6
6
  }), n = d(), s = f(() => {
7
- const o = r.theme_preference || l;
8
- return o !== "system" ? o : n();
7
+ const t = r.theme_preference || l;
8
+ return t !== "system" ? t : 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
- setLocalStore: t,
15
+ setLocalStore: o,
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
- setLocalStore: t
22
+ setLocalStore: o
23
23
  });
24
24
  }
25
25
  });
@@ -1,5 +1,5 @@
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-9Q9qiie5.js";
2
- import { g as v, i as C, j as e } from "./index-Bz9hJQp5.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-CBxUINrF.js";
2
+ import { o as v, q as C, r as e } from "./index-DbgtnTLR.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -10,12 +10,12 @@ var h = (t) => {
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, {