@bahmni/clinical-app 0.0.1-dev.193 → 0.0.1-dev.194

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,7 +1,7 @@
1
- import { jsx as o, jsxs as l, Fragment as $ } from "react/jsx-runtime";
2
- import { d as V, u as F, t as H, a as x, O as z, R as P, N as j, L as G, z as W } from "./index-CDL0wtSq.js";
3
- import { useState as C, useCallback as T, useEffect as S, useMemo as E } from "react";
4
- const Y = "_documentsTableBody_6qsah_1", J = "_viewAttachmentsLink_6qsah_11", K = "_documentViewerContainer_6qsah_15", Q = "_attachmentItem_6qsah_23", X = "_attachmentCounter_6qsah_27", Z = "_attachmentError_6qsah_36", ee = "_documentIframe_6qsah_44", te = "_documentImage_6qsah_50", d = {
1
+ import { jsx as o, jsxs as l, Fragment as k } from "react/jsx-runtime";
2
+ import { d as V, u as F, t as H, a as q, O as x, R as z, N as P, L as G, z as W } from "./index-DCHMhMTf.js";
3
+ import { useState as O, useCallback as T, useEffect as S, useMemo as p } from "react";
4
+ const Y = "_documentsTableBody_1voj8_1", J = "_viewAttachmentsLink_1voj8_11", K = "_documentViewerContainer_1voj8_15", Q = "_attachmentItem_1voj8_23", X = "_attachmentCounter_1voj8_27", Z = "_attachmentError_1voj8_36", ee = "_documentIframe_1voj8_44", te = "_documentImage_1voj8_50", d = {
5
5
  documentsTableBody: Y,
6
6
  viewAttachmentsLink: J,
7
7
  documentViewerContainer: K,
@@ -32,60 +32,60 @@ const re = [
32
32
  "uploadedOn",
33
33
  "uploadedBy",
34
34
  "action"
35
- ], w = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], ce = ({ config: a, encounterUuids: u }) => {
36
- const [s, A] = C(!1), [r, g] = C(
35
+ ], oe = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, v = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], ie = ({ config: a, encounterUuids: u }) => {
36
+ const [s, C] = O(!1), [r, A] = O(
37
37
  null
38
- ), [M, N] = C(
38
+ ), [w, E] = O(
39
39
  /* @__PURE__ */ new Set()
40
- ), p = V(), { t: n } = F(), { addNotification: y } = H(), D = T((e) => {
41
- g(e), A(!0);
42
- }, []), b = T(() => {
43
- A(!1), g(null), N(/* @__PURE__ */ new Set());
40
+ ), N = V(), { t: n } = F(), { addNotification: y } = H(), D = T((e) => {
41
+ A(e), C(!0);
42
+ }, []), M = T(() => {
43
+ C(!1), A(null), E(/* @__PURE__ */ new Set());
44
44
  }, []), L = T((e) => {
45
- N((t) => new Set(t).add(e));
46
- }, []), { data: R, isLoading: q, isError: f, error: I } = x({
47
- queryKey: ["documents", p, u],
48
- enabled: !!p,
49
- queryFn: () => W(p, u)
45
+ E((t) => new Set(t).add(e));
46
+ }, []), { data: b, isLoading: R, isError: f, error: g } = q({
47
+ queryKey: ["documents", N, u],
48
+ enabled: !!N,
49
+ queryFn: () => W(N, u)
50
50
  });
51
51
  S(() => {
52
52
  f && y({
53
53
  title: n("ERROR_DEFAULT_TITLE"),
54
- message: I?.message ?? "",
54
+ message: g?.message ?? "",
55
55
  type: "error"
56
56
  });
57
- }, [f, I, y, n]), S(() => {
57
+ }, [f, g, y, n]), S(() => {
58
58
  const e = new AbortController();
59
59
  return (async () => {
60
60
  if (!s || !r) return;
61
- const t = /* @__PURE__ */ new Set(), c = w(r);
62
- for (let m = 0; m < c.length; m++) {
63
- const O = U(c[m].url);
61
+ const t = /* @__PURE__ */ new Set(), c = v(r);
62
+ for (let i = 0; i < c.length; i++) {
63
+ const I = U(c[i].url);
64
64
  try {
65
- (await fetch(O, {
65
+ (await fetch(I, {
66
66
  method: "HEAD",
67
67
  signal: e.signal
68
- })).ok || t.add(m);
69
- } catch (_) {
70
- _ instanceof Error && _.name !== "AbortError" && t.add(m);
68
+ })).ok || t.add(i);
69
+ } catch (h) {
70
+ h instanceof Error && h.name !== "AbortError" && t.add(i);
71
71
  }
72
72
  }
73
- e.signal.aborted || N(t);
73
+ e.signal.aborted || E(t);
74
74
  })(), () => e.abort();
75
75
  }, [s, r]);
76
- const h = E(
76
+ const _ = p(
77
77
  () => a?.fields ?? re,
78
78
  [a?.fields]
79
- ), B = E(() => ne(h, n), [h, n]), v = E(
80
- () => h.map((e) => ({
79
+ ), j = p(() => ne(_, n), [_, n]), B = p(
80
+ () => _.map((e) => ({
81
81
  key: e,
82
82
  sortable: e !== "action"
83
83
  })),
84
- [h]
85
- ), i = E(
86
- () => r ? w(r) : [],
84
+ [_]
85
+ ), m = p(
86
+ () => r ? v(r) : [],
87
87
  [r]
88
- ), k = T(
88
+ ), $ = T(
89
89
  (e, t) => {
90
90
  switch (t) {
91
91
  case "documentIdentifier":
@@ -93,7 +93,7 @@ const re = [
93
93
  case "documentType":
94
94
  return e.documentType ?? n("DOCUMENTS_NOT_AVAILABLE");
95
95
  case "uploadedOn":
96
- return P(
96
+ return z(
97
97
  e.uploadedOn,
98
98
  n,
99
99
  !0
@@ -102,7 +102,7 @@ const re = [
102
102
  return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
103
103
  case "action":
104
104
  return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ o(
105
- z,
105
+ x,
106
106
  {
107
107
  onClick: () => D(e),
108
108
  className: d.viewAttachmentsLink,
@@ -116,18 +116,18 @@ const re = [
116
116
  },
117
117
  [D, n]
118
118
  );
119
- return /* @__PURE__ */ l($, { children: [
119
+ return /* @__PURE__ */ l(k, { children: [
120
120
  /* @__PURE__ */ o("div", { "data-testid": "documents-table", children: /* @__PURE__ */ o(
121
- j,
121
+ P,
122
122
  {
123
- headers: B,
123
+ headers: j,
124
124
  ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
125
- rows: R ?? [],
126
- loading: q,
127
- errorStateMessage: f ? I?.message : null,
128
- sortable: v,
125
+ rows: b ?? [],
126
+ loading: R,
127
+ errorStateMessage: f ? g?.message : null,
128
+ sortable: B,
129
129
  emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
130
- renderCell: k,
130
+ renderCell: $,
131
131
  className: d.documentsTableBody,
132
132
  dataTestId: "documents-table"
133
133
  }
@@ -138,23 +138,23 @@ const re = [
138
138
  id: "modalIdForActionAreaLayout",
139
139
  portalId: "main-display-area",
140
140
  open: s,
141
- onRequestClose: b,
141
+ onRequestClose: M,
142
142
  modalHeading: r.documentIdentifier,
143
143
  passiveModal: !0,
144
144
  size: "lg",
145
145
  testId: "document-view-modal",
146
- children: /* @__PURE__ */ o("div", { className: d.documentViewerContainer, children: i.map((e, t) => {
147
- const c = U(e.url), m = e.contentType?.toLowerCase().includes("pdf"), O = e.contentType?.toLowerCase().includes("image"), _ = M.has(t);
148
- return c === "#" || _ ? /* @__PURE__ */ l(
146
+ children: /* @__PURE__ */ o("div", { className: d.documentViewerContainer, children: m.map((e, t) => {
147
+ const c = U(e.url), i = e.contentType?.toLowerCase().includes("pdf"), I = (e.contentType?.toLowerCase().includes("image") ?? !1) || oe.test(e.url ?? ""), h = w.has(t);
148
+ return c === "#" || h ? /* @__PURE__ */ l(
149
149
  "div",
150
150
  {
151
151
  className: d.attachmentError,
152
152
  "data-testid": `attachment-error-${t}`,
153
153
  children: [
154
- i.length > 1 && /* @__PURE__ */ l("p", { className: d.attachmentCounter, children: [
154
+ m.length > 1 && /* @__PURE__ */ l("p", { className: d.attachmentCounter, children: [
155
155
  t + 1,
156
156
  "/",
157
- i.length
157
+ m.length
158
158
  ] }),
159
159
  /* @__PURE__ */ o("p", { children: n("DOCUMENTS_ERROR_LOADING_ATTACHMENT") })
160
160
  ]
@@ -166,12 +166,12 @@ const re = [
166
166
  className: d.attachmentItem,
167
167
  "data-testid": `attachment-item-${t}`,
168
168
  children: [
169
- i.length > 1 && /* @__PURE__ */ l("p", { className: d.attachmentCounter, children: [
169
+ m.length > 1 && /* @__PURE__ */ l("p", { className: d.attachmentCounter, children: [
170
170
  t + 1,
171
171
  "/",
172
- i.length
172
+ m.length
173
173
  ] }),
174
- O ? /* @__PURE__ */ o(
174
+ I ? /* @__PURE__ */ o(
175
175
  "img",
176
176
  {
177
177
  src: c,
@@ -182,7 +182,7 @@ const re = [
182
182
  ) : /* @__PURE__ */ o(
183
183
  "iframe",
184
184
  {
185
- src: m ? `${c}#toolbar=0` : c,
185
+ src: i ? `${c}#toolbar=0` : c,
186
186
  className: d.documentIframe,
187
187
  title: r.documentIdentifier,
188
188
  onError: () => L(t)
@@ -198,5 +198,5 @@ const re = [
198
198
  ] });
199
199
  };
200
200
  export {
201
- ce as default
201
+ ie as default
202
202
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as o, jsxs as p, Fragment as P } from "react/jsx-runtime";
2
- import { u as O, d as ae, m as te, b as oe, a as L, E as ne, R as se, O as de, N as q, W as me, K as ie, L as le, X as ce, I as H, V as ue, n as k, C, c as be, e as pe, r as _e, f as fe, g as $e, h as ge, i as he, x as ve, M as ye } from "./index-CDL0wtSq.js";
2
+ import { u as O, d as ae, m as te, b as oe, a as L, E as ne, R as se, O as de, N as q, W as me, K as ie, L as le, X as ce, I as H, V as ue, n as k, C, c as be, e as pe, r as _e, f as fe, g as $e, h as ge, i as he, x as ve, M as ye } from "./index-DCHMhMTf.js";
3
3
  import { useState as K, useMemo as v, useCallback as R } from "react";
4
4
  const Ne = "_formsTableBody_1pd36_1", Le = "_customAccordianItem_1pd36_6", Re = "_formContent_1pd36_18", Ce = "_formDetailsContainer_1pd36_25", Ae = "_observation_1pd36_30", Fe = "_groupContainer_1pd36_39", Ie = "_rowContainer_1pd36_43", Me = "_groupLabel_1pd36_48", Oe = "_rowLabel_1pd36_58", Te = "_rowValue_1pd36_67", Ve = "_groupMembers_1pd36_75", Ee = "_memberRow_1pd36_81", xe = "_memberLabel_1pd36_86", De = "_memberValue_1pd36_94", Se = "_abnormalValue_1pd36_102", we = "_commentSection_1pd36_110", Be = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", Ue = "_nestedGroupLabel_1pd36_132", qe = "_nestedGroupMembers_1pd36_141", n = {
5
5
  formsTableBody: Ne,
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as v, D as u, Q as i } from "./YPM2AS64-Dwm-PfM0.js";
2
- import { q as d, s as f, v as e } from "./index-CDL0wtSq.js";
1
+ import { c, T as l, P as m, a as v, D as u, Q as i } from "./YPM2AS64-BjArjSkq.js";
2
+ import { q as d, s as f, v as e } from "./index-DCHMhMTf.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
- import { c as l, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-Dwm-PfM0.js";
2
- import { q as v, s as C, v as e } from "./index-CDL0wtSq.js";
1
+ import { c as l, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-BjArjSkq.js";
2
+ import { q as v, s as C, v as e } from "./index-DCHMhMTf.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = l({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
1
  import { jsxs as N, jsx as l } from "react/jsx-runtime";
2
- import { d as k, t as B, u as I, j as Q, y as H, a as K, E as j, V as w, k as x, l as G, o as M, N as z, p as P, Q as S, T as Y, c as J, $ as W, e as X, r as Z, f as ee, H as te } from "./index-CDL0wtSq.js";
2
+ import { d as k, t as B, u as I, j as Q, y as H, a as K, E as j, V as w, k as x, l as G, o as M, N as z, p as P, Q as S, T as Y, c as J, $ as W, e as X, r as Z, f as ee, H as te } from "./index-DCHMhMTf.js";
3
3
  import { useRef as ae, useEffect as T, useMemo as R } from "react";
4
4
  const D = (t, d, n, u, r) => {
5
5
  const a = Y(t, d, r), s = a.value, o = J(s);
@@ -1,4 +1,4 @@
1
- import { w as we, A as z, B as xt, D as B, s as q, v as y, P as Ro, F as ye, S as R, G as _, J as k, U as N, Y as A, Z as bs, _ as ir, a0 as $e, a1 as U, a2 as Hn, a3 as Vn, a4 as dt, a5 as D, a6 as xs, a7 as cn, a8 as Be, a9 as ws, aa as qt, ab as zt, ac as $s, ad as Cs, ae as $n, af as Ss, ag as Nr, ah as Bt, ai as zo, aj as ks, ak as Es, al as j, am as Ur, an as Ms, ao as Ds, ap as sr, aq as As, ar as Ts, as as zn, at as Fs, au as Is, av as Z, aw as Ps, ax as Ls } from "./index-CDL0wtSq.js";
1
+ import { w as we, A as z, B as xt, D as B, s as q, v as y, P as Ro, F as ye, S as R, G as _, J as k, U as N, Y as A, Z as bs, _ as ir, a0 as $e, a1 as U, a2 as Hn, a3 as Vn, a4 as dt, a5 as D, a6 as xs, a7 as cn, a8 as Be, a9 as ws, aa as qt, ab as zt, ac as $s, ad as Cs, ae as $n, af as Ss, ag as Nr, ah as Bt, ai as zo, aj as ks, ak as Es, al as j, am as Ur, an as Ms, ao as Ds, ap as sr, aq as As, ar as Ts, as as zn, at as Fs, au as Is, av as Z, aw as Ps, ax as Ls } from "./index-DCHMhMTf.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -162884,7 +162884,7 @@ const j0t = [
162884
162884
  },
162885
162885
  {
162886
162886
  type: "patientDocuments",
162887
- component: lazy$1(() => import("./DocumentsTable-CYxu-75r-CvJ1TanU.js"))
162887
+ component: lazy$1(() => import("./DocumentsTable-BJ1OXT8Q-Bq282_zo.js"))
162888
162888
  },
162889
162889
  {
162890
162890
  type: "flowSheet",
@@ -162892,7 +162892,7 @@ const j0t = [
162892
162892
  },
162893
162893
  {
162894
162894
  type: "forms",
162895
- component: lazy$1(() => import("./FormsTable-DrKr31Pe-D8D6MdgZ.js"))
162895
+ component: lazy$1(() => import("./FormsTable-CF5ZuCw3-DGqQiwCC.js"))
162896
162896
  },
162897
162897
  {
162898
162898
  type: "labOrders",
@@ -162900,7 +162900,7 @@ const j0t = [
162900
162900
  },
162901
162901
  {
162902
162902
  type: "observations",
162903
- component: lazy$1(() => import("./Observations-21c_55Fg-BcXTPhtB.js"))
162903
+ component: lazy$1(() => import("./Observations-COn04_t4-CEA3YMgy.js"))
162904
162904
  },
162905
162905
  {
162906
162906
  type: "ordersControl",
@@ -164801,7 +164801,7 @@ var displayValue = (n, e = !1) => {
164801
164801
  const e = render(() => {
164802
164802
  const r = this, [a] = this.#o, [o] = this.#d, [c] = this.#f, [f] = this.#u, [p] = this.#h, [m] = this.#t;
164803
164803
  let A;
164804
- return this.#s ? A = this.#s : (A = lazy(() => import("./LNWAZHJI-D6sfmRmM.js")), this.#s = A), setupStyleSheet(this.#i, this.#l), createComponent(A, mergeProps({
164804
+ return this.#s ? A = this.#s : (A = lazy(() => import("./LNWAZHJI-0CULmAKu.js")), this.#s = A), setupStyleSheet(this.#i, this.#l), createComponent(A, mergeProps({
164805
164805
  get queryFlavor() {
164806
164806
  return r.#n;
164807
164807
  },
@@ -164899,7 +164899,7 @@ var displayValue = (n, e = !1) => {
164899
164899
  const e = render(() => {
164900
164900
  const r = this, [a] = this.#o, [o] = this.#d, [c] = this.#f, [f] = this.#u, [p] = this.#h, [m] = this.#t, [A] = this.#s;
164901
164901
  let g;
164902
- return this.#c ? g = this.#c : (g = lazy(() => import("./MWZ6AO7Z-CjaTKgjS.js")), this.#c = g), setupStyleSheet(this.#i, this.#l), createComponent(g, mergeProps({
164902
+ return this.#c ? g = this.#c : (g = lazy(() => import("./MWZ6AO7Z-Bj9WuRhm.js")), this.#c = g), setupStyleSheet(this.#i, this.#l), createComponent(g, mergeProps({
164903
164903
  get queryFlavor() {
164904
164904
  return r.#n;
164905
164905
  },