@bahmni/clinical-app 0.0.1-dev.119 → 0.0.1-dev.121

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