@bahmni/registration-app 0.0.1-dev.118 → 0.0.1-dev.120

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,44 +1,44 @@
1
- import { jsx as o, jsxs as p, Fragment as Y } from "react/jsx-runtime";
2
- import { u as J, O as W, K as X, S as Z, D as ee, R as re, L as ae, _ as oe, T as ne, e as $, a as te, b as se, c as de, C as me, w as I, q as ie, d as N } from "./index-CkeU8lKx.js";
1
+ import { jsx as o, jsxs as p, Fragment as J } from "react/jsx-runtime";
2
+ import { u as Q, C as Y, K as W, a as Z, n as ee, o as re, r as ae, H as oe, R as ne, q as V, O as te, T as se, L as de, b as ie, w as $, G as me, I as N } from "./index-BfJu4sPw.js";
3
3
  import { useQuery as f } from "@tanstack/react-query";
4
- import { useState as x, useMemo as b, useCallback as g } from "react";
4
+ import { useState as x, useMemo as _, useCallback as g } from "react";
5
5
  import { createPortal as le } from "react-dom";
6
- const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe = "_formContent_1pd36_18", _e = "_formDetailsContainer_1pd36_25", be = "_observation_1pd36_30", fe = "_groupContainer_1pd36_39", ge = "_rowContainer_1pd36_43", Ne = "_groupLabel_1pd36_48", he = "_rowLabel_1pd36_58", ye = "_rowValue_1pd36_67", ve = "_groupMembers_1pd36_75", Le = "_memberRow_1pd36_81", Me = "_memberLabel_1pd36_86", Ae = "_memberValue_1pd36_94", Oe = "_abnormalValue_1pd36_102", Ce = "_commentSection_1pd36_110", Re = "_commentText_1pd36_116", Te = "_nestedGroup_1pd36_125", De = "_nestedGroupLabel_1pd36_132", Fe = "_nestedGroupMembers_1pd36_141", r = {
6
+ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe = "_formContent_1pd36_18", be = "_formDetailsContainer_1pd36_25", _e = "_observation_1pd36_30", fe = "_groupContainer_1pd36_39", ge = "_rowContainer_1pd36_43", Ne = "_groupLabel_1pd36_48", he = "_rowLabel_1pd36_58", ye = "_rowValue_1pd36_67", ve = "_groupMembers_1pd36_75", Me = "_memberRow_1pd36_81", Le = "_memberLabel_1pd36_86", Ae = "_memberValue_1pd36_94", Ce = "_abnormalValue_1pd36_102", Oe = "_commentSection_1pd36_110", Re = "_commentText_1pd36_116", Te = "_nestedGroup_1pd36_125", Fe = "_nestedGroupLabel_1pd36_132", De = "_nestedGroupMembers_1pd36_141", r = {
7
7
  formsTableBody: ce,
8
8
  customAccordianItem: ue,
9
9
  formContent: pe,
10
- formDetailsContainer: _e,
11
- observation: be,
10
+ formDetailsContainer: be,
11
+ observation: _e,
12
12
  groupContainer: fe,
13
13
  rowContainer: ge,
14
14
  groupLabel: Ne,
15
15
  rowLabel: he,
16
16
  rowValue: ye,
17
17
  groupMembers: ve,
18
- memberRow: Le,
19
- memberLabel: Me,
18
+ memberRow: Me,
19
+ memberLabel: Le,
20
20
  memberValue: Ae,
21
- abnormalValue: Oe,
22
- commentSection: Ce,
21
+ abnormalValue: Ce,
22
+ commentSection: Oe,
23
23
  commentText: Re,
24
24
  nestedGroup: Te,
25
- nestedGroupLabel: De,
26
- nestedGroupMembers: Fe
25
+ nestedGroupLabel: Fe,
26
+ nestedGroupMembers: De
27
27
  }, we = "ABNORMAL", U = (e) => {
28
- const m = e.concept?.units, i = e.concept?.lowNormal, a = e.concept?.hiNormal, l = i != null, c = a != null, u = l && c ? ` (${i} - ${a})` : l ? ` (>${i})` : c ? ` (<${a})` : "", t = e.interpretation && e.interpretation.toUpperCase() === we;
29
- return { units: m, rangeString: u, isAbnormal: t };
28
+ const i = e.concept?.units, m = e.concept?.lowNormal, a = e.concept?.hiNormal, l = m != null, c = a != null, u = l && c ? ` (${m} - ${a})` : l ? ` (>${m})` : c ? ` (<${a})` : "", t = e.interpretation && e.interpretation.toUpperCase() === we;
29
+ return { units: i, rangeString: u, isAbnormal: t };
30
30
  }, q = ({
31
31
  member: e,
32
- depth: m = 0
32
+ depth: i = 0
33
33
  }) => {
34
- const i = e.groupMembers && e.groupMembers.length > 0, a = e.conceptNameToDisplay ?? e.concept?.shortName ?? e.concept?.name;
35
- if (i)
34
+ const m = e.groupMembers && e.groupMembers.length > 0, a = e.conceptNameToDisplay ?? e.concept?.shortName ?? e.concept?.name;
35
+ if (m)
36
36
  return /* @__PURE__ */ p("div", { className: r.nestedGroup, children: [
37
37
  /* @__PURE__ */ o(
38
38
  "div",
39
39
  {
40
40
  className: r.nestedGroupLabel,
41
- style: { paddingLeft: `${m * 16}px` },
41
+ style: { paddingLeft: `${i * 16}px` },
42
42
  children: a
43
43
  }
44
44
  ),
@@ -46,7 +46,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
46
46
  q,
47
47
  {
48
48
  member: t,
49
- depth: m + 1
49
+ depth: i + 1
50
50
  },
51
51
  `${t.concept.uuid}`
52
52
  )) })
@@ -56,7 +56,7 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
56
56
  "div",
57
57
  {
58
58
  className: r.memberRow,
59
- style: { paddingLeft: `${m * 16}px` },
59
+ style: { paddingLeft: `${i * 16}px` },
60
60
  children: [
61
61
  /* @__PURE__ */ p(
62
62
  "p",
@@ -87,11 +87,11 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
87
87
  ]
88
88
  }
89
89
  );
90
- }, Se = ({
90
+ }, Be = ({
91
91
  observation: e,
92
- index: m
92
+ index: i
93
93
  }) => {
94
- const i = e.groupMembers && e.groupMembers.length > 0, { units: a, rangeString: l, isAbnormal: c } = U(e);
94
+ const m = e.groupMembers && e.groupMembers.length > 0, { units: a, rangeString: l, isAbnormal: c } = U(e);
95
95
  return /* @__PURE__ */ p(
96
96
  "div",
97
97
  {
@@ -100,22 +100,22 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
100
100
  /* @__PURE__ */ p(
101
101
  "div",
102
102
  {
103
- className: i ? r.groupContainer : r.rowContainer,
103
+ className: m ? r.groupContainer : r.rowContainer,
104
104
  children: [
105
105
  /* @__PURE__ */ p(
106
106
  "p",
107
107
  {
108
108
  className: N(
109
- i ? r.groupLabel : r.rowLabel,
110
- !i && c ? r.abnormalValue : ""
109
+ m ? r.groupLabel : r.rowLabel,
110
+ !m && c ? r.abnormalValue : ""
111
111
  ),
112
112
  children: [
113
113
  e.conceptNameToDisplay,
114
- !i && l && /* @__PURE__ */ o("span", { className: r.rangeInfo, children: l })
114
+ !m && l && /* @__PURE__ */ o("span", { className: r.rangeInfo, children: l })
115
115
  ]
116
116
  }
117
117
  ),
118
- i ? /* @__PURE__ */ o("div", { className: r.groupMembers, children: e.groupMembers?.map((u) => /* @__PURE__ */ o(
118
+ m ? /* @__PURE__ */ o("div", { className: r.groupMembers, children: e.groupMembers?.map((u) => /* @__PURE__ */ o(
119
119
  q,
120
120
  {
121
121
  member: u,
@@ -144,40 +144,40 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
144
144
  ] }) })
145
145
  ]
146
146
  },
147
- `${e.concept.uuid}-${m}`
147
+ `${e.concept.uuid}-${i}`
148
148
  );
149
149
  }, xe = ({
150
150
  episodeOfCareUuids: e,
151
- encounterUuids: m,
152
- config: i
151
+ encounterUuids: i,
152
+ config: m
153
153
  }) => {
154
- const { t: a } = J(), l = W(), [c, u] = x(!1), [t, M] = x(null), k = i?.numberOfVisits, A = X(
154
+ const { t: a } = Q(), l = Y(), [c, u] = x(!1), [t, L] = x(null), H = m?.numberOfVisits, A = W(
155
155
  e,
156
- m
156
+ i
157
157
  ), {
158
158
  data: h = [],
159
- isLoading: O,
160
- isError: C,
161
- error: K
159
+ isLoading: C,
160
+ isError: O,
161
+ error: k
162
162
  } = f({
163
163
  queryKey: ["forms", l, e],
164
- queryFn: () => Z(l, void 0, k),
164
+ queryFn: () => Z(l, void 0, H),
165
165
  enabled: !!l && !A
166
- }), R = b(() => !m || m.length === 0 ? h : h.filter(
167
- (n) => m.includes(n.encounterUuid)
168
- ), [h, m]), { data: T = [] } = f({
166
+ }), R = _(() => !i || i.length === 0 ? h : h.filter(
167
+ (n) => i.includes(n.encounterUuid)
168
+ ), [h, i]), { data: T = [] } = f({
169
169
  queryKey: ["observationForms"],
170
170
  queryFn: ee
171
- }), D = g(
171
+ }), F = g(
172
172
  (n) => T.find((s) => s.name === n)?.uuid,
173
173
  [T]
174
- ), y = b(() => {
174
+ ), y = _(() => {
175
175
  if (t)
176
- return D(t.formName);
177
- }, [t, D]), {
178
- data: Be,
179
- isLoading: H,
180
- error: F
176
+ return F(t.formName);
177
+ }, [t, F]), {
178
+ data: Ee,
179
+ isLoading: K,
180
+ error: D
181
181
  } = f({
182
182
  queryKey: ["formMetadata", y],
183
183
  queryFn: () => re(y),
@@ -190,31 +190,31 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
190
190
  queryKey: ["formsEncounter", t?.encounterUuid],
191
191
  queryFn: () => ae(t.encounterUuid, !0),
192
192
  enabled: !!t?.encounterUuid && c
193
- }), S = b(() => !v?.observations || !t?.formName ? [] : v.observations.filter(
193
+ }), B = _(() => !v?.observations || !t?.formName ? [] : v.observations.filter(
194
194
  (n) => "formFieldPath" in n && typeof n.formFieldPath == "string" && n.formFieldPath.includes(t.formName)
195
- ), [v?.observations, t?.formName]), B = b(
195
+ ), [v?.observations, t?.formName]), E = _(
196
196
  () => [
197
197
  { key: "recordedOn", header: a("FORM_RECORDED_ON") },
198
198
  { key: "recordedBy", header: a("FORM_RECORDED_BY") }
199
199
  ],
200
200
  [a]
201
- ), P = b(
201
+ ), P = _(
202
202
  () => [
203
203
  { key: "recordedOn", sortable: !0 },
204
204
  { key: "recordedBy", sortable: !0 }
205
205
  ],
206
206
  []
207
- ), E = b(() => {
207
+ ), I = _(() => {
208
208
  const n = R.reduce(
209
209
  (s, d) => {
210
- const _ = d.formName;
211
- s[_] ??= [];
212
- const L = d.providers.map((Q) => Q.providerName).filter(Boolean).join(", ");
213
- return s[_].push({
210
+ const b = d.formName;
211
+ s[b] ??= [];
212
+ const M = d.providers.map((z) => z.providerName).filter(Boolean).join(", ");
213
+ return s[b].push({
214
214
  id: d.encounterUuid,
215
215
  formName: d.formName,
216
- recordedOn: oe(d.encounterDateTime, a, ie).formattedResult,
217
- recordedBy: L ?? "--",
216
+ recordedOn: oe(d.encounterDateTime, a, me).formattedResult,
217
+ recordedBy: M ?? "--",
218
218
  encounterDateTime: d.encounterDateTime,
219
219
  encounterUuid: d.encounterUuid
220
220
  }), s;
@@ -225,43 +225,43 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
225
225
  ([s, d]) => ({
226
226
  formName: s,
227
227
  records: d.sort(
228
- (_, L) => L.encounterDateTime - _.encounterDateTime
228
+ (b, M) => M.encounterDateTime - b.encounterDateTime
229
229
  )
230
230
  })
231
231
  ).sort((s, d) => s.formName.localeCompare(d.formName));
232
- }, [R, a]), G = g((n) => {
233
- M(n), u(!0);
234
- }, []), z = g(() => {
235
- u(!1), M(null);
236
- }, []), V = g(
232
+ }, [R, a]), S = g((n) => {
233
+ L(n), u(!0);
234
+ }, []), X = g(() => {
235
+ u(!1), L(null);
236
+ }, []), G = g(
237
237
  (n, s) => {
238
238
  switch (s) {
239
239
  case "recordedOn":
240
- return /* @__PURE__ */ o(ne, { onClick: () => G(n), children: n.recordedOn });
240
+ return /* @__PURE__ */ o(ne, { onClick: () => S(n), children: n.recordedOn });
241
241
  case "recordedBy":
242
242
  return n.recordedBy;
243
243
  default:
244
244
  return null;
245
245
  }
246
246
  },
247
- [G]
247
+ [S]
248
248
  );
249
- return /* @__PURE__ */ p(Y, { children: [
250
- /* @__PURE__ */ o("div", { "data-testid": "forms-table", children: O || C || E.length === 0 || A ? /* @__PURE__ */ o(
251
- $,
249
+ return /* @__PURE__ */ p(J, { children: [
250
+ /* @__PURE__ */ o("div", { "data-testid": "forms-table", children: C || O || I.length === 0 || A ? /* @__PURE__ */ o(
251
+ V,
252
252
  {
253
- headers: B,
253
+ headers: E,
254
254
  ariaLabel: a("FORMS_HEADING"),
255
255
  rows: [],
256
- loading: O,
257
- errorStateMessage: C ? K?.message : void 0,
256
+ loading: C,
257
+ errorStateMessage: O ? k?.message : void 0,
258
258
  emptyStateMessage: a("FORMS_UNAVAILABLE"),
259
- renderCell: V,
259
+ renderCell: G,
260
260
  className: r.formsTableBody,
261
261
  "data-testid": "sortable-data-table"
262
262
  }
263
- ) : /* @__PURE__ */ o(te, { align: "start", children: E.map((n, s) => {
264
- const { formName: d, records: _ } = n;
263
+ ) : /* @__PURE__ */ o(te, { align: "start", children: I.map((n, s) => {
264
+ const { formName: d, records: b } = n;
265
265
  return /* @__PURE__ */ o(
266
266
  se,
267
267
  {
@@ -270,16 +270,16 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
270
270
  testId: `accordian-title-${d}`,
271
271
  open: s === 0,
272
272
  children: /* @__PURE__ */ o(
273
- $,
273
+ V,
274
274
  {
275
- headers: B,
275
+ headers: E,
276
276
  ariaLabel: a("FORMS_HEADING"),
277
- rows: _,
277
+ rows: b,
278
278
  loading: !1,
279
279
  errorStateMessage: "",
280
280
  sortable: P,
281
281
  emptyStateMessage: a("FORMS_UNAVAILABLE"),
282
- renderCell: V,
282
+ renderCell: G,
283
283
  className: r.formsTableBody,
284
284
  "data-testid": "forms-data-table"
285
285
  }
@@ -294,14 +294,14 @@ const ce = "_formsTableBody_1pd36_1", ue = "_customAccordianItem_1pd36_6", pe =
294
294
  {
295
295
  id: "formDetailsModal",
296
296
  open: c,
297
- onRequestClose: z,
297
+ onRequestClose: X,
298
298
  modalHeading: t.formName,
299
299
  modalLabel: `${t.recordedOn} | ${t.recordedBy}`,
300
300
  passiveModal: !0,
301
301
  size: "md",
302
302
  testId: "form-details-modal",
303
- children: /* @__PURE__ */ o("div", { className: r.formContent, children: H || j ? /* @__PURE__ */ o(me, { width: "100%", lineCount: 3 }) : F ? /* @__PURE__ */ o("div", { children: I(F).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ o("div", { children: I(w).message ?? a("ERROR_FETCHING_FORM_DATA") }) : S.length > 0 ? /* @__PURE__ */ o("div", { className: r.formDetailsContainer, children: S.map((n, s) => /* @__PURE__ */ o(
304
- Se,
303
+ children: /* @__PURE__ */ o("div", { className: r.formContent, children: K || j ? /* @__PURE__ */ o(ie, { width: "100%", lineCount: 3 }) : D ? /* @__PURE__ */ o("div", { children: $(D).message ?? a("ERROR_FETCHING_FORM_METADATA") }) : w ? /* @__PURE__ */ o("div", { children: $(w).message ?? a("ERROR_FETCHING_FORM_DATA") }) : B.length > 0 ? /* @__PURE__ */ o("div", { className: r.formDetailsContainer, children: B.map((n, s) => /* @__PURE__ */ o(
304
+ Be,
305
305
  {
306
306
  observation: n,
307
307
  index: s
@@ -0,0 +1,33 @@
1
+ import { c, T as l, P as m, a as i, D as u, Q as v } from "./YPM2AS64-BR6gQKF0.js";
2
+ import { g as d, h as f, i as e } from "./index-BfJu4sPw.js";
3
+ var h = (a) => {
4
+ const [r, t] = c({
5
+ prefix: "TanstackQueryDevtools"
6
+ }), n = d(), s = f(() => {
7
+ const o = r.theme_preference || l;
8
+ return o !== "system" ? o : n();
9
+ });
10
+ return e(v.Provider, {
11
+ value: a,
12
+ get children() {
13
+ return e(m, {
14
+ localStore: r,
15
+ setLocalStore: t,
16
+ get children() {
17
+ return e(i.Provider, {
18
+ value: s,
19
+ get children() {
20
+ return e(u, {
21
+ localStore: r,
22
+ setLocalStore: t
23
+ });
24
+ }
25
+ });
26
+ }
27
+ });
28
+ }
29
+ });
30
+ }, C = h;
31
+ export {
32
+ C as default
33
+ };
@@ -1,21 +1,21 @@
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-C9-Y0_W9.js";
2
- import { n as v, o as C, p as e } from "./index-CkeU8lKx.js";
3
- var h = (t) => {
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-BR6gQKF0.js";
2
+ import { g as h, h as v, i as e } from "./index-BfJu4sPw.js";
3
+ var C = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
6
- }), a = v(), l = C(() => {
6
+ }), a = h(), 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(u, {
13
+ return e(i, {
14
14
  disabled: !0,
15
15
  localStore: r,
16
16
  setLocalStore: o,
17
17
  get children() {
18
- return e(i.Provider, {
18
+ return e(u.Provider, {
19
19
  value: l,
20
20
  get children() {
21
21
  return e(m, {
@@ -36,7 +36,7 @@ var h = (t) => {
36
36
  });
37
37
  }
38
38
  });
39
- }, g = h;
39
+ }, p = C;
40
40
  export {
41
- g as default
41
+ p as default
42
42
  };