@bahmni/clinical-app 0.0.1-dev.245 → 0.0.1-dev.246

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 r, jsxs as p, Fragment as Y } from "react/jsx-runtime";
2
- import { c as K, u as Q, d as W, a as J, l as X, m as Z, b as ee, w as te, e as ae } from "./index-1Ut0P2Mo.js";
2
+ import { c as K, u as Q, d as W, a as J, l as X, m as Z, b as ee, w as te, e as ae } from "./index-CJnq-JxP.js";
3
3
  import { useState as l, useCallback as h, useEffect as f, useMemo as T } from "react";
4
4
  const ne = "_documentsTableBody_1voj8_1", oe = "_viewAttachmentsLink_1voj8_11", re = "_documentViewerContainer_1voj8_15", de = "_attachmentItem_1voj8_23", se = "_attachmentCounter_1voj8_27", ce = "_attachmentError_1voj8_36", ie = "_documentIframe_1voj8_44", le = "_documentImage_1voj8_50", d = {
5
5
  documentsTableBody: ne,
@@ -1,17 +1,17 @@
1
- import { jsx as s, jsxs as W, Fragment as X } from "react/jsx-runtime";
2
- import { u as Z, c as ee, f as re, g as ae, a as c, Q as te, N as U, m as oe, l as se, b as S, x as ne, h as de, w as ie, $ as ue, o as me, i as le, s as ce, j as fe, k as ye } from "./index-1Ut0P2Mo.js";
1
+ import { jsx as s, jsxs as J, Fragment as W } from "react/jsx-runtime";
2
+ import { u as X, c as ee, f as re, g as ae, a as c, Q as te, N as U, m as oe, l as se, b as S, x as ne, h as de, w as ie, $ as ue, o as me, i as le, s as ce, j as fe, k as ye } from "./index-CJnq-JxP.js";
3
3
  import { useState as q, useMemo as d, useCallback as f } from "react";
4
- const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", I = {
4
+ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", O = {
5
5
  formsTableBody: pe,
6
6
  customAccordianItem: be
7
7
  }, Ne = (u) => u ? u.extension?.find(
8
8
  (n) => n.url === me
9
- )?.valueString : void 0, Oe = ({
9
+ )?.valueString : void 0, Ae = ({
10
10
  episodeOfCareUuids: u,
11
11
  encounterUuids: n,
12
12
  config: C
13
13
  }) => {
14
- const { t: o } = Z(), m = ee(), [l, O] = q(!1), [t, A] = q(null), { numberOfVisits: x, hideThumbnail: k = !1 } = C ?? {}, T = re(
14
+ const { t: o } = X(), m = ee(), [l, A] = q(!1), [t, I] = q(null), { numberOfVisits: k, hideThumbnail: x = !1 } = C ?? {}, T = re(
15
15
  u,
16
16
  n
17
17
  ), $ = ae(), {
@@ -22,20 +22,20 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", I = {
22
22
  refetch: w
23
23
  } = c({
24
24
  queryKey: ["forms", m, u],
25
- queryFn: () => le(m, void 0, x),
25
+ queryFn: () => le(m, void 0, k),
26
26
  enabled: !!m && !T
27
- }), F = d(() => !n || n.length === 0 ? y : y.filter(
27
+ }), _ = d(() => !n || n.length === 0 ? y : y.filter(
28
28
  (e) => n.includes(e.encounterUuid)
29
- ), [y, n]), { data: _ = [] } = c({
29
+ ), [y, n]), { data: D = [] } = c({
30
30
  queryKey: ["observationForms"],
31
31
  queryFn: () => ce()
32
- }), L = f(
33
- (e) => _.find((r) => r.name === e)?.uuid,
34
- [_]
32
+ }), F = f(
33
+ (e) => D.find((r) => r.name === e)?.uuid,
34
+ [D]
35
35
  ), p = d(() => {
36
36
  if (t)
37
- return L(t.formName);
38
- }, [t, L]), {
37
+ return F(t.formName);
38
+ }, [t, F]), {
39
39
  isLoading: H,
40
40
  isError: K,
41
41
  error: b
@@ -67,7 +67,7 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", I = {
67
67
  return U(b).message;
68
68
  if (g)
69
69
  return U(g).message;
70
- }, [b, g]), M = d(
70
+ }, [b, g]), L = d(
71
71
  () => [
72
72
  { key: "recordedOn", header: o("RECORDED_ON") },
73
73
  { key: "recordedBy", header: o("RECORDED_BY") }
@@ -79,12 +79,12 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", I = {
79
79
  { key: "recordedBy", sortable: !0 }
80
80
  ],
81
81
  []
82
- ), D = d(() => {
83
- const e = F.reduce(
82
+ ), M = d(() => {
83
+ const e = _.reduce(
84
84
  (r, a) => {
85
85
  const i = a.formName;
86
86
  r[i] ??= [];
87
- const h = a.providers.map((J) => J.providerName).filter(Boolean).join(", ");
87
+ const h = a.providers.map((Z) => Z.providerName).filter(Boolean).join(", ");
88
88
  return r[i].push({
89
89
  id: a.encounterUuid,
90
90
  formName: a.formName,
@@ -104,10 +104,10 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", I = {
104
104
  )
105
105
  })
106
106
  ).sort((r, a) => r.formName.localeCompare(a.formName));
107
- }, [F, o]), R = f((e) => {
108
- A(e), O(!0);
107
+ }, [_, o]), R = f((e) => {
108
+ I(e), A(!0);
109
109
  }, []), Y = f(() => {
110
- O(!1), A(null);
110
+ A(!1), I(null);
111
111
  }, []), v = f(
112
112
  (e, r) => {
113
113
  switch (r) {
@@ -121,33 +121,33 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", I = {
121
121
  },
122
122
  [R]
123
123
  );
124
- return /* @__PURE__ */ W(X, { children: [
125
- /* @__PURE__ */ s("div", { "data-testid": "forms-table", children: B || E || D.length === 0 || T ? /* @__PURE__ */ s(
124
+ return /* @__PURE__ */ J(W, { children: [
125
+ /* @__PURE__ */ s("div", { "data-testid": "forms-table", children: B || E || M.length === 0 || T ? /* @__PURE__ */ s(
126
126
  S,
127
127
  {
128
- headers: M,
128
+ headers: L,
129
129
  ariaLabel: o("FORMS_HEADING"),
130
130
  rows: [],
131
131
  loading: B,
132
132
  errorStateMessage: E ? j?.message : void 0,
133
133
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
134
134
  renderCell: v,
135
- className: I.formsTableBody,
135
+ className: O.formsTableBody,
136
136
  dataTestId: "forms-table"
137
137
  }
138
- ) : /* @__PURE__ */ s(ne, { align: "start", children: D.map((e, r) => {
138
+ ) : /* @__PURE__ */ s(ne, { align: "start", children: M.map((e, r) => {
139
139
  const { formName: a, records: i } = e;
140
140
  return /* @__PURE__ */ s(
141
141
  de,
142
142
  {
143
143
  title: a,
144
- className: I.customAccordianItem,
144
+ className: O.customAccordianItem,
145
145
  testId: `accordian-title-${a}`,
146
146
  open: r === 0,
147
147
  children: /* @__PURE__ */ s(
148
148
  S,
149
149
  {
150
- headers: M,
150
+ headers: L,
151
151
  ariaLabel: o("FORMS_HEADING"),
152
152
  rows: i,
153
153
  loading: !1,
@@ -155,7 +155,7 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", I = {
155
155
  sortable: P,
156
156
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
157
157
  renderCell: v,
158
- className: I.formsTableBody,
158
+ className: O.formsTableBody,
159
159
  dataTestId: `forms-table-${a}`
160
160
  }
161
161
  )
@@ -184,7 +184,7 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", I = {
184
184
  errorMessage: G,
185
185
  emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
186
186
  testIdPrefix: t.formName,
187
- hideThumbnail: k
187
+ hideThumbnail: x
188
188
  }
189
189
  )
190
190
  }
@@ -192,5 +192,5 @@ const pe = "_formsTableBody_81hra_1", be = "_customAccordianItem_81hra_6", I = {
192
192
  ] });
193
193
  };
194
194
  export {
195
- Oe as default
195
+ Ae as default
196
196
  };
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CeHV8uHs.js";
2
- import { E as d, F as f, G as e } from "./index-1Ut0P2Mo.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CGyL4NAP.js";
2
+ import { E as d, F as f, G as e } from "./index-CJnq-JxP.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-CeHV8uHs.js";
2
- import { E as v, F as C, G as e } from "./index-1Ut0P2Mo.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-CGyL4NAP.js";
2
+ import { E as v, F as C, G as e } from "./index-CJnq-JxP.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,6 +1,6 @@
1
1
  import { jsxs as N, jsx as u } from "react/jsx-runtime";
2
- import { c as Q, d as k, u as S, n as H, p as K, a as w, Q as M, q as x, r as G, t as X, H as j, b as z, v as P, Z as D, y as Z, z as Y, R as J, A as W, B as ee, C as ae, D as te } from "./index-1Ut0P2Mo.js";
3
- import { useRef as se, useEffect as $, useMemo as R } from "react";
2
+ import { c as Q, d as V, u as S, n as H, p as K, a as w, Q as x, q as G, r as M, t as X, H as j, b as z, v as P, Z as D, y as Z, z as Y, R as J, A as W, B as ee, C as ae, D as te } from "./index-CJnq-JxP.js";
3
+ import { useRef as se, useEffect as O, useMemo as R } from "react";
4
4
  const A = (a, n, d, l, b, r) => {
5
5
  const t = Z(a, n, b), s = t.value, i = Y(s);
6
6
  let o = s;
@@ -112,20 +112,20 @@ const A = (a, n, d, l, b, r) => {
112
112
  conceptNames: d = [],
113
113
  conceptUuid: l = [],
114
114
  hideThumbnail: b = !1
115
- } = n, r = se(/* @__PURE__ */ new Set()), t = Q(), { addNotification: s } = k(), { t: i } = S(), o = H({
115
+ } = n, r = se(/* @__PURE__ */ new Set()), t = Q(), { addNotification: s } = V(), { t: i } = S(), o = H({
116
116
  queries: d.map((e) => ({
117
117
  queryKey: de(e),
118
118
  queryFn: () => K(e),
119
119
  enabled: !!e
120
120
  }))
121
121
  });
122
- $(() => {
122
+ O(() => {
123
123
  o.forEach((e, h) => {
124
124
  if (e.isError && !r.current.has(h)) {
125
- const V = d[h];
125
+ const k = d[h];
126
126
  s({
127
127
  title: i("ERROR_DEFAULT_TITLE"),
128
- message: i("ERROR_FETCHING_CONCEPT", { conceptName: V }),
128
+ message: i("ERROR_FETCHING_CONCEPT", { conceptName: k }),
129
129
  type: "error"
130
130
  }), r.current.add(h);
131
131
  } else e.isError || r.current.delete(h);
@@ -135,35 +135,35 @@ const A = (a, n, d, l, b, r) => {
135
135
  data: c,
136
136
  isLoading: F,
137
137
  isError: f,
138
- refetch: T
138
+ refetch: g
139
139
  } = w({
140
140
  queryKey: le(t, m),
141
141
  queryFn: () => te(t, m),
142
142
  enabled: !!t && m.length > 0 && y
143
143
  });
144
- M(
144
+ x(
145
145
  (e) => {
146
146
  e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
147
147
  (h) => m.includes(h)
148
- ) && T();
148
+ ) && g();
149
149
  },
150
- [t, T]
151
- ), $(() => {
150
+ [t, g]
151
+ ), O(() => {
152
152
  f && s({
153
153
  title: i("ERROR_DEFAULT_TITLE"),
154
154
  message: i("ERROR_FETCHING_OBSERVATIONS"),
155
155
  type: "error"
156
156
  });
157
157
  }, [f]);
158
- const g = R(() => {
158
+ const T = R(() => {
159
159
  if (!c) return [];
160
- const e = x(c), h = G(e);
160
+ const e = G(c), h = M(e);
161
161
  return X(h);
162
- }, [c]), C = [
162
+ }, [c]), q = [
163
163
  { key: "name", header: "name" },
164
164
  { key: "value", header: "value" },
165
165
  { key: "form", header: "form" }
166
- ], O = F || !y, _ = f && y, L = (!c || c.entry?.length === 0 || m.length === 0) && y, q = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, B = L ? i("NO_OBSERVATIONS_FOUND") : void 0, U = g.length > 0 && !O && !_, E = n.titleTranslationKey, v = E ? i(E) : "";
166
+ ], _ = F || !y, $ = f && y, C = (!c || c.entry?.length === 0 || m.length === 0) && y, L = $ ? i("ERROR_FETCHING_OBSERVATIONS") : null, B = C ? i("NO_OBSERVATIONS_FOUND") : void 0, U = T.length > 0 && !_ && !$, E = n.titleTranslationKey, v = E ? i(E) : "";
167
167
  return /* @__PURE__ */ N(
168
168
  "div",
169
169
  {
@@ -185,18 +185,18 @@ const A = (a, n, d, l, b, r) => {
185
185
  U ? /* @__PURE__ */ u(
186
186
  ie,
187
187
  {
188
- groupedData: g,
188
+ groupedData: T,
189
189
  title: v,
190
190
  hideThumbnail: b
191
191
  }
192
192
  ) : /* @__PURE__ */ u(
193
193
  z,
194
194
  {
195
- headers: C,
195
+ headers: q,
196
196
  rows: [],
197
197
  ariaLabel: i("OBSERVATIONS"),
198
- loading: O,
199
- errorStateMessage: q,
198
+ loading: _,
199
+ errorStateMessage: L,
200
200
  emptyStateMessage: B,
201
201
  dataTestId: "observations-table"
202
202
  }
@@ -1,4 +1,4 @@
1
- import { I as we, J as z, K as xt, L as B, F as q, G as y, P as Ro, M as ye, S as R, O as _, T as k, U as N, V as A, W as bs, X as ir, Y as $e, _ as U, a0 as Hn, a1 as Vn, a2 as dt, a3 as D, a4 as xs, a5 as cn, a6 as Be, a7 as ws, a8 as qt, a9 as zt, aa as $s, ab as Cs, ac as $n, ad as Ss, ae as Nr, af as Bt, ag as zo, ah as ks, ai as Es, aj as j, ak as Ur, al as Ms, am as Ds, an as sr, ao as As, ap as Ts, aq as zn, ar as Fs, as as Is, at as Z, au as Ps, av as Ls } from "./index-1Ut0P2Mo.js";
1
+ import { I as we, J as z, K as xt, L as B, F as q, G as y, P as Ro, M as ye, S as R, O as _, T as k, U as N, V as A, W as bs, X as ir, Y as $e, _ as U, a0 as Hn, a1 as Vn, a2 as dt, a3 as D, a4 as xs, a5 as cn, a6 as Be, a7 as ws, a8 as qt, a9 as zt, aa as $s, ab as Cs, ac as $n, ad as Ss, ae as Nr, af as Bt, ag as zo, ah as ks, ai as Es, aj as j, ak as Ur, al as Ms, am as Ds, an as sr, ao as As, ap as Ts, aq as zn, ar as Fs, as as Is, at as Z, au as Ps, av as Ls } from "./index-CJnq-JxP.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1,6 +1,8 @@
1
1
  import { default as React } from 'react';
2
2
  interface ConsultationActionButtonProps {
3
3
  isActionAreaVisible: boolean;
4
+ editActiveEncounter: boolean;
5
+ isLoading: boolean;
4
6
  }
5
7
  declare const ConsultationActionButton: React.FC<ConsultationActionButtonProps>;
6
8
  export default ConsultationActionButton;
@@ -1 +1 @@
1
- {"version":3,"file":"ConsultationActionButton.d.ts","sourceRoot":"","sources":["../../../src/components/patientHeader/ConsultationActionButton.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,6BAA6B;IACrC,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,QAAA,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CA8BrE,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
1
+ {"version":3,"file":"ConsultationActionButton.d.ts","sourceRoot":"","sources":["../../../src/components/patientHeader/ConsultationActionButton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,6BAA6B;IACrC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CA4BrE,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PatientHeader.d.ts","sourceRoot":"","sources":["../../../src/components/patientHeader/PatientHeader.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,kBAAkB;IAC1B,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAe/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"PatientHeader.d.ts","sourceRoot":"","sources":["../../../src/components/patientHeader/PatientHeader.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,kBAAkB;IAC1B,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAgC/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,24 +1,18 @@
1
- import { Provider } from '@bahmni/services';
1
+ import { Provider, MatchReasonCode } from '@bahmni/services';
2
2
  import { Encounter } from 'fhir/r4';
3
- interface UseEncounterSessionOptions {
3
+ export interface UseEncounterSessionOptions {
4
4
  practitioner: Provider | null;
5
5
  encounterTypeUUID?: string;
6
6
  }
7
- interface UseEncounterSessionReturn {
7
+ export interface UseEncounterSessionReturn {
8
8
  hasActiveSession: boolean;
9
9
  activeEncounter: Encounter | null;
10
10
  isPractitionerMatch: boolean;
11
+ matchReason: MatchReasonCode[];
11
12
  editActiveEncounter: boolean;
12
13
  isLoading: boolean;
13
14
  error: string | null;
14
15
  refetch: () => Promise<void>;
15
16
  }
16
- /**
17
- * Hook to manage encounter session state
18
- * Determines if there's an active encounter session for the current patient
19
- * @param options - Options containing the practitioner to use for session filtering
20
- * @returns Object containing session state and utilities
21
- */
22
17
  export declare function useEncounterSession(options: UseEncounterSessionOptions): UseEncounterSessionReturn;
23
- export {};
24
18
  //# sourceMappingURL=useEncounterSession.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useEncounterSession.d.ts","sourceRoot":"","sources":["../../src/hooks/useEncounterSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,UAAU,0BAA0B;IAClC,YAAY,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,UAAU,yBAAyB;IACjC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,SAAS,GAAG,IAAI,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED;;;;;GAKG;AAEH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,0BAA0B,GAClC,yBAAyB,CA0F3B"}
1
+ {"version":3,"file":"useEncounterSession.d.ts","sourceRoot":"","sources":["../../src/hooks/useEncounterSession.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGR,eAAe,EAEhB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,yBAAyB;IACxC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,SAAS,GAAG,IAAI,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,0BAA0B,GAClC,yBAAyB,CAiG3B"}