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

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 { t as B, v as ENCOUNTER_CONCEPTS_URL, Y as Yr, C as Ci, w as BAHMNI_USER_LOCATION_COOKIE_NAME, u as useTranslation, z as Lm, A as vSe, g as gr, I as ZH2, K as BH2, M as RH2, N as gM2, S as rc1, $ as $H2, V as AE, _ as Di, a0 as Dd, a1 as dE, a2 as Id, a3 as vs, a4 as dist, a5 as yt, a6 as ge, a7 as ss, a8 as Mb, a9 as Kb, aa as Wb, ab as PH2, ac as YH2, ad as oV2, G as G1, H as H3, ae as Jb, af as fH2, ag as HH2, ah as hC2, ai as QH2, aj as XH2, X as XYt, ak as R_, al as OH2, am as Y_, an as Ps, ao as P_, ap as mv, aq as Yb, ar as CH2, as as n_, at as a_, au as CLINICAL_V2_CONFIG_BASE_URL, av as d_, aw as CE, ax as Qr, ay as c_, az as qb, aA as gv, aB as Og2, aC as $_, aD as l_, aE as f_, aF as Ev, aG as TH2, aH as Dv, aI as kb, aJ as p_, aK as Rt, aL as jr, aM as Rv, aN as Nv, Q as Qn, aO as Q_, aP as I_, aQ as L_, B as BYt, aR as sC2, aS as fC2, aT as ev, aU as Z_, 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 X_, b1 as rv, b2 as YE, b3 as Lb, b4 as zE, b5 as an, b6 as N4, b7 as c3, b8 as cC2, b9 as _E, ba as tv, bb as sv, bc as ov, bd as av, be as Ii, bf as ns, bg as F_, bh as Zb, bi as Iv, bj as yv, bk as wv, bl as hv, bm as CDSS_SERVER_CONFIG_URL, bn as t_, bo as Mi, bp as wb, bq as Ze, br as KH2, bs as rJt, bt as qH2, bu as Xy, bv as j_, bw as V_, bx as SH2, by as ml1, bz as z_, bA as B_, bB as H_, bC as ZYt, bD as SYt, bE as KE, bF as G_, bG as aE, bH as BAHMNI_CLINICAL_PATH, bI as RE, bJ as sw, bK as GH2, bL as jH2, bM as QE2, bN as GGt, bO as SE, bP as GYt } from "./index-CdJk8bVX.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-xjC_sgLM.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 : {};
@@ -2046,7 +2046,7 @@ const useLocations = () => {
2046
2046
  encounterSessionStartContext: p,
2047
2047
  inputControlConfig: c
2048
2048
  }) => {
2049
- const a = p?.isVisitActive ?? !0, { t: s } = useTranslation(), f = mSe(), d = gr(), {
2049
+ const a = p?.isVisitActive ?? !0, { t: s } = useTranslation(), f = vSe(), d = gr(), {
2050
2050
  activeVisit: h,
2051
2051
  loading: E,
2052
2052
  error: C
@@ -2342,12 +2342,12 @@ const ALLERGY_INTOLERANCE_RESOURCE_TYPE = "AllergyIntolerance", ALLERGY_SEVERITY
2342
2342
  const a = {
2343
2343
  coding: p
2344
2344
  };
2345
- return OE(c) || (a.text = c), a;
2345
+ return AE(c) || (a.text = c), a;
2346
2346
  }, createCoding = (p, c, a) => {
2347
2347
  const s = {
2348
2348
  code: p
2349
2349
  };
2350
- return OE(c) || (s.system = c), OE(a) || (s.display = a), s;
2350
+ return AE(c) || (s.system = c), AE(a) || (s.display = a), s;
2351
2351
  }, createEncounterAllergyResource = (p, c, a, s, f, d, h) => {
2352
2352
  const E = {
2353
2353
  resourceType: "AllergyIntolerance",
@@ -2411,7 +2411,7 @@ const ALLERGY_INTOLERANCE_RESOURCE_TYPE = "AllergyIntolerance", ALLERGY_SEVERITY
2411
2411
  verificationStatus: createCodeableConcept([
2412
2412
  createCoding(
2413
2413
  c,
2414
- lE
2414
+ dE
2415
2415
  )
2416
2416
  ]),
2417
2417
  encounter: s,
@@ -139483,7 +139483,7 @@ function createConditionsBundleEntries({
139483
139483
  for (const h of p) {
139484
139484
  if (!h || typeof h.durationValue != "number" || !h.durationUnit || h.durationValue === null || h.durationUnit === null)
139485
139485
  throw new Error(CONSULTATION_ERROR_MESSAGES.INVALID_CONDITION_PARAMS);
139486
- const E = kb(
139486
+ const E = Mb(
139487
139487
  f,
139488
139488
  h.durationValue,
139489
139489
  h.durationUnit
@@ -139592,13 +139592,13 @@ const useAllergenSearch = (p = "") => {
139592
139592
  allergyReactionUuid: Z
139593
139593
  } = T.consultationPad.allergyConceptMap;
139594
139594
  try {
139595
- const k = await Gb(
139595
+ const k = await Kb(
139596
139596
  D,
139597
139597
  z,
139598
139598
  O
139599
139599
  );
139600
139600
  a(k);
139601
- const U = await Kb(Z);
139601
+ const U = await Wb(Z);
139602
139602
  f(U);
139603
139603
  } catch (k) {
139604
139604
  const U = Yr(k);
@@ -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
+ XYt.ALLERGIES
139774
139774
  ), h = H3(
139775
- PYt.EDIT_ALLERGIES
139775
+ XYt.EDIT_ALLERGIES
139776
139776
  ), [E, C] = useState(""), [R, T] = useState(null), [H, M] = useState(!1), [I, F] = useState(
139777
139777
  null
139778
139778
  ), {
@@ -139794,7 +139794,7 @@ const allergiesFormTile = "AllergiesForm-module_allergiesFormTile__1UsbU", aller
139794
139794
  } = useQuery({
139795
139795
  queryKey: allergiesQueryKeys(s),
139796
139796
  enabled: !!s && d,
139797
- queryFn: () => Wb(s)
139797
+ queryFn: () => Jb(s)
139798
139798
  });
139799
139799
  useEffect(() => {
139800
139800
  fe && f({
@@ -139985,7 +139985,7 @@ const useInvestigationsSearch = (p = "") => {
139985
139985
  (async () => {
139986
139986
  try {
139987
139987
  d(!0), E(null);
139988
- const H = await S_();
139988
+ const H = await R_();
139989
139989
  s(H);
139990
139990
  } catch (H) {
139991
139991
  const M = Yr(H);
@@ -140095,8 +140095,8 @@ 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
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, {
140098
+ XYt.INVESTIGATIONS
140099
+ ), [f, d] = useState(""), [h, E] = useState(null), [C, R] = useState(!1), { activeEncounter: T, matchReasons: H } = Y_(), I = H.includes("MATCHED") ? T?.id : void 0, {
140100
140100
  data: F,
140101
140101
  refetch: $,
140102
140102
  error: D
@@ -140106,7 +140106,7 @@ const investigationsFormTile = "InvestigationsForm-module_investigationsFormTile
140106
140106
  staleTime: 3e4,
140107
140107
  queryFn: async () => {
140108
140108
  const ne = await Ps();
140109
- return A_(
140109
+ return P_(
140110
140110
  ne.results,
140111
140111
  c,
140112
140112
  [I]
@@ -140119,7 +140119,7 @@ const investigationsFormTile = "InvestigationsForm-module_investigationsFormTile
140119
140119
  message: D.message,
140120
140120
  type: "error"
140121
140121
  });
140122
- }, [D, a, p]), pv(
140122
+ }, [D, a, p]), mv(
140123
140123
  (ne) => {
140124
140124
  ne.patientUUID === c && Object.keys(ne.updatedResources.serviceRequests ?? {}).length > 0 && $();
140125
140125
  },
@@ -140312,7 +140312,7 @@ const useConceptSearch = (p, c = 20, a = 500) => {
140312
140312
  (async () => {
140313
140313
  h(!0), C(null);
140314
140314
  try {
140315
- const H = await zb(R, c);
140315
+ const H = await Yb(R, c);
140316
140316
  f(H);
140317
140317
  } catch (H) {
140318
140318
  C(
@@ -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
+ XYt.CONDITIONS_AND_DIAGNOSES
140512
140512
  ), [f, d] = useState(""), [h, E] = useState(null), [C, R] = useState(!1), {
140513
140513
  selectedDiagnoses: T,
140514
140514
  selectedConditions: H,
@@ -140530,7 +140530,7 @@ const conditionsAndDiagnosesTile = "ConditionsAndDiagnoses-module_conditionsAndD
140530
140530
  } = useQuery({
140531
140531
  queryKey: ["conditions", c],
140532
140532
  enabled: !!c && s,
140533
- queryFn: () => r_(c)
140533
+ queryFn: () => n_(c)
140534
140534
  }), {
140535
140535
  data: Q,
140536
140536
  isLoading: V,
@@ -140539,9 +140539,9 @@ const conditionsAndDiagnosesTile = "ConditionsAndDiagnoses-module_conditionsAndD
140539
140539
  } = useQuery({
140540
140540
  queryKey: ["diagnoses", c],
140541
140541
  enabled: !!c && s,
140542
- queryFn: () => o_(c)
140542
+ queryFn: () => a_(c)
140543
140543
  });
140544
- pv(
140544
+ mv(
140545
140545
  (ae) => {
140546
140546
  ae.patientUUID === c && ae.updatedResources.conditions && (ee(), K());
140547
140547
  },
@@ -140775,7 +140775,7 @@ const useMedicationSearch = (p, c = 20, a = 500) => {
140775
140775
  (async () => {
140776
140776
  h(!0), C(null);
140777
140777
  try {
140778
- const H = await l_(R, c);
140778
+ const H = await d_(R, c);
140779
140779
  f(getMedicationsFromBundle(H));
140780
140780
  } catch (H) {
140781
140781
  C(
@@ -141095,7 +141095,7 @@ function getMedicationRequestComboBoxItems(p, c, a, s, f) {
141095
141095
  displayName: getMedicationDisplay(h),
141096
141096
  disabled: !1
141097
141097
  }));
141098
- return DE(a, s, d, toSentinel, f);
141098
+ return CE(a, s, d, toSentinel, f);
141099
141099
  }
141100
141100
  function getVaccinationComboBoxItems(p, c, a, s, f) {
141101
141101
  if (!p.trim()) return [];
@@ -141106,7 +141106,7 @@ function getVaccinationComboBoxItems(p, c, a, s, f) {
141106
141106
  displayName: getMedicationDisplay(h),
141107
141107
  disabled: !1
141108
141108
  }));
141109
- return DE(
141109
+ return CE(
141110
141110
  a,
141111
141111
  s,
141112
141112
  d,
@@ -141300,7 +141300,7 @@ function validateEntry$1(p, c) {
141300
141300
  return { entry: { ...p, errors: a, hasBeenValidated: !0 }, valid: s };
141301
141301
  }
141302
141302
  function createMedicationRequestStore(p) {
141303
- const c = p === i_;
141303
+ const c = p === c_;
141304
141304
  return createStore((a, s) => ({
141305
141305
  selectedMedicationRequests: [],
141306
141306
  attributes: void 0,
@@ -141526,7 +141526,7 @@ const column$2 = "SelectedMedicationRequestItem-module_column__RoFL-", itemTitle
141526
141526
  updateDispenseQuantity: $,
141527
141527
  updateDispenseUnit: D,
141528
141528
  updateNote: z
141529
- } = useMedicationRequestStore(a), { t: O } = useTranslation(), Z = a === i_, {
141529
+ } = useMedicationRequestStore(a), { t: O } = useTranslation(), Z = a === c_, {
141530
141530
  id: k,
141531
141531
  dosage: U,
141532
141532
  dosageUnit: W,
@@ -141571,10 +141571,10 @@ const column$2 = "SelectedMedicationRequestItem-module_column__RoFL-", itemTitle
141571
141571
  const de = c.frequencies.find(isImmediateFrequency);
141572
141572
  de && E(k, de);
141573
141573
  }
141574
- se && F(k, Ub());
141574
+ se && F(k, qb());
141575
141575
  } else if (se) {
141576
141576
  const de = c.frequencies.find(isImmediateFrequency);
141577
- de && E(k, de), R(k, 0), T(k, null), F(k, Ub());
141577
+ de && E(k, de), R(k, 0), T(k, null), F(k, qb());
141578
141578
  }
141579
141579
  }
141580
141580
  }, [
@@ -141601,7 +141601,7 @@ const column$2 = "SelectedMedicationRequestItem-module_column__RoFL-", itemTitle
141601
141601
  });
141602
141602
  }, []), useEffect(() => {
141603
141603
  const de = f?.filter((_e) => _e.event === "onSelect") ?? [];
141604
- de.length > 0 && hv({
141604
+ de.length > 0 && gv({
141605
141605
  controlKey: a,
141606
141606
  itemId: k,
141607
141607
  rules: de
@@ -141860,7 +141860,7 @@ const column$2 = "SelectedMedicationRequestItem-module_column__RoFL-", itemTitle
141860
141860
  datePickerType: "single",
141861
141861
  "data-testid": `${a}-start-date-picker-${k}-test-id`,
141862
141862
  value: ie,
141863
- minDate: Ub(),
141863
+ minDate: qb(),
141864
141864
  onChange: (de) => {
141865
141865
  F(k, de[0]);
141866
141866
  },
@@ -141961,11 +141961,11 @@ const $schema$2 = "http://json-schema.org/draft-07/schema#", title$4 = "Medicati
141961
141961
  cdsCard: cdsCard$1
141962
141962
  }, MedicationRequestForm = React__default.memo(({ inputControlConfig: p }) => {
141963
141963
  const { t: c } = useTranslation(), {
141964
- type: a = i_,
141964
+ type: a = c_,
141965
141965
  label: s = "MEDICATIONS_INPUT_CONTROL_TITLE",
141966
141966
  attributes: f = [],
141967
141967
  cdss: d = []
141968
- } = p ?? {}, h = a === i_, [E, C] = useState(""), {
141968
+ } = p ?? {}, h = a === c_, [E, C] = useState(""), {
141969
141969
  data: R,
141970
141970
  isLoading: T,
141971
141971
  error: H
@@ -141973,11 +141973,11 @@ const $schema$2 = "http://json-schema.org/draft-07/schema#", title$4 = "Medicati
141973
141973
  queryKey: ["medicationConfig"],
141974
141974
  queryFn: async () => {
141975
141975
  const [Y, ne] = await Promise.all([
141976
- P_(
141976
+ $_(
141977
141977
  MEDICATIONS_CONFIG_URL,
141978
141978
  medicationConfigSchema
141979
141979
  ),
141980
- u_()
141980
+ l_()
141981
141981
  ]);
141982
141982
  return { ...ne, ...Y };
141983
141983
  }
@@ -141991,7 +141991,7 @@ const $schema$2 = "http://json-schema.org/draft-07/schema#", title$4 = "Medicati
141991
141991
  error: z
141992
141992
  } = useQuery({
141993
141993
  queryKey: ["vaccination"],
141994
- queryFn: d_,
141994
+ queryFn: f_,
141995
141995
  enabled: !h
141996
141996
  }), O = useMemo(
141997
141997
  () => $ ? getMedicationsFromBundle($) : [],
@@ -142008,11 +142008,11 @@ const $schema$2 = "http://json-schema.org/draft-07/schema#", title$4 = "Medicati
142008
142008
  ), [N, R]);
142009
142009
  useEffect(() => {
142010
142010
  W(f), V && getMedicationRequestStore(a).getState().loadMedicationsForEdit(V);
142011
- }, [V, a]), yv((Y) => {
142011
+ }, [V, a]), Ev((Y) => {
142012
142012
  const { cards: ne } = Y, oe = new Set(
142013
142013
  Z.map((ae) => ae.id)
142014
142014
  );
142015
- Nv(ne, oe).forEach(({ card: ae, resourceId: re }) => {
142015
+ Dv(ne, oe).forEach(({ card: ae, resourceId: re }) => {
142016
142016
  K(re, [ae]);
142017
142017
  });
142018
142018
  });
@@ -142160,7 +142160,7 @@ const registerMedicationRequestControl = (p) => {
142160
142160
  hasCriticalCDSCards: () => c().getState().hasCriticalCDSCards()
142161
142161
  });
142162
142162
  };
142163
- registerMedicationRequestControl(i_);
142163
+ registerMedicationRequestControl(c_);
142164
142164
  registerMedicationRequestControl(VACCINATIONS_INPUT_CONTROL_KEY);
142165
142165
  const IMMUNIZATION_HISTORY_INPUT_CONTROL_KEY = "immunizationHistory", IMMUNIZATION_ADMINISTRATION_INPUT_CONTROL_KEY = "immunizationAdministration", IMMUNIZATION_WAIVER_INPUT_CONTROL_KEY = "immunizationWaiver", ADMINISTERED_PRODUCT_EXTENSION_URL = "http://fhir.bahmni.org/ext/immunization/administeredProduct", BASED_ON_EXTENSION_URL = "http://fhir.bahmni.org/ext/immunization/basedOn", STOCK_LOCATION_EXTENSION_URL = "http://fhir.bahmni.org/ext/immunization/stockLocation", ENTERING_PROVIDER_SYSTEM = "http://terminology.hl7.org/CodeSystem/v2-0443", ENTERING_PROVIDER_CODE = "EP", ENTERING_PROVIDER_DISPLAY = "Entering Provider";
142166
142166
  function resolveAdministeredProductExtension(p) {
@@ -142254,7 +142254,7 @@ function getBatchNumberComboBoxItems(p, c, a) {
142254
142254
  }
142255
142255
  function formatBatchItemDisplay(p, c) {
142256
142256
  if (!p) return "";
142257
- const a = p.expiryDate ? ` [${xb(p.expiryDate, c, !1, "d MMM yyyy").formattedResult}]` : "", s = p.stockLocationName ? ` - ${p.stockLocationName}` : "";
142257
+ const a = p.expiryDate ? ` [${kb(p.expiryDate, c, !1, "d MMM yyyy").formattedResult}]` : "", s = p.stockLocationName ? ` - ${p.stockLocationName}` : "";
142258
142258
  return p.batchNumber + a + s;
142259
142259
  }
142260
142260
  function getLocationComboBoxItems(p, c) {
@@ -142267,7 +142267,7 @@ function getComboBoxItems(p, c, a, s, f) {
142267
142267
  const h = (c?.expansion?.contains ?? []).filter(
142268
142268
  (E) => E.display?.toLowerCase().includes(p.toLowerCase())
142269
142269
  );
142270
- return DE(
142270
+ return CE(
142271
142271
  a,
142272
142272
  s,
142273
142273
  h,
@@ -142687,7 +142687,7 @@ const form = "ImmunizationForm-module_form__e68vP", title$2 = "ImmunizationForm-
142687
142687
  fe && ne(!0);
142688
142688
  }, [fe]), useEffect(() => {
142689
142689
  const Be = M?.filter((Ue) => Ue.event === "onSelect") ?? [];
142690
- Be.length > 0 && hv({
142690
+ Be.length > 0 && gv({
142691
142691
  controlKey: C,
142692
142692
  itemId: V,
142693
142693
  rules: Be
@@ -143050,7 +143050,7 @@ const form = "ImmunizationForm-module_form__e68vP", title$2 = "ImmunizationForm-
143050
143050
  isError: O
143051
143051
  } = useQuery({
143052
143052
  queryKey: ["medication", $],
143053
- queryFn: () => f_($),
143053
+ queryFn: () => p_($),
143054
143054
  enabled: !!I && !!$,
143055
143055
  staleTime: 1 / 0
143056
143056
  }), { isLoading: Z, error: k } = useClinicalConfig(), U = Rt(), {
@@ -143063,11 +143063,11 @@ const form = "ImmunizationForm-module_form__e68vP", title$2 = "ImmunizationForm-
143063
143063
  N && T(N);
143064
143064
  }, [N, T]), useEffect(() => {
143065
143065
  ie && H({ otherReasonConceptUuid: ie });
143066
- }, [ie, H]), yv((at) => {
143066
+ }, [ie, H]), Ev((at) => {
143067
143067
  const { cards: nt } = at, it = new Set(
143068
143068
  R.map((Vt) => Vt.id)
143069
143069
  );
143070
- Nv(nt, it).forEach(({ card: Vt, resourceId: vt }) => {
143070
+ Dv(nt, it).forEach(({ card: Vt, resourceId: vt }) => {
143071
143071
  M(vt, [Vt]);
143072
143072
  });
143073
143073
  });
@@ -143086,7 +143086,7 @@ const form = "ImmunizationForm-module_form__e68vP", title$2 = "ImmunizationForm-
143086
143086
  error: le
143087
143087
  } = useQuery({
143088
143088
  queryKey: ["administeredLocationTag", se],
143089
- queryFn: () => Tv(se),
143089
+ queryFn: () => Rv(se),
143090
143090
  enabled: !h && !!se && !Z && !k && !!findAttr("administeredLocation", N),
143091
143091
  staleTime: 1 / 0
143092
143092
  }), {
@@ -143122,7 +143122,7 @@ const form = "ImmunizationForm-module_form__e68vP", title$2 = "ImmunizationForm-
143122
143122
  error: je
143123
143123
  } = useQuery({
143124
143124
  queryKey: ["vaccination"],
143125
- queryFn: d_,
143125
+ queryFn: f_,
143126
143126
  staleTime: 1 / 0
143127
143127
  }), Je = useMemo(
143128
143128
  () => Fe?.entry?.filter((at) => at.resource?.resourceType === "Medication").map((at) => at.resource) ?? [],
@@ -143132,7 +143132,7 @@ const form = "ImmunizationForm-module_form__e68vP", title$2 = "ImmunizationForm-
143132
143132
  const nt = at.administeredLocation?.uuid;
143133
143133
  return {
143134
143134
  queryKey: ["availableStocks", at.drug?.code, nt],
143135
- queryFn: () => Pv(at.drug.code, nt),
143135
+ queryFn: () => Nv(at.drug.code, nt),
143136
143136
  enabled: !h && !!ne && !!at.drug?.code && !!nt
143137
143137
  };
143138
143138
  })
@@ -143330,7 +143330,7 @@ const canUserAccessForm = (p, c) => {
143330
143330
  error: h
143331
143331
  } = useQuery({
143332
143332
  queryKey: ["observationForms", c],
143333
- queryFn: () => W_(c)
143333
+ queryFn: () => Q_(c)
143334
143334
  });
143335
143335
  return {
143336
143336
  forms: useMemo(() => {
@@ -143355,7 +143355,7 @@ const canUserAccessForm = (p, c) => {
143355
143355
  try {
143356
143356
  if (!p)
143357
143357
  throw new Error(PINNED_FORMS_ERROR_MESSAGES.USER_NOT_FOUND);
143358
- const c = await B(N_(p));
143358
+ const c = await B(I_(p));
143359
143359
  if (!c || typeof c != "object")
143360
143360
  return [];
143361
143361
  const a = c.userProperties?.pinnedObsTemplates ?? "";
@@ -143373,7 +143373,7 @@ const canUserAccessForm = (p, c) => {
143373
143373
  const a = c.filter(
143374
143374
  (s) => typeof s == "string" && s.trim().length > 0
143375
143375
  );
143376
- await ge(N_(p), {
143376
+ await ge(I_(p), {
143377
143377
  userProperties: {
143378
143378
  pinnedObsTemplates: a.join(PINNED_FORMS_DELIMITER)
143379
143379
  }
@@ -143443,7 +143443,7 @@ function usePinnedObservationForms(p, c) {
143443
143443
  return { pinnedForms: f, updatePinnedForms: M, isLoading: !h, error: C, refetch: I };
143444
143444
  }
143445
143445
  function useSubmittedEncounterForms(p) {
143446
- const c = gr(), { activeEncounter: a, matchReasons: s } = z_(), f = s.includes("MATCHED") ? a?.id : void 0, {
143446
+ const c = gr(), { activeEncounter: a, matchReasons: s } = Y_(), f = s.includes("MATCHED") ? a?.id : void 0, {
143447
143447
  data: d,
143448
143448
  refetch: h,
143449
143449
  error: E
@@ -143451,11 +143451,11 @@ function useSubmittedEncounterForms(p) {
143451
143451
  queryKey: ["submittedEncounterForms", c, f],
143452
143452
  enabled: !!f && !!c,
143453
143453
  staleTime: 3e4,
143454
- queryFn: () => C_(f)
143454
+ queryFn: () => L_(f)
143455
143455
  });
143456
143456
  return useEffect(() => {
143457
143457
  E && console.error("Failed to fetch submitted encounter forms", E);
143458
- }, [E]), pv(
143458
+ }, [E]), mv(
143459
143459
  (C) => {
143460
143460
  C.patientUUID === c && h();
143461
143461
  },
@@ -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 = BYt(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
+ XYt.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+/);
@@ -143672,7 +143672,7 @@ ObservationForms.displayName = "ObservationForms";
143672
143672
  const ObservationFormsPanel = ({
143673
143673
  encounterSessionStartContext: p
143674
143674
  }) => {
143675
- const { user: c } = mSe(), a = gr(), { episodeOfCare: s } = useClinicalAppData(), f = s.map((V) => V.uuid), {
143675
+ const { user: c } = vSe(), a = gr(), { episodeOfCare: s } = useClinicalAppData(), f = s.map((V) => V.uuid), {
143676
143676
  forms: d,
143677
143677
  isLoading: h,
143678
143678
  error: E
@@ -143714,18 +143714,18 @@ const ObservationFormsPanel = ({
143714
143714
  );
143715
143715
  if (!V) return;
143716
143716
  const fe = `${U}:${k}`;
143717
- K.current !== fe && (K.current = fe, C_(U).then(async (ee) => {
143717
+ K.current !== fe && (K.current = fe, L_(U).then(async (ee) => {
143718
143718
  const se = bundleExports.getObservationsFromFhir(ee).filter(
143719
143719
  (oe) => oe.formFieldPath?.toLowerCase().startsWith(`${k.toLowerCase()}.`)
143720
143720
  );
143721
143721
  let Y = V, ne = null;
143722
143722
  if (a) {
143723
- const ie = (await X_(a).catch(
143723
+ const ie = (await ev(a).catch(
143724
143724
  () => []
143725
143725
  )).find(
143726
143726
  (ae) => ae.encounterUuid === U && ae.formName.toLowerCase() === k.toLowerCase()
143727
143727
  );
143728
- ne = ie?.formUuid ?? await Q_(
143728
+ ne = ie?.formUuid ?? await Z_(
143729
143729
  k,
143730
143730
  ie?.formVersion,
143731
143731
  ie?.encounterDateTime
@@ -143865,11 +143865,11 @@ const stopMedicationFormTile = "StopMedicationForm-module_stopMedicationFormTile
143865
143865
  queryKey: ["medicationConfig"],
143866
143866
  queryFn: async () => {
143867
143867
  const [V, fe] = await Promise.all([
143868
- P_(
143868
+ $_(
143869
143869
  MEDICATIONS_CONFIG_URL,
143870
143870
  medicationConfigSchema
143871
143871
  ),
143872
- u_()
143872
+ l_()
143873
143873
  ]);
143874
143874
  return { ...fe, ...V };
143875
143875
  }
@@ -144047,7 +144047,7 @@ function useObservationFormData(p) {
144047
144047
  error: d
144048
144048
  } = useQuery({
144049
144049
  queryKey: ["formMetadata", p?.formUuid],
144050
- queryFn: () => J_(p.formUuid),
144050
+ queryFn: () => X_(p.formUuid),
144051
144051
  enabled: !!p?.formUuid
144052
144052
  }), h = p?.formMetadata ?? s, E = d || null, C = useCallback((H) => {
144053
144053
  if (!H) {
@@ -144101,7 +144101,7 @@ function useObservationFormData(p) {
144101
144101
  a(F);
144102
144102
  }, []), R = () => {
144103
144103
  a(null);
144104
- }, T = c && h ? ev(c, h) : [];
144104
+ }, T = c && h ? rv(c, h) : [];
144105
144105
  return {
144106
144106
  formData: c,
144107
144107
  observations: T,
@@ -144239,17 +144239,17 @@ const formView = "ObservationFormsContainer-module_formView__d3K6Z", errorNotifi
144239
144239
  onDirectModeCancel: C,
144240
144240
  encounterSessionStartContext: R
144241
144241
  }) => {
144242
- const { t: T } = useTranslation(), H = R?.editOnly === "observationForms", [M, I] = React__default.useState(!1), $ = R?.task?.basedOn?.[0], D = gr(), { user: z } = mSe(), { episodeOfCare: O, activeVisitId: Z } = useClinicalAppData(), {
144242
+ const { t: T } = useTranslation(), H = R?.editOnly === "observationForms", [M, I] = React__default.useState(!1), $ = R?.task?.basedOn?.[0], D = gr(), { user: z } = vSe(), { episodeOfCare: O, activeVisitId: Z } = useClinicalAppData(), {
144243
144243
  data: k,
144244
144244
  isLoading: U,
144245
144245
  error: W
144246
144246
  } = useQuery({
144247
144247
  queryKey: ["patient", D],
144248
- queryFn: () => zE(D),
144248
+ queryFn: () => YE(D),
144249
144249
  enabled: !!D
144250
144250
  }), N = useMemo(() => {
144251
144251
  if (!k || !D) return null;
144252
- const Be = k.birthDate ? Cb(k.birthDate) : null;
144252
+ const Be = k.birthDate ? Lb(k.birthDate) : null;
144253
144253
  return {
144254
144254
  uuid: D,
144255
144255
  identifier: k.identifier ?? void 0,
@@ -144260,7 +144260,7 @@ const formView = "ObservationFormsContainer-module_formView__d3K6Z", errorNotifi
144260
144260
  ageInDays: Be?.ageInDays,
144261
144261
  birthdate: k.birthDate ?? void 0,
144262
144262
  birthtime: k.birthtime ?? void 0,
144263
- gender: k.gender ? BE(k.gender) : void 0,
144263
+ gender: k.gender ? zE(k.gender) : void 0,
144264
144264
  activeVisitUuid: Z ?? void 0,
144265
144265
  currentEncounterUuid: d ?? void 0,
144266
144266
  getAgeDetails: () => Be ?? AGE_DETAILS_DEFAULT
@@ -144307,7 +144307,7 @@ const formView = "ObservationFormsContainer-module_formView__d3K6Z", errorNotifi
144307
144307
  groupMembers: nt.groupMembers.map(ut)
144308
144308
  } : nt;
144309
144309
  }, mt = (at) => {
144310
- const nt = typeof at.value == "string" && bE.test(at.value) ? { ...at, value: Z_(new Date(at.value)) } : at;
144310
+ const nt = typeof at.value == "string" && _E.test(at.value) ? { ...at, value: tv(new Date(at.value)) } : at;
144311
144311
  return nt.groupMembers ? {
144312
144312
  ...nt,
144313
144313
  groupMembers: nt.groupMembers.map(mt)
@@ -144342,7 +144342,7 @@ const formView = "ObservationFormsContainer-module_formView__d3K6Z", errorNotifi
144342
144342
  if (ie.current) {
144343
144343
  if (se && !Be) {
144344
144344
  Y(null);
144345
- const { observations: rt } = ie.current.getValue(), Vt = rt && rt.length > 0 ? rv(
144345
+ const { observations: rt } = ie.current.getValue(), Vt = rt && rt.length > 0 ? sv(
144346
144346
  rt,
144347
144347
  we
144348
144348
  ) : [];
@@ -144358,7 +144358,7 @@ const formView = "ObservationFormsContainer-module_formView__d3K6Z", errorNotifi
144358
144358
  ), Oe(Vt, se);
144359
144359
  return;
144360
144360
  }
144361
- const { observations: Ue, errors: ut } = ie.current.getValue(), mt = Ue && Ue.length > 0 ? rv(
144361
+ const { observations: Ue, errors: ut } = ie.current.getValue(), mt = Ue && Ue.length > 0 ? sv(
144362
144362
  Ue,
144363
144363
  we
144364
144364
  ) : [], Xe = (rt) => rt.value !== null && rt.value !== void 0 && rt.value !== "" ? !0 : rt.groupMembers && rt.groupMembers.length > 0 ? rt.groupMembers.some(Xe) : !1, nt = !mt.some(Xe);
@@ -144402,7 +144402,7 @@ const formView = "ObservationFormsContainer-module_formView__d3K6Z", errorNotifi
144402
144402
  }
144403
144403
  }, Fe = () => {
144404
144404
  if (Y(null), ie.current) {
144405
- const { observations: Be } = ie.current.getValue(), Ue = Be && Be.length > 0 ? rv(
144405
+ const { observations: Be } = ie.current.getValue(), Ue = Be && Be.length > 0 ? sv(
144406
144406
  Be,
144407
144407
  we
144408
144408
  ) : [];
@@ -144542,8 +144542,8 @@ const formView = "ObservationFormsContainer-module_formView__d3K6Z", errorNotifi
144542
144542
  return null;
144543
144543
  }, extractAndAppendNotesFromFormData = (p, c) => {
144544
144544
  if (!p.current) return;
144545
- const a = p.current?.state, s = nv(a?.data);
144546
- sv(s, c);
144545
+ const a = p.current?.state, s = ov(a?.data);
144546
+ av(s, c);
144547
144547
  }, $schema$1 = "http://json-schema.org/draft-07/schema#", title$1 = "CDSS Servers Configuration Schema", description$1 = "Schema for CDSS (Clinical Decision Support System) server configurations", type$1 = "array", items = { type: "object", required: ["server", "url", "services"], additionalProperties: !1, properties: { server: { type: "string", description: "CDSS server identifier" }, url: { type: "string", description: "Base URL for the CDSS server" }, services: { type: "array", description: "List of CDS Hooks services provided by this server", items: { type: "object", required: ["name", "description"], additionalProperties: !1, properties: { name: { type: "string", description: "Service/hook name" }, description: { type: "string", description: "Service description" }, contextResourceMap: { type: "array", description: "Mapping of FHIR resources to context attributes", items: { type: "object", required: ["type", "attribute"], additionalProperties: !1, properties: { type: { type: "string", description: "FHIR resource type" }, attribute: { type: "string", description: "Context attribute name" } } } }, prefetch: { type: "object", description: "Prefetch templates for the service", additionalProperties: { type: "string" } } } } } } }, cdssConfigSchema = {
144548
144548
  $schema: $schema$1,
144549
144549
  title: title$1,
@@ -144691,7 +144691,7 @@ const ConsultationPad = ({
144691
144691
  error: Z
144692
144692
  } = useQuery({
144693
144693
  queryKey: ["cdssConfig"],
144694
- queryFn: () => P_(CDSS_SERVER_CONFIG_URL, cdssConfigSchema),
144694
+ queryFn: () => $_(CDSS_SERVER_CONFIG_URL, cdssConfigSchema),
144695
144695
  enabled: M
144696
144696
  });
144697
144697
  useEffect(() => {
@@ -144731,14 +144731,14 @@ const ConsultationPad = ({
144731
144731
  useEffect(() => {
144732
144732
  useEncounterDetailsStore.getState().setRequestedEncounterType(K);
144733
144733
  }, [K]);
144734
- const { episodeOfCare: ne, patientId: oe, activeVisitId: ie, activeEpisodeId: ae } = useClinicalAppData(), { practitioner: re } = mSe(), { data: X, status: ye } = useQuery({
144734
+ const { episodeOfCare: ne, patientId: oe, activeVisitId: ie, activeEpisodeId: ae } = useClinicalAppData(), { practitioner: re } = vSe(), { data: X, status: ye } = useQuery({
144735
144735
  queryKey: [
144736
144736
  "activeEncounter",
144737
144737
  oe,
144738
144738
  re?.uuid,
144739
144739
  Y?.uuid
144740
144740
  ],
144741
- queryFn: () => q_(
144741
+ queryFn: () => F_(
144742
144742
  oe,
144743
144743
  re?.uuid,
144744
144744
  void 0,
@@ -144752,7 +144752,7 @@ const ConsultationPad = ({
144752
144752
  error: Re
144753
144753
  } = useQuery({
144754
144754
  queryKey: ["encounter", h],
144755
- queryFn: ({ signal: it }) => Xb(h, { signal: it }),
144755
+ queryFn: ({ signal: it }) => Zb(h, { signal: it }),
144756
144756
  enabled: !!h
144757
144757
  });
144758
144758
  useEffect(() => {
@@ -144780,7 +144780,7 @@ const ConsultationPad = ({
144780
144780
  } = useObservationFormsStore();
144781
144781
  useEffect(() => {
144782
144782
  const it = p.editMedications;
144783
- getMedicationRequestStore(i_).getState().setPendingFhirEdits(it?.length ? it : []);
144783
+ getMedicationRequestStore(c_).getState().setPendingFhirEdits(it?.length ? it : []);
144784
144784
  }, [p.editMedications]), useEffect(() => () => Q.forEach((it) => it.reset()), []), useEffect(() => {
144785
144785
  a?.length && useAllergyStore.getState().preloadAllergies(a);
144786
144786
  }, [a]);
@@ -144820,7 +144820,7 @@ const ConsultationPad = ({
144820
144820
  visitId: Qa,
144821
144821
  episodeId: ae ?? void 0
144822
144822
  }, ja = vt.map(
144823
- (ra) => $v(z, ra, za, ta).catch(
144823
+ (ra) => Iv(z, ra, za, ta).catch(
144824
144824
  () => (R({
144825
144825
  title: C("ERROR_DEFAULT_TITLE"),
144826
144826
  message: C("CDSS_RULE_INVOCATION_ERROR", {
@@ -144831,7 +144831,7 @@ const ConsultationPad = ({
144831
144831
  }), [])
144832
144832
  )
144833
144833
  ), cn = (await Promise.all(ja)).flat();
144834
- mv({
144834
+ yv({
144835
144835
  cards: cn,
144836
144836
  triggerItemId: Vt,
144837
144837
  controlKey: rt
@@ -144863,7 +144863,7 @@ const ConsultationPad = ({
144863
144863
  M
144864
144864
  ]
144865
144865
  );
144866
- gv(Je);
144866
+ wv(Je);
144867
144867
  const We = async () => {
144868
144868
  const it = Q.map((vt) => ({
144869
144869
  key: vt.key,
@@ -144899,7 +144899,7 @@ const ConsultationPad = ({
144899
144899
  await ja.onDirectSubmit();
144900
144900
  if (vt.length > 0 && ta.length === 0) {
144901
144901
  const ja = captureUpdatedResources(Q);
144902
- fv({
144902
+ hv({
144903
144903
  patientUUID: useEncounterDetailsStore.getState().patientUUID ?? "",
144904
144904
  updatedResources: ja,
144905
144905
  updatedConcepts: /* @__PURE__ */ new Map()
@@ -144923,7 +144923,7 @@ const ConsultationPad = ({
144923
144923
  messageParams: { encounterType: Qa.encounterTypeName }
144924
144924
  });
144925
144925
  const za = captureUpdatedResources(Q);
144926
- fv({
144926
+ hv({
144927
144927
  patientUUID: Qa.patientUUID,
144928
144928
  updatedResources: za,
144929
144929
  updatedConcepts: Qa.updatedConcepts
@@ -144957,9 +144957,9 @@ const ConsultationPad = ({
144957
144957
  encounterSessionStartContext: p
144958
144958
  },
144959
144959
  it.key
144960
- )) }), mt = !!f, Xe = getMedicationRequestStore(i_), at = useSyncExternalStore(
144960
+ )) }), mt = !!f, Xe = getMedicationRequestStore(c_), at = useSyncExternalStore(
144961
144961
  (it) => Xe.subscribe(it),
144962
- () => !mt || f !== i_ ? !0 : Xe.getState().hasEditChanges()
144962
+ () => !mt || f !== c_ ? !0 : Xe.getState().hasEditChanges()
144963
144963
  ), nt = Ue || !ee || T || !fe || !at || le;
144964
144964
  return /* @__PURE__ */ jsxs(Fragment, { children: [
144965
144965
  /* @__PURE__ */ jsx(
@@ -145000,14 +145000,14 @@ 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
+ XYt.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,
145007
145007
  isLoading: Z
145008
145008
  } = useQuery({
145009
145009
  queryKey: ["activeVisitAtLoginLocation", f],
145010
- queryFn: () => e_(f),
145010
+ queryFn: () => t_(f),
145011
145011
  enabled: !!f,
145012
145012
  retry: !1
145013
145013
  }), k = useMemo(
@@ -145031,7 +145031,7 @@ const ConsultationPad = ({
145031
145031
  const ae = await Mi(
145032
145032
  Rt().uuid
145033
145033
  );
145034
- await yb(
145034
+ await wb(
145035
145035
  f,
145036
145036
  ae.uuid,
145037
145037
  oe,
@@ -145156,8 +145156,8 @@ const ConsultationPad = ({
145156
145156
  encounterUuids: s,
145157
145157
  visitUuids: f
145158
145158
  }) => {
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);
145159
+ const { t: d } = useTranslation(), { matchReasons: h, canEditOrCreate: E, activeEncounter: C } = Y_(), R = h.includes("NO_ACTIVE_VISIT"), T = h.includes("MATCHED"), M = h.includes("MATCHED") ? C?.id ?? null : null, I = ($, D, z) => {
145160
+ const O = rJt($.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;
@@ -145295,14 +145295,14 @@ function useEncounterSession(p) {
145295
145295
  }
145296
145296
  T(!0), M(null);
145297
145297
  try {
145298
- const W = await F_(
145298
+ const W = await j_(
145299
145299
  $,
145300
145300
  D,
145301
145301
  k,
145302
145302
  a
145303
145303
  );
145304
145304
  if (Z.ignored) return;
145305
- const N = j_(W);
145305
+ const N = V_(W);
145306
145306
  f(N), h(W.encounter), C(N), F(W.reasons);
145307
145307
  } catch (W) {
145308
145308
  if (Z.ignored) return;
@@ -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
+ XYt.ENCOUNTER
145354
145354
  ) ? a ? /* @__PURE__ */ jsx(
145355
145355
  SH2,
145356
145356
  {
@@ -145373,7 +145373,7 @@ const CONSULTATION_START_EVENT = "startConsultation", dispatchConsultationStart
145373
145373
  isActionAreaVisible: p,
145374
145374
  printOptions: c
145375
145375
  }) => {
145376
- const { t: a } = useTranslation(), { practitioner: s } = mSe(), { clinicalConfig: f } = useClinicalConfig(), { encounterConcepts: d } = useEncounterConcepts(), h = gr(), E = f?.consultationPad?.inputControls?.find(
145376
+ const { t: a } = useTranslation(), { practitioner: s } = vSe(), { clinicalConfig: f } = useClinicalConfig(), { encounterConcepts: d } = useEncounterConcepts(), h = gr(), E = f?.consultationPad?.inputControls?.find(
145377
145377
  (k) => k.type === "encounterDetails"
145378
145378
  )?.metadata?.defaultEncounterType, C = useMemo(() => {
145379
145379
  if (!(!E || !d))
@@ -145391,15 +145391,15 @@ const CONSULTATION_START_EVENT = "startConsultation", dispatchConsultationStart
145391
145391
  encounterTypeUUID: C
145392
145392
  }), F = useRef(null);
145393
145393
  useEffect(() => {
145394
- F.current !== h && (F.current = h, B_());
145394
+ F.current !== h && (F.current = h, z_());
145395
145395
  }, [h]), useEffect(() => {
145396
- H_(M);
145396
+ B_(M);
145397
145397
  }, [M]), useEffect(() => {
145398
- M || V_({
145398
+ M || H_({
145399
145399
  reasons: R,
145400
145400
  encounter: H
145401
145401
  });
145402
- }, [M, R, H]), pv(
145402
+ }, [M, R, H]), mv(
145403
145403
  (k) => {
145404
145404
  k.patientUUID === h && I();
145405
145405
  },
@@ -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(ZYt, {}),
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
+ SYt,
145443
145443
  {
145444
145444
  printOptions: c,
145445
145445
  renderContext: Z,
@@ -145460,7 +145460,7 @@ const CONSULTATION_START_EVENT = "startConsultation", dispatchConsultationStart
145460
145460
  error: f
145461
145461
  } = useQuery({
145462
145462
  queryKey: ["patientSearch", p],
145463
- queryFn: () => GE(p),
145463
+ queryFn: () => KE(p),
145464
145464
  enabled: p.trim().length > 0
145465
145465
  });
145466
145466
  return { results: useMemo(
@@ -145594,10 +145594,10 @@ const CONSULTATION_START_EVENT = "startConsultation", dispatchConsultationStart
145594
145594
  error: E
145595
145595
  } = useQuery({
145596
145596
  queryKey: ["encounters-for-eoc", c],
145597
- queryFn: () => Y_(c),
145597
+ queryFn: () => G_(c),
145598
145598
  enabled: c.length > 0
145599
145599
  }), { activeVisit: C } = usePatientVisit(a);
145600
- pv(() => {
145600
+ mv(() => {
145601
145601
  c.length > 0 && f.invalidateQueries({
145602
145602
  queryKey: ["encounters-for-eoc", c]
145603
145603
  });
@@ -145662,7 +145662,7 @@ const DASHBOARD_CONFIG_URL = (p) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
145662
145662
  })), addSectionIds = (p) => p?.sections?.length ? {
145663
145663
  ...p,
145664
145664
  sections: p.sections.map(
145665
- (c) => c.id ? c : { ...c, id: TE() }
145665
+ (c) => c.id ? c : { ...c, id: SE() }
145666
145666
  )
145667
145667
  } : p, ConsultationPage = () => {
145668
145668
  const { t: p } = useTranslation(), { clinicalConfig: c, isLoading: a } = useClinicalConfig(), { userPrivileges: s } = Qn(), { addNotification: f } = G1(), [d, h] = useState(!1), [E, C] = useState(null);
@@ -145683,15 +145683,15 @@ const DASHBOARD_CONFIG_URL = (p) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
145683
145683
  [M, p]
145684
145684
  ), $ = useObservationFormsStore((re) => re.viewingForm), D = gr(), { data: z } = useQuery({
145685
145685
  queryKey: ["patient", D],
145686
- queryFn: () => zE(D),
145686
+ queryFn: () => YE(D),
145687
145687
  enabled: !!D
145688
145688
  }), O = useMemo(
145689
145689
  () => [
145690
- { id: "home", label: "Home", href: oE },
145690
+ { id: "home", label: "Home", href: aE },
145691
145691
  { id: "clinical", label: "Clinical", href: BAHMNI_CLINICAL_PATH },
145692
145692
  {
145693
145693
  id: "current",
145694
- label: z?.fullName ? SE(z.fullName) : p("CURRENT_PATIENT"),
145694
+ label: z?.fullName ? RE(z.fullName) : p("CURRENT_PATIENT"),
145695
145695
  isCurrentPage: !0
145696
145696
  }
145697
145697
  ],
@@ -145709,7 +145709,7 @@ const DASHBOARD_CONFIG_URL = (p) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
145709
145709
  error: Q
145710
145710
  } = useQuery({
145711
145711
  queryKey: ["dashboardConfig", W],
145712
- queryFn: () => P_(
145712
+ queryFn: () => $_(
145713
145713
  DASHBOARD_CONFIG_URL(W),
145714
145714
  dashboardConfigSchema
145715
145715
  ),
@@ -145727,7 +145727,7 @@ const DASHBOARD_CONFIG_URL = (p) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
145727
145727
  ...N,
145728
145728
  sections: filterSectionsByPrivileges(N.sections)
145729
145729
  }, [N, s]), fe = useMemo(() => !U?.printOptions || !s ? [] : U.printOptions.filter(
145730
- (re) => nw(s, re.privileges)
145730
+ (re) => sw(s, re.privileges)
145731
145731
  ), [U, s]), ee = useMemo(() => V ? getSidebarItems(V, p) : [], [V, p]), [se, Y] = useState(0), { activeItemId: ne, handleItemClick: oe } = GH2(ee), ie = useCallback(
145732
145732
  (re) => {
145733
145733
  oe(re), Y((X) => X + 1);
@@ -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
+ GYt,
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(GGt, {}),
145806
145806
  sideNavItems: ee,
145807
145807
  activeSideNavItemId: ne,
145808
145808
  onSideNavItemClick: ie,