@bahmni/clinical-app 0.0.1-dev.281 → 0.0.1-dev.282

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,112 +1,112 @@
1
- import { jsx as r, jsxs as _, Fragment as x } from "react/jsx-runtime";
2
- import { u as G, a as W, h as Y, K as J, w as X, m as Z, c as ee, n as te } from "./index-BsJk02uJ.js";
1
+ import { jsx as r, jsxs as h, Fragment as x } from "react/jsx-runtime";
2
+ import { u as G, a as W, h as Y, K as J, w as X, m as Z, c as ee, n as te } from "./index-ib3P37Hz.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
- import { useState as l, useCallback as p, useEffect as O, useMemo as h } from "react";
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", ce = "DocumentsTable-module_attachmentError__RI4U2", me = "DocumentsTable-module_documentIframe__ptq5I", le = "DocumentsTable-module_documentImage__KQVgS", d = {
4
+ import { useState as l, useCallback as _, useEffect as N, useMemo as p } from "react";
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 = {
6
6
  documentsTableBody: ne,
7
7
  viewAttachmentsLink: oe,
8
8
  documentViewerContainer: re,
9
9
  attachmentItem: de,
10
10
  attachmentCounter: se,
11
- attachmentError: ce,
12
- documentIframe: me,
11
+ attachmentError: me,
12
+ documentIframe: ce,
13
13
  documentImage: le
14
14
  }, ue = {
15
15
  documentIdentifier: "DOCUMENTS_DOCUMENT_IDENTIFIER",
16
16
  documentType: "DOCUMENTS_TYPE",
17
17
  uploadedOn: "DOCUMENTS_UPLOADED_ON",
18
18
  uploadedBy: "DOCUMENTS_UPLOADED_BY",
19
- action: "DOCUMENTS_ACTION"
19
+ attachments: "DOCUMENTS_ATTACHMENTS"
20
20
  };
21
21
  function R(a) {
22
22
  return !a || a.includes(":") ? "#" : `/openmrs/auth?requested_document=/document_images/${a}`;
23
23
  }
24
- function ie(a, E) {
24
+ function ie(a, g) {
25
25
  return a.map((s) => ({
26
26
  key: s,
27
- header: E(ue[s])
27
+ header: g(ue[s])
28
28
  }));
29
29
  }
30
30
  const Te = [
31
31
  "documentIdentifier",
32
32
  "documentType",
33
+ "attachments",
33
34
  "uploadedOn",
34
- "uploadedBy",
35
- "action"
36
- ], _e = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], Ie = ({ config: a, encounterUuids: E }) => {
37
- const [s, S] = l(!1), [o, U] = l(
35
+ "uploadedBy"
36
+ ], he = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i, B = (a) => a.attachments.length > 0 ? a.attachments : a.documentUrl ? [{ url: a.documentUrl, contentType: a.contentType }] : [], fe = ({ config: a, encounterUuids: g }) => {
37
+ const [s, w] = l(!1), [o, U] = l(
38
38
  null
39
39
  ), [$, D] = l(
40
40
  /* @__PURE__ */ new Set()
41
- ), g = G(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = p((e) => {
42
- U(e), S(!0);
43
- }, []), H = p(() => {
44
- S(!1), U(null), D(/* @__PURE__ */ new Set());
45
- }, []), v = p((e) => {
41
+ ), E = G(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [O, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = _((e) => {
42
+ U(e), w(!0);
43
+ }, []), H = _(() => {
44
+ w(!1), U(null), D(/* @__PURE__ */ new Set());
45
+ }, []), v = _((e) => {
46
46
  D((t) => new Set(t).add(e));
47
47
  }, []), { data: i, isLoading: q, isError: b, error: y } = ae({
48
48
  queryKey: [
49
49
  "documents",
50
- g,
51
50
  E,
52
- f,
51
+ g,
52
+ O,
53
53
  u
54
54
  ],
55
- enabled: !!g,
55
+ enabled: !!E,
56
56
  queryFn: () => J(
57
- g,
58
57
  E,
58
+ g,
59
59
  u,
60
- f
60
+ O
61
61
  )
62
62
  });
63
- O(() => {
63
+ N(() => {
64
64
  i && A(i.total);
65
- }, [i]), O(() => {
65
+ }, [i]), N(() => {
66
66
  C(1), A(void 0);
67
- }, [g]), O(() => {
67
+ }, [E]), N(() => {
68
68
  b && L({
69
69
  title: n("ERROR_DEFAULT_TITLE"),
70
70
  message: y?.message ?? "",
71
71
  type: "error"
72
72
  });
73
- }, [b, y, L, n]), O(() => {
73
+ }, [b, y, L, n]), N(() => {
74
74
  const e = new AbortController();
75
75
  return (async () => {
76
76
  if (!s || !o) return;
77
- const t = /* @__PURE__ */ new Set(), c = B(o);
78
- for (let m = 0; m < c.length; m++) {
79
- const w = R(c[m].url);
77
+ const t = /* @__PURE__ */ new Set(), m = B(o);
78
+ for (let c = 0; c < m.length; c++) {
79
+ const S = R(m[c].url);
80
80
  try {
81
- (await fetch(w, {
81
+ (await fetch(S, {
82
82
  method: "HEAD",
83
83
  signal: e.signal
84
- })).ok || t.add(m);
85
- } catch (N) {
86
- N instanceof Error && N.name !== "AbortError" && t.add(m);
84
+ })).ok || t.add(c);
85
+ } catch (I) {
86
+ I instanceof Error && I.name !== "AbortError" && t.add(c);
87
87
  }
88
88
  }
89
89
  e.signal.aborted || D(t);
90
90
  })(), () => e.abort();
91
91
  }, [s, o]);
92
- const K = p(
92
+ const K = _(
93
93
  (e, t) => {
94
94
  t !== u ? (V(t), C(1), A(void 0)) : C(e);
95
95
  },
96
96
  [u]
97
- ), I = h(
97
+ ), f = p(
98
98
  () => a?.fields ?? Te,
99
99
  [a?.fields]
100
- ), j = h(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), P = h(() => ie(I, n), [I, n]), z = h(
101
- () => I.map((e) => ({
100
+ ), j = p(() => [...i?.documents ?? []].sort((e, t) => !e.uploadedOn && !t.uploadedOn ? 0 : e.uploadedOn ? t.uploadedOn ? new Date(t.uploadedOn).getTime() - new Date(e.uploadedOn).getTime() : -1 : 1), [i]), P = p(() => ie(f, n), [f, n]), z = p(
101
+ () => f.map((e) => ({
102
102
  key: e,
103
- sortable: e !== "action"
103
+ sortable: e !== "attachments"
104
104
  })),
105
- [I]
106
- ), T = h(
105
+ [f]
106
+ ), T = p(
107
107
  () => o ? B(o) : [],
108
108
  [o]
109
- ), Q = p(
109
+ ), Q = _(
110
110
  (e, t) => {
111
111
  switch (t) {
112
112
  case "documentIdentifier":
@@ -121,7 +121,7 @@ const Te = [
121
121
  ).formattedResult || n("DOCUMENTS_NOT_AVAILABLE");
122
122
  case "uploadedBy":
123
123
  return e.uploadedBy ?? n("DOCUMENTS_NOT_AVAILABLE");
124
- case "action":
124
+ case "attachments":
125
125
  return e.attachments.length > 0 || e.documentUrl ? /* @__PURE__ */ r(
126
126
  X,
127
127
  {
@@ -137,7 +137,7 @@ const Te = [
137
137
  },
138
138
  [M, n]
139
139
  );
140
- return /* @__PURE__ */ _(x, { children: [
140
+ return /* @__PURE__ */ h(x, { children: [
141
141
  /* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
142
142
  ee,
143
143
  {
@@ -153,7 +153,7 @@ const Te = [
153
153
  dataTestId: "documents-table",
154
154
  pageSize: u,
155
155
  totalItems: F,
156
- page: f,
156
+ page: O,
157
157
  onPageChange: K
158
158
  }
159
159
  ) }),
@@ -169,14 +169,14 @@ const Te = [
169
169
  size: "lg",
170
170
  testId: "document-view-modal",
171
171
  children: /* @__PURE__ */ r("div", { className: d.documentViewerContainer, children: T.map((e, t) => {
172
- const c = R(e.url), m = e.contentType?.toLowerCase().includes("pdf"), w = (e.contentType?.toLowerCase().includes("image") ?? !1) || _e.test(e.url ?? ""), N = $.has(t);
173
- return c === "#" || N ? /* @__PURE__ */ _(
172
+ const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), I = $.has(t);
173
+ return m === "#" || I ? /* @__PURE__ */ h(
174
174
  "div",
175
175
  {
176
176
  className: d.attachmentError,
177
177
  "data-testid": `attachment-error-${t}`,
178
178
  children: [
179
- T.length > 1 && /* @__PURE__ */ _("p", { className: d.attachmentCounter, children: [
179
+ T.length > 1 && /* @__PURE__ */ h("p", { className: d.attachmentCounter, children: [
180
180
  t + 1,
181
181
  "/",
182
182
  T.length
@@ -185,21 +185,21 @@ const Te = [
185
185
  ]
186
186
  },
187
187
  `${o.id}-${e.url}`
188
- ) : /* @__PURE__ */ _(
188
+ ) : /* @__PURE__ */ h(
189
189
  "div",
190
190
  {
191
191
  className: d.attachmentItem,
192
192
  "data-testid": `attachment-item-${t}`,
193
193
  children: [
194
- T.length > 1 && /* @__PURE__ */ _("p", { className: d.attachmentCounter, children: [
194
+ T.length > 1 && /* @__PURE__ */ h("p", { className: d.attachmentCounter, children: [
195
195
  t + 1,
196
196
  "/",
197
197
  T.length
198
198
  ] }),
199
- w ? /* @__PURE__ */ r(
199
+ S ? /* @__PURE__ */ r(
200
200
  "img",
201
201
  {
202
- src: c,
202
+ src: m,
203
203
  alt: o.documentIdentifier,
204
204
  className: d.documentImage,
205
205
  onError: () => v(t)
@@ -207,7 +207,7 @@ const Te = [
207
207
  ) : /* @__PURE__ */ r(
208
208
  "iframe",
209
209
  {
210
- src: m ? `${c}#toolbar=0` : c,
210
+ src: c ? `${m}#toolbar=0` : m,
211
211
  className: d.documentIframe,
212
212
  title: o.documentIdentifier,
213
213
  onError: () => v(t)
@@ -223,5 +223,5 @@ const Te = [
223
223
  ] });
224
224
  };
225
225
  export {
226
- Ie as default
226
+ fe as default
227
227
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as s, jsxs as X, Fragment as Z } from "react/jsx-runtime";
2
- import { a as ee, u as re, E as ae, q as oe, U as te, W as se, j as ne, t as de, _ as R, m as ie, w as me, c as q, O as ue, L as le, n as ce, Y as fe, P as ye } from "./index-BsJk02uJ.js";
2
+ import { a as ee, u as re, E as ae, q as oe, U as te, W as se, j as ne, t as de, _ as R, m as ie, w as me, c as q, O as ue, L as le, n as ce, Y as fe, P as ye } from "./index-ib3P37Hz.js";
3
3
  import { useQueryClient as be, useQuery as f } from "@tanstack/react-query";
4
4
  import { useState as S, useMemo as d, useCallback as y } from "react";
5
5
  const pe = "FormsTable-module_formsTableBody__SvGha", ge = "FormsTable-module_customAccordianItem__isszs", A = {
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Bh050bR8.js";
2
- import { g as d, d as f, f as e } from "./index-BsJk02uJ.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DK2G1oCF.js";
2
+ import { g as d, d as f, f as e } from "./index-ib3P37Hz.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 d, Q as P } from "./YPM2AS64-Bh050bR8.js";
2
- import { g as v, d as C, f as e } from "./index-BsJk02uJ.js";
1
+ import { c as s, T as c, P as u, a as i, b as m, C as d, Q as P } from "./YPM2AS64-DK2G1oCF.js";
2
+ import { g as v, d as C, f as e } from "./index-ib3P37Hz.js";
3
3
  var f = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
1
  import { jsxs as N, jsx as u } from "react/jsx-runtime";
2
- import { u as U, h as K, a as S, B as Q, F as q, t as k, e as w, b as z, r as x, z as G, c as J, X as j, M as F, Q as P, V as X, J as Y, N as W, I as Z, C as ee } from "./index-BsJk02uJ.js";
2
+ import { u as U, h as K, a as S, B as Q, F as q, t as k, e as w, b as z, r as x, z as G, c as J, X as j, M as F, Q as P, V as X, J as Y, N as W, I as Z, C as ee } from "./index-ib3P37Hz.js";
3
3
  import { useQueries as te, useQuery as ae } from "@tanstack/react-query";
4
4
  import { useRef as se, useEffect as $, useMemo as R } from "react";
5
5
  const C = (t, n, d, l, b, r) => {
@@ -1,4 +1,4 @@
1
- import { i as we, k as z, o as xt, l as B, d as q, f as y, p as Ro, s as ye, S as R, v as _, x as k, y as N, A, D as bs, G as ir, H as $e, R as G, T as Hn, Z as Vn, $ as dt, a0 as D, a1 as xs, a2 as cn, a3 as Be, a4 as ws, a5 as qt, a6 as zt, a7 as $s, a8 as Cs, a9 as $n, aa as Ss, ab as Nr, ac as Bt, ad as zo, ae as ks, af as Es, ag as j, ah as Gr, ai as Ms, aj as Ds, ak as sr, al as As, am as Ts, an as zn, ao as Fs, ap as Is, aq as Z, ar as Ps, as as Ls } from "./index-BsJk02uJ.js";
1
+ import { i as we, k as z, o as xt, l as B, d as q, f as y, p as Ro, s as ye, S as R, v as _, x as k, y as N, A, D as bs, G as ir, H as $e, R as G, T as Hn, Z as Vn, $ as dt, a0 as D, a1 as xs, a2 as cn, a3 as Be, a4 as ws, a5 as qt, a6 as zt, a7 as $s, a8 as Cs, a9 as $n, aa as Ss, ab as Nr, ac as Bt, ad as zo, ae as ks, af as Es, ag as j, ah as Gr, ai as Ms, aj as Ds, ak as sr, al as As, am as Ts, an as zn, ao as Fs, ap as Is, aq as Z, ar as Ps, as as Ls } from "./index-ib3P37Hz.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -175403,7 +175403,7 @@ const cHt = [
175403
175403
  },
175404
175404
  {
175405
175405
  type: "patientDocuments",
175406
- component: lazy$1(() => import("./DocumentsTable-DBTAKAkE-DUvGvSQb.js"))
175406
+ component: lazy$1(() => import("./DocumentsTable-BFpvq1kQ-DTDgCwar.js"))
175407
175407
  },
175408
175408
  {
175409
175409
  type: "flowSheet",
@@ -175411,7 +175411,7 @@ const cHt = [
175411
175411
  },
175412
175412
  {
175413
175413
  type: "forms",
175414
- component: lazy$1(() => import("./FormsTable-3k4qn6RT-RbU6HxAj.js"))
175414
+ component: lazy$1(() => import("./FormsTable-BmlIPu2T-CwY6-xWJ.js"))
175415
175415
  },
175416
175416
  {
175417
175417
  type: "labOrders",
@@ -175419,7 +175419,7 @@ const cHt = [
175419
175419
  },
175420
175420
  {
175421
175421
  type: "observations",
175422
- component: lazy$1(() => import("./Observations-BQ_tgOPv-DSTkbpfc.js"))
175422
+ component: lazy$1(() => import("./Observations-CsCQ1ADc-Bxyh5c5Y.js"))
175423
175423
  },
175424
175424
  {
175425
175425
  type: "ordersControl",
@@ -177325,7 +177325,7 @@ var displayValue = (t, e = !1) => {
177325
177325
  const e = render(() => {
177326
177326
  const a = this, [r] = this.#a, [o] = this.#r, [s] = this.#o, [c] = this.#l, [g] = this.#h, [A] = this.#e;
177327
177327
  let v;
177328
- return this.#i ? v = this.#i : (v = lazy(() => import("./LNWAZHJI-dyATaY1R.js")), this.#i = v), setupStyleSheet(this.#d, this.#n), createComponent(v, mergeProps({
177328
+ return this.#i ? v = this.#i : (v = lazy(() => import("./LNWAZHJI-DoOd-7O2.js")), this.#i = v), setupStyleSheet(this.#d, this.#n), createComponent(v, mergeProps({
177329
177329
  get queryFlavor() {
177330
177330
  return a.#f;
177331
177331
  },
@@ -177423,7 +177423,7 @@ var displayValue = (t, e = !1) => {
177423
177423
  const e = render(() => {
177424
177424
  const a = this, [r] = this.#a, [o] = this.#r, [s] = this.#o, [c] = this.#l, [g] = this.#h, [A] = this.#e, [v] = this.#i;
177425
177425
  let E;
177426
- return this.#s ? E = this.#s : (E = lazy(() => import("./MWZ6AO7Z-BKP4saWn.js")), this.#s = E), setupStyleSheet(this.#d, this.#n), createComponent(E, mergeProps({
177426
+ return this.#s ? E = this.#s : (E = lazy(() => import("./MWZ6AO7Z-AVi1HWHZ.js")), this.#s = E), setupStyleSheet(this.#d, this.#n), createComponent(E, mergeProps({
177427
177427
  get queryFlavor() {
177428
177428
  return a.#f;
177429
177429
  },
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { at as i } from "./index-BsJk02uJ.js";
1
+ import { at as i } from "./index-ib3P37Hz.js";
2
2
  export {
3
3
  i as ClinicalApp
4
4
  };
@@ -134,7 +134,7 @@
134
134
  "DIAGNOSIS_LIST_RECORDED_BY": "Recorded By",
135
135
  "DIAGNOSIS_RECORDED_DATE": "Recorded Date",
136
136
  "DIAGNOSIS_TABLE_NOT_AVAILABLE": "Not available",
137
- "DOCUMENTS_ACTION": "Action",
137
+ "DOCUMENTS_ATTACHMENTS": "Attachments",
138
138
  "DOCUMENTS_DOCUMENT_IDENTIFIER": "Document Identifier",
139
139
  "DOCUMENTS_ERROR_LOADING_ATTACHMENT": "Unable to load attachment. The document URL may be corrupt or not found.",
140
140
  "DOCUMENTS_NOT_AVAILABLE": "Not available",
@@ -134,7 +134,7 @@
134
134
  "DIAGNOSIS_LIST_RECORDED_BY": "Grabado Por",
135
135
  "DIAGNOSIS_RECORDED_DATE": "Fecha de grabación",
136
136
  "DIAGNOSIS_TABLE_NOT_AVAILABLE": "No disponible",
137
- "DOCUMENTS_ACTION": "Acción",
137
+ "DOCUMENTS_ATTACHMENTS": "Adjuntos",
138
138
  "DOCUMENTS_DOCUMENT_IDENTIFIER": "Identificador de Documento",
139
139
  "DOCUMENTS_ERROR_LOADING_ATTACHMENT": "No se puede cargar el adjunto. La URL del documento puede estar dañada o no encontrada.",
140
140
  "DOCUMENTS_NOT_AVAILABLE": "No disponible",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/clinical-app",
3
- "version": "0.0.1-dev.281",
3
+ "version": "0.0.1-dev.282",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",