@bahmni/clinical-app 0.0.1-dev.374 → 0.0.1-dev.375

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 { B, v as ENCOUNTER_CONCEPTS_URL, Y as Yr, C as Ci, w as BAHMNI_USER_LOCATION_COOKIE_NAME, u as useTranslation, y as Lm, z as mSe, g as gr, A as ZH2, F as BH2, K as RH2, N as gM2, U as rc1, $ as $H2, X as OE, _ as Di, a0 as Dd, a1 as lE, a2 as Id, a3 as vs, a4 as dist, a5 as yt, a6 as ge, a7 as ss, a8 as kb, a9 as Gb, aa as Kb, ab as PH2, ac as YH2, ad as oV2, G as G1, H as H3, ae as Wb, af as fH2, ag as HH2, ah as hC2, ai as QH2, aj as XH2, P as PYt, ak as S_, al as OH2, am as z_, an as Ps, ao as A_, ap as pv, aq as zb, ar as CH2, as as r_, at as o_, au as CLINICAL_V2_CONFIG_BASE_URL, av as l_, aw as DE, ax as Qr, ay as i_, az as Ub, aA as hv, aB as Og2, aC as P_, aD as u_, aE as d_, aF as yv, aG as TH2, aH as Nv, aI as xb, aJ as f_, aK as Rt, aL as jr, aM as Tv, aN as Pv, Q as Qn, aO as W_, aP as N_, aQ as C_, T as TYt, aR as sC2, aS as fC2, aT as X_, aU as Q_, aV as STOP_REASON_VALUESET_URL, aW as STOP_REASON_VALUESET_EXPAND_URL, aX as STOP_MEDICATION_URL, aY as xH2, aZ as mf, a_ as es$2, a$ as lC2, b0 as J_, b1 as ev, b2 as zE, b3 as Cb, b4 as BE, b5 as an, b6 as N4, b7 as c3, b8 as cC2, b9 as bE, ba as Z_, bb as rv, bc as nv, bd as sv, be as Ii, bf as ns, bg as q_, bh as Xb, bi as $v, bj as mv, bk as gv, bl as fv, bm as CDSS_SERVER_CONFIG_URL, bn as e_, bo as Mi, bp as yb, bq as Ze, br as KH2, bs as WYt, bt as qH2, bu as Xy, bv as F_, bw as j_, bx as SH2, by as ml1, bz as B_, bA as H_, bB as V_, bC as zYt, bD as AYt, bE as GE, bF as Y_, bG as oE, bH as BAHMNI_CLINICAL_PATH, bI as SE, bJ as nw, bK as GH2, bL as jH2, bM as QE2, bN as kGt, bO as TE, bP as kYt } from "./index-D0-iBtyH.js";
2
+ import { r as B, t as ENCOUNTER_CONCEPTS_URL, Y as Yr, v as Ci, y as BAHMNI_USER_LOCATION_COOKIE_NAME, u as useTranslation, L as Lm, A as mSe, g as gr, D as ZH2, F as BH2, R as RH2, M as gM2, O as rc1, U as $H2, V as OE, X as Di, a0 as Dd, a1 as lE, a2 as Id, a3 as vs, a4 as dist, a5 as yt, a6 as ge, a7 as ss, a8 as kb, a9 as Gb, aa as Kb, ab as PH2, ac as YH2, ad as oV2, G as G1, H as H3, ae as Wb, af as fH2, ag as HH2, ah as hC2, ai as QH2, aj as XH2, K as KYt, ak as S_, al as OH2, am as z_, an as Ps, ao as A_, ap as pv, aq as zb, ar as CH2, as as r_, at as o_, au as CLINICAL_V2_CONFIG_BASE_URL, av as l_, aw as DE, ax as Qr, ay as i_, az as Ub, aA as hv, aB as Og2, aC as P_, aD as u_, aE as d_, aF as yv, aG as TH2, aH as Nv, aI as xb, aJ as f_, aK as Rt, aL as jr, aM as Tv, aN as Pv, Q as Qn, aO as W_, aP as N_, aQ as C_, $ as $Yt, aR as sC2, aS as fC2, aT as X_, aU as Q_, aV as STOP_REASON_VALUESET_URL, aW as STOP_REASON_VALUESET_EXPAND_URL, aX as STOP_MEDICATION_URL, aY as xH2, aZ as mf, a_ as es$2, a$ as lC2, b0 as J_, b1 as ev, b2 as zE, b3 as Cb, b4 as BE, b5 as an, b6 as N4, b7 as c3, b8 as cC2, b9 as bE, ba as Z_, bb as rv, bc as nv, bd as sv, be as Ii, bf as ns, bg as q_, bh as Xb, bi as $v, bj as mv, bk as gv, bl as fv, bm as CDSS_SERVER_CONFIG_URL, bn as e_, bo as Mi, bp as yb, bq as Ze, br as KH2, bs as XYt, bt as qH2, bu as Xy, bv as F_, bw as j_, bx as SH2, by as ml1, bz as B_, bA as H_, bB as V_, bC as SYt, bD as OYt, bE as GE, bF as Y_, bG as oE, bH as BAHMNI_CLINICAL_PATH, bI as SE, bJ as nw, bK as GH2, bL as jH2, bM as QE2, bN as UGt, bO as TE, bP as UYt } from "./index-CFQLhNb5.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-CVhjmeas.js";
7
+ import { u as useClinicalConfig } from "./hook-BmX5jWNq.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 : {};
@@ -139770,9 +139770,9 @@ const allergiesFormTile = "AllergiesForm-module_allergiesFormTile__1UsbU", aller
139770
139770
  duplicateNotification: duplicateNotification$2
139771
139771
  }, allergiesQueryKeys = (p) => ["allergies", p], AllergiesForm = React__default.memo(({ encounterSessionStartContext: p }) => {
139772
139772
  const c = !!p?.preloadedAllergies, { t: a } = useTranslation(), s = gr(), { addNotification: f } = G1(), d = H3(
139773
- PYt.ALLERGIES
139773
+ KYt.ALLERGIES
139774
139774
  ), h = H3(
139775
- PYt.EDIT_ALLERGIES
139775
+ KYt.EDIT_ALLERGIES
139776
139776
  ), [E, C] = useState(""), [R, T] = useState(null), [H, M] = useState(!1), [I, F] = useState(
139777
139777
  null
139778
139778
  ), {
@@ -140095,7 +140095,7 @@ const investigationsFormTile = "InvestigationsForm-module_investigationsFormTile
140095
140095
  duplicateNotification: duplicateNotification$1
140096
140096
  }, InvestigationsForm = React__default.memo(() => {
140097
140097
  const { t: p } = useTranslation(), c = gr(), { addNotification: a } = G1(), s = H3(
140098
- PYt.INVESTIGATIONS
140098
+ KYt.INVESTIGATIONS
140099
140099
  ), [f, d] = useState(""), [h, E] = useState(null), [C, R] = useState(!1), { activeEncounter: T, matchReasons: H } = z_(), I = H.includes("MATCHED") ? T?.id : void 0, {
140100
140100
  data: F,
140101
140101
  refetch: $,
@@ -140508,7 +140508,7 @@ const conditionsAndDiagnosesTile = "ConditionsAndDiagnoses-module_conditionsAndD
140508
140508
  duplicateNotification
140509
140509
  }, ConditionsAndDiagnoses = React__default.memo(() => {
140510
140510
  const { t: p } = useTranslation(), c = gr(), { addNotification: a } = G1(), s = H3(
140511
- PYt.CONDITIONS_AND_DIAGNOSES
140511
+ KYt.CONDITIONS_AND_DIAGNOSES
140512
140512
  ), [f, d] = useState(""), [h, E] = useState(null), [C, R] = useState(!1), {
140513
140513
  selectedDiagnoses: T,
140514
140514
  selectedConditions: H,
@@ -143463,7 +143463,7 @@ function useSubmittedEncounterForms(p) {
143463
143463
  ), useMemo(() => {
143464
143464
  const C = d?.entry?.map((T) => T.resource).filter((T) => T?.resourceType === "Observation") ?? [], R = /* @__PURE__ */ new Set();
143465
143465
  for (const T of C) {
143466
- const H = TYt(T);
143466
+ const H = $Yt(T);
143467
143467
  if (!H) continue;
143468
143468
  const M = p.find((I) => I.name === H);
143469
143469
  M && R.add(M.uuid);
@@ -143488,7 +143488,7 @@ const observationFormsTile = "ObservationForms-module_observationFormsTile__AZ0b
143488
143488
  submittedFormUuids: R = EMPTY_SET
143489
143489
  }) => {
143490
143490
  const { t: T } = useTranslation(), H = H3(
143491
- PYt.OBSERVATIONS
143491
+ KYt.OBSERVATIONS
143492
143492
  ), [M, I] = useState(""), [F, $] = useState(null), { getFormData: D } = useObservationFormsStore(), z = useMemo(() => {
143493
143493
  if (!M.trim()) return h;
143494
143494
  const ne = M.toLowerCase().trim().split(/\s+/);
@@ -145000,7 +145000,7 @@ const ConsultationPad = ({
145000
145000
  onClose: c
145001
145001
  }) => {
145002
145002
  const { t: a } = useTranslation(), { addNotification: s } = G1(), f = gr(), { activeEpisodeId: d } = useClinicalAppData(), { clinicalConfig: h, isLoading: E } = useClinicalConfig(), { encounterConcepts: C } = useEncounterConcepts(), R = H3(
145003
- PYt.ADD_VISITS
145003
+ KYt.ADD_VISITS
145004
145004
  ), T = useQueryClient(), [H, M] = useState(!1), [I, F] = useState(!1), [$, D] = useState(null), {
145005
145005
  data: z,
145006
145006
  error: O,
@@ -145157,7 +145157,7 @@ const ConsultationPad = ({
145157
145157
  visitUuids: f
145158
145158
  }) => {
145159
145159
  const { t: d } = useTranslation(), { matchReasons: h, canEditOrCreate: E, activeEncounter: C } = z_(), R = h.includes("NO_ACTIVE_VISIT"), T = h.includes("MATCHED"), M = h.includes("MATCHED") ? C?.id ?? null : null, I = ($, D, z) => {
145160
- const O = WYt($.type);
145160
+ const O = XYt($.type);
145161
145161
  if (!O)
145162
145162
  return /* @__PURE__ */ jsx("div", { className: styles$4.widgetError, children: /* @__PURE__ */ jsx("p", { children: d("CONTROL_NOT_FOUND", { type: $.type }) }) }, `${$.type}-${D}`);
145163
145163
  const Z = D < z - 1;
@@ -145350,7 +145350,7 @@ const CONSULTATION_START_EVENT = "startConsultation", dispatchConsultationStart
145350
145350
  }) => {
145351
145351
  const { t: s } = useTranslation();
145352
145352
  return H3(
145353
- PYt.ENCOUNTER
145353
+ KYt.ENCOUNTER
145354
145354
  ) ? a ? /* @__PURE__ */ jsx(
145355
145355
  SH2,
145356
145356
  {
@@ -145428,7 +145428,7 @@ const CONSULTATION_START_EVENT = "startConsultation", dispatchConsultationStart
145428
145428
  "data-active-encounter-uuid": T && H?.id ? H.id : void 0,
145429
145429
  "data-active-practitioner-uuid": s?.uuid ?? void 0,
145430
145430
  children: [
145431
- /* @__PURE__ */ jsx(zYt, {}),
145431
+ /* @__PURE__ */ jsx(SYt, {}),
145432
145432
  /* @__PURE__ */ jsxs("div", { className: styles$2.actionButtons, children: [
145433
145433
  /* @__PURE__ */ jsx(
145434
145434
  ConsultationActionButton,
@@ -145439,7 +145439,7 @@ const CONSULTATION_START_EVENT = "startConsultation", dispatchConsultationStart
145439
145439
  }
145440
145440
  ),
145441
145441
  /* @__PURE__ */ jsx(
145442
- AYt,
145442
+ OYt,
145443
145443
  {
145444
145444
  printOptions: c,
145445
145445
  renderContext: Z,
@@ -145783,7 +145783,7 @@ const DASHBOARD_CONFIG_URL = (p) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
145783
145783
  const ae = () => {
145784
145784
  const re = H.get(PROGRAM_UUID_SEARCH_PARAMS_KEY);
145785
145785
  return re && c.contextInformation?.program ? /* @__PURE__ */ jsx(
145786
- kYt,
145786
+ UYt,
145787
145787
  {
145788
145788
  programUUID: re,
145789
145789
  config: {
@@ -145802,7 +145802,7 @@ const DASHBOARD_CONFIG_URL = (p) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
145802
145802
  {
145803
145803
  breadcrumbItems: O,
145804
145804
  globalActions: F,
145805
- userMenu: /* @__PURE__ */ jsx(kGt, {}),
145805
+ userMenu: /* @__PURE__ */ jsx(UGt, {}),
145806
145806
  sideNavItems: ee,
145807
145807
  activeSideNavItemId: ne,
145808
145808
  onSideNavItemClick: ie,
@@ -1,5 +1,5 @@
1
- import { jsx as r, jsxs as p, Fragment as K } from "react/jsx-runtime";
2
- import { g as Q, u as W, G as Y, x as J, a as X, b as Z, W as ee, p as te } from "./index-D0-iBtyH.js";
1
+ import { jsx as r, jsxs as p, Fragment as Q } from "react/jsx-runtime";
2
+ import { g as W, u as x, G as Y, T as J, a as X, b as Z, W as ee, p as te } from "./index-CFQLhNb5.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
4
  import { useState as l, useCallback as h, useEffect as I, useMemo as _ } from "react";
5
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 = {
@@ -38,7 +38,7 @@ const Te = [
38
38
  null
39
39
  ), [$, O] = l(
40
40
  /* @__PURE__ */ new Set()
41
- ), E = Q(), { 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 = h((e) => {
41
+ ), E = W(), { t: n } = x(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, V] = l(k), [F, A] = l(void 0), M = h((e) => {
42
42
  U(e), w(!0);
43
43
  }, []), H = h(() => {
44
44
  w(!1), U(null), O(/* @__PURE__ */ new Set());
@@ -97,7 +97,7 @@ const Te = [
97
97
  ), N = _(
98
98
  () => a?.fields ?? Te,
99
99
  [a?.fields]
100
- ), x = _(() => [...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]), G = _(() => ie(N, n), [N, n]), P = _(
100
+ ), G = _(() => [...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 = _(() => ie(N, n), [N, n]), z = _(
101
101
  () => N.map((e) => ({
102
102
  key: e,
103
103
  sortable: e !== "attachments"
@@ -106,7 +106,7 @@ const Te = [
106
106
  ), T = _(
107
107
  () => o ? B(o) : [],
108
108
  [o]
109
- ), z = h(
109
+ ), K = h(
110
110
  (e, t) => {
111
111
  switch (t) {
112
112
  case "documentIdentifier":
@@ -137,18 +137,18 @@ const Te = [
137
137
  },
138
138
  [M, n]
139
139
  );
140
- return /* @__PURE__ */ p(K, { children: [
140
+ return /* @__PURE__ */ p(Q, { children: [
141
141
  /* @__PURE__ */ r("div", { "data-testid": "documents-table", children: /* @__PURE__ */ r(
142
142
  ee,
143
143
  {
144
- headers: G,
144
+ headers: P,
145
145
  ariaLabel: n("DOCUMENTS_TABLE_HEADING"),
146
- rows: x,
146
+ rows: G,
147
147
  loading: q,
148
148
  errorStateMessage: b ? y?.message : null,
149
- sortable: P,
149
+ sortable: z,
150
150
  emptyStateMessage: n("DOCUMENTS_NO_RECORDS"),
151
- renderCell: z,
151
+ renderCell: K,
152
152
  className: d.documentsTableBody,
153
153
  dataTestId: "documents-table",
154
154
  pageSize: u,
@@ -1,26 +1,26 @@
1
- import { jsx as i, jsxs as K, Fragment as ge } from "react/jsx-runtime";
2
- import { u as ye, g as be, H as Oe, Q as Te, f as Ne, c as Ie, d as Ee, M as Ae, t as _e, m as ve, S as Se, T as Fe, s as P, b as Me, e as Q, n as Y, a as Re, W as z, I as Be, k as Ce, p as Le, J as Ue, P as ke } from "./index-D0-iBtyH.js";
3
- import { useQueryClient as De, useQuery as T } from "@tanstack/react-query";
1
+ import { jsx as i, jsxs as j, Fragment as ge } from "react/jsx-runtime";
2
+ import { u as ye, g as be, H as Oe, Q as Ne, f as Te, z as Ie, w as Ee, C as Ae, o as _e, m as ve, S as Se, $ as Fe, s as z, b as Ce, x as Q, n as Y, a as Me, W as P, k as Re, Z as Be, p as Le, J as Ue, K as ke } from "./index-CFQLhNb5.js";
3
+ import { useQueryClient as De, useQuery as N } from "@tanstack/react-query";
4
4
  import { useState as G, useMemo as d, useCallback as c } from "react";
5
- const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", He = "FormsTable-module_customAccordianItem__isszs", N = {
6
- formsTableBody: qe,
7
- modalHeading: we,
5
+ const we = "FormsTable-module_formsTableBody__SvGha", qe = "FormsTable-module_modalHeading__wnTmA", He = "FormsTable-module_customAccordianItem__isszs", T = {
6
+ formsTableBody: we,
7
+ modalHeading: qe,
8
8
  customAccordianItem: He
9
- }, Ve = "startConsultation", Pe = ({
10
- episodeOfCareUuids: M,
9
+ }, Ve = "startConsultation", ze = ({
10
+ episodeOfCareUuids: C,
11
11
  encounterUuids: m,
12
- config: J,
13
- disableActions: W = !1,
12
+ config: Z,
13
+ disableActions: J = !1,
14
14
  activeEncounterUuid: p = null
15
15
  }) => {
16
- const { t: n } = ye(), u = be(), [g, R] = G(!1), [s, B] = G(null), {
17
- numberOfVisits: X,
18
- hideThumbnail: Z = !1,
16
+ const { t: n } = ye(), u = be(), [g, M] = G(!1), [s, R] = G(null), {
17
+ numberOfVisits: W,
18
+ hideThumbnail: X = !1,
19
19
  forms: y
20
- } = J ?? {}, ee = Oe(
20
+ } = Z ?? {}, ee = Oe(
21
21
  ke.EDIT_OBSERVATIONS
22
- ), { userPrivileges: b } = Te(), I = ee && !W && !!p, C = Ne(
23
- M,
22
+ ), { userPrivileges: b } = Ne(), I = ee && !J && !!p, B = Te(
23
+ C,
24
24
  m
25
25
  ), re = De(), {
26
26
  data: L = [],
@@ -28,10 +28,10 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
28
28
  isError: k,
29
29
  error: oe,
30
30
  refetch: te
31
- } = T({
32
- queryKey: ["forms", u, M],
33
- queryFn: () => Ie(u, void 0, X),
34
- enabled: !!u && !C
31
+ } = N({
32
+ queryKey: ["forms", u, C],
33
+ queryFn: () => Ie(u, void 0, W),
34
+ enabled: !!u && !B
35
35
  }), D = d(() => {
36
36
  let e = L;
37
37
  return m && m.length > 0 && (e = e.filter(
@@ -39,10 +39,10 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
39
39
  )), Array.isArray(y) && y.length > 0 && (e = e.filter(
40
40
  (r) => y.some((o) => o.toLowerCase() === r.formName.toLowerCase())
41
41
  )), e;
42
- }, [L, m, y]), { data: O = [] } = T({
42
+ }, [L, m, y]), { data: O = [] } = N({
43
43
  queryKey: ["observationForms"],
44
44
  queryFn: () => Ee()
45
- }), q = c(
45
+ }), w = c(
46
46
  (e) => {
47
47
  const r = O.find((a) => a.name === e);
48
48
  if (!r?.privileges || r.privileges.length === 0) return !0;
@@ -54,20 +54,20 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
54
54
  },
55
55
  [O, b]
56
56
  ), f = c(
57
- (e) => !p || e.encounterUuid !== p ? !1 : q(e.formName),
58
- [p, q]
59
- ), w = c(
57
+ (e) => !p || e.encounterUuid !== p ? !1 : w(e.formName),
58
+ [p, w]
59
+ ), q = c(
60
60
  (e) => O.find((r) => r.name === e)?.uuid,
61
61
  [O]
62
62
  ), E = d(() => {
63
63
  if (s)
64
- return w(s.formName);
65
- }, [s, w]), {
64
+ return q(s.formName);
65
+ }, [s, q]), {
66
66
  data: l,
67
67
  isLoading: ae,
68
68
  isError: se,
69
69
  error: A
70
- } = T({
70
+ } = N({
71
71
  queryKey: ["formMetadata", E],
72
72
  queryFn: () => Ae(E),
73
73
  enabled: !!E && g
@@ -76,7 +76,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
76
76
  isLoading: ne,
77
77
  isError: ie,
78
78
  error: v
79
- } = T({
79
+ } = N({
80
80
  queryKey: ["formsEncounterFHIR", s?.encounterUuid],
81
81
  queryFn: () => _e(s.encounterUuid),
82
82
  enabled: !!s?.encounterUuid && g
@@ -125,9 +125,9 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
125
125
  ), Object.keys(e).length > 0 ? e : void 0;
126
126
  }, [l]), ue = d(() => {
127
127
  if (A)
128
- return P(A).message;
128
+ return z(A).message;
129
129
  if (v)
130
- return P(v).message;
130
+ return z(v).message;
131
131
  }, [A, v]), h = d(
132
132
  () => [
133
133
  { key: "recordedOn", header: n("RECORDED_ON") },
@@ -155,7 +155,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
155
155
  return r[a].push({
156
156
  id: o.encounterUuid,
157
157
  formName: o.formName,
158
- recordedOn: Me(o.encounterDateTime, n, !0).formattedResult,
158
+ recordedOn: Ce(o.encounterDateTime, n, !0).formattedResult,
159
159
  recordedBy: t ?? "--",
160
160
  encounterDateTime: o.encounterDateTime,
161
161
  encounterUuid: o.encounterUuid
@@ -172,9 +172,9 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
172
172
  })
173
173
  ).sort((r, o) => r.formName.localeCompare(o.formName));
174
174
  }, [D, n]), $ = c((e) => {
175
- B(e), R(!0);
176
- }, []), j = c(() => {
177
- R(!1), B(null);
175
+ R(e), M(!0);
176
+ }, []), K = c(() => {
177
+ M(!1), R(null);
178
178
  }, []), S = c((e) => {
179
179
  globalThis.dispatchEvent(
180
180
  new CustomEvent(Ve, {
@@ -191,7 +191,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
191
191
  (e, r) => {
192
192
  switch (r) {
193
193
  case "recordedOn":
194
- return /* @__PURE__ */ i(Re, { onClick: () => $(e), children: e.recordedOn });
194
+ return /* @__PURE__ */ i(Me, { onClick: () => $(e), children: e.recordedOn });
195
195
  case "recordedBy":
196
196
  return e.recordedBy;
197
197
  case "actions":
@@ -212,9 +212,9 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
212
212
  },
213
213
  [$, S, f, n]
214
214
  );
215
- return /* @__PURE__ */ K(ge, { children: [
216
- /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || k || V.length === 0 || C ? /* @__PURE__ */ i(
217
- z,
215
+ return /* @__PURE__ */ j(ge, { children: [
216
+ /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || k || V.length === 0 || B ? /* @__PURE__ */ i(
217
+ P,
218
218
  {
219
219
  headers: he,
220
220
  ariaLabel: n("FORMS_HEADING"),
@@ -223,20 +223,20 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
223
223
  errorStateMessage: k ? oe?.message : void 0,
224
224
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
225
225
  renderCell: x,
226
- className: N.formsTableBody,
226
+ className: T.formsTableBody,
227
227
  dataTestId: "forms-table"
228
228
  }
229
- ) : /* @__PURE__ */ i(Be, { align: "start", children: V.map((e, r) => {
229
+ ) : /* @__PURE__ */ i(Re, { align: "start", children: V.map((e, r) => {
230
230
  const { formName: o, records: a } = e, t = fe(a);
231
231
  return /* @__PURE__ */ i(
232
- Ce,
232
+ Be,
233
233
  {
234
234
  title: o,
235
- className: N.customAccordianItem,
235
+ className: T.customAccordianItem,
236
236
  testId: `accordian-title-${o}`,
237
237
  open: r === 0,
238
238
  children: /* @__PURE__ */ i(
239
- z,
239
+ P,
240
240
  {
241
241
  headers: t,
242
242
  ariaLabel: n("FORMS_HEADING"),
@@ -246,7 +246,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
246
246
  sortable: pe,
247
247
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
248
248
  renderCell: x,
249
- className: N.formsTableBody,
249
+ className: T.formsTableBody,
250
250
  dataTestId: `forms-table-${o}`
251
251
  }
252
252
  )
@@ -260,8 +260,8 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
260
260
  id: "modalIdForActionAreaLayout",
261
261
  portalId: "main-display-area",
262
262
  open: g,
263
- onRequestClose: j,
264
- modalHeading: /* @__PURE__ */ K("div", { className: N.modalHeading, children: [
263
+ onRequestClose: K,
264
+ modalHeading: /* @__PURE__ */ j("div", { className: T.modalHeading, children: [
265
265
  /* @__PURE__ */ i("span", { children: s.formName }),
266
266
  I && f(s) && /* @__PURE__ */ i(
267
267
  Q,
@@ -271,7 +271,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
271
271
  size: "sm",
272
272
  testId: `edit-form-modal-${s.encounterUuid}`,
273
273
  onClick: () => {
274
- j(), S(s);
274
+ K(), S(s);
275
275
  },
276
276
  children: /* @__PURE__ */ i(Y, {})
277
277
  }
@@ -290,7 +290,7 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
290
290
  errorMessage: ue,
291
291
  emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
292
292
  testIdPrefix: s.formName,
293
- hideThumbnail: Z,
293
+ hideThumbnail: X,
294
294
  controlOrder: le,
295
295
  sectionMap: ce,
296
296
  conceptDatatypeMap: me
@@ -301,5 +301,5 @@ const qe = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
301
301
  ] });
302
302
  };
303
303
  export {
304
- Pe as default
304
+ ze as default
305
305
  };
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CEGgzhAq.js";
2
- import { bV as d, bW as f, bX as e } from "./index-D0-iBtyH.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-BKGejflS.js";
2
+ import { bV as d, bW as f, bX as e } from "./index-CFQLhNb5.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-CEGgzhAq.js";
2
- import { bV as v, bW as C, bX as e } from "./index-D0-iBtyH.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-BKGejflS.js";
2
+ import { bV as v, bW as C, bX as e } from "./index-CFQLhNb5.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,9 +1,9 @@
1
- import { jsxs as I, jsx as u } from "react/jsx-runtime";
2
- import { g as q, G as K, u as N, V as G, h as k, m as w, R as H, D as M, i as Q, j, W as x, O as z, r as D, L as P, E as W, Z, l as J, o as X, q as ee } from "./index-D0-iBtyH.js";
1
+ import { jsxs as N, jsx as u } from "react/jsx-runtime";
2
+ import { g as q, G as K, u as S, _ as k, N as G, m as w, c as M, B as P, P as Q, i as j, W as x, I as H, l as D, d as z, E as W, e as Z, h as J, j as X, q as ee } from "./index-CFQLhNb5.js";
3
3
  import { useQueries as ae, useQuery as te } from "@tanstack/react-query";
4
- import { useRef as se, useEffect as $, useMemo as E } from "react";
5
- const L = (a, n, d, l, b, r) => {
6
- const t = P(a, n, b), s = t.value, i = W(s);
4
+ import { useRef as se, useEffect as $, useMemo as R } from "react";
5
+ const F = (a, n, d, l, b, r) => {
6
+ const t = z(a, n, b), s = t.value, i = W(s);
7
7
  let o = s;
8
8
  i === "Image" && (o = /* @__PURE__ */ u(
9
9
  J,
@@ -43,7 +43,7 @@ const L = (a, n, d, l, b, r) => {
43
43
  id: `grouped-obs-${a.display}-${l}`,
44
44
  open: d,
45
45
  children: a.members?.map(
46
- (s, i) => L(
46
+ (s, i) => F(
47
47
  s,
48
48
  i,
49
49
  b,
@@ -59,9 +59,9 @@ const L = (a, n, d, l, b, r) => {
59
59
  title: n = "",
60
60
  hideThumbnail: d
61
61
  }) => {
62
- const { t: l } = N(), b = (r, t, s) => {
63
- const i = z(r.encounterDetails, l);
64
- return /* @__PURE__ */ I(
62
+ const { t: l } = S(), b = (r, t, s) => {
63
+ const i = H(r.encounterDetails, l);
64
+ return /* @__PURE__ */ N(
65
65
  D,
66
66
  {
67
67
  title: i,
@@ -69,7 +69,7 @@ const L = (a, n, d, l, b, r) => {
69
69
  open: t,
70
70
  children: [
71
71
  r.observations.map(
72
- (o, m) => L(
72
+ (o, m) => F(
73
73
  o,
74
74
  m,
75
75
  s,
@@ -105,7 +105,7 @@ const L = (a, n, d, l, b, r) => {
105
105
  )
106
106
  }
107
107
  );
108
- }, oe = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", S = {
108
+ }, oe = "Observations-module_observations__RKSyo", ne = "Observations-module_title__TJL3z", I = {
109
109
  observations: oe,
110
110
  title: ne
111
111
  }, de = (a) => ["conceptUuid", a], le = (a, n) => ["observations", a, ...n], pe = ({ config: a }) => {
@@ -113,81 +113,81 @@ const L = (a, n, d, l, b, r) => {
113
113
  conceptNames: d = [],
114
114
  conceptUuid: l = [],
115
115
  hideThumbnail: b = !1
116
- } = n, r = se(/* @__PURE__ */ new Set()), t = q(), { addNotification: s } = K(), { t: i } = N(), o = ae({
116
+ } = n, r = se(/* @__PURE__ */ new Set()), t = q(), { addNotification: s } = K(), { t: i } = S(), o = ae({
117
117
  queries: d.map((e) => ({
118
118
  queryKey: de(e),
119
- queryFn: () => G(e),
119
+ queryFn: () => k(e),
120
120
  enabled: !!e
121
121
  }))
122
122
  });
123
123
  $(() => {
124
124
  o.forEach((e, h) => {
125
125
  if (e.isError && !r.current.has(h)) {
126
- const B = d[h];
126
+ const V = d[h];
127
127
  s({
128
128
  title: i("ERROR_DEFAULT_TITLE"),
129
- message: i("ERROR_FETCHING_CONCEPT", { conceptName: B }),
129
+ message: i("ERROR_FETCHING_CONCEPT", { conceptName: V }),
130
130
  type: "error"
131
131
  }), r.current.add(h);
132
132
  } else e.isError || r.current.delete(h);
133
133
  });
134
134
  }, [o, d]);
135
- const m = E(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), p = E(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = E(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
135
+ const m = R(() => o.map((e) => e.data?.uuid).filter((e) => !!e), [o]), p = R(() => [.../* @__PURE__ */ new Set([...m, ...l])], [m, l]), y = R(() => d.length === 0 ? !0 : o.every((e) => !e.isLoading), [o, d.length]), {
136
136
  data: c,
137
- isLoading: F,
138
- isError: O,
139
- refetch: T
137
+ isLoading: L,
138
+ isError: T,
139
+ refetch: g
140
140
  } = te({
141
141
  queryKey: le(t, p),
142
- queryFn: () => k(t, p),
142
+ queryFn: () => G(t, p),
143
143
  enabled: !!t && p.length > 0 && y
144
144
  });
145
145
  w(
146
146
  (e) => {
147
147
  e.patientUUID === t && e.updatedConcepts.size > 0 && [...e.updatedConcepts.keys()].some(
148
148
  (h) => p.includes(h)
149
- ) && T();
149
+ ) && g();
150
150
  },
151
- [t, T]
151
+ [t, g]
152
152
  ), $(() => {
153
- O && s({
153
+ T && s({
154
154
  title: i("ERROR_DEFAULT_TITLE"),
155
155
  message: i("ERROR_FETCHING_OBSERVATIONS"),
156
156
  type: "error"
157
157
  });
158
- }, [O]);
159
- const g = E(() => {
158
+ }, [T]);
159
+ const O = R(() => {
160
160
  if (!c) return [];
161
- const e = H(c), h = M(e);
161
+ const e = M(c), h = P(e);
162
162
  return Q(h);
163
163
  }, [c]), A = [
164
164
  { key: "name", header: "name" },
165
165
  { key: "value", header: "value" },
166
166
  { key: "form", header: "form" }
167
- ], f = F || !y, _ = O && y, V = (!c || c.entry?.length === 0 || p.length === 0) && y, Y = _ ? i("ERROR_FETCHING_OBSERVATIONS") : null, C = V ? i("NO_OBSERVATIONS_FOUND") : void 0, U = g.length > 0 && !f && !_, v = n.titleTranslationKey, R = v ? i(v) : "";
168
- return /* @__PURE__ */ I(
167
+ ], _ = L || !y, f = T && y, B = (!c || c.entry?.length === 0 || p.length === 0) && y, Y = f ? i("ERROR_FETCHING_OBSERVATIONS") : null, C = B ? i("NO_OBSERVATIONS_FOUND") : void 0, U = O.length > 0 && !_ && !f, E = n.titleTranslationKey, v = E ? i(E) : "";
168
+ return /* @__PURE__ */ N(
169
169
  "div",
170
170
  {
171
171
  id: "observations",
172
- "data-testid": v ? `observations-${R}` : "observations",
172
+ "data-testid": E ? `observations-${v}` : "observations",
173
173
  "aria-label": "observations-aria-label",
174
- className: S.observations,
174
+ className: I.observations,
175
175
  children: [
176
176
  /* @__PURE__ */ u(
177
177
  j,
178
178
  {
179
179
  id: "observations-title",
180
- testId: v ? `observations-title-${R}` : "observations-title",
181
- title: R,
182
- className: S.title,
183
- children: /* @__PURE__ */ u("p", { children: R })
180
+ testId: E ? `observations-title-${v}` : "observations-title",
181
+ title: v,
182
+ className: I.title,
183
+ children: /* @__PURE__ */ u("p", { children: v })
184
184
  }
185
185
  ),
186
186
  U ? /* @__PURE__ */ u(
187
187
  ie,
188
188
  {
189
- groupedData: g,
190
- title: R,
189
+ groupedData: O,
190
+ title: v,
191
191
  hideThumbnail: b
192
192
  }
193
193
  ) : /* @__PURE__ */ u(
@@ -196,7 +196,7 @@ const L = (a, n, d, l, b, r) => {
196
196
  headers: A,
197
197
  rows: [],
198
198
  ariaLabel: i("OBSERVATIONS"),
199
- loading: f,
199
+ loading: _,
200
200
  errorStateMessage: Y,
201
201
  emptyStateMessage: C,
202
202
  dataTestId: "observations-table"
@@ -1,4 +1,4 @@
1
- import { bY as we, bZ as z, b_ as xt, b$ as B, bW as q, bX as y, c0 as Ro, c1 as ye, c2 as R, c3 as _, c4 as k, c5 as N, c6 as A, c7 as bs, c8 as ir, c9 as $e, ca as G, cb as Hn, cc as Vn, cd as dt, ce as D, cf as xs, cg as cn, ch as Be, ci as ws, cj as qt, ck as zt, cl as $s, cm as Cs, cn as $n, co as Ss, cp as Nr, cq as Bt, cr as zo, cs as ks, ct as Es, cu as j, cv as Gr, cw as Ms, cx as Ds, cy as sr, cz as As, cA as Ts, cB as zn, cC as Fs, cD as Is, cE as Z, cF as Ps, cG as Ls } from "./index-D0-iBtyH.js";
1
+ import { bY as we, bZ as z, b_ as xt, b$ as B, bW as q, bX as y, c0 as Ro, c1 as ye, c2 as R, c3 as _, c4 as k, c5 as N, c6 as A, c7 as bs, c8 as ir, c9 as $e, ca as G, cb as Hn, cc as Vn, cd as dt, ce as D, cf as xs, cg as cn, ch as Be, ci as ws, cj as qt, ck as zt, cl as $s, cm as Cs, cn as $n, co as Ss, cp as Nr, cq as Bt, cr as zo, cs as ks, ct as Es, cu as j, cv as Gr, cw as Ms, cx as Ds, cy as sr, cz as As, cA as Ts, cB as zn, cC as Fs, cD as Is, cE as Z, cF as Ps, cG as Ls } from "./index-CFQLhNb5.js";
2
2
  var Os = (e) => e != null, qs = (e) => e.filter(Os);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -1,4 +1,4 @@
1
- import { bT as i, bU as o } from "./index-D0-iBtyH.js";
1
+ import { bT as i, bU as o } from "./index-CFQLhNb5.js";
2
2
  import "react";
3
3
  import "react/jsx-runtime";
4
4
  import "@tanstack/react-query";