@bahmni/clinical-app 0.0.1-dev.366 → 0.0.1-dev.367

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,5 +1,5 @@
1
1
  import { jsx as r, jsxs as p, Fragment as x } from "react/jsx-runtime";
2
- import { g as G, u as Y, K as W, w as J, a as X, b as Z, U as ee, p as te } from "./index-DEW6CGpb.js";
2
+ import { g as G, u as Y, K as W, w as J, a as X, b as Z, U as ee, p as te } from "./index-DET3dQtT.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
4
  import { useState as l, useCallback as h, useEffect as I, 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 = {
@@ -1,12 +1,12 @@
1
- import { jsx as i, jsxs as G, Fragment as ye } from "react/jsx-runtime";
2
- import { u as ge, g as pe, v as be, J as Oe, c as Ne, m as Te, h as Ie, f as Ee, e as Ae, d as ve, R as _e, H as Se, s as K, b as Fe, i as Y, t as x, a as Re, U as P, S as Ue, $ as Ce, p as Be, G as Le, O as De } from "./index-DEW6CGpb.js";
1
+ import { jsx as i, jsxs as z, Fragment as ye } from "react/jsx-runtime";
2
+ import { u as ge, g as pe, E as be, J as Oe, c as Ne, m as Te, h as Ee, f as Ie, e as Ae, d as _e, R as ve, H as Se, s as K, b as Fe, i as x, t as P, a as Re, U as G, S as Ue, $ as Ce, p as Be, Y as Le, O as De } from "./index-DET3dQtT.js";
3
3
  import { useQueryClient as Me, useQuery as N } from "@tanstack/react-query";
4
4
  import { useState as Q, useMemo as d, useCallback as l } from "react";
5
5
  const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_modalHeading__wnTmA", we = "FormsTable-module_customAccordianItem__isszs", T = {
6
6
  formsTableBody: ke,
7
7
  modalHeading: qe,
8
8
  customAccordianItem: we
9
- }, He = "startConsultation", Ge = ({
9
+ }, He = "startConsultation", ze = ({
10
10
  episodeOfCareUuids: R,
11
11
  encounterUuids: u,
12
12
  config: J,
@@ -19,7 +19,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
19
19
  forms: p
20
20
  } = J ?? {}, ee = be(
21
21
  De.EDIT_OBSERVATIONS
22
- ), { userPrivileges: b } = Oe(), I = ee && !X && !!y, B = Ne(
22
+ ), { userPrivileges: b } = Oe(), E = ee && !X && !!y, B = Ne(
23
23
  R,
24
24
  u
25
25
  ), re = Me(), {
@@ -41,7 +41,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
41
41
  )), e;
42
42
  }, [L, u, p]), { data: O = [] } = N({
43
43
  queryKey: ["observationForms"],
44
- queryFn: () => Ie()
44
+ queryFn: () => Ee()
45
45
  }), q = l(
46
46
  (e) => {
47
47
  const r = O.find((a) => a.name === e);
@@ -59,7 +59,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
59
59
  ), w = l(
60
60
  (e) => O.find((r) => r.name === e)?.uuid,
61
61
  [O]
62
- ), E = d(() => {
62
+ ), I = d(() => {
63
63
  if (s)
64
64
  return w(s.formName);
65
65
  }, [s, w]), {
@@ -68,26 +68,26 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
68
68
  isError: se,
69
69
  error: A
70
70
  } = N({
71
- queryKey: ["formMetadata", E],
72
- queryFn: () => Ee(E),
73
- enabled: !!E && g
71
+ queryKey: ["formMetadata", I],
72
+ queryFn: () => Ie(I),
73
+ enabled: !!I && g
74
74
  }), {
75
- data: v,
75
+ data: _,
76
76
  isLoading: ne,
77
77
  isError: ie,
78
- error: _
78
+ error: v
79
79
  } = N({
80
80
  queryKey: ["formsEncounterFHIR", s?.encounterUuid],
81
81
  queryFn: () => Ae(s.encounterUuid),
82
82
  enabled: !!s?.encounterUuid && g
83
83
  });
84
- ve(
84
+ _e(
85
85
  (e) => {
86
86
  e.patientUUID === c && e.updatedConcepts.size > 0 && (ae(), re.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
87
87
  },
88
88
  [c]
89
89
  );
90
- const de = d(() => !v?.entry || !s?.formName ? [] : v.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => _e(e) ? Se(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [v, s?.formName]), le = d(() => {
90
+ const de = d(() => !_?.entry || !s?.formName ? [] : _.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => ve(e) ? Se(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [_, s?.formName]), le = d(() => {
91
91
  if (!m?.schema) return;
92
92
  const e = [], r = (o) => {
93
93
  (o ?? []).forEach((a) => {
@@ -115,9 +115,9 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
115
115
  }, [m]), ue = d(() => {
116
116
  if (A)
117
117
  return K(A).message;
118
- if (_)
119
- return K(_).message;
120
- }, [A, _]), h = d(
118
+ if (v)
119
+ return K(v).message;
120
+ }, [A, v]), h = d(
121
121
  () => [
122
122
  { key: "recordedOn", header: n("RECORDED_ON") },
123
123
  { key: "recordedBy", header: n("RECORDED_BY") }
@@ -127,8 +127,8 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
127
127
  () => [...h, { key: "actions", header: n("ACTIONS") }],
128
128
  [h, n]
129
129
  ), ce = l(
130
- (e) => I && e.some((r) => f(r)) ? H : h,
131
- [I, f, H, h]
130
+ (e) => E && e.some((r) => f(r)) ? H : h,
131
+ [E, f, H, h]
132
132
  ), fe = h, he = d(
133
133
  () => [
134
134
  { key: "recordedOn", sortable: !0 },
@@ -162,7 +162,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
162
162
  ).sort((r, o) => r.formName.localeCompare(o.formName));
163
163
  }, [k, n]), $ = l((e) => {
164
164
  C(e), U(!0);
165
- }, []), j = l(() => {
165
+ }, []), Y = l(() => {
166
166
  U(!1), C(null);
167
167
  }, []), S = l((e) => {
168
168
  globalThis.dispatchEvent(
@@ -176,7 +176,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
176
176
  }
177
177
  })
178
178
  );
179
- }, []), z = l(
179
+ }, []), j = l(
180
180
  (e, r) => {
181
181
  switch (r) {
182
182
  case "recordedOn":
@@ -185,14 +185,14 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
185
185
  return e.recordedBy;
186
186
  case "actions":
187
187
  return f(e) ? /* @__PURE__ */ i(
188
- Y,
188
+ x,
189
189
  {
190
190
  label: n("EDIT_OBSERVATION_FORM"),
191
191
  kind: "ghost",
192
192
  size: "sm",
193
193
  testId: `edit-form-${e.encounterUuid}`,
194
194
  onClick: () => S(e),
195
- children: /* @__PURE__ */ i(x, {})
195
+ children: /* @__PURE__ */ i(P, {})
196
196
  }
197
197
  ) : null;
198
198
  default:
@@ -201,9 +201,9 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
201
201
  },
202
202
  [$, S, f, n]
203
203
  );
204
- return /* @__PURE__ */ G(ye, { children: [
204
+ return /* @__PURE__ */ z(ye, { children: [
205
205
  /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: D || M || V.length === 0 || B ? /* @__PURE__ */ i(
206
- P,
206
+ G,
207
207
  {
208
208
  headers: fe,
209
209
  ariaLabel: n("FORMS_HEADING"),
@@ -211,7 +211,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
211
211
  loading: D,
212
212
  errorStateMessage: M ? oe?.message : void 0,
213
213
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
214
- renderCell: z,
214
+ renderCell: j,
215
215
  className: T.formsTableBody,
216
216
  dataTestId: "forms-table"
217
217
  }
@@ -225,7 +225,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
225
225
  testId: `accordian-title-${o}`,
226
226
  open: r === 0,
227
227
  children: /* @__PURE__ */ i(
228
- P,
228
+ G,
229
229
  {
230
230
  headers: t,
231
231
  ariaLabel: n("FORMS_HEADING"),
@@ -234,7 +234,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
234
234
  errorStateMessage: "",
235
235
  sortable: he,
236
236
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
237
- renderCell: z,
237
+ renderCell: j,
238
238
  className: T.formsTableBody,
239
239
  dataTestId: `forms-table-${o}`
240
240
  }
@@ -249,20 +249,20 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
249
249
  id: "modalIdForActionAreaLayout",
250
250
  portalId: "main-display-area",
251
251
  open: g,
252
- onRequestClose: j,
253
- modalHeading: /* @__PURE__ */ G("div", { className: T.modalHeading, children: [
252
+ onRequestClose: Y,
253
+ modalHeading: /* @__PURE__ */ z("div", { className: T.modalHeading, children: [
254
254
  /* @__PURE__ */ i("span", { children: s.formName }),
255
- I && f(s) && /* @__PURE__ */ i(
256
- Y,
255
+ E && f(s) && /* @__PURE__ */ i(
256
+ x,
257
257
  {
258
258
  label: n("EDIT_OBSERVATION_FORM"),
259
259
  kind: "ghost",
260
260
  size: "sm",
261
261
  testId: `edit-form-modal-${s.encounterUuid}`,
262
262
  onClick: () => {
263
- j(), S(s);
263
+ Y(), S(s);
264
264
  },
265
- children: /* @__PURE__ */ i(x, {})
265
+ children: /* @__PURE__ */ i(P, {})
266
266
  }
267
267
  )
268
268
  ] }),
@@ -289,5 +289,5 @@ const ke = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_mo
289
289
  ] });
290
290
  };
291
291
  export {
292
- Ge as default
292
+ ze as default
293
293
  };
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DmchN3Iw.js";
2
- import { bN as d, bO as f, bP as e } from "./index-DEW6CGpb.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-AgEWaI9q.js";
2
+ import { bN as d, bO as f, bP as e } from "./index-DET3dQtT.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -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-DmchN3Iw.js";
2
- import { bN as v, bO as C, bP as e } from "./index-DEW6CGpb.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-AgEWaI9q.js";
2
+ import { bN as v, bO as C, bP as e } from "./index-DET3dQtT.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
1
  import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
- import { g as B, K as V, u as N, j as M, k, d as x, x as Q, A as G, _ as j, l as w, U as z, M as H, q as A, n as P, o as J, I as W, r as X, y as Z, z as ee } from "./index-DEW6CGpb.js";
2
+ import { g as B, K as V, u as N, j as M, k, d as x, x as Q, A as G, _ as j, l as w, U as H, M as z, q as A, n as P, v as J, I as W, o as X, r as Z, y as ee } from "./index-DET3dQtT.js";
3
3
  import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
4
4
  import { useRef as se, useEffect as $, useMemo as E } from "react";
5
5
  const D = (a, n, d, l, b, r) => {
@@ -23,7 +23,7 @@ const D = (a, n, d, l, b, r) => {
23
23
  )), o === "PDF" && (i = /* @__PURE__ */ u(ee, { id: `${s}-pdf`, src: s }));
24
24
  const m = b("OBSERVATIONS_RECORDED_BY", {
25
25
  provider: t.provider
26
- }), p = a.display, y = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${y}-${p}-${d}-${n}` : `${y}-${p}-${d}-${n}`;
26
+ }), p = a.display, v = a.observationValue?.isAbnormal ? "abnormal-obs" : "obs", c = l ? `${l}-${v}-${p}-${d}-${n}` : `${v}-${p}-${d}-${n}`;
27
27
  return /* @__PURE__ */ u(
28
28
  W,
29
29
  {
@@ -60,7 +60,7 @@ const D = (a, n, d, l, b, r) => {
60
60
  hideThumbnail: d
61
61
  }) => {
62
62
  const { t: l } = N(), b = (r, t, s) => {
63
- const o = H(r.encounterDetails, l);
63
+ const o = z(r.encounterDetails, l);
64
64
  return /* @__PURE__ */ S(
65
65
  A,
66
66
  {
@@ -132,30 +132,30 @@ const D = (a, n, d, l, b, r) => {
132
132
  } else e.isError || r.current.delete(h);
133
133
  });
134
134
  }, [i, d]);
135
- const m = E(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = E(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = E(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
135
+ const m = E(() => i.map((e) => e.data?.uuid).filter((e) => !!e), [i]), p = E(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), v = E(() => d.length === 0 ? !0 : i.every((e) => !e.isLoading), [i, d.length]), {
136
136
  data: c,
137
137
  isLoading: F,
138
- isError: g,
139
- refetch: T
138
+ isError: T,
139
+ refetch: g
140
140
  } = te({
141
141
  queryKey: le(t, p),
142
142
  queryFn: () => k(t, p),
143
- enabled: !!t && p.length > 0 && y
143
+ enabled: !!t && p.length > 0 && v
144
144
  });
145
145
  x(
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
+ ) && g();
150
150
  },
151
- [t, T]
151
+ [t, g]
152
152
  ), $(() => {
153
- g && s({
153
+ T && s({
154
154
  title: o("ERROR_DEFAULT_TITLE"),
155
155
  message: o("ERROR_FETCHING_OBSERVATIONS"),
156
156
  type: "error"
157
157
  });
158
- }, [g]);
158
+ }, [T]);
159
159
  const O = E(() => {
160
160
  if (!c) return [];
161
161
  const e = Q(c), h = G(e);
@@ -164,12 +164,12 @@ const D = (a, n, d, l, b, r) => {
164
164
  { key: "name", header: "name" },
165
165
  { key: "value", header: "value" },
166
166
  { key: "form", header: "form" }
167
- ], _ = F || !y, f = g && y, U = (!c || c.entry?.length === 0 || p.length === 0) && y, C = f ? o("ERROR_FETCHING_OBSERVATIONS") : null, K = U ? o("NO_OBSERVATIONS_FOUND") : void 0, Y = O.length > 0 && !_ && !f, R = n.titleTranslationKey, v = R ? o(R) : "";
167
+ ], _ = F || !v, f = T && v, U = (!c || c.entry?.length === 0 || p.length === 0) && v, C = f ? o("ERROR_FETCHING_OBSERVATIONS") : null, K = U ? o("NO_OBSERVATIONS_FOUND") : void 0, Y = O.length > 0 && !_ && !f, R = n.titleTranslationKey, y = R ? o(R) : "";
168
168
  return /* @__PURE__ */ S(
169
169
  "div",
170
170
  {
171
171
  id: "observations",
172
- "data-testid": R ? `observations-${v}` : "observations",
172
+ "data-testid": R ? `observations-${y}` : "observations",
173
173
  "aria-label": "observations-aria-label",
174
174
  className: I.observations,
175
175
  children: [
@@ -177,21 +177,21 @@ const D = (a, n, d, l, b, r) => {
177
177
  w,
178
178
  {
179
179
  id: "observations-title",
180
- testId: R ? `observations-title-${v}` : "observations-title",
181
- title: v,
180
+ testId: R ? `observations-title-${y}` : "observations-title",
181
+ title: y,
182
182
  className: I.title,
183
- children: /* @__PURE__ */ u("p", { children: v })
183
+ children: /* @__PURE__ */ u("p", { children: y })
184
184
  }
185
185
  ),
186
186
  Y ? /* @__PURE__ */ u(
187
187
  oe,
188
188
  {
189
189
  groupedData: O,
190
- title: v,
190
+ title: y,
191
191
  hideThumbnail: b
192
192
  }
193
193
  ) : /* @__PURE__ */ u(
194
- z,
194
+ H,
195
195
  {
196
196
  headers: L,
197
197
  rows: [],
@@ -1,4 +1,4 @@
1
- import { bQ as we, bR as z, bS as xt, bT as B, bO as q, bP as y, bU as Ro, bV as ye, bW as R, bX as _, bY as k, bZ as N, b_ as A, b$ as bs, c0 as ir, c1 as $e, c2 as U, c3 as Hn, c4 as Vn, c5 as dt, c6 as D, c7 as xs, c8 as cn, c9 as Be, ca as ws, cb as qt, cc as zt, cd as $s, ce as Cs, cf as $n, cg as Ss, ch as Nr, ci as Bt, cj as zo, ck as ks, cl as Es, cm as j, cn as Ur, co as Ms, cp as Ds, cq as sr, cr as As, cs as Ts, ct as zn, cu as Fs, cv as Is, cw as Z, cx as Ps, cy as Os } from "./index-DEW6CGpb.js";
1
+ import { bQ as we, bR as z, bS as xt, bT as B, bO as q, bP as y, bU as Ro, bV as ye, bW as R, bX as _, bY as k, bZ as N, b_ as A, b$ as bs, c0 as ir, c1 as $e, c2 as U, c3 as Hn, c4 as Vn, c5 as dt, c6 as D, c7 as xs, c8 as cn, c9 as Be, ca as ws, cb as qt, cc as zt, cd as $s, ce as Cs, cf as $n, cg as Ss, ch as Nr, ci as Bt, cj as zo, ck as ks, cl as Es, cm as j, cn as Ur, co as Ms, cp as Ds, cq as sr, cr as As, cs as Ts, ct as zn, cu as Fs, cv as Is, cw as Z, cx as Ps, cy as Os } from "./index-DET3dQtT.js";
2
2
  var Ls = (e) => e != null, qs = (e) => e.filter(Ls);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1,4 +1,4 @@
1
- import { bL as i, bM as o } from "./index-DEW6CGpb.js";
1
+ import { bL as i, bM as o } from "./index-DET3dQtT.js";
2
2
  import "react";
3
3
  import "react/jsx-runtime";
4
4
  import "@tanstack/react-query";