@bahmni/clinical-app 0.0.1-dev.438 → 0.0.1-dev.439

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 d, jsxs as h, Fragment as x } from "react/jsx-runtime";
2
- import { d as G, u as W, z as Y, R as J, s as X, h as Z, $ as ee, a as te } from "./index-oWgjP_o2.js";
2
+ import { d as G, u as W, z as Y, R as J, s as X, h as Z, $ as ee, a as te } from "./index-CyvuKZwu.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
4
  import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
5
5
  const ne = "DocumentsTable-module_documentsTableBody__6iR3w", oe = "DocumentsTable-module_viewAttachmentsLink__aQ1on", de = "DocumentsTable-module_documentViewerContainer__F5m8D", re = "DocumentsTable-module_attachmentItem__17KA7", se = "DocumentsTable-module_attachmentCounter__WFiI3", me = "DocumentsTable-module_attachmentError__RI4U2", ce = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", r = {
@@ -1,45 +1,45 @@
1
1
  import { jsx as n, jsxs as q, Fragment as ne } from "react/jsx-runtime";
2
- import { u as ie, d as de, g as le, k as me, H as ue, L as ce, b as fe, A as ye, w as ge, M as he, l as Ne, c as Oe, h as Te, O as V, x as $, s as pe, $ as x, W as be, q as Ie, a as Ae, e as Ee, J as _e } from "./index-oWgjP_o2.js";
2
+ import { u as ie, d as de, g as le, k as me, H as ue, L as ce, b as fe, A as ye, w as ge, M as he, l as Ne, c as Te, h as pe, e as V, x as $, s as Oe, $ as x, W as be, q as Ie, a as Ae, f as Ee, J as _e } from "./index-CyvuKZwu.js";
3
3
  import { useQueryClient as Le, useQuery as A } from "@tanstack/react-query";
4
4
  import { useState as K, useMemo as i, useCallback as d } from "react";
5
- const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_modalHeading__wnTmA", Be = "FormsTable-module_customAccordianItem__isszs", N = {
6
- formsTableBody: Re,
7
- modalHeading: ve,
8
- customAccordianItem: Be
9
- }, Ce = "startConsultation", Se = ({
5
+ const ve = "FormsTable-module_formsTableBody__SvGha", Ce = "FormsTable-module_modalHeading__wnTmA", Re = "FormsTable-module_customAccordianItem__isszs", N = {
6
+ formsTableBody: ve,
7
+ modalHeading: Ce,
8
+ customAccordianItem: Re
9
+ }, Be = "startConsultation", Se = ({
10
10
  episodeOfCareUuids: E,
11
11
  encounterUuids: l,
12
12
  config: j,
13
13
  disableActions: z = !1,
14
14
  activeEncounterUuid: y = null
15
15
  }) => {
16
- const { t: o } = ie(), m = de(), [O, _] = K(!1), [s, L] = K(null), {
16
+ const { t: o } = ie(), m = de(), [T, _] = K(!1), [s, L] = K(null), {
17
17
  numberOfVisits: Q,
18
18
  hideThumbnail: G = !1,
19
19
  forms: g
20
20
  } = j ?? {}, J = le(
21
21
  _e.EDIT_OBSERVATIONS
22
- ), { userPrivileges: h } = me(), T = J && !z && !!y, R = ue(
22
+ ), { userPrivileges: h } = me(), p = J && !z && !!y, v = ue(
23
23
  E,
24
24
  l
25
25
  ), W = Le(), {
26
- data: v = [],
27
- isLoading: B,
28
- isError: C,
26
+ data: C = [],
27
+ isLoading: R,
28
+ isError: B,
29
29
  error: P,
30
30
  refetch: Y
31
31
  } = A({
32
32
  queryKey: ["forms", m, E],
33
33
  queryFn: () => ce(m, void 0, Q),
34
- enabled: !!m && !R
34
+ enabled: !!m && !v
35
35
  }), F = i(() => {
36
- let e = v;
36
+ let e = C;
37
37
  return l && l.length > 0 && (e = e.filter(
38
38
  (r) => l.includes(r.encounterUuid)
39
39
  )), Array.isArray(g) && g.length > 0 && (e = e.filter(
40
40
  (r) => g.some((a) => a.toLowerCase() === r.formName.toLowerCase())
41
41
  )), e;
42
- }, [v, l, g]), { data: M = [] } = A({
42
+ }, [C, l, g]), { data: M = [] } = A({
43
43
  queryKey: ["observationForms"],
44
44
  queryFn: () => fe()
45
45
  }), U = d(
@@ -59,14 +59,14 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
59
59
  (e) => !y || e.encounterUuid !== y ? !1 : U(e.formName),
60
60
  [y, U]
61
61
  ), {
62
- data: p,
62
+ data: O,
63
63
  isLoading: X,
64
64
  isError: Z,
65
65
  error: b
66
66
  } = A({
67
67
  queryKey: ["formsEncounterFHIR", s?.encounterUuid],
68
68
  queryFn: () => ye(s.encounterUuid),
69
- enabled: !!s?.encounterUuid && O
69
+ enabled: !!s?.encounterUuid && T
70
70
  });
71
71
  ge(
72
72
  (e) => {
@@ -74,9 +74,9 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
74
74
  },
75
75
  [m]
76
76
  );
77
- const ee = i(() => !p?.entry || !s?.formName ? [] : p.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => he(e) ? Ne(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [p, s?.formName]), re = i(() => {
77
+ const ee = i(() => !O?.entry || !s?.formName ? [] : O.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => he(e) ? Ne(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [O, s?.formName]), re = i(() => {
78
78
  if (b)
79
- return Oe(b).message;
79
+ return Te(b).message;
80
80
  }, [b]), c = i(
81
81
  () => [
82
82
  { key: "recordedOn", header: o("RECORDED_ON") },
@@ -87,8 +87,8 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
87
87
  () => [...c, { key: "actions", header: o("ACTIONS") }],
88
88
  [c, o]
89
89
  ), ae = d(
90
- (e) => T && e.some((r) => u(r)) ? D : c,
91
- [T, u, D, c]
90
+ (e) => p && e.some((r) => u(r)) ? D : c,
91
+ [p, u, D, c]
92
92
  ), oe = c, se = i(
93
93
  () => [
94
94
  { key: "recordedOn", sortable: !0 },
@@ -104,7 +104,7 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
104
104
  return r[t].push({
105
105
  id: a.encounterUuid,
106
106
  formName: a.formName,
107
- recordedOn: Te(a.encounterDateTime, o, !0).formattedResult,
107
+ recordedOn: pe(a.encounterDateTime, o, !0).formattedResult,
108
108
  recordedBy: f ?? "--",
109
109
  encounterDateTime: a.encounterDateTime,
110
110
  encounterUuid: a.encounterUuid
@@ -126,7 +126,7 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
126
126
  _(!1), L(null);
127
127
  }, []), I = d((e) => {
128
128
  globalThis.dispatchEvent(
129
- new CustomEvent(Ce, {
129
+ new CustomEvent(Be, {
130
130
  detail: {
131
131
  editOnly: "observationForms",
132
132
  editTitle: "EDIT_OBSERVATION_FORM_TITLE",
@@ -140,7 +140,7 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
140
140
  (e, r) => {
141
141
  switch (r) {
142
142
  case "recordedOn":
143
- return /* @__PURE__ */ n(pe, { onClick: () => k(e), children: e.recordedOn });
143
+ return /* @__PURE__ */ n(Oe, { onClick: () => k(e), children: e.recordedOn });
144
144
  case "recordedBy":
145
145
  return e.recordedBy;
146
146
  case "actions":
@@ -162,14 +162,14 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
162
162
  [k, I, u, o]
163
163
  );
164
164
  return /* @__PURE__ */ q(ne, { children: [
165
- /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: B || C || S.length === 0 || R ? /* @__PURE__ */ n(
165
+ /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: R || B || S.length === 0 || v ? /* @__PURE__ */ n(
166
166
  x,
167
167
  {
168
168
  headers: oe,
169
169
  ariaLabel: o("FORMS_HEADING"),
170
170
  rows: [],
171
- loading: B,
172
- errorStateMessage: C ? P?.message : void 0,
171
+ loading: R,
172
+ errorStateMessage: B ? P?.message : void 0,
173
173
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
174
174
  renderCell: H,
175
175
  className: N.formsTableBody,
@@ -203,16 +203,16 @@ const Re = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
203
203
  a
204
204
  );
205
205
  }) }) }),
206
- O && s && /* @__PURE__ */ n(
206
+ T && s && /* @__PURE__ */ n(
207
207
  Ae,
208
208
  {
209
209
  id: "modalIdForActionAreaLayout",
210
210
  portalId: "main-display-area",
211
- open: O,
211
+ open: T,
212
212
  onRequestClose: w,
213
213
  modalHeading: /* @__PURE__ */ q("div", { className: N.modalHeading, children: [
214
214
  /* @__PURE__ */ n("span", { children: s.formName }),
215
- T && u(s) && /* @__PURE__ */ n(
215
+ p && u(s) && /* @__PURE__ */ n(
216
216
  V,
217
217
  {
218
218
  label: o("EDIT_OBSERVATION_FORM"),
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-D3wFjpju.js";
2
- import { bZ as d, b_ as f, b$ as e } from "./index-oWgjP_o2.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-9e9ECVpU.js";
2
+ import { bZ as d, b_ as f, b$ as e } from "./index-CyvuKZwu.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-D3wFjpju.js";
2
- import { bZ as v, b_ as C, b$ as e } from "./index-oWgjP_o2.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-9e9ECVpU.js";
2
+ import { bZ as v, b_ as C, b$ as e } from "./index-CyvuKZwu.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 I, jsx as o } from "react/jsx-runtime";
2
- import { d as Q, z as j, u as L, f as M, H as P, i as x, T as G, w as Y, P as J, U as W, F as X, j as Z, m as ee, $ as ae, n as se, o as F, B as te, Y as re, h as ie, p as ne, r as oe, t as de, v as le } from "./index-oWgjP_o2.js";
2
+ import { d as Q, z as j, u as L, i as G, H as M, O as P, T as x, w as Y, P as J, U as W, F as X, j as Z, m as ee, $ as ae, n as se, o as U, B as te, Y as re, h as ie, p as ne, r as oe, t as de, v as le } from "./index-CyvuKZwu.js";
3
3
  import { useQueries as ue, useQuery as ce } from "@tanstack/react-query";
4
4
  import { useRef as pe, useEffect as D, 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 = {
@@ -7,7 +7,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
7
7
  title: be,
8
8
  wrapper: he,
9
9
  secondary: ve
10
- }, U = (s, l, n, d, c, t) => {
10
+ }, F = (s, l, n, d, c, t) => {
11
11
  const r = te(s, l, c), e = r.value, p = re(e);
12
12
  let i = e;
13
13
  p === "Image" && (i = /* @__PURE__ */ o(
@@ -31,7 +31,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
31
31
  r.header.referenceRange && /* @__PURE__ */ o("span", { className: O.secondary, children: r.header.referenceRange })
32
32
  ] }), u = c("OBSERVATIONS_RECORDED_BY", {
33
33
  provider: r.provider
34
- }), b = s.effectiveDateTime ? ie(s.effectiveDateTime, c, !0).formattedResult : void 0, _ = /* @__PURE__ */ I("div", { className: O.wrapper, children: [
34
+ }), b = s.effectiveDateTime ? ie(s.effectiveDateTime, c, !0).formattedResult : void 0, f = /* @__PURE__ */ I("div", { className: O.wrapper, children: [
35
35
  /* @__PURE__ */ o("span", { children: u }),
36
36
  b && /* @__PURE__ */ o("span", { className: O.secondary, children: b })
37
37
  ] }), h = s.display, v = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs", R = d ? `${d}-${v}-${h}-${n}-${l}` : `${v}-${h}-${n}-${l}`;
@@ -40,7 +40,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
40
40
  {
41
41
  header: m,
42
42
  value: i,
43
- info: _,
43
+ info: f,
44
44
  id: R,
45
45
  testId: R,
46
46
  ariaLabel: R
@@ -48,13 +48,13 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
48
48
  `obs-${s.id}`
49
49
  );
50
50
  }, ye = (s, l, n, d, c, t, r) => /* @__PURE__ */ o(
51
- F,
51
+ U,
52
52
  {
53
53
  title: s.display,
54
54
  id: `grouped-obs-${s.display}-${d}`,
55
55
  open: n,
56
56
  children: s.members?.map(
57
- (e, p) => U(
57
+ (e, p) => F(
58
58
  e,
59
59
  p,
60
60
  c,
@@ -73,14 +73,14 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
73
73
  const { t: d } = L(), c = (t, r, e) => {
74
74
  const p = se(t.encounterDetails, d);
75
75
  return /* @__PURE__ */ I(
76
- F,
76
+ U,
77
77
  {
78
78
  title: p,
79
79
  id: `encounter-${t.encounterId}`,
80
80
  open: r,
81
81
  children: [
82
82
  t.observations.map(
83
- (i, m) => U(
83
+ (i, m) => F(
84
84
  i,
85
85
  m,
86
86
  e,
@@ -116,7 +116,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
116
116
  )
117
117
  }
118
118
  );
119
- }, Re = (s) => ["conceptUuid", s], fe = (s, l, n, d) => [
119
+ }, Re = (s) => ["conceptUuid", s], Te = (s, l, n, d) => [
120
120
  "observations",
121
121
  s,
122
122
  ...l,
@@ -135,7 +135,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
135
135
  } = d, p = pe(/* @__PURE__ */ new Set()), i = Q(), { addNotification: m } = j(), { t: u } = L(), b = ue({
136
136
  queries: c.map((a) => ({
137
137
  queryKey: Re(a),
138
- queryFn: () => M(a),
138
+ queryFn: () => G(a),
139
139
  enabled: !!a
140
140
  }))
141
141
  });
@@ -147,26 +147,26 @@ 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 _ = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([..._, ...t])], [_, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter", V = P(
150
+ const f = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...f, ...t])], [f, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter", V = M(
151
151
  l,
152
152
  n
153
153
  ), {
154
- data: f,
154
+ data: T,
155
155
  isLoading: w,
156
156
  isError: S,
157
157
  refetch: N
158
158
  } = ce({
159
- queryKey: fe(
159
+ queryKey: Te(
160
160
  i,
161
161
  h,
162
162
  n,
163
163
  e
164
164
  ),
165
- queryFn: () => R ? x(
165
+ queryFn: () => R ? P(
166
166
  i,
167
167
  h,
168
168
  n
169
- ) : G(
169
+ ) : x(
170
170
  i,
171
171
  h,
172
172
  n
@@ -188,21 +188,21 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
188
188
  });
189
189
  }, [S]);
190
190
  const $ = g(() => {
191
- if (!f) return [];
192
- let a = J(f);
191
+ if (!T) return [];
192
+ let a = J(T);
193
193
  e === "latest-encounter" && (a = W(a));
194
194
  const y = X(a);
195
195
  return Z(y);
196
- }, [f, e]), k = [
196
+ }, [T, e]), k = [
197
197
  { key: "name", header: "name" },
198
198
  { key: "value", header: "value" },
199
199
  { key: "form", header: "form" }
200
- ], A = w || !v, B = S && v, q = (!f || f.entry?.length === 0 || h.length === 0) && v, C = B ? u("ERROR_FETCHING_OBSERVATIONS") : null, K = q ? u("NO_OBSERVATIONS_FOUND") : void 0, z = $.length > 0 && !A && !B, E = d.titleTranslationKey, T = E ? u(E) : "";
200
+ ], A = w || !v, B = S && v, q = (!T || T.entry?.length === 0 || h.length === 0) && v, C = B ? u("ERROR_FETCHING_OBSERVATIONS") : null, K = q ? u("NO_OBSERVATIONS_FOUND") : void 0, z = $.length > 0 && !A && !B, E = d.titleTranslationKey, _ = E ? u(E) : "";
201
201
  return /* @__PURE__ */ I(
202
202
  "div",
203
203
  {
204
204
  id: "observations",
205
- "data-testid": E ? `observations-${T}` : "observations",
205
+ "data-testid": E ? `observations-${_}` : "observations",
206
206
  "aria-label": "observations-aria-label",
207
207
  className: O.observations,
208
208
  children: [
@@ -210,17 +210,17 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
210
210
  ee,
211
211
  {
212
212
  id: "observations-title",
213
- testId: E ? `observations-title-${T}` : "observations-title",
214
- title: T,
213
+ testId: E ? `observations-title-${_}` : "observations-title",
214
+ title: _,
215
215
  className: O.title,
216
- children: /* @__PURE__ */ o("p", { children: T })
216
+ children: /* @__PURE__ */ o("p", { children: _ })
217
217
  }
218
218
  ),
219
219
  z ? /* @__PURE__ */ o(
220
220
  Oe,
221
221
  {
222
222
  groupedData: $,
223
- title: T,
223
+ title: _,
224
224
  hideThumbnail: r
225
225
  }
226
226
  ) : /* @__PURE__ */ o(
@@ -242,5 +242,5 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
242
242
  export {
243
243
  Re as conceptUuidQueryKeys,
244
244
  Ie as default,
245
- fe as observationsQueryKeys
245
+ Te as observationsQueryKeys
246
246
  };
@@ -1,4 +1,4 @@
1
- import { c0 as we, c1 as z, c2 as xt, c3 as B, b_ as q, b$ as y, c4 as Ro, c5 as ye, c6 as R, c7 as _, c8 as k, c9 as N, ca as A, cb as bs, cc as ir, cd as $e, ce as G, cf as Hn, cg as Vn, ch as dt, ci as D, cj as xs, ck as cn, cl as Be, cm as ws, cn as qt, co as zt, cp as $s, cq as Cs, cr as $n, cs as Ss, ct as Nr, cu as Bt, cv as zo, cw as ks, cx as Es, cy as j, cz as Gr, cA as Ms, cB as Ds, cC as sr, cD as As, cE as Ts, cF as zn, cG as Fs, cH as Is, cI as Z, cJ as Ps, cK as Ls } from "./index-oWgjP_o2.js";
1
+ import { c0 as we, c1 as z, c2 as xt, c3 as B, b_ as q, b$ as y, c4 as Ro, c5 as ye, c6 as R, c7 as _, c8 as k, c9 as N, ca as A, cb as bs, cc as ir, cd as $e, ce as G, cf as Hn, cg as Vn, ch as dt, ci as D, cj as xs, ck as cn, cl as Be, cm as ws, cn as qt, co as zt, cp as $s, cq as Cs, cr as $n, cs as Ss, ct as Nr, cu as Bt, cv as zo, cw as ks, cx as Es, cy as j, cz as Gr, cA as Ms, cB as Ds, cC as sr, cD as As, cE as Ts, cF as zn, cG as Fs, cH as Is, cI as Z, cJ as Ps, cK as Ls } from "./index-CyvuKZwu.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 { bX as i, bY as o } from "./index-oWgjP_o2.js";
1
+ import { bX as i, bY as o } from "./index-CyvuKZwu.js";
2
2
  import "react";
3
3
  import "react/jsx-runtime";
4
4
  import "@tanstack/react-query";
@@ -1,5 +1,5 @@
1
1
  import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
- import { u as r, cL as l, cM as o, cN as c, ba as m, bb as g, cO as h, cP as p, cQ as b, aI as u } from "./index-oWgjP_o2.js";
2
+ import { u as r, cL as l, cM as o, cN as c, ba as m, bb as g, cO as h, cP as p, cQ as b, aI as u } from "./index-CyvuKZwu.js";
3
3
  import { Suspense as _ } from "react";
4
4
  import "@tanstack/react-query";
5
5
  const E = "index-module_loading__eyE2k", $ = "index-module_message__95HmH", y = "index-module_panel__8VJh2", s = {