@bahmni/clinical-app 0.0.1-dev.355 → 0.0.1-dev.357

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 { r as H, s as ENCOUNTER_CONCEPTS_URL, Y as Yr, D as Di, B as BAHMNI_USER_LOCATION_COOKIE_NAME, u as useTranslation, G as Dm, K as iSe, m as mr, M as kH2, P as IH2, R as TH2, S as gM2, U as rc1, Z as AH2, _ as vE, $ as Ii, a0 as Id, a1 as iE, a2 as Nd, a3 as Es, a4 as dist, a5 as yt, a6 as ge, a7 as ns, a8 as Ib, a9 as Vb, aa as Hb, ab as BH2, ac as KH2, ad as oV2, a as ar, w as w3, ae as Bb, af as sH2, ag as VH2, ah as pC2, ai as XH2, aj as JH2, I as IGt, ak as w_, al as RH2, am as q_, an as Os, ao as __, ap as iv, aq as Fb, ar as HH2, as as Jb, at as Zb, au as CLINICAL_V2_CONFIG_BASE_URL, av as s_, aw as PE, ax as Qr, ay as t_, az as Cb, aA as cv, aB as Og2, aC as v_, aD as n_, aE as o_, aF as dv, aG as DH2, aH as Sv, aI as Nb, aJ as a_, aK as Kt, aL as jr, aM as yv, aN as vv, x as x2, aO as B_, aP as S_, aQ as A_, N as NGt, aR as iC2, aS as sC2, aT as G_, aU as Y_, aV as STOP_REASON_VALUESET_URL, aW as STOP_REASON_VALUESET_EXPAND_URL, aX as STOP_MEDICATION_URL, aY as CH2, aZ as mf, a_ as Zn, a$ as oC2, b0 as z_, b1 as K_, b2 as jE, b3 as Pb, b4 as FE, b5 as J_, b6 as an, b7 as N4, b8 as c3, b9 as rC2, ba as Q_, bb as X_, bc as Pi, bd as rs, be as C_, bf as Gb, bg as Tv, bh as uv, bi as lv, bj as av, bk as CDSS_SERVER_CONFIG_URL, bl as jGt, bm as UH2, bn as Jy, bo as L_, bp as x_, bq as $H2, br as ml1, bs as U_, bt as M_, bu as k_, bv as _Gt, bw as MGt, bx as HE, by as F_, bz as GH2, bA as rE, bB as BAHMNI_CLINICAL_PATH, bC as bE, bD as H_, bE as qH2, bF as WH2, bG as QE2, bH as SKt, bI as EE, bJ as RGt } from "./index-BmHdPpxJ.js";
2
+ import { B as H, E as ENCOUNTER_CONCEPTS_URL, Y as Yr, C as Di, G as BAHMNI_USER_LOCATION_COOKIE_NAME, u as useTranslation, I as Dm, J as sSe, m as mr, K as kH2, N as IH2, P as TH2, Q as gM2, S as rc1, U as AH2, Z as vE, $ as Ii, a0 as Id, a1 as iE, a2 as Nd, a3 as Es, a4 as dist, a5 as yt, a6 as ge, a7 as ns, a8 as Ib, a9 as Vb, aa as Hb, ab as BH2, ac as KH2, ad as oV2, a as ar, w as w3, ae as Bb, af as sH2, ag as VH2, ah as pC2, ai as XH2, aj as JH2, n as kGt, ak as w_, al as RH2, am as q_, an as Os, ao as __, ap as iv, aq as Fb, ar as HH2, as as Jb, at as Zb, au as CLINICAL_V2_CONFIG_BASE_URL, av as s_, aw as PE, ax as Qr, ay as t_, az as Cb, aA as cv, aB as Og2, aC as v_, aD as n_, aE as o_, aF as dv, aG as DH2, aH as Sv, aI as Nb, aJ as a_, aK as Kt, aL as jr, aM as yv, aN as vv, x as x2, aO as B_, aP as S_, aQ as A_, z as zGt, aR as iC2, aS as sC2, aT as G_, aU as Y_, aV as STOP_REASON_VALUESET_URL, aW as STOP_REASON_VALUESET_EXPAND_URL, aX as STOP_MEDICATION_URL, aY as CH2, aZ as mf, a_ as Zn, a$ as oC2, b0 as z_, b1 as K_, b2 as jE, b3 as Pb, b4 as FE, b5 as J_, b6 as an, b7 as N4, b8 as c3, b9 as rC2, ba as Q_, bb as X_, bc as Pi, bd as rs, be as C_, bf as Gb, bg as Tv, bh as uv, bi as lv, bj as av, bk as CDSS_SERVER_CONFIG_URL, bl as WGt, bm as UH2, bn as Jy, bo as L_, bp as x_, bq as $H2, br as ml1, bs as U_, bt as M_, bu as k_, bv as CGt, bw as xGt, bx as HE, by as F_, bz as GH2, bA as rE, bB as BAHMNI_CLINICAL_PATH, bC as bE, bD as H_, bE as qH2, bF as WH2, bG as QE2, bH as IKt, bI as EE, bJ as $Gt } from "./index-BSvPW3bO.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-ByROKK6U.js";
7
+ import { u as useClinicalConfig } from "./hook-BSWs-0ve.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 : {};
@@ -2042,7 +2042,7 @@ const useLocations = () => {
2042
2042
  skeletonBody,
2043
2043
  skeletonTitle
2044
2044
  }, EncounterDetails = () => {
2045
- const { t: p } = useTranslation(), c = iSe(), a = mr(), {
2045
+ const { t: p } = useTranslation(), c = sSe(), a = mr(), {
2046
2046
  activeVisit: s,
2047
2047
  loading: f,
2048
2048
  error: d
@@ -139626,9 +139626,9 @@ const allergiesFormTile = "AllergiesForm-module_allergiesFormTile__1UsbU", aller
139626
139626
  duplicateNotification: duplicateNotification$2
139627
139627
  }, allergiesQueryKeys = (p) => ["allergies", p], AllergiesForm = React__default.memo(({ encounterSessionStartContext: p }) => {
139628
139628
  const c = !!p?.preloadedAllergies, { t: a } = useTranslation(), s = mr(), { addNotification: f } = ar(), d = w3(
139629
- IGt.ALLERGIES
139629
+ kGt.ALLERGIES
139630
139630
  ), h = w3(
139631
- IGt.EDIT_ALLERGIES
139631
+ kGt.EDIT_ALLERGIES
139632
139632
  ), [E, C] = useState(""), [R, T] = useState(null), [M, x] = useState(!1), [I, k] = useState(
139633
139633
  null
139634
139634
  ), {
@@ -139951,7 +139951,7 @@ const investigationsFormTile = "InvestigationsForm-module_investigationsFormTile
139951
139951
  duplicateNotification: duplicateNotification$1
139952
139952
  }, InvestigationsForm = React__default.memo(() => {
139953
139953
  const { t: p } = useTranslation(), c = mr(), { addNotification: a } = ar(), s = w3(
139954
- IGt.INVESTIGATIONS
139954
+ kGt.INVESTIGATIONS
139955
139955
  ), [f, d] = useState(""), [h, E] = useState(null), [C, R] = useState(!1), { activeEncounter: T, matchReasons: M } = q_(), I = M.includes("MATCHED") ? T?.id : void 0, {
139956
139956
  data: k,
139957
139957
  refetch: N,
@@ -140364,7 +140364,7 @@ const conditionsAndDiagnosesTile = "ConditionsAndDiagnoses-module_conditionsAndD
140364
140364
  duplicateNotification
140365
140365
  }, ConditionsAndDiagnoses = React__default.memo(() => {
140366
140366
  const { t: p } = useTranslation(), c = mr(), { addNotification: a } = ar(), s = w3(
140367
- IGt.CONDITIONS_AND_DIAGNOSES
140367
+ kGt.CONDITIONS_AND_DIAGNOSES
140368
140368
  ), [f, d] = useState(""), [h, E] = useState(null), [C, R] = useState(!1), {
140369
140369
  selectedDiagnoses: T,
140370
140370
  selectedConditions: M,
@@ -143319,7 +143319,7 @@ function useSubmittedEncounterForms(p) {
143319
143319
  ), useMemo(() => {
143320
143320
  const C = d?.entry?.map((T) => T.resource).filter((T) => T?.resourceType === "Observation") ?? [], R = /* @__PURE__ */ new Set();
143321
143321
  for (const T of C) {
143322
- const M = NGt(T);
143322
+ const M = zGt(T);
143323
143323
  if (!M) continue;
143324
143324
  const x = p.find((I) => I.name === M);
143325
143325
  x && R.add(x.uuid);
@@ -143344,7 +143344,7 @@ const observationFormsTile = "ObservationForms-module_observationFormsTile__AZ0b
143344
143344
  submittedFormUuids: R = EMPTY_SET
143345
143345
  }) => {
143346
143346
  const { t: T } = useTranslation(), M = w3(
143347
- IGt.OBSERVATIONS
143347
+ kGt.OBSERVATIONS
143348
143348
  ), [x, I] = useState(""), [k, N] = useState(null), { getFormData: O } = useObservationFormsStore(), z = useMemo(() => {
143349
143349
  if (!x.trim()) return h;
143350
143350
  const ee = x.toLowerCase().trim().split(/\s+/);
@@ -143528,7 +143528,7 @@ ObservationForms.displayName = "ObservationForms";
143528
143528
  const ObservationFormsPanel = ({
143529
143529
  encounterSessionStartContext: p
143530
143530
  }) => {
143531
- const { user: c } = iSe(), a = mr(), { episodeOfCare: s } = useClinicalAppData(), f = s.map((V) => V.uuid), {
143531
+ const { user: c } = sSe(), a = mr(), { episodeOfCare: s } = useClinicalAppData(), f = s.map((V) => V.uuid), {
143532
143532
  forms: d,
143533
143533
  isLoading: h,
143534
143534
  error: E
@@ -144021,7 +144021,7 @@ const formView = "ObservationFormsContainer-module_formView__d3K6Z", errorNotifi
144021
144021
  }) => {
144022
144022
  const { t: T } = useTranslation(), M = R?.editOnly === "observationForms", x = React__default.useRef(!M), I = React__default.useRef(
144023
144023
  null
144024
- ), [k, N] = React__default.useState([]), z = R?.task?.basedOn?.[0], B = mr(), { user: Z } = iSe(), { episodeOfCare: F, activeVisitId: W } = useClinicalAppData(), {
144024
+ ), [k, N] = React__default.useState([]), z = R?.task?.basedOn?.[0], B = mr(), { user: Z } = sSe(), { episodeOfCare: F, activeVisitId: W } = useClinicalAppData(), {
144025
144025
  data: U,
144026
144026
  isLoading: P,
144027
144027
  error: K
@@ -144554,7 +144554,7 @@ async function submitConsultation(p) {
144554
144554
  const error = "index-module_error__OkEFn", formList = "index-module_formList__xenBJ", styles$5 = {
144555
144555
  error,
144556
144556
  formList
144557
- };
144557
+ }, extractId = (p) => (typeof p == "string" ? p : p?.reference)?.split("/")?.pop();
144558
144558
  function loadEncounterInputControls(p) {
144559
144559
  if (!p) return [];
144560
144560
  const c = getRegisteredInputControls();
@@ -144580,7 +144580,7 @@ function captureUpdatedResources(p) {
144580
144580
  useServiceRequestStore.getState().selectedServiceRequests.forEach((d, h) => {
144581
144581
  c[h.toLowerCase()] = !0;
144582
144582
  });
144583
- const a = (d) => p.find((h) => h.key === d)?.hasData() ?? !1, f = useObservationFormsStore.getState().getObservationFormsData().some(
144583
+ const a = (d) => p.find((h) => h.key === d)?.hasData() ?? !1, f = useObservationFormsStore.getState().getObservationFormsData().find(
144584
144584
  (d) => d.basedOn !== void 0
144585
144585
  );
144586
144586
  return {
@@ -144589,7 +144589,7 @@ function captureUpdatedResources(p) {
144589
144589
  medications: a("medication") || a("vaccination") || a("stopMedications"),
144590
144590
  immunizationHistory: a("immunizationHistory") || a("immunizationAdministration") || a("immunizationWaiver"),
144591
144591
  serviceRequests: c,
144592
- observationFormsWithBasedOn: f
144592
+ observationFormsWithBasedOn: extractId(f?.basedOn)
144593
144593
  };
144594
144594
  }
144595
144595
  const ConsultationPad = ({
@@ -144645,7 +144645,7 @@ const ConsultationPad = ({
144645
144645
  useEffect(() => {
144646
144646
  useEncounterDetailsStore.getState().setRequestedEncounterType(K);
144647
144647
  }, [K]);
144648
- const { episodeOfCare: ee, patientId: oe, activeVisitId: le, activeEpisodeId: re } = useClinicalAppData(), { practitioner: ae } = iSe(), { data: J, status: Ce } = useQuery({
144648
+ const { episodeOfCare: ee, patientId: oe, activeVisitId: le, activeEpisodeId: re } = useClinicalAppData(), { practitioner: ae } = sSe(), { data: J, status: Ce } = useQuery({
144649
144649
  queryKey: [
144650
144650
  "activeEncounter",
144651
144651
  oe,
@@ -144921,7 +144921,7 @@ const ConsultationPad = ({
144921
144921
  visitUuids: f
144922
144922
  }) => {
144923
144923
  const { t: d } = useTranslation(), { matchReasons: h, canEditOrCreate: E, activeEncounter: C } = q_(), R = h.includes("NO_ACTIVE_VISIT"), T = h.includes("MATCHED"), x = h.includes("MATCHED") ? C?.id ?? null : null, I = (N, O, z) => {
144924
- const B = jGt(N.type);
144924
+ const B = WGt(N.type);
144925
144925
  if (!B)
144926
144926
  return /* @__PURE__ */ jsx("div", { className: styles$4.widgetError, children: /* @__PURE__ */ jsx("p", { children: d("CONTROL_NOT_FOUND", { type: N.type }) }) }, `${N.type}-${O}`);
144927
144927
  const Z = O < z - 1;
@@ -145115,7 +145115,7 @@ const CONSULTATION_START_EVENT = "startConsultation", dispatchConsultationStart
145115
145115
  }) => {
145116
145116
  const { t: s } = useTranslation();
145117
145117
  return w3(
145118
- IGt.ENCOUNTER
145118
+ kGt.ENCOUNTER
145119
145119
  ) ? a ? /* @__PURE__ */ jsx(
145120
145120
  $H2,
145121
145121
  {
@@ -145139,7 +145139,7 @@ const CONSULTATION_START_EVENT = "startConsultation", dispatchConsultationStart
145139
145139
  isActionAreaVisible: p,
145140
145140
  printOptions: c
145141
145141
  }) => {
145142
- const { t: a } = useTranslation(), { practitioner: s } = iSe(), { clinicalConfig: f } = useClinicalConfig(), { encounterConcepts: d } = useEncounterConcepts(), h = mr(), E = f?.consultationPad?.inputControls?.find(
145142
+ const { t: a } = useTranslation(), { practitioner: s } = sSe(), { clinicalConfig: f } = useClinicalConfig(), { encounterConcepts: d } = useEncounterConcepts(), h = mr(), E = f?.consultationPad?.inputControls?.find(
145143
145143
  (F) => F.type === "encounterDetails"
145144
145144
  )?.metadata?.defaultEncounterType, C = useMemo(() => {
145145
145145
  if (!(!E || !d))
@@ -145194,7 +145194,7 @@ const CONSULTATION_START_EVENT = "startConsultation", dispatchConsultationStart
145194
145194
  "data-active-encounter-uuid": T && M?.id ? M.id : void 0,
145195
145195
  "data-active-practitioner-uuid": s?.uuid ?? void 0,
145196
145196
  children: [
145197
- /* @__PURE__ */ jsx(_Gt, {}),
145197
+ /* @__PURE__ */ jsx(CGt, {}),
145198
145198
  /* @__PURE__ */ jsxs("div", { className: styles$2.actionButtons, children: [
145199
145199
  /* @__PURE__ */ jsx(
145200
145200
  ConsultationActionButton,
@@ -145205,7 +145205,7 @@ const CONSULTATION_START_EVENT = "startConsultation", dispatchConsultationStart
145205
145205
  }
145206
145206
  ),
145207
145207
  /* @__PURE__ */ jsx(
145208
- MGt,
145208
+ xGt,
145209
145209
  {
145210
145210
  printOptions: c,
145211
145211
  renderContext: Z,
@@ -145549,7 +145549,7 @@ const DASHBOARD_CONFIG_URL = (p) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
145549
145549
  const re = () => {
145550
145550
  const ae = M.get(PROGRAM_UUID_SEARCH_PARAMS_KEY);
145551
145551
  return ae && c.contextInformation?.program ? /* @__PURE__ */ jsx(
145552
- RGt,
145552
+ $Gt,
145553
145553
  {
145554
145554
  programUUID: ae,
145555
145555
  config: {
@@ -145568,7 +145568,7 @@ const DASHBOARD_CONFIG_URL = (p) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
145568
145568
  {
145569
145569
  breadcrumbItems: B,
145570
145570
  globalActions: k,
145571
- userMenu: /* @__PURE__ */ jsx(SKt, {}),
145571
+ userMenu: /* @__PURE__ */ jsx(IKt, {}),
145572
145572
  sideNavItems: te,
145573
145573
  activeSideNavItemId: ee,
145574
145574
  onSideNavItemClick: le,
@@ -1,5 +1,5 @@
1
1
  import { jsx as r, jsxs as h, Fragment as Q } from "react/jsx-runtime";
2
- import { m as x, u as W, a as Y, H as J, t as X, g as Z, e as ee, d as te } from "./index-BmHdPpxJ.js";
2
+ import { m as x, u as W, a as Y, b as J, t as X, g as Z, e as ee, d as te } from "./index-BSvPW3bO.js";
3
3
  import { useQuery as ae } from "@tanstack/react-query";
4
4
  import { useState as l, useCallback as _, useEffect as I, useMemo as p } 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,9 +38,9 @@ const Te = [
38
38
  null
39
39
  ), [$, O] = l(
40
40
  /* @__PURE__ */ new Set()
41
- ), E = x(), { t: n } = W(), { addNotification: L } = Y(), k = Number(a?.pageSize) || 5, [f, C] = l(1), [u, H] = l(k), [V, A] = l(void 0), M = _((e) => {
41
+ ), E = x(), { 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 = _((e) => {
42
42
  U(e), w(!0);
43
- }, []), F = _(() => {
43
+ }, []), H = _(() => {
44
44
  w(!1), U(null), O(/* @__PURE__ */ new Set());
45
45
  }, []), v = _((e) => {
46
46
  O((t) => new Set(t).add(e));
@@ -91,7 +91,7 @@ const Te = [
91
91
  }, [s, o]);
92
92
  const j = _(
93
93
  (e, t) => {
94
- t !== u ? (H(t), C(1), A(void 0)) : C(e);
94
+ t !== u ? (V(t), C(1), A(void 0)) : C(e);
95
95
  },
96
96
  [u]
97
97
  ), N = p(
@@ -152,7 +152,7 @@ const Te = [
152
152
  className: d.documentsTableBody,
153
153
  dataTestId: "documents-table",
154
154
  pageSize: u,
155
- totalItems: V,
155
+ totalItems: F,
156
156
  page: f,
157
157
  onPageChange: j
158
158
  }
@@ -163,7 +163,7 @@ const Te = [
163
163
  id: "modalIdForActionAreaLayout",
164
164
  portalId: "main-display-area",
165
165
  open: s,
166
- onRequestClose: F,
166
+ onRequestClose: H,
167
167
  modalHeading: o.documentIdentifier,
168
168
  passiveModal: !0,
169
169
  size: "lg",
@@ -1,47 +1,47 @@
1
- import { jsx as i, jsxs as x, Fragment as he } from "react/jsx-runtime";
2
- import { u as ge, m as pe, w as Ne, x as Oe, h as be, V as Ie, X as Te, y as Ae, k as Ee, J as _e, A as ve, N as Fe, o as z, g as Se, b as K, c as P, t as Ce, e as Q, f as Re, i as Be, d as Le, W as Me, I as Ue } from "./index-BmHdPpxJ.js";
1
+ import { jsx as i, jsxs as $, Fragment as ye } from "react/jsx-runtime";
2
+ import { u as ge, m as pe, w as Ne, x as Oe, h as be, M as Te, X as Ie, H as Ee, k as _e, c as Ae, _ as ve, z as Fe, o as x, g as Se, f as K, i as P, t as Me, e as Q, j as Ce, l as Re, d as Be, W as Le, n as Ue } from "./index-BSvPW3bO.js";
3
3
  import { useQueryClient as De, useQuery as b } from "@tanstack/react-query";
4
4
  import { useState as X, useMemo as d, useCallback as l } from "react";
5
- const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", qe = "FormsTable-module_customAccordianItem__isszs", I = {
5
+ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_modalHeading__wnTmA", He = "FormsTable-module_customAccordianItem__isszs", T = {
6
6
  formsTableBody: ke,
7
7
  modalHeading: we,
8
- customAccordianItem: qe
9
- }, He = "startConsultation", xe = ({
10
- episodeOfCareUuids: C,
8
+ customAccordianItem: He
9
+ }, qe = "startConsultation", $e = ({
10
+ episodeOfCareUuids: M,
11
11
  encounterUuids: c,
12
- config: J,
13
- disableActions: W = !1,
14
- activeEncounterUuid: h = null
12
+ config: W,
13
+ disableActions: Y = !1,
14
+ activeEncounterUuid: y = null
15
15
  }) => {
16
- const { t: n } = ge(), u = pe(), [g, R] = X(!1), [s, B] = X(null), {
17
- numberOfVisits: Y,
18
- hideThumbnail: Z = !1,
16
+ const { t: n } = ge(), u = pe(), [g, C] = X(!1), [s, R] = X(null), {
17
+ numberOfVisits: Z,
18
+ hideThumbnail: J = !1,
19
19
  forms: p
20
- } = J ?? {}, ee = Ne(
20
+ } = W ?? {}, ee = Ne(
21
21
  Ue.EDIT_OBSERVATIONS
22
- ), { userPrivileges: N } = Oe(), T = ee && !W && !!h, L = be(
23
- C,
22
+ ), { userPrivileges: N } = Oe(), I = ee && !Y && !!y, B = be(
23
+ M,
24
24
  c
25
25
  ), re = De(), {
26
- data: M = [],
26
+ data: L = [],
27
27
  isLoading: U,
28
28
  isError: D,
29
29
  error: oe,
30
30
  refetch: ae
31
31
  } = b({
32
- queryKey: ["forms", u, C],
33
- queryFn: () => Ie(u, void 0, Y),
34
- enabled: !!u && !L
32
+ queryKey: ["forms", u, M],
33
+ queryFn: () => Te(u, void 0, Z),
34
+ enabled: !!u && !B
35
35
  }), k = d(() => {
36
- let e = M;
36
+ let e = L;
37
37
  return c && c.length > 0 && (e = e.filter(
38
38
  (r) => c.includes(r.encounterUuid)
39
39
  )), Array.isArray(p) && p.length > 0 && (e = e.filter(
40
40
  (r) => p.some((o) => o.toLowerCase() === r.formName.toLowerCase())
41
41
  )), e;
42
- }, [M, c, p]), { data: O = [] } = b({
42
+ }, [L, c, p]), { data: O = [] } = b({
43
43
  queryKey: ["observationForms"],
44
- queryFn: () => Te()
44
+ queryFn: () => Ie()
45
45
  }), w = l(
46
46
  (e) => {
47
47
  const r = O.find((a) => a.name === e);
@@ -54,40 +54,40 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
54
54
  },
55
55
  [O, N]
56
56
  ), f = l(
57
- (e) => !h || e.encounterUuid !== h ? !1 : w(e.formName),
58
- [h, w]
59
- ), q = l(
57
+ (e) => !y || e.encounterUuid !== y ? !1 : w(e.formName),
58
+ [y, w]
59
+ ), H = l(
60
60
  (e) => O.find((r) => r.name === e)?.uuid,
61
61
  [O]
62
- ), A = d(() => {
62
+ ), E = d(() => {
63
63
  if (s)
64
- return q(s.formName);
65
- }, [s, q]), {
64
+ return H(s.formName);
65
+ }, [s, H]), {
66
66
  data: m,
67
67
  isLoading: te,
68
68
  isError: se,
69
- error: E
69
+ error: _
70
70
  } = b({
71
- queryKey: ["formMetadata", A],
72
- queryFn: () => Ae(A),
73
- enabled: !!A && g
71
+ queryKey: ["formMetadata", E],
72
+ queryFn: () => Ee(E),
73
+ enabled: !!E && g
74
74
  }), {
75
- data: _,
75
+ data: A,
76
76
  isLoading: ne,
77
77
  isError: ie,
78
78
  error: v
79
79
  } = b({
80
80
  queryKey: ["formsEncounterFHIR", s?.encounterUuid],
81
- queryFn: () => Ee(s.encounterUuid),
81
+ queryFn: () => _e(s.encounterUuid),
82
82
  enabled: !!s?.encounterUuid && g
83
83
  });
84
- _e(
84
+ Ae(
85
85
  (e) => {
86
86
  e.patientUUID === u && e.updatedConcepts.size > 0 && (ae(), re.invalidateQueries({ queryKey: ["formsEncounterFHIR"] }));
87
87
  },
88
88
  [u]
89
89
  );
90
- const de = d(() => !_?.entry || !s?.formName ? [] : _.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => ve(e) ? Fe(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [_, s?.formName]), le = d(() => {
90
+ const de = d(() => !A?.entry || !s?.formName ? [] : A.entry.filter((e) => e.resource?.resourceType === "Observation").map((e) => e.resource).filter((e) => ve(e) ? Fe(e)?.toLowerCase() === s.formName.toLowerCase() : !0), [A, s?.formName]), le = d(() => {
91
91
  if (!m?.schema) return;
92
92
  const e = [], r = (o) => {
93
93
  (o ?? []).forEach((a) => {
@@ -113,23 +113,23 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
113
113
  null
114
114
  ), Object.keys(e).length > 0 ? e : void 0;
115
115
  }, [m]), ce = d(() => {
116
- if (E)
117
- return z(E).message;
116
+ if (_)
117
+ return x(_).message;
118
118
  if (v)
119
- return z(v).message;
120
- }, [E, v]), y = d(
119
+ return x(v).message;
120
+ }, [_, v]), h = d(
121
121
  () => [
122
122
  { key: "recordedOn", header: n("RECORDED_ON") },
123
123
  { key: "recordedBy", header: n("RECORDED_BY") }
124
124
  ],
125
125
  [n]
126
- ), H = d(
127
- () => [...y, { key: "actions", header: n("ACTIONS") }],
128
- [y, n]
126
+ ), q = d(
127
+ () => [...h, { key: "actions", header: n("ACTIONS") }],
128
+ [h, n]
129
129
  ), ue = l(
130
- (e) => T && e.some((r) => f(r)) ? H : y,
131
- [T, f, H, y]
132
- ), fe = y, ye = d(
130
+ (e) => I && e.some((r) => f(r)) ? q : h,
131
+ [I, f, q, h]
132
+ ), fe = h, he = d(
133
133
  () => [
134
134
  { key: "recordedOn", sortable: !0 },
135
135
  { key: "recordedBy", sortable: !0 }
@@ -160,13 +160,13 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
160
160
  )
161
161
  })
162
162
  ).sort((r, o) => r.formName.localeCompare(o.formName));
163
- }, [k, n]), G = l((e) => {
164
- B(e), R(!0);
165
- }, []), $ = l(() => {
166
- R(!1), B(null);
163
+ }, [k, n]), z = l((e) => {
164
+ R(e), C(!0);
165
+ }, []), j = l(() => {
166
+ C(!1), R(null);
167
167
  }, []), F = l((e) => {
168
168
  globalThis.dispatchEvent(
169
- new CustomEvent(He, {
169
+ new CustomEvent(qe, {
170
170
  detail: {
171
171
  editOnly: "observationForms",
172
172
  editTitle: "EDIT_OBSERVATION_FORM_TITLE",
@@ -176,11 +176,11 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
176
176
  }
177
177
  })
178
178
  );
179
- }, []), j = l(
179
+ }, []), G = l(
180
180
  (e, r) => {
181
181
  switch (r) {
182
182
  case "recordedOn":
183
- return /* @__PURE__ */ i(Ce, { onClick: () => G(e), children: e.recordedOn });
183
+ return /* @__PURE__ */ i(Me, { onClick: () => z(e), children: e.recordedOn });
184
184
  case "recordedBy":
185
185
  return e.recordedBy;
186
186
  case "actions":
@@ -199,10 +199,10 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
199
199
  return null;
200
200
  }
201
201
  },
202
- [G, F, f, n]
202
+ [z, F, f, n]
203
203
  );
204
- return /* @__PURE__ */ x(he, { children: [
205
- /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 || L ? /* @__PURE__ */ i(
204
+ return /* @__PURE__ */ $(ye, { children: [
205
+ /* @__PURE__ */ i("div", { id: "forms-table", "data-testid": "forms-table", children: U || D || V.length === 0 || B ? /* @__PURE__ */ i(
206
206
  Q,
207
207
  {
208
208
  headers: fe,
@@ -211,17 +211,17 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
211
211
  loading: U,
212
212
  errorStateMessage: D ? oe?.message : void 0,
213
213
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
214
- renderCell: j,
215
- className: I.formsTableBody,
214
+ renderCell: G,
215
+ className: T.formsTableBody,
216
216
  dataTestId: "forms-table"
217
217
  }
218
- ) : /* @__PURE__ */ i(Re, { align: "start", children: V.map((e, r) => {
218
+ ) : /* @__PURE__ */ i(Ce, { align: "start", children: V.map((e, r) => {
219
219
  const { formName: o, records: a } = e, t = ue(a);
220
220
  return /* @__PURE__ */ i(
221
- Be,
221
+ Re,
222
222
  {
223
223
  title: o,
224
- className: I.customAccordianItem,
224
+ className: T.customAccordianItem,
225
225
  testId: `accordian-title-${o}`,
226
226
  open: r === 0,
227
227
  children: /* @__PURE__ */ i(
@@ -232,10 +232,10 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
232
232
  rows: a,
233
233
  loading: !1,
234
234
  errorStateMessage: "",
235
- sortable: ye,
235
+ sortable: he,
236
236
  emptyStateMessage: n("FORMS_UNAVAILABLE"),
237
- renderCell: j,
238
- className: I.formsTableBody,
237
+ renderCell: G,
238
+ className: T.formsTableBody,
239
239
  dataTestId: `forms-table-${o}`
240
240
  }
241
241
  )
@@ -244,15 +244,15 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
244
244
  );
245
245
  }) }) }),
246
246
  g && s && /* @__PURE__ */ i(
247
- Le,
247
+ Be,
248
248
  {
249
249
  id: "modalIdForActionAreaLayout",
250
250
  portalId: "main-display-area",
251
251
  open: g,
252
- onRequestClose: $,
253
- modalHeading: /* @__PURE__ */ x("div", { className: I.modalHeading, children: [
252
+ onRequestClose: j,
253
+ modalHeading: /* @__PURE__ */ $("div", { className: T.modalHeading, children: [
254
254
  /* @__PURE__ */ i("span", { children: s.formName }),
255
- T && f(s) && /* @__PURE__ */ i(
255
+ I && f(s) && /* @__PURE__ */ i(
256
256
  K,
257
257
  {
258
258
  label: n("EDIT_OBSERVATION_FORM"),
@@ -260,7 +260,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
260
260
  size: "sm",
261
261
  testId: `edit-form-modal-${s.encounterUuid}`,
262
262
  onClick: () => {
263
- $(), F(s);
263
+ j(), F(s);
264
264
  },
265
265
  children: /* @__PURE__ */ i(P, {})
266
266
  }
@@ -271,7 +271,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
271
271
  size: "md",
272
272
  testId: "form-details-modal",
273
273
  children: /* @__PURE__ */ i(
274
- Me,
274
+ Le,
275
275
  {
276
276
  observations: de,
277
277
  isLoading: te || ne,
@@ -279,7 +279,7 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
279
279
  errorMessage: ce,
280
280
  emptyStateMessage: n("NO_FORM_DATA_AVAILABLE"),
281
281
  testIdPrefix: s.formName,
282
- hideThumbnail: Z,
282
+ hideThumbnail: J,
283
283
  controlOrder: le,
284
284
  sectionMap: me
285
285
  }
@@ -289,5 +289,5 @@ const ke = "FormsTable-module_formsTableBody__SvGha", we = "FormsTable-module_mo
289
289
  ] });
290
290
  };
291
291
  export {
292
- xe as default
292
+ $e as default
293
293
  };
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-DGHZuWjT.js";
2
- import { bN as d, bO as f, bP as e } from "./index-BmHdPpxJ.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-CqaAnTQN.js";
2
+ import { bN as d, bO as f, bP as e } from "./index-BSvPW3bO.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-DGHZuWjT.js";
2
- import { bN as v, bO as C, bP as e } from "./index-BmHdPpxJ.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-CqaAnTQN.js";
2
+ import { bN as v, bO as C, bP as e } from "./index-BSvPW3bO.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"