@bahmni/clinical-app 0.0.1-dev.457 → 0.0.1-dev.459

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,13 +1,13 @@
1
1
  import { jsxs as S, jsx as n } from "react/jsx-runtime";
2
- import { d as Q, z as x, u as L, $ as M, f as G, p as J, H as P, a as X, r as Y, P as j, s as Z, v as W, b as ee, I as ae, S as se, y as B, B as te, X as re, h as ie, C as oe, Y as ne, D as de, J as le } from "./index-CqGwlQCF.js";
2
+ import { u as z, z as Q, a as V, n as M, V as G, o as H, Y, w as j, p as J, q as P, r as W, s as X, d as ee, I as ae, t as se, v as B, x as te, B as re, h as ie, C as oe, D as ne, E as de, F as le } from "./index-k-BDWW2Q.js";
3
3
  import { useQueries as ue, useQuery as ce } from "@tanstack/react-query";
4
- import { useRef as pe, useEffect as D, useMemo as g } from "react";
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 = {
6
6
  observations: me,
7
7
  title: be,
8
8
  wrapper: he,
9
9
  secondary: ve
10
- }, U = (s, l, o, d, c, t) => {
10
+ }, F = (s, l, o, 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__ */ n(
@@ -31,7 +31,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
31
31
  r.header.referenceRange && /* @__PURE__ */ n("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, E = /* @__PURE__ */ S("div", { className: O.wrapper, children: [
34
+ }), b = s.effectiveDateTime ? ie(s.effectiveDateTime, c, !0).formattedResult : void 0, T = /* @__PURE__ */ S("div", { className: O.wrapper, children: [
35
35
  /* @__PURE__ */ n("span", { children: u }),
36
36
  b && /* @__PURE__ */ n("span", { className: O.secondary, children: b })
37
37
  ] }), h = s.display, v = s.observationValue?.isAbnormal ? "abnormal-obs" : "obs", R = d ? `${d}-${v}-${h}-${o}-${l}` : `${v}-${h}-${o}-${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: E,
43
+ info: T,
44
44
  id: R,
45
45
  testId: R,
46
46
  ariaLabel: R
@@ -54,7 +54,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
54
54
  id: `grouped-obs-${s.display}-${d}`,
55
55
  open: o,
56
56
  children: s.members?.map(
57
- (e, p) => U(
57
+ (e, p) => F(
58
58
  e,
59
59
  p,
60
60
  c,
@@ -70,7 +70,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
70
70
  title: l = "",
71
71
  hideThumbnail: o
72
72
  }) => {
73
- const { t: d } = L(), c = (t, r, e) => {
73
+ const { t: d } = V(), c = (t, r, e) => {
74
74
  const p = se(t.encounterDetails, d);
75
75
  return /* @__PURE__ */ S(
76
76
  B,
@@ -80,7 +80,7 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
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,
@@ -132,29 +132,29 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
132
132
  conceptUuid: t = [],
133
133
  hideThumbnail: r = !1,
134
134
  scope: e = "all"
135
- } = d, p = pe(/* @__PURE__ */ new Set()), i = Q(), { addNotification: m } = x(), { t: u } = L(), b = ue({
135
+ } = d, p = pe(/* @__PURE__ */ new Set()), i = z(), { addNotification: m } = Q(), { t: u } = V(), b = ue({
136
136
  queries: c.map((a) => ({
137
137
  queryKey: Re(a),
138
138
  queryFn: () => M(a),
139
139
  enabled: !!a
140
140
  }))
141
141
  });
142
- D(() => {
143
- const a = b.some((z) => z.isError), y = p.current.size > 0;
142
+ L(() => {
143
+ const a = b.some((Z) => Z.isError), y = p.current.size > 0;
144
144
  a && !y ? (m({
145
145
  title: u("ERROR_DEFAULT_TITLE"),
146
146
  message: u("ERROR_FETCHING_OBSERVATIONS"),
147
147
  type: "error"
148
148
  }), p.current.add(0)) : !a && y && p.current.clear();
149
149
  }, [b, m, u]);
150
- const E = g(() => b.map((a) => a.data?.uuid).filter((a) => !!a), [b]), h = g(() => [.../* @__PURE__ */ new Set([...E, ...t])], [E, t]), v = g(() => c.length === 0 ? !0 : b.every((a) => !a.isLoading), [b, c.length]), R = e === "latest" || e === "latest-encounter", V = G(
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", U = G(
151
151
  l,
152
152
  o
153
153
  ), {
154
154
  data: _,
155
- isLoading: F,
155
+ isLoading: k,
156
156
  isError: I,
157
- refetch: $
157
+ refetch: N
158
158
  } = ce({
159
159
  queryKey: _e(
160
160
  i,
@@ -162,47 +162,47 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
162
162
  o,
163
163
  e
164
164
  ),
165
- queryFn: () => R ? J(
165
+ queryFn: () => R ? H(
166
166
  i,
167
167
  h,
168
168
  o
169
- ) : P(
169
+ ) : Y(
170
170
  i,
171
171
  h,
172
172
  o
173
173
  ),
174
- enabled: !!i && h.length > 0 && v && !V
174
+ enabled: !!i && h.length > 0 && v && !U
175
175
  });
176
- X(
176
+ j(
177
177
  (a) => {
178
178
  a.patientUUID === i && a.updatedConcepts.size > 0 && [...a.updatedConcepts.keys()].some(
179
179
  (y) => h.includes(y)
180
- ) && $();
180
+ ) && N();
181
181
  },
182
- [i, $]
183
- ), D(() => {
182
+ [i, N]
183
+ ), L(() => {
184
184
  I && m({
185
185
  title: u("ERROR_DEFAULT_TITLE"),
186
186
  message: u("ERROR_FETCHING_OBSERVATIONS"),
187
187
  type: "error"
188
188
  });
189
189
  }, [I]);
190
- const N = g(() => {
190
+ const $ = g(() => {
191
191
  if (!_) return [];
192
- let a = Y(_);
193
- e === "latest-encounter" && (a = j(a));
194
- const y = Z(a);
195
- return W(y);
192
+ let a = J(_);
193
+ e === "latest-encounter" && (a = P(a));
194
+ const y = W(a);
195
+ return X(y);
196
196
  }, [_, e]), w = [
197
197
  { key: "name", header: "name" },
198
198
  { key: "value", header: "value" },
199
199
  { key: "form", header: "form" }
200
- ], k = F || !v, A = I && v, C = (!_ || _.entry?.length === 0 || h.length === 0) && v, H = A ? u("ERROR_FETCHING_OBSERVATIONS") : null, K = C ? u("NO_OBSERVATIONS_FOUND") : void 0, q = N.length > 0 && !k && !A, T = d.titleTranslationKey, f = T ? u(T) : "";
200
+ ], A = k || !v, D = I && v, C = (!_ || _.entry?.length === 0 || h.length === 0) && v, q = D ? u("ERROR_FETCHING_OBSERVATIONS") : null, x = C ? u("NO_OBSERVATIONS_FOUND") : void 0, K = $.length > 0 && !A && !D, E = d.titleTranslationKey, f = E ? u(E) : "";
201
201
  return /* @__PURE__ */ S(
202
202
  "div",
203
203
  {
204
204
  id: "observations",
205
- "data-testid": T ? `observations-${f}` : "observations",
205
+ "data-testid": E ? `observations-${f}` : "observations",
206
206
  "aria-label": "observations-aria-label",
207
207
  className: O.observations,
208
208
  children: [
@@ -210,16 +210,16 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
210
210
  ee,
211
211
  {
212
212
  id: "observations-title",
213
- testId: T ? `observations-title-${f}` : "observations-title",
213
+ testId: E ? `observations-title-${f}` : "observations-title",
214
214
  title: f,
215
215
  className: O.title,
216
216
  children: /* @__PURE__ */ n("p", { children: f })
217
217
  }
218
218
  ),
219
- q ? /* @__PURE__ */ n(
219
+ K ? /* @__PURE__ */ n(
220
220
  Oe,
221
221
  {
222
- groupedData: N,
222
+ groupedData: $,
223
223
  title: f,
224
224
  hideThumbnail: r
225
225
  }
@@ -229,9 +229,9 @@ const me = "Observations-module_observations__RKSyo", be = "Observations-module_
229
229
  headers: w,
230
230
  rows: [],
231
231
  ariaLabel: u("OBSERVATIONS"),
232
- loading: k,
233
- errorStateMessage: H,
234
- emptyStateMessage: K ?? u("NO_OBSERVATIONS_AVAILABLE"),
232
+ loading: A,
233
+ errorStateMessage: q,
234
+ emptyStateMessage: x ?? u("NO_OBSERVATIONS_AVAILABLE"),
235
235
  dataTestId: "observations-table"
236
236
  }
237
237
  )
@@ -1,4 +1,4 @@
1
- import { ck as we, cl as z, cm as xt, cn as B, ci as q, cj as y, co as Ro, cp as ye, cq as R, cr as _, cs as k, ct as N, cu as A, cv as bs, cw as ir, cx as $e, cy as U, cz as Hn, cA as Vn, cB as dt, cC as D, cD as xs, cE as cn, cF as Be, cG as ws, cH as qt, cI as zt, cJ as $s, cK as Cs, cL as $n, cM as Ss, cN as Nr, cO as Bt, cP as zo, cQ as ks, cR as Es, cS as j, cT as Ur, cU as Ms, cV as Ds, cW as sr, cX as As, cY as Ts, cZ as zn, c_ as Fs, c$ as Is, d0 as Z, d1 as Ps, d2 as Ls } from "./index-CqGwlQCF.js";
1
+ import { cl as we, cm as z, cn as xt, co as B, cj as q, ck as y, cp as Ro, cq as ye, cr as R, cs as _, ct as k, cu as N, cv as A, cw as bs, cx as ir, cy as $e, cz as U, cA as Hn, cB as Vn, cC as dt, cD as D, cE as xs, cF as cn, cG as Be, cH as ws, cI as qt, cJ as zt, cK as $s, cL as Cs, cM as $n, cN as Ss, cO as Nr, cP as Bt, cQ as zo, cR as ks, cS as Es, cT as j, cU as Ur, cV as Ms, cW as Ds, cX as sr, cY as As, cZ as Ts, c_ as zn, c$ as Fs, d0 as Is, d1 as Z, d2 as Ps, d3 as Ls } from "./index-k-BDWW2Q.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -4,4 +4,6 @@ export declare const DOCUMENT_ID_ATTRIBUTE = "documentId";
4
4
  export declare const DOCUMENTS_SELECT_TYPE_ERROR = "DOCUMENTS_SELECT_DOCUMENT_TYPE";
5
5
  export declare const DOCUMENTS_UPLOAD_REQUIRED_ERROR = "DOCUMENTS_UPLOAD_A_DOCUMENT";
6
6
  export declare const DOCUMENTS_ID_REQUIRED_ERROR = "INPUT_VALUE_REQUIRED";
7
+ export declare const DOCUMENTS_ID_ALPHANUMERIC_ERROR = "DOCUMENTS_DOCUMENT_ID_ALPHANUMERIC";
8
+ export declare const DOCUMENT_ID_PATTERN: RegExp;
7
9
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/documents/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAEvD,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AACtD,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD,eAAO,MAAM,2BAA2B,mCAAmC,CAAC;AAC5E,eAAO,MAAM,+BAA+B,gCAAgC,CAAC;AAC7E,eAAO,MAAM,2BAA2B,yBAAyB,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/documents/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAEvD,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AACtD,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD,eAAO,MAAM,2BAA2B,mCAAmC,CAAC;AAC5E,eAAO,MAAM,+BAA+B,gCAAgC,CAAC;AAC7E,eAAO,MAAM,2BAA2B,yBAAyB,CAAC;AAClE,eAAO,MAAM,+BAA+B,uCACN,CAAC;AACvC,eAAO,MAAM,mBAAmB,QAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/documents/utils.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,SAAS,CAAC;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAQvF,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAUlE,eAAO,MAAM,aAAa,GACxB,OAAO,aAAa,EACpB,YAAY,sBAAsB,EAAE,GAAG,SAAS,KAC/C,mBAkBF,CAAC;AAKF,eAAO,MAAM,kBAAkB,GAAI,OAAO,aAAa,KAAG,OACT,CAAC;AAElD,eAAO,MAAM,2BAA2B,GAAI,sEAKzC,iCAAiC,KAAG,WAAW,EA4B7C,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/documents/utils.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,SAAS,CAAC;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAUvF,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAUlE,eAAO,MAAM,aAAa,GACxB,OAAO,aAAa,EACpB,YAAY,sBAAsB,EAAE,GAAG,SAAS,KAC/C,mBAoBF,CAAC;AAKF,eAAO,MAAM,kBAAkB,GAAI,OAAO,aAAa,KAAG,OACT,CAAC;AAElD,eAAO,MAAM,2BAA2B,GAAI,sEAKzC,iCAAiC,KAAG,WAAW,EA4B7C,CAAC"}
@@ -1,7 +1,7 @@
1
- import { cf as i, cg as o } from "./index-CqGwlQCF.js";
2
- import "react";
1
+ import { cg as i, ch as o } from "./index-k-BDWW2Q.js";
3
2
  import "react/jsx-runtime";
4
3
  import "@tanstack/react-query";
4
+ import "react";
5
5
  const r = i(
6
6
  o,
7
7
  "useClinicalConfig",
@@ -1,31 +1,31 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { u as g, Z as u, c2 as f, cc as x, cd as p, ce as _, aW as b, c8 as N } from "./index-CqGwlQCF.js";
3
- import { lazy as h, useMemo as t, Suspense as C } from "react";
2
+ import { a as g, Z as u, c3 as f, cd as p, ce as x, cf as _, aX as N, c9 as b } from "./index-k-BDWW2Q.js";
4
3
  import "@tanstack/react-query";
5
- import { u as E } from "./hook-D0mPwQxh.js";
6
- const L = {
4
+ import { lazy as h, useMemo as t, Suspense as L } from "react";
5
+ import { u as C } from "./hook-BrMn2rwL.js";
6
+ const E = {
7
7
  "org.bahmni.clinical.v2.search": h(
8
- () => import("./index-BRJXYEIR.js")
8
+ () => import("./index-p_S0LS2P.js")
9
9
  )
10
- }, I = "index-module_page__16xxw", O = "index-module_loading__wNI-4", P = "index-module_message__Ib5Iw", l = {
11
- page: I,
12
- loading: O,
13
- message: P
14
- }, H = () => {
15
- const { t: i } = g(), { clinicalConfig: o } = E(), { userPrivileges: r } = u(), m = t(
10
+ }, P = "index-module_page__16xxw", S = "index-module_loading__wNI-4", I = "index-module_message__Ib5Iw", l = {
11
+ page: P,
12
+ loading: S,
13
+ message: I
14
+ }, T = () => {
15
+ const { t: i } = g(), { clinicalConfig: o } = C(), { userPrivileges: r } = u(), m = t(
16
16
  () => [
17
17
  { id: "home", label: i("HOME_LABEL"), href: f },
18
18
  { id: "clinical", label: i("CLINICAL_LABEL"), isCurrentPage: !0 }
19
19
  ],
20
20
  [i]
21
21
  ), c = t(
22
- () => x(o?.extensions ?? []),
22
+ () => p(o?.extensions ?? []),
23
23
  [o]
24
24
  ), d = t(
25
25
  () => Array.from(c.entries()).map(([e, a]) => ({
26
26
  pointId: e,
27
- Handler: L[e],
28
- filtered: p(
27
+ Handler: E[e],
28
+ filtered: x(
29
29
  a,
30
30
  r
31
31
  ).filter(
@@ -37,7 +37,7 @@ const L = {
37
37
  return /* @__PURE__ */ s(
38
38
  _,
39
39
  {
40
- header: /* @__PURE__ */ s(N, { breadcrumbItems: m }),
40
+ header: /* @__PURE__ */ s(b, { breadcrumbItems: m }),
41
41
  main: /* @__PURE__ */ s(
42
42
  "div",
43
43
  {
@@ -51,10 +51,10 @@ const L = {
51
51
  id: e,
52
52
  "data-testid": `${e}-test-id`,
53
53
  children: /* @__PURE__ */ s(
54
- C,
54
+ L,
55
55
  {
56
56
  fallback: /* @__PURE__ */ s(
57
- b,
57
+ N,
58
58
  {
59
59
  type: "multi",
60
60
  className: l.loading
@@ -81,5 +81,5 @@ const L = {
81
81
  );
82
82
  };
83
83
  export {
84
- H as default
84
+ T as default
85
85
  };