@bahmni/clinical-app 0.0.1-dev.446 → 0.0.1-dev.448

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,10 +1,10 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { u as useTranslation, H as q, I as ENCOUNTER_CONCEPTS_URL, J as Jr, L as Yo, M as oqt, N as Ns, O as BAHMNI_USER_LOCATION_COOKIE_NAME, P as bc, Q as D3, d as d0, S as Vb2, T as Cb2, X as vb2, Z as jx2, _ as il1, a0 as ub2, a1 as U_, a2 as Wi, a3 as rf, a4 as b_, a5 as tf, a6 as Ps, a7 as dist, a8 as nt, a9 as ge, aa as us, ab as ob, ac as wb, ad as _b, ae as Lb2, af as Ab2, ag as ab2, ah as Bz2, z as z1, y as yp, ai as bb, aj as cg, ak as Tb, al as Uy2, am as cb2, an as qb2, ao as Tb2, ap as Db2, i as h21, aq as Sb, ar as vb, as as Rb, at as ev, au as Mb2, av as vv, aw as qs, ax as nv, ay as Wv, az as mb, aA as Ib, aB as Lb, aC as CLINICAL_V2_CONFIG_BASE_URL, aD as qb, aE as Y_, aF as fn, aG as Mb, aH as cb, aI as Jv, aJ as oL2, aK as sv, aL as Fb, aM as jb, aN as Zv, aO as gb2, aP as fT, aQ as sb, aR as Vb, aS as Rt, aT as Yr, aU as oT, aV as lT, k as kr, aW as $v, aX as av, aY as lv, e as bKt, aZ as Wb2, a_ as jb2, a$ as Dv, b0 as Cv, b1 as Nb2, b2 as se, b3 as STOP_REASON_VALUESET_EXPAND_URL, b4 as Be, b5 as T_, b6 as STOP_REASON_VALUESET_TITLE, b7 as Gf, b8 as os, b9 as Pb2, ba as Iv, bb as xv, bc as i0, bd as rb, be as a0, bf as dn, bg as N4, bh as c3, bi as Bb2, bj as C_, bk as Lv, bl as Mv, bm as Uv, bn as Fv, bo as Ki, bp as cs, bq as gv, br as Ab, bs as dT, bt as Qv, bu as Xv, bv as Kv, bw as CDSS_SERVER_CONFIG_URL, bx as Nb, by as ec, bz as M0, bA as Ge, bB as w21, bC as yb2, bD as XE, bE as yv, bF as Ev, bG as mb2, bH as Xt, bI as bv, bJ as _v, bK as wv, bL as e21, bM as Yn1, bN as u0, bO as Tv, bP as Mi, bQ as g_, bR as BAHMNI_CLINICAL_PATH, bS as k_, bT as cw, bU as bb2, bV as _b2, bW as $z2, bX as en1, bY as x_, bZ as c21 } from "./index-CWrIj17R.js";
2
+ import { u as useTranslation, E as q, F as ENCOUNTER_CONCEPTS_URL, L as Jr, M as Yo, N as oqt, O as Ns, P as BAHMNI_USER_LOCATION_COOKIE_NAME, Q as bc, S as D3, d as d0, V as Vb2, T as Cb2, X as vb2, Z as jx2, $ as il1, a0 as ub2, a1 as U_, a2 as Wi, a3 as rf, a4 as b_, a5 as tf, a6 as Ps, a7 as dist, a8 as nt, a9 as ge, aa as us, ab as ob, ac as wb, ad as _b, ae as Lb2, af as Ab2, ag as ab2, ah as Bz2, z as z1, y as yp, ai as bb, aj as cg, ak as Tb, al as Uy2, am as cb2, an as qb2, ao as Tb2, ap as Db2, j as f21, aq as Sb, ar as vb, as as Rb, at as ev, au as Mb2, av as vv, aw as qs, ax as nv, ay as Wv, az as mb, aA as Ib, aB as Lb, aC as CLINICAL_V2_CONFIG_BASE_URL, aD as qb, aE as Y_, aF as fn, aG as Mb, aH as cb, aI as Jv, aJ as oL2, aK as sv, aL as Fb, aM as jb, aN as Zv, aO as gb2, aP as fT, aQ as sb, aR as Vb, aS as Rt, aT as Yr, aU as oT, aV as lT, k as kr, aW as $v, aX as av, aY as lv, f as bKt, aZ as Wb2, a_ as jb2, a$ as Dv, b0 as Cv, b1 as Nb2, b2 as se, b3 as STOP_REASON_VALUESET_EXPAND_URL, b4 as Be, b5 as T_, b6 as STOP_REASON_VALUESET_TITLE, b7 as Gf, b8 as os, b9 as Pb2, ba as Iv, bb as xv, bc as i0, bd as rb, be as a0, bf as dn, bg as N4, bh as c3, bi as Bb2, bj as C_, bk as Lv, bl as Mv, bm as Uv, bn as Fv, bo as Ki, bp as cs, bq as gv, br as Ab, bs as dT, bt as Qv, bu as Xv, bv as Kv, bw as CDSS_SERVER_CONFIG_URL, bx as Nb, by as ec, bz as M0, bA as Ge, bB as v21, bC as yb2, bD as XE, bE as yv, bF as Ev, bG as mb2, bH as Xt, bI as bv, bJ as _v, bK as wv, bL as r21, bM as Xn1, bN as u0, bO as Tv, bP as Mi, bQ as g_, bR as BAHMNI_CLINICAL_PATH, bS as k_, bT as cw, bU as bb2, bV as _b2, bW as $z2, bX as rn1, bY as x_, bZ as u21 } from "./index-BFeX1vte.js";
3
3
  import * as React from "react";
4
4
  import React__default, { createContext, useContext, useState, useCallback, useEffect, useMemo, Children, useRef, useLayoutEffect, forwardRef, isValidElement, cloneElement, useReducer, Component, useImperativeHandle, PureComponent, createRef, useSyncExternalStore, Suspense } from "react";
5
5
  import { useQuery, useQueries, useQueryClient } from "@tanstack/react-query";
6
6
  import { useNavigate, useSearchParams } from "react-router-dom";
7
- import { u as useClinicalConfig } from "./hook-CPfpyOdi.js";
7
+ import { u as useClinicalConfig } from "./hook-CLdRoLd-.js";
8
8
  import * as ReactDOM from "react-dom";
9
9
  import ReactDOM__default, { createPortal } from "react-dom";
10
10
  var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
@@ -134582,7 +134582,7 @@ Try polyfilling it using "@formatjs/intl-displaynames"
134582
134582
  }
134583
134583
  _parseDate(u) {
134584
134584
  if (!u) return !1;
134585
- const [A, m, y] = u.split("-").map(Number);
134585
+ const [A, m, y] = u.split(/[ T]/)[0].split("-").map(Number);
134586
134586
  return !!(A && m && y) && new globalThis.Date(A, m - 1, y);
134587
134587
  }
134588
134588
  _shouldValidateOnMount() {
@@ -134603,7 +134603,7 @@ Try polyfilling it using "@formatjs/intl-displaynames"
134603
134603
  }
134604
134604
  render() {
134605
134605
  const { conceptUuid: u, label: A, enabled: m } = this.props;
134606
- return (0, ve.jsx)(za.DatePicker, { datePickerType: "single", dateFormat: "d-M-Y", value: this.props.value, parseDate: (y) => this._parseDate(y), onChange: (y) => this.handleChange(y), ref: (y) => {
134606
+ return (0, ve.jsx)(za.DatePicker, { datePickerType: "single", dateFormat: "d-M-Y", value: this._parseDate(this.props.value) || "", parseDate: (y) => this._parseDate(y), onChange: (y) => this.handleChange(y), ref: (y) => {
134607
134607
  this.datePickerRef = y;
134608
134608
  }, children: (0, ve.jsx)(za.DatePickerInput, { id: u, labelText: A, placeholder: "dd-Mmm-yyyy", size: "sm", disabled: !m, invalid: this.state.hasErrors, warn: this.state.hasWarnings }) });
134609
134609
  }
@@ -139903,9 +139903,9 @@ const allergiesFormTile = "AllergiesForm-module_allergiesFormTile__1UsbU", aller
139903
139903
  duplicateNotification: duplicateNotification$2
139904
139904
  }, allergiesQueryKeys = (p) => ["allergies", p], AllergiesForm = React__default.memo(({ encounterSessionStartContext: p }) => {
139905
139905
  const c = !!p?.preloadedAllergies, { t: a } = useTranslation(), s = d0(), { addNotification: f } = z1(), d = yp(
139906
- h21.ALLERGIES
139906
+ f21.ALLERGIES
139907
139907
  ), h = yp(
139908
- h21.EDIT_ALLERGIES
139908
+ f21.EDIT_ALLERGIES
139909
139909
  ), [E, g] = useState(""), [R, V] = useState(null), [H, M] = useState(!1), [$, B] = useState(
139910
139910
  null
139911
139911
  ), {
@@ -140299,7 +140299,7 @@ const investigationsFormTile = "InvestigationsForm-module_investigationsFormTile
140299
140299
  duplicateNotification: duplicateNotification$1
140300
140300
  }, InvestigationsForm = React__default.memo(() => {
140301
140301
  const { t: p } = useTranslation(), c = d0(), { addNotification: a } = z1(), s = yp(
140302
- h21.INVESTIGATIONS
140302
+ f21.INVESTIGATIONS
140303
140303
  ), [f, d] = useState(""), [h, E] = useState(null), [g, R] = useState(!1), { activeEncounter: V, matchReasons: H } = vv(), $ = H.includes("MATCHED") ? V?.id : void 0, {
140304
140304
  data: B,
140305
140305
  refetch: I,
@@ -140712,7 +140712,7 @@ const conditionsAndDiagnosesTile = "ConditionsAndDiagnoses-module_conditionsAndD
140712
140712
  duplicateNotification
140713
140713
  }, ConditionsAndDiagnoses = React__default.memo(() => {
140714
140714
  const { t: p } = useTranslation(), c = d0(), { addNotification: a } = z1(), s = yp(
140715
- h21.CONDITIONS_AND_DIAGNOSES
140715
+ f21.CONDITIONS_AND_DIAGNOSES
140716
140716
  ), [f, d] = useState(""), [h, E] = useState(null), [g, R] = useState(!1), {
140717
140717
  selectedDiagnoses: V,
140718
140718
  selectedConditions: H,
@@ -143692,7 +143692,7 @@ const observationFormsTile = "ObservationForms-module_observationFormsTile__AZ0b
143692
143692
  submittedFormUuids: R = EMPTY_SET
143693
143693
  }) => {
143694
143694
  const { t: V } = useTranslation(), H = yp(
143695
- h21.OBSERVATIONS
143695
+ f21.OBSERVATIONS
143696
143696
  ), [M, $] = useState(""), [B, I] = useState(null), { getFormData: D } = useObservationFormsStore(), z = useMemo(() => {
143697
143697
  if (!M.trim()) return h;
143698
143698
  const ne = M.toLowerCase().trim().split(/\s+/);
@@ -145391,7 +145391,7 @@ const ConsultationPad = ({
145391
145391
  onToggleActionAreaExpand: s
145392
145392
  }) => {
145393
145393
  const { t: f } = useTranslation(), { addNotification: d } = z1(), h = d0(), { activeEpisodeId: E } = useClinicalAppData(), { clinicalConfig: g, isLoading: R } = useClinicalConfig(), { encounterConcepts: V } = useEncounterConcepts(), H = yp(
145394
- h21.ADD_VISITS
145394
+ f21.ADD_VISITS
145395
145395
  ), M = useActionAreaExpandProps({
145396
145396
  isExpanded: a,
145397
145397
  onToggleExpand: s
@@ -145563,7 +145563,7 @@ const ConsultationPad = ({
145563
145563
  visitUuids: f
145564
145564
  }) => {
145565
145565
  const { t: d } = useTranslation(), { matchReasons: h, canEditOrCreate: E, activeEncounter: g } = vv(), R = h.includes("NO_ACTIVE_VISIT"), V = h.includes("MATCHED"), M = h.includes("MATCHED") ? g?.id ?? null : null, $ = (I, D, z) => {
145566
- const O = w21(I.type);
145566
+ const O = v21(I.type);
145567
145567
  if (!O)
145568
145568
  return /* @__PURE__ */ jsx("div", { className: styles$4.widgetError, children: /* @__PURE__ */ jsx("p", { children: d("CONTROL_NOT_FOUND", { type: I.type }) }) }, `${I.type}-${D}`);
145569
145569
  const F = D < z - 1;
@@ -145756,7 +145756,7 @@ const CONSULTATION_START_EVENT = "startConsultation", dispatchConsultationStart
145756
145756
  }) => {
145757
145757
  const { t: s } = useTranslation();
145758
145758
  return yp(
145759
- h21.ENCOUNTER
145759
+ f21.ENCOUNTER
145760
145760
  ) ? a ? /* @__PURE__ */ jsx(
145761
145761
  mb2,
145762
145762
  {
@@ -145834,7 +145834,7 @@ const CONSULTATION_START_EVENT = "startConsultation", dispatchConsultationStart
145834
145834
  "data-active-encounter-uuid": V && H?.id ? H.id : void 0,
145835
145835
  "data-active-practitioner-uuid": s?.uuid ?? void 0,
145836
145836
  children: [
145837
- /* @__PURE__ */ jsx(e21, {}),
145837
+ /* @__PURE__ */ jsx(r21, {}),
145838
145838
  /* @__PURE__ */ jsxs("div", { className: styles$2.actionButtons, children: [
145839
145839
  /* @__PURE__ */ jsx(
145840
145840
  ConsultationActionButton,
@@ -145845,7 +145845,7 @@ const CONSULTATION_START_EVENT = "startConsultation", dispatchConsultationStart
145845
145845
  }
145846
145846
  ),
145847
145847
  /* @__PURE__ */ jsx(
145848
- Yn1,
145848
+ Xn1,
145849
145849
  {
145850
145850
  printOptions: c,
145851
145851
  renderContext: F,
@@ -146198,7 +146198,7 @@ const DASHBOARD_CONFIG_URL = (p) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
146198
146198
  const Ee = () => {
146199
146199
  const Ie = $.get(PROGRAM_UUID_SEARCH_PARAMS_KEY);
146200
146200
  return Ie && c.contextInformation?.program ? /* @__PURE__ */ jsx(
146201
- c21,
146201
+ u21,
146202
146202
  {
146203
146203
  programUUID: Ie,
146204
146204
  config: {
@@ -146217,7 +146217,7 @@ const DASHBOARD_CONFIG_URL = (p) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
146217
146217
  {
146218
146218
  breadcrumbItems: X,
146219
146219
  globalActions: D,
146220
- userMenu: /* @__PURE__ */ jsx(en1, {}),
146220
+ userMenu: /* @__PURE__ */ jsx(rn1, {}),
146221
146221
  sideNavItems: E ? [] : re,
146222
146222
  activeSideNavItemId: _e,
146223
146223
  onSideNavItemClick: ye,
@@ -1,7 +1,7 @@
1
1
  import { jsx as d, jsxs as h, Fragment as Y } from "react/jsx-runtime";
2
- import { d as x, u as G, z as W, K as J, Y as X, h as Z, $ as ee, a as te } from "./index-CWrIj17R.js";
2
+ import { d as x, u as G, z as J, J as W, Y as X, h as Z, I as ee, a as te } from "./index-BFeX1vte.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
- import { useState as l, useCallback as _, useEffect as I, useMemo as p } from "react";
4
+ import { useState as l, useCallback as _, useEffect as D, 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 = {
6
6
  documentsTableBody: ne,
7
7
  viewAttachmentsLink: oe,
@@ -33,12 +33,12 @@ const Te = [
33
33
  "attachments",
34
34
  "uploadedOn",
35
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 }] : [], Ne = ({ config: a, encounterUuids: E }) => {
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 }] : [], Ie = ({ config: a, encounterUuids: E }) => {
37
37
  const [s, w] = l(!1), [o, U] = l(
38
38
  null
39
39
  ), [$, O] = l(
40
40
  /* @__PURE__ */ new Set()
41
- ), g = x(), { t: n } = G(), { addNotification: L } = W(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = _((e) => {
41
+ ), g = x(), { t: n } = G(), { addNotification: L } = J(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = _((e) => {
42
42
  U(e), w(!0);
43
43
  }, []), H = _(() => {
44
44
  w(!1), U(null), O(/* @__PURE__ */ new Set());
@@ -53,24 +53,24 @@ const Te = [
53
53
  u
54
54
  ],
55
55
  enabled: !!g,
56
- queryFn: () => J(
56
+ queryFn: () => W(
57
57
  g,
58
58
  E,
59
59
  u,
60
60
  f
61
61
  )
62
62
  });
63
- I(() => {
63
+ D(() => {
64
64
  i && A(i.total);
65
- }, [i]), I(() => {
65
+ }, [i]), D(() => {
66
66
  C(1), A(void 0);
67
- }, [g]), I(() => {
67
+ }, [g]), D(() => {
68
68
  y && L({
69
69
  title: n("ERROR_DEFAULT_TITLE"),
70
70
  message: b?.message ?? "",
71
71
  type: "error"
72
72
  });
73
- }, [y, b, L, n]), I(() => {
73
+ }, [y, b, L, n]), D(() => {
74
74
  const e = new AbortController();
75
75
  return (async () => {
76
76
  if (!s || !o) return;
@@ -82,8 +82,8 @@ const Te = [
82
82
  method: "HEAD",
83
83
  signal: e.signal
84
84
  })).ok || t.add(c);
85
- } catch (D) {
86
- D instanceof Error && D.name !== "AbortError" && t.add(c);
85
+ } catch (N) {
86
+ N instanceof Error && N.name !== "AbortError" && t.add(c);
87
87
  }
88
88
  }
89
89
  e.signal.aborted || O(t);
@@ -94,15 +94,15 @@ const Te = [
94
94
  t !== u ? (V(t), C(1), A(void 0)) : C(e);
95
95
  },
96
96
  [u]
97
- ), N = p(
97
+ ), I = p(
98
98
  () => a?.fields ?? Te,
99
99
  [a?.fields]
100
- ), K = 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]), j = p(() => ie(N, n), [N, n]), P = p(
101
- () => N.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(I, n), [I, n]), K = p(
101
+ () => I.map((e) => ({
102
102
  key: e,
103
103
  sortable: e !== "attachments"
104
104
  })),
105
- [N]
105
+ [I]
106
106
  ), T = p(
107
107
  () => o ? B(o) : [],
108
108
  [o]
@@ -141,12 +141,12 @@ const Te = [
141
141
  /* @__PURE__ */ d("div", { "data-testid": "documents-table", children: /* @__PURE__ */ d(
142
142
  ee,
143
143
  {
144
- headers: j,
144
+ headers: P,
145
145
  ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
146
- rows: K,
146
+ rows: j,
147
147
  loading: q,
148
148
  errorStateMessage: y ? b?.message : null,
149
- sortable: P,
149
+ sortable: K,
150
150
  emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
151
151
  renderCell: Q,
152
152
  className: r.documentsTableBody,
@@ -169,8 +169,8 @@ const Te = [
169
169
  size: "lg",
170
170
  testId: "document-view-modal",
171
171
  children: /* @__PURE__ */ d("div", { className: r.documentViewerContainer, children: T.map((e, t) => {
172
- const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), D = $.has(t);
173
- return m === "#" || D ? /* @__PURE__ */ h(
172
+ const m = R(e.url), c = e.contentType?.toLowerCase().includes("pdf"), S = (e.contentType?.toLowerCase().includes("image") ?? !1) || he.test(e.url ?? ""), N = $.has(t);
173
+ return m === "#" || N ? /* @__PURE__ */ h(
174
174
  "div",
175
175
  {
176
176
  className: r.attachmentError,
@@ -223,5 +223,5 @@ const Te = [
223
223
  ] });
224
224
  };
225
225
  export {
226
- Ne as default
226
+ Ie as default
227
227
  };
@@ -1,7 +1,7 @@
1
- import { jsx as n, jsxs as H, Fragment as ne } from "react/jsx-runtime";
2
- import { u as ie, d as de, y as le, k as me, V as ue, G as ce, m as fe, b as ye, w as he, c as Ne, e as ge, R as Te, h as pe, f as q, g as $, Y as Oe, $ as z, j as be, U as Ie, a as Ae, A as Ee, i as _e } from "./index-CWrIj17R.js";
1
+ import { jsx as n, jsxs as q, Fragment as ne } from "react/jsx-runtime";
2
+ import { u as ie, d as de, y as le, k as me, H as ue, b as ce, m as fe, c as ye, w as he, e as Ne, f as ge, R as Te, h as pe, g as V, i as z, Y as Ie, I as K, U as Oe, W as be, a as Ae, A as Ee, j as _e } from "./index-BFeX1vte.js";
3
3
  import { useQueryClient as Re, useQuery as A } from "@tanstack/react-query";
4
- import { useState as j, useMemo as i, useCallback as d } from "react";
4
+ import { useState as Y, useMemo as i, useCallback as d } from "react";
5
5
  const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_modalHeading__wnTmA", Le = "FormsTable-module_customAccordianItem__isszs", g = {
6
6
  formsTableBody: Ce,
7
7
  modalHeading: ve,
@@ -9,28 +9,28 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
9
9
  }, Ue = "startConsultation", Me = ({
10
10
  episodeOfCareUuids: E,
11
11
  encounterUuids: l,
12
- config: K,
13
- disableActions: G = !1,
12
+ config: $,
13
+ disableActions: j = !1,
14
14
  activeEncounterUuid: y = null
15
15
  }) => {
16
- const { t: o } = ie(), m = de(), [T, _] = j(!1), [t, R] = j(null), {
17
- numberOfVisits: Y,
18
- hideThumbnail: x = !1,
16
+ const { t: o } = ie(), m = de(), [T, _] = Y(!1), [t, R] = Y(null), {
17
+ numberOfVisits: x,
18
+ hideThumbnail: Q = !1,
19
19
  forms: h
20
- } = K ?? {}, Q = le(
20
+ } = $ ?? {}, G = le(
21
21
  _e.EDIT_OBSERVATIONS
22
- ), { userPrivileges: N } = me(), p = Q && !G && !!y, C = ue(
22
+ ), { userPrivileges: N } = me(), p = G && !j && !!y, C = ue(
23
23
  E,
24
24
  l
25
25
  ), P = Re(), {
26
26
  data: v = [],
27
27
  isLoading: L,
28
28
  isError: U,
29
- error: J,
30
- refetch: W
29
+ error: W,
30
+ refetch: J
31
31
  } = A({
32
32
  queryKey: ["forms", m, E],
33
- queryFn: () => ce(m, void 0, Y),
33
+ queryFn: () => ce(m, void 0, x),
34
34
  enabled: !!m && !C
35
35
  }), B = i(() => {
36
36
  let e = v;
@@ -59,10 +59,10 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
59
59
  (e) => !y || e.encounterUuid !== y ? !1 : D(e.formName),
60
60
  [y, D]
61
61
  ), {
62
- data: O,
62
+ data: I,
63
63
  isLoading: X,
64
64
  isError: Z,
65
- error: b
65
+ error: O
66
66
  } = A({
67
67
  queryKey: ["formsEncounterFHIR", t?.encounterUuid],
68
68
  queryFn: () => ye(t.encounterUuid),
@@ -70,14 +70,14 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
70
70
  });
71
71
  he(
72
72
  (e) => {
73
- e.patientUUID === m && (W(), P.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
73
+ e.patientUUID === m && (J(), P.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
74
74
  },
75
75
  [m]
76
76
  );
77
- const ee = i(() => !O?.entry || !t?.formName ? [] : O.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => Ne(e) ? ge(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [O, t?.formName]), re = i(() => {
78
- if (b)
79
- return Te(b).message;
80
- }, [b]), c = i(
77
+ const ee = i(() => !I?.entry || !t?.formName ? [] : I.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => Ne(e) ? ge(e)?.toLowerCase() === t.formName.toLowerCase() : !0), [I, t?.formName]), re = i(() => {
78
+ if (O)
79
+ return Te(O).message;
80
+ }, [O]), c = i(
81
81
  () => [
82
82
  { key: "recordedOn", header: o("RECORDED_ON") },
83
83
  { key: "recordedBy", header: o("RECORDED_BY") }
@@ -124,7 +124,7 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
124
124
  R(e), _(!0);
125
125
  }, []), w = d(() => {
126
126
  _(!1), R(null);
127
- }, []), I = d((e) => {
127
+ }, []), b = d((e) => {
128
128
  globalThis.dispatchEvent(
129
129
  new CustomEvent(Ue, {
130
130
  detail: {
@@ -136,56 +136,56 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
136
136
  }
137
137
  })
138
138
  );
139
- }, []), V = d(
139
+ }, []), H = d(
140
140
  (e, r) => {
141
141
  switch (r) {
142
142
  case "recordedOn":
143
- return /* @__PURE__ */ n(Oe, { onClick: () => k(e), children: e.recordedOn });
143
+ return /* @__PURE__ */ n(Ie, { onClick: () => k(e), children: e.recordedOn });
144
144
  case "recordedBy":
145
145
  return e.recordedBy;
146
146
  case "actions":
147
147
  return u(e) ? /* @__PURE__ */ n(
148
- q,
148
+ V,
149
149
  {
150
150
  label: o("EDIT_OBSERVATION_FORM"),
151
151
  kind: "ghost",
152
152
  size: "sm",
153
153
  testId: `edit-form-${e.encounterUuid}`,
154
- onClick: () => I(e),
155
- children: /* @__PURE__ */ n($, {})
154
+ onClick: () => b(e),
155
+ children: /* @__PURE__ */ n(z, {})
156
156
  }
157
157
  ) : null;
158
158
  default:
159
159
  return null;
160
160
  }
161
161
  },
162
- [k, I, u, o]
162
+ [k, b, u, o]
163
163
  );
164
- return /* @__PURE__ */ H(ne, { children: [
164
+ return /* @__PURE__ */ q(ne, { children: [
165
165
  /* @__PURE__ */ n("div", { id: "forms-table", "data-testid": "forms-table", children: L || U || M.length === 0 || C ? /* @__PURE__ */ n(
166
- z,
166
+ K,
167
167
  {
168
168
  headers: oe,
169
169
  ariaLabel: o("FORMS_HEADING"),
170
170
  rows: [],
171
171
  loading: L,
172
- errorStateMessage: U ? J?.message : void 0,
172
+ errorStateMessage: U ? W?.message : void 0,
173
173
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
174
- renderCell: V,
174
+ renderCell: H,
175
175
  className: g.formsTableBody,
176
176
  dataTestId: "forms-table"
177
177
  }
178
- ) : /* @__PURE__ */ n(be, { align: "start", children: M.map((e, r) => {
178
+ ) : /* @__PURE__ */ n(Oe, { align: "start", children: M.map((e, r) => {
179
179
  const { formName: a, records: s } = e, f = ae(s);
180
180
  return /* @__PURE__ */ n(
181
- Ie,
181
+ be,
182
182
  {
183
183
  title: a,
184
184
  className: g.customAccordianItem,
185
185
  testId: `accordian-title-${a}`,
186
186
  open: r === 0,
187
187
  children: /* @__PURE__ */ n(
188
- z,
188
+ K,
189
189
  {
190
190
  headers: f,
191
191
  ariaLabel: o("FORMS_HEADING"),
@@ -194,7 +194,7 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
194
194
  errorStateMessage: "",
195
195
  sortable: te,
196
196
  emptyStateMessage: o("FORMS_UNAVAILABLE"),
197
- renderCell: V,
197
+ renderCell: H,
198
198
  className: g.formsTableBody,
199
199
  dataTestId: `forms-table-${a}`
200
200
  }
@@ -210,19 +210,19 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
210
210
  portalId: "main-display-area",
211
211
  open: T,
212
212
  onRequestClose: w,
213
- modalHeading: /* @__PURE__ */ H("div", { className: g.modalHeading, children: [
213
+ modalHeading: /* @__PURE__ */ q("div", { className: g.modalHeading, children: [
214
214
  /* @__PURE__ */ n("span", { children: t.formName }),
215
215
  p && u(t) && /* @__PURE__ */ n(
216
- q,
216
+ V,
217
217
  {
218
218
  label: o("EDIT_OBSERVATION_FORM"),
219
219
  kind: "ghost",
220
220
  size: "sm",
221
221
  testId: `edit-form-modal-${t.encounterUuid}`,
222
222
  onClick: () => {
223
- w(), I(t);
223
+ w(), b(t);
224
224
  },
225
- children: /* @__PURE__ */ n($, {})
225
+ children: /* @__PURE__ */ n(z, {})
226
226
  }
227
227
  )
228
228
  ] }),
@@ -239,7 +239,7 @@ const Ce = "FormsTable-module_formsTableBody__SvGha", ve = "FormsTable-module_mo
239
239
  errorMessage: re,
240
240
  emptyStateMessage: o("NO_FORM_DATA_AVAILABLE"),
241
241
  testIdPrefix: t.formName,
242
- hideThumbnail: x,
242
+ hideThumbnail: Q,
243
243
  formName: t.formName
244
244
  }
245
245
  )
@@ -1,5 +1,5 @@
1
- import { c as s, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-r4Lc-1Zs.js";
2
- import { c3 as d, c4 as f, c5 as e } from "./index-CWrIj17R.js";
1
+ import { c as s, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-TN6fy-3B.js";
2
+ import { c3 as d, c4 as f, c5 as e } from "./index-BFeX1vte.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = s({
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-r4Lc-1Zs.js";
2
- import { c3 as v, c4 as C, c5 as e } from "./index-CWrIj17R.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-TN6fy-3B.js";
2
+ import { c3 as v, c4 as C, c5 as e } from "./index-BFeX1vte.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"