@bahmni/clinical-app 0.0.1-dev.464 → 0.0.1-dev.465

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 n, jsxs as u, Fragment as pe } from "react/jsx-runtime";
2
- import { u as _e, a as Ee, z as ge, s as Ne, N as Ce, K as fe, w as Ae, O as w, t as Ie, r as Le, b as be, h as De, R as ye, p as we, q as Q, J as ve, L as Oe, $ as Se, c as Re, d as Ue, Q as J, e as ee } from "./index-CtWcMAiX.js";
2
+ import { u as _e, a as Ee, z as ge, s as Ne, N as Ce, K as fe, w as Ae, O as w, t as Ie, r as Le, b as be, h as De, R as ye, p as we, q as Q, J as ve, L as Oe, $ as Se, c as Re, d as Ue, Q as J, e as ee } from "./index-CbuA4ZA9.js";
3
3
  import { useQuery as Me } from "@tanstack/react-query";
4
4
  import { useState as h, useRef as $e, useEffect as _, useMemo as E, useCallback as T } from "react";
5
5
  const ke = "DocumentsTable-module_documentsTableBody__6iR3w", He = "DocumentsTable-module_viewAttachmentsLink__aQ1on", Be = "DocumentsTable-module_documentViewerContainer__F5m8D", ze = "DocumentsTable-module_printContainer__rtarJ", Ve = "DocumentsTable-module_attachmentItem__17KA7", We = "DocumentsTable-module_attachmentCounter__WFiI3", qe = "DocumentsTable-module_attachmentError__RI4U2", xe = "DocumentsTable-module_documentIframe__ptq5I", Fe = "DocumentsTable-module_attachmentContent__IaCEe", Ge = "DocumentsTable-module_attachmentLoading__FAR6p", Ke = "DocumentsTable-module_hiddenWhileLoading__IxocW", Pe = "DocumentsTable-module_documentImage__KQVgS", je = "DocumentsTable-module_header__345GY", Qe = "DocumentsTable-module_documentTypeCell__uWGM8", Je = "DocumentsTable-module_printAllButton__IVYUW", Ye = "DocumentsTable-module_attachmentHeader__yI2xn", o = {
@@ -1,38 +1,38 @@
1
1
  import { jsx as n, jsxs as H, Fragment as ne } from "react/jsx-runtime";
2
- import { a as ie, u as de, s as le, Z as me, f as ue, G as ce, y as fe, v as ye, w as Ne, k as pe, M as ge, g as he, h as be, N as Ae, q as K, C as $, b as Oe, $ as V, i as Te, j as Ie, c as _e, A as Ce, l as Ee } from "./index-CtWcMAiX.js";
2
+ import { a as ie, u as de, s as le, Z as me, f as ue, G as ce, y as fe, v as ye, w as Ne, k as be, M as pe, g as ge, h as he, N as Ae, q as K, C as $, b as Oe, $ as V, i as Te, j as Ie, c as _e, A as Ee, l as Ce } from "./index-CbuA4ZA9.js";
3
3
  import { useQueryClient as ve, useQuery as I } from "@tanstack/react-query";
4
4
  import { useState as G, useMemo as i, useCallback as d } from "react";
5
- const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_modalHeading__wnTmA", Fe = "FormsTable-module_customAccordianItem__isszs", g = {
5
+ const Le = "FormsTable-module_formsTableBody__SvGha", Re = "FormsTable-module_modalHeading__wnTmA", Be = "FormsTable-module_customAccordianItem__isszs", p = {
6
6
  formsTableBody: Le,
7
- modalHeading: Be,
8
- customAccordianItem: Fe
9
- }, Se = ({
7
+ modalHeading: Re,
8
+ customAccordianItem: Be
9
+ }, De = ({
10
10
  episodeOfCareUuids: _,
11
11
  encounterUuids: l,
12
12
  config: j,
13
13
  disableActions: x = !1,
14
14
  activeEncounterUuid: y = null
15
15
  }) => {
16
- const { t: o } = ie(), m = de(), [h, C] = G(!1), [t, E] = G(null), {
16
+ const { t: o } = ie(), m = de(), [g, E] = G(!1), [t, C] = G(null), {
17
17
  numberOfVisits: z,
18
18
  hideThumbnail: Q = !1,
19
19
  forms: N
20
20
  } = j ?? {}, Z = le(
21
- Ee.EDIT_OBSERVATIONS
22
- ), { userPrivileges: p } = me(), b = Z && !x && !!y, v = ue(
21
+ Ce.EDIT_OBSERVATIONS
22
+ ), { userPrivileges: b } = me(), h = Z && !x && !!y, v = ue(
23
23
  _,
24
24
  l
25
25
  ), P = ve(), {
26
26
  data: L = [],
27
- isLoading: B,
28
- isError: F,
27
+ isLoading: R,
28
+ isError: B,
29
29
  error: Y,
30
30
  refetch: J
31
31
  } = I({
32
32
  queryKey: ["forms", m, _],
33
33
  queryFn: () => ce(m, void 0, z),
34
34
  enabled: !!m && !v
35
- }), R = i(() => {
35
+ }), F = i(() => {
36
36
  let e = L;
37
37
  return l && l.length > 0 && (e = e.filter(
38
38
  (r) => l.includes(r.encounterUuid)
@@ -42,22 +42,22 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
42
42
  }, [L, l, N]), { data: M = [] } = I({
43
43
  queryKey: ["observationForms"],
44
44
  queryFn: () => fe()
45
- }), U = d(
45
+ }), S = d(
46
46
  (e) => {
47
47
  const r = M.find(
48
48
  (s) => s.name.toLowerCase() === e.toLowerCase()
49
49
  );
50
50
  if (!r?.privileges || r.privileges.length === 0) return !0;
51
- if (!p || p.length === 0) return !1;
52
- const a = new Set(p.map((s) => s.name));
51
+ if (!b || b.length === 0) return !1;
52
+ const a = new Set(b.map((s) => s.name));
53
53
  return r.privileges.some(
54
54
  (s) => a.has(s.privilegeName) && s.editable
55
55
  );
56
56
  },
57
- [M, p]
57
+ [M, b]
58
58
  ), u = d(
59
- (e) => !y || e.encounterUuid !== y ? !1 : U(e.formName),
60
- [y, U]
59
+ (e) => !y || e.encounterUuid !== y ? !1 : S(e.formName),
60
+ [y, S]
61
61
  ), {
62
62
  data: A,
63
63
  isLoading: W,
@@ -66,7 +66,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
66
66
  } = I({
67
67
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
68
68
  queryFn: () => ye(t.encounterUuid),
69
- enabled: !!t?.encounterUuid && h
69
+ enabled: !!t?.encounterUuid && g
70
70
  });
71
71
  Ne(
72
72
  (e) => {
@@ -74,29 +74,29 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
74
74
  },
75
75
  [m]
76
76
  );
77
- const ee = i(() => !A?.entry || !t?.formName ? [] : A.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => pe(e) ? ge(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [A, t?.formName]), re = i(() => {
77
+ const ee = i(() => !A?.entry || !t?.formName ? [] : A.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => be(e) ? pe(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [A, t?.formName]), re = i(() => {
78
78
  if (O)
79
- return he(O).message;
79
+ return ge(O).message;
80
80
  }, [O]), c = i(
81
81
  () => [
82
82
  { key: "recordedOn", header: o("RECORDED_ON") },
83
83
  { key: "recordedBy", header: o("RECORDED_BY") }
84
84
  ],
85
85
  [o]
86
- ), D = i(
86
+ ), U = i(
87
87
  () => [...c, { key: "actions", header: o("ACTIONS") }],
88
88
  [c, o]
89
89
  ), ae = d(
90
- (e) => b && e.some((r) => u(r)) ? D : c,
91
- [b, u, D, c]
90
+ (e) => h && e.some((r) => u(r)) ? U : c,
91
+ [h, u, U, c]
92
92
  ), oe = c, te = i(
93
93
  () => [
94
94
  { key: "recordedOn", sortable: !0 },
95
95
  { key: "recordedBy", sortable: !0 }
96
96
  ],
97
97
  []
98
- ), S = i(() => {
99
- const e = R.reduce(
98
+ ), D = i(() => {
99
+ const e = F.reduce(
100
100
  (r, a) => {
101
101
  const s = a.formName;
102
102
  r[s] ??= [];
@@ -104,7 +104,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
104
104
  return r[s].push({
105
105
  id: a.encounterUuid,
106
106
  formName: a.formName,
107
- recordedOn: be(a.encounterDateTime, o, !0).formattedResult,
107
+ recordedOn: he(a.encounterDateTime, o, !0).formattedResult,
108
108
  recordedBy: f ?? "--",
109
109
  encounterDateTime: a.encounterDateTime,
110
110
  encounterUuid: a.encounterUuid
@@ -120,10 +120,10 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
120
120
  )
121
121
  })
122
122
  ).sort((r, a) => r.formName.localeCompare(a.formName));
123
- }, [R, o]), k = d((e) => {
124
- E(e), C(!0);
123
+ }, [F, o]), k = d((e) => {
124
+ C(e), E(!0);
125
125
  }, []), w = d(() => {
126
- C(!1), E(null);
126
+ E(!1), C(null);
127
127
  }, []), T = d((e) => {
128
128
  Ae({
129
129
  context: {
@@ -159,26 +159,26 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
159
159
  [k, T, u, o]
160
160
  );
161
161
  return /* @__PURE__ */ H(ne, { children: [
162
- /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: B || F || S.length === 0 || v ? /* @__PURE__ */ n(
162
+ /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: R || B || D.length === 0 || v ? /* @__PURE__ */ n(
163
163
  V,
164
164
  {
165
165
  headers: oe,
166
166
  ariaLabel: o("FORMS_HEADING"),
167
167
  rows: [],
168
- loading: B,
169
- errorStateMessage: F ? Y?.message : void 0,
168
+ loading: R,
169
+ errorStateMessage: B ? Y?.message : void 0,
170
170
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
171
171
  renderCell: q,
172
- className: g.formsTableBody,
172
+ className: p.formsTableBody,
173
173
  dataTestId: "forms-table"
174
174
  }
175
- ) : /* @__PURE__ */ n(Te, { align: "start", children: S.map((e, r) => {
175
+ ) : /* @__PURE__ */ n(Te, { align: "start", children: D.map((e, r) => {
176
176
  const { formName: a, records: s } = e, f = ae(s);
177
177
  return /* @__PURE__ */ n(
178
178
  Ie,
179
179
  {
180
180
  title: a,
181
- className: g.customAccordianItem,
181
+ className: p.customAccordianItem,
182
182
  testId: `accordian-title-${a}`,
183
183
  open: r === 0,
184
184
  children: /* @__PURE__ */ n(
@@ -192,7 +192,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
192
192
  sortable: te,
193
193
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
194
194
  renderCell: q,
195
- className: g.formsTableBody,
195
+ className: p.formsTableBody,
196
196
  dataTestId: `forms-table-${a}`
197
197
  }
198
198
  )
@@ -200,16 +200,16 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
200
200
  a
201
201
  );
202
202
  }) }) }),
203
- h && t && /* @__PURE__ */ n(
203
+ g && t && /* @__PURE__ */ n(
204
204
  _e,
205
205
  {
206
206
  id: "modalIdForActionAreaLayout",
207
207
  portalId: "main-display-area",
208
- open: h,
208
+ open: g,
209
209
  onRequestClose: w,
210
- modalHeading: /* @__PURE__ */ H("div", { className: g.modalHeading, children: [
210
+ modalHeading: /* @__PURE__ */ H("div", { className: p.modalHeading, children: [
211
211
  /* @__PURE__ */ n("span", { children: t.formName }),
212
- b && u(t) && /* @__PURE__ */ n(
212
+ h && u(t) && /* @__PURE__ */ n(
213
213
  K,
214
214
  {
215
215
  label: o("EDIT_OBSERVATION_FORM"),
@@ -228,7 +228,7 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
228
228
  size: "md",
229
229
  testId: "form-details-modal",
230
230
  children: /* @__PURE__ */ n(
231
- Ce,
231
+ Ee,
232
232
  {
233
233
  observations: ee,
234
234
  isLoading: W,
@@ -245,5 +245,5 @@ const Le = "FormsTable-module_formsTableBody__SvGha", Be = "FormsTable-module_mo
245
245
  ] });
246
246
  };
247
247
  export {
248
- Se as default
248
+ De as default
249
249
  };
@@ -1,5 +1,5 @@
1
- import { c as s, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CU99DV8p.js";
2
- import { cm as d, cn as f, co as e } from "./index-CtWcMAiX.js";
1
+ import { c as s, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DSpEOl1B.js";
2
+ import { cm as d, cn as f, co as e } from "./index-CbuA4ZA9.js";
3
3
  var p = (a) => {
4
4
  const [r, o] = s({
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-CU99DV8p.js";
2
- import { cm as v, cn as C, co as e } from "./index-CtWcMAiX.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-DSpEOl1B.js";
2
+ import { cm as v, cn as C, co as e } from "./index-CbuA4ZA9.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 n } from "react/jsx-runtime";
2
- import { u as z, z as Q, a as B, m as H, f as M, W as G, n as j, w as P, o as W, x as J, B as Y, D as X, p as ee, $ as ae, E as se, F as U, H as te, I as re, h as ie, P as oe, S as ne, T as de, U as le } from "./index-CtWcMAiX.js";
2
+ import { u as z, z as Q, a as B, m as G, f as H, W as M, n as j, w as P, o as W, x as J, B as Y, D as X, p as ee, $ as ae, E as se, F as U, H as te, I as re, h as ie, P as oe, S as ne, T as de, U as le } from "./index-CbuA4ZA9.js";
3
3
  import { useQueries as ue, useQuery as ce } from "@tanstack/react-query";
4
4
  import { useRef as pe, useEffect as L, useMemo as g } from "react";
5
5
  const me = "Observations-module_observations__RKSyo", be = "Observations-module_title__TJL3z", he = "Observations-module_wrapper__muk2L", ve = "Observations-module_secondary__14nuS", O = {
@@ -135,7 +135,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
135
135
  } = d, p = pe(/* @__PURE__ */ new Set()), i = z(), { addNotification: m } = Q(), { t: u } = B(), b = ue({
136
136
  queries: c.map((a) => ({
137
137
  queryKey: Re(a),
138
- queryFn: () => H(a),
138
+ queryFn: () => G(a),
139
139
  enabled: !!a
140
140
  }))
141
141
  });
@@ -147,7 +147,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
147
147
  type: "error"
148
148
  }), p.current.add(0)) : !a && y && p.current.clear();
149
149
  }, [b, m, u]);
150
- const T = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...T, ...t])], [T, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter", w = M(
150
+ const T = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...T, ...t])], [T, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter", w = H(
151
151
  l,
152
152
  o
153
153
  ), {
@@ -162,7 +162,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
162
162
  o,
163
163
  e
164
164
  ),
165
- queryFn: () => R ? G(
165
+ queryFn: () => R ? M(
166
166
  i,
167
167
  h,
168
168
  o
@@ -1,4 +1,4 @@
1
- import { cp as we, cq as z, cr as xt, cs as B, cn as q, co as y, ct as Ro, cu as ye, cv as R, cw as _, cx as k, cy as N, cz as A, cA as bs, cB as ir, cC as $e, cD as U, cE as Hn, cF as Vn, cG as dt, cH as D, cI as xs, cJ as cn, cK as Be, cL as ws, cM as qt, cN as zt, cO as $s, cP as Cs, cQ as $n, cR as Ss, cS as Nr, cT as Bt, cU as zo, cV as ks, cW as Es, cX as j, cY as Ur, cZ as Ms, c_ as Ds, c$ as sr, d0 as As, d1 as Ts, d2 as zn, d3 as Fs, d4 as Is, d5 as Z, d6 as Ps, d7 as Ls } from "./index-CtWcMAiX.js";
1
+ import { cp as we, cq as z, cr as xt, cs as B, cn as q, co as y, ct as Ro, cu as ye, cv as R, cw as _, cx as k, cy as N, cz as A, cA as bs, cB as ir, cC as $e, cD as U, cE as Hn, cF as Vn, cG as dt, cH as D, cI as xs, cJ as cn, cK as Be, cL as ws, cM as qt, cN as zt, cO as $s, cP as Cs, cQ as $n, cR as Ss, cS as Nr, cT as Bt, cU as zo, cV as ks, cW as Es, cX as j, cY as Ur, cZ as Ms, c_ as Ds, c$ as sr, d0 as As, d1 as Ts, d2 as zn, d3 as Fs, d4 as Is, d5 as Z, d6 as Ps, d7 as Ls } from "./index-CbuA4ZA9.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1,4 +1,4 @@
1
- import { ck as i, cl as o } from "./index-CtWcMAiX.js";
1
+ import { ck as i, cl as o } from "./index-CbuA4ZA9.js";
2
2
  import "react/jsx-runtime";
3
3
  import "@tanstack/react-query";
4
4
  import "react";
@@ -1,12 +1,12 @@
1
1
  import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import { a as r, d8 as l, d9 as o, da as c, bw as m, bx as b, db as g, dc as h, dd as p, a_ as _ } from "./index-CtWcMAiX.js";
2
+ import { a as r, d8 as l, d9 as o, da as c, bw as m, bx as b, db as h, dc as g, dd as p, a_ as _ } from "./index-CbuA4ZA9.js";
3
3
  import "@tanstack/react-query";
4
4
  import { Suspense as u } from "react";
5
5
  const E = "index-module_loading__eyE2k", $ = "index-module_message__95HmH", f = "index-module_panel__8VJh2", s = {
6
6
  loading: E,
7
7
  message: $,
8
8
  panel: f
9
- }, P = ({ extensions: i }) => {
9
+ }, y = ({ extensions: i }) => {
10
10
  const { t: n } = r();
11
11
  return i.length === 0 ? null : /* @__PURE__ */ t(l, { children: [
12
12
  /* @__PURE__ */ e(
@@ -37,8 +37,8 @@ const E = "index-module_loading__eyE2k", $ = "index-module_message__95HmH", f =
37
37
  ))
38
38
  }
39
39
  ),
40
- /* @__PURE__ */ e(g, { children: i.map((a) => {
41
- const d = h(
40
+ /* @__PURE__ */ e(h, { children: i.map((a) => {
41
+ const d = g(
42
42
  a.extensionParams?.searchHandler ?? ""
43
43
  )?.component;
44
44
  return /* @__PURE__ */ e(
@@ -77,5 +77,5 @@ const E = "index-module_loading__eyE2k", $ = "index-module_message__95HmH", f =
77
77
  ] });
78
78
  };
79
79
  export {
80
- P as default
80
+ y as default
81
81
  };