@bahmni/services 0.0.1-dev.166 → 0.0.1-dev.169

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.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { initReactI18next as Ri } from "react-i18next";
2
- import { useTranslation as Cw } from "react-i18next";
2
+ import { useTranslation as Lw } from "react-i18next";
3
3
  import { useRef as _n, useCallback as Xr, useEffect as Sn } from "react";
4
4
  function fo(e, t) {
5
5
  return function() {
@@ -108,7 +108,7 @@ const Vi = (e, t, r, { allOwnKeys: n } = {}) => (Pt(
108
108
  }), Object.defineProperty(e, "super", {
109
109
  value: t.prototype
110
110
  }), r && Object.assign(e.prototype, r);
111
- }, Wi = (e, t, r, n) => {
111
+ }, zi = (e, t, r, n) => {
112
112
  let s, a, o;
113
113
  const i = {};
114
114
  if (t = t || {}, e == null) return t;
@@ -118,7 +118,7 @@ const Vi = (e, t, r, { allOwnKeys: n } = {}) => (Pt(
118
118
  e = r !== !1 && Ln(e);
119
119
  } while (e && (!r || r(e, t)) && e !== Object.prototype);
120
120
  return t;
121
- }, zi = (e, t, r) => {
121
+ }, Wi = (e, t, r) => {
122
122
  e = String(e), (r === void 0 || r > e.length) && (r = e.length), r -= t.length;
123
123
  const n = e.indexOf(t, r);
124
124
  return n !== -1 && n === r;
@@ -238,10 +238,10 @@ const ac = (e) => {
238
238
  trim: Fi,
239
239
  stripBOM: Hi,
240
240
  inherits: Bi,
241
- toFlatObject: Wi,
241
+ toFlatObject: zi,
242
242
  kindOf: kr,
243
243
  kindOfTest: De,
244
- endsWith: zi,
244
+ endsWith: Wi,
245
245
  toArray: Gi,
246
246
  forEachEntry: Yi,
247
247
  matchAll: Ji,
@@ -1201,7 +1201,7 @@ const Po = (e) => {
1201
1201
  }, {
1202
1202
  highWaterMark: 2
1203
1203
  });
1204
- }, is = 64 * 1024, { isFunction: Lt } = I, Wc = (({ Request: e, Response: t }) => ({
1204
+ }, is = 64 * 1024, { isFunction: Lt } = I, zc = (({ Request: e, Response: t }) => ({
1205
1205
  Request: e,
1206
1206
  Response: t
1207
1207
  }))(I.global), {
@@ -1213,10 +1213,10 @@ const Po = (e) => {
1213
1213
  } catch {
1214
1214
  return !1;
1215
1215
  }
1216
- }, zc = (e) => {
1216
+ }, Wc = (e) => {
1217
1217
  e = I.merge.call({
1218
1218
  skipUndefined: !0
1219
- }, Wc, e);
1219
+ }, zc, e);
1220
1220
  const { fetch: t, Request: r, Response: n } = e, s = t ? Lt(t) : typeof fetch == "function", a = Lt(r), o = Lt(n);
1221
1221
  if (!s)
1222
1222
  return !1;
@@ -1276,7 +1276,7 @@ const Po = (e) => {
1276
1276
  } = Po(v), U = t || fetch;
1277
1277
  R = R ? (R + "").toLowerCase() : "text";
1278
1278
  let j = Fc([u, h && h.toAbortSignal()], w), V = null;
1279
- const W = j && j.unsubscribe && (() => {
1279
+ const z = j && j.unsubscribe && (() => {
1280
1280
  j.unsubscribe();
1281
1281
  });
1282
1282
  let re;
@@ -1308,7 +1308,7 @@ const Po = (e) => {
1308
1308
  V = a && new r(g, he);
1309
1309
  let J = await (a ? U(V, q) : U(g, he));
1310
1310
  const ce = d && (R === "stream" || R === "response");
1311
- if (d && (_ || ce && W)) {
1311
+ if (d && (_ || ce && z)) {
1312
1312
  const O = {};
1313
1313
  ["status", "statusText", "headers"].forEach((T) => {
1314
1314
  O[T] = J[T];
@@ -1319,14 +1319,14 @@ const Po = (e) => {
1319
1319
  ) || [];
1320
1320
  J = new n(
1321
1321
  os(J.body, is, N, () => {
1322
- b && b(), W && W();
1322
+ b && b(), z && z();
1323
1323
  }),
1324
1324
  O
1325
1325
  );
1326
1326
  }
1327
1327
  R = R || "text";
1328
1328
  let M = await m[I.findKey(m, R) || "text"](J, v);
1329
- return !ce && W && W(), await new Promise((O, C) => {
1329
+ return !ce && z && z(), await new Promise((O, C) => {
1330
1330
  Ao(O, C, {
1331
1331
  data: M,
1332
1332
  headers: Re.from(J.headers),
@@ -1337,7 +1337,7 @@ const Po = (e) => {
1337
1337
  });
1338
1338
  });
1339
1339
  } catch (ne) {
1340
- throw W && W(), ne && ne.name === "TypeError" && /Load failed|fetch/i.test(ne.message) ? Object.assign(
1340
+ throw z && z(), ne && ne.name === "TypeError" && /Load failed|fetch/i.test(ne.message) ? Object.assign(
1341
1341
  new G("Network Error", G.ERR_NETWORK, v, V, ne && ne.response),
1342
1342
  {
1343
1343
  cause: ne.cause || ne
@@ -1354,7 +1354,7 @@ const Po = (e) => {
1354
1354
  ];
1355
1355
  let o = a.length, i = o, c, l, d = Gc;
1356
1356
  for (; i--; )
1357
- c = a[i], l = d.get(c), l === void 0 && d.set(c, l = i ? /* @__PURE__ */ new Map() : zc(t)), d = l;
1357
+ c = a[i], l = d.get(c), l === void 0 && d.set(c, l = i ? /* @__PURE__ */ new Map() : Wc(t)), d = l;
1358
1358
  return l;
1359
1359
  };
1360
1360
  $o();
@@ -1798,8 +1798,8 @@ ue.HttpStatusCode = On;
1798
1798
  ue.default = ue;
1799
1799
  const {
1800
1800
  Axios: By,
1801
- AxiosError: Wy,
1802
- CanceledError: zy,
1801
+ AxiosError: zy,
1802
+ CanceledError: Wy,
1803
1803
  isCancel: Gy,
1804
1804
  CancelToken: Ky,
1805
1805
  VERSION: Yy,
@@ -2017,7 +2017,7 @@ Fe.interceptors.response.use(
2017
2017
  return r.startsWith("ERROR_") || /^[A-Z_]+$/.test(r) ? Promise.reject(new Error(r)) : Promise.reject(`${t}: ${r}`);
2018
2018
  }
2019
2019
  );
2020
- const z = async (e) => (await Fe.get(e)).data, Ve = async (e, t) => (await Fe.post(e, t)).data, ov = async (e, t) => (await Fe.put(e, t)).data, iv = async (e, t) => (await Fe.patch(e, t)).data, cv = async (e) => (await Fe.delete(e)).data, K = (e) => typeof e == "string", gt = () => {
2020
+ const W = async (e) => (await Fe.get(e)).data, Ve = async (e, t) => (await Fe.post(e, t)).data, ov = async (e, t) => (await Fe.put(e, t)).data, iv = async (e, t) => (await Fe.patch(e, t)).data, cv = async (e) => (await Fe.delete(e)).data, K = (e) => typeof e == "string", gt = () => {
2021
2021
  let e, t;
2022
2022
  const r = new Promise((n, s) => {
2023
2023
  e = n, t = s;
@@ -2387,19 +2387,19 @@ class Nr extends qr {
2387
2387
  }
2388
2388
  if (a) {
2389
2389
  const U = Array.isArray(P), j = U ? [] : {}, V = U ? v : S;
2390
- for (const W in P)
2391
- if (Object.prototype.hasOwnProperty.call(P, W)) {
2392
- const re = `${V}${a}${W}`;
2393
- h && !y ? j[W] = this.translate(re, {
2390
+ for (const z in P)
2391
+ if (Object.prototype.hasOwnProperty.call(P, z)) {
2392
+ const re = `${V}${a}${z}`;
2393
+ h && !y ? j[z] = this.translate(re, {
2394
2394
  ...r,
2395
- defaultValue: Es(R) ? R[W] : void 0,
2395
+ defaultValue: Es(R) ? R[z] : void 0,
2396
2396
  joinArrays: !1,
2397
2397
  ns: i
2398
- }) : j[W] = this.translate(re, {
2398
+ }) : j[z] = this.translate(re, {
2399
2399
  ...r,
2400
2400
  joinArrays: !1,
2401
2401
  ns: i
2402
- }), j[W] === re && (j[W] = P[W]);
2402
+ }), j[z] === re && (j[z] = P[z]);
2403
2403
  }
2404
2404
  y = j;
2405
2405
  }
@@ -2408,7 +2408,7 @@ class Nr extends qr {
2408
2408
  else {
2409
2409
  let U = !1, j = !1;
2410
2410
  !this.isValidLookup(y) && h && (U = !0, y = R), this.isValidLookup(y) || (j = !0, y = o);
2411
- const W = (r.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && j ? void 0 : y, re = h && R !== y && this.options.updateMissing;
2411
+ const z = (r.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && j ? void 0 : y, re = h && R !== y && this.options.updateMissing;
2412
2412
  if (j || U || re) {
2413
2413
  if (this.logger.log(re ? "updateKey" : "missingKey", l, c, o, re ? R : y), a) {
2414
2414
  const ce = this.resolve(o, {
@@ -2424,7 +2424,7 @@ class Nr extends qr {
2424
2424
  ne.push(he[ce]);
2425
2425
  else this.options.saveMissingTo === "all" ? ne = this.languageUtils.toResolveHierarchy(r.lng || this.language) : ne.push(r.lng || this.language);
2426
2426
  const J = (ce, M, O) => {
2427
- const C = h && O !== y ? O : W;
2427
+ const C = h && O !== y ? O : z;
2428
2428
  this.options.missingKeyHandler ? this.options.missingKeyHandler(ce, c, M, C, re, r) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(ce, c, M, C, re, r), this.emit("missingKey", ce, c, M, y);
2429
2429
  };
2430
2430
  this.options.saveMissing && (this.options.saveMissingPlurals && u ? ne.forEach((ce) => {
@@ -3618,7 +3618,7 @@ var Vu = {
3618
3618
  const n = t || (typeof document < "u" ? document.documentElement : null);
3619
3619
  return n && typeof n.getAttribute == "function" && (r = n.getAttribute("lang")), r;
3620
3620
  }
3621
- }, Wu = {
3621
+ }, zu = {
3622
3622
  name: "path",
3623
3623
  // Deconstruct the options object and extract the lookupFromPathIndex property
3624
3624
  lookup(e) {
@@ -3629,7 +3629,7 @@ var Vu = {
3629
3629
  const r = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
3630
3630
  return Array.isArray(r) ? r[typeof t == "number" ? t : 0]?.replace("/", "") : void 0;
3631
3631
  }
3632
- }, zu = {
3632
+ }, Wu = {
3633
3633
  name: "subdomain",
3634
3634
  lookup(e) {
3635
3635
  let {
@@ -3669,7 +3669,7 @@ class qo {
3669
3669
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
3670
3670
  languageUtils: {}
3671
3671
  }, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3672
- this.services = t, this.options = ku(r, this.options || {}, Gu()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (s) => s.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = n, this.addDetector(Uu), this.addDetector(qu), this.addDetector(Fu), this.addDetector(Vu), this.addDetector(Hu), this.addDetector(Bu), this.addDetector(Wu), this.addDetector(zu), this.addDetector(ju);
3672
+ this.services = t, this.options = ku(r, this.options || {}, Gu()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (s) => s.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = n, this.addDetector(Uu), this.addDetector(qu), this.addDetector(Fu), this.addDetector(Vu), this.addDetector(Hu), this.addDetector(Bu), this.addDetector(zu), this.addDetector(Wu), this.addDetector(ju);
3673
3673
  }
3674
3674
  addDetector(t) {
3675
3675
  return this.detectors[t.name] = t, this;
@@ -3693,7 +3693,7 @@ class qo {
3693
3693
  qo.type = "languageDetector";
3694
3694
  const Ku = process.env.PUBLIC_URL ?? "/", pe = "/openmrs/ws/fhir2/R4", ee = "/openmrs/ws/rest/v1", Yu = "/openmrs/ws/rest/v2", Ju = "bahmni.user", uv = "/bahmni/home/index.html", Xu = ee + "/bahmnicore/whoami", jo = ee + "/bahmnicore/sql", Qu = "en", Fo = "NG_TRANSLATE_LANG_KEY", Zu = (e, t) => Ku + `${e}/locales/locale_${t}.json`, el = (e, t) => `/bahmni_config/openmrs/i18n/${e}/locale_${t}.json`, It = () => localStorage.getItem(Fo) ?? Qu, Ds = async (e) => {
3695
3695
  try {
3696
- const t = await z(e);
3696
+ const t = await W(e);
3697
3697
  return t || (console.error(`Invalid response from ${e}`), {});
3698
3698
  } catch (t) {
3699
3699
  return console.error(`Failed to load translations from ${e}:`, t), {};
@@ -3774,14 +3774,14 @@ function fv() {
3774
3774
  }, []);
3775
3775
  return Sn(() => () => n(), [n]), { videoRef: e, start: r, stop: n, capture: s };
3776
3776
  }
3777
- const nl = "bahmni.enableAuditLog", Vo = (e) => `${ee}/bahmnicore/sql/globalproperty?property=${e}`, Ho = 6048e5, sl = 864e5, Bo = 6e4, Wo = 36e5, Ls = /* @__PURE__ */ Symbol.for("constructDateFrom");
3777
+ const nl = "bahmni.enableAuditLog", Vo = (e) => `${ee}/bahmnicore/sql/globalproperty?property=${e}`, Ho = 6048e5, sl = 864e5, Bo = 6e4, zo = 36e5, Ls = /* @__PURE__ */ Symbol.for("constructDateFrom");
3778
3778
  function $e(e, t) {
3779
3779
  return typeof e == "function" ? e(t) : e && typeof e == "object" && Ls in e ? e[Ls](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
3780
3780
  }
3781
3781
  function fe(e, t) {
3782
3782
  return $e(t || e, e);
3783
3783
  }
3784
- function zo(e, t, r) {
3784
+ function Wo(e, t, r) {
3785
3785
  const n = fe(e, r?.in);
3786
3786
  return isNaN(t) ? $e(e, NaN) : (t && n.setDate(n.getDate() + t), n);
3787
3787
  }
@@ -5014,7 +5014,7 @@ const Fs = (e, t) => {
5014
5014
  default:
5015
5015
  return t.time({ width: "full" });
5016
5016
  }
5017
- }, Wl = (e, t) => {
5017
+ }, zl = (e, t) => {
5018
5018
  const r = e.match(/(P+)(p+)?/) || [], n = r[1], s = r[2];
5019
5019
  if (!s)
5020
5020
  return Fs(e, t);
@@ -5034,9 +5034,9 @@ const Fs = (e, t) => {
5034
5034
  break;
5035
5035
  }
5036
5036
  return a.replace("{{date}}", Fs(n, t)).replace("{{time}}", ti(s, t));
5037
- }, zl = {
5037
+ }, Wl = {
5038
5038
  p: ti,
5039
- P: Wl
5039
+ P: zl
5040
5040
  }, Gl = /^D+$/, Kl = /^Y+$/, Yl = ["D", "DD", "YY", "YYYY"];
5041
5041
  function Jl(e) {
5042
5042
  return Gl.test(e);
@@ -5060,7 +5060,7 @@ function ad(e, t, r) {
5060
5060
  let c = t.match(td).map((d) => {
5061
5061
  const m = d[0];
5062
5062
  if (m === "p" || m === "P") {
5063
- const y = zl[m];
5063
+ const y = Wl[m];
5064
5064
  return y(d, s.formatLong);
5065
5065
  }
5066
5066
  return d;
@@ -5097,7 +5097,7 @@ function od(e) {
5097
5097
  return t ? t[1].replace(nd, "'") : e;
5098
5098
  }
5099
5099
  function id(e, t, r) {
5100
- return zo(e, -t, r);
5100
+ return Wo(e, -t, r);
5101
5101
  }
5102
5102
  function ri(e, t) {
5103
5103
  const r = () => $e(t?.in, NaN), s = dd(e);
@@ -5177,7 +5177,7 @@ function hd(e) {
5177
5177
  const t = e.match(ud);
5178
5178
  if (!t) return NaN;
5179
5179
  const r = an(t[1]), n = an(t[2]), s = an(t[3]);
5180
- return Ed(r, n, s) ? r * Wo + n * Bo + s * 1e3 : NaN;
5180
+ return Ed(r, n, s) ? r * zo + n * Bo + s * 1e3 : NaN;
5181
5181
  }
5182
5182
  function an(e) {
5183
5183
  return e && parseFloat(e.replace(",", ".")) || 0;
@@ -5187,7 +5187,7 @@ function md(e) {
5187
5187
  const t = e.match(ld);
5188
5188
  if (!t) return 0;
5189
5189
  const r = t[1] === "+" ? -1 : 1, n = parseInt(t[2]), s = t[3] && parseInt(t[3]) || 0;
5190
- return _d(n, s) ? r * (n * Wo + s * Bo) : NaN;
5190
+ return _d(n, s) ? r * (n * zo + s * Bo) : NaN;
5191
5191
  }
5192
5192
  function gd(e, t, r) {
5193
5193
  const n = /* @__PURE__ */ new Date(0);
@@ -5584,9 +5584,9 @@ const Vs = {
5584
5584
  narrow: /^[1234]/i,
5585
5585
  abbreviated: /^q[1234]/i,
5586
5586
  wide: /^[1234](\.)? Quartal/i
5587
- }, Wd = {
5588
- any: [/1/i, /2/i, /3/i, /4/i]
5589
5587
  }, zd = {
5588
+ any: [/1/i, /2/i, /3/i, /4/i]
5589
+ }, Wd = {
5590
5590
  narrow: /^[jfmasond]/i,
5591
5591
  abbreviated: /^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,
5592
5592
  wide: /^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i
@@ -5658,12 +5658,12 @@ const Vs = {
5658
5658
  quarter: de({
5659
5659
  matchPatterns: Bd,
5660
5660
  defaultMatchWidth: "wide",
5661
- parsePatterns: Wd,
5661
+ parsePatterns: zd,
5662
5662
  defaultParseWidth: "any",
5663
5663
  valueCallback: (e) => e + 1
5664
5664
  }),
5665
5665
  month: de({
5666
- matchPatterns: zd,
5666
+ matchPatterns: Wd,
5667
5667
  defaultMatchWidth: "wide",
5668
5668
  parsePatterns: Gd,
5669
5669
  defaultParseWidth: "any"
@@ -6086,7 +6086,7 @@ const Vs = {
6086
6086
  parsePatterns: Df,
6087
6087
  defaultParseWidth: "any"
6088
6088
  })
6089
- }, Ws = {
6089
+ }, zs = {
6090
6090
  code: "es",
6091
6091
  formatDistance: sf,
6092
6092
  formatLong: uf,
@@ -6236,7 +6236,7 @@ const Vs = {
6236
6236
  "novembre",
6237
6237
  "décembre"
6238
6238
  ]
6239
- }, Wf = {
6239
+ }, zf = {
6240
6240
  narrow: ["D", "L", "M", "M", "J", "V", "S"],
6241
6241
  short: ["di", "lu", "ma", "me", "je", "ve", "sa"],
6242
6242
  abbreviated: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."],
@@ -6249,7 +6249,7 @@ const Vs = {
6249
6249
  "vendredi",
6250
6250
  "samedi"
6251
6251
  ]
6252
- }, zf = {
6252
+ }, Wf = {
6253
6253
  narrow: {
6254
6254
  am: "AM",
6255
6255
  pm: "PM",
@@ -6307,11 +6307,11 @@ const Vs = {
6307
6307
  defaultWidth: "wide"
6308
6308
  }),
6309
6309
  day: le({
6310
- values: Wf,
6310
+ values: zf,
6311
6311
  defaultWidth: "wide"
6312
6312
  }),
6313
6313
  dayPeriod: le({
6314
- values: zf,
6314
+ values: Wf,
6315
6315
  defaultWidth: "wide"
6316
6316
  })
6317
6317
  }, Jf = /^(\d+)(ième|ère|ème|er|e)?/i, Xf = /\d+/i, Qf = {
@@ -6418,7 +6418,7 @@ const Vs = {
6418
6418
  parsePatterns: ip,
6419
6419
  defaultParseWidth: "any"
6420
6420
  })
6421
- }, zs = {
6421
+ }, Ws = {
6422
6422
  code: "fr",
6423
6423
  formatDistance: kf,
6424
6424
  formatLong: qf,
@@ -6439,10 +6439,10 @@ const Vs = {
6439
6439
  en: Bs,
6440
6440
  "en-US": Zo,
6441
6441
  "en-GB": Bs,
6442
- es: Ws,
6443
- "es-ES": Ws,
6444
- fr: zs,
6445
- "fr-FR": zs,
6442
+ es: zs,
6443
+ "es-ES": zs,
6444
+ fr: Ws,
6445
+ "fr-FR": Ws,
6446
6446
  de: Hs,
6447
6447
  "de-DE": Hs
6448
6448
  };
@@ -6630,7 +6630,7 @@ const pp = {
6630
6630
  if (isNaN(n.getTime()))
6631
6631
  throw new Error(`Invalid date: ${e}`);
6632
6632
  const s = pp[r] ?? 1, a = t * s;
6633
- return zo(n, a);
6633
+ return Wo(n, a);
6634
6634
  }, Tv = (e, t, r, n) => e <= n && r <= t;
6635
6635
  function Av(e, t, r = !1) {
6636
6636
  return !e || !Array.isArray(e) ? [] : e.sort((n, s) => {
@@ -6723,8 +6723,11 @@ const gp = (e) => new Promise((t, r) => {
6723
6723
  function kv(e) {
6724
6724
  return e.replace(/\s+/g, "_").replace(/([a-z])([A-Z])/g, "$1_$2").replace(/([A-Z])([A-Z][a-z])/g, "$1_$2").toUpperCase();
6725
6725
  }
6726
+ function Mv(e) {
6727
+ return e ? e.replaceAll(/[_-]/g, " ").replaceAll(/([a-z])([A-Z])/g, "$1 $2").replaceAll(/([A-Z])([A-Z][a-z])/g, "$1 $2").replaceAll(/([a-z])(\d)/gi, "$1 $2").replaceAll(/(\d)([a-z])/gi, "$1 $2").replaceAll(/\s+/g, " ").trim().toLowerCase().replace(/^./, (t) => t.toUpperCase()) : "";
6728
+ }
6726
6729
  const yp = (e) => ee + `/user?username=${e}&v=custom:(username,uuid)`, vp = "bahmni.user.location";
6727
- async function Mv() {
6730
+ async function xv() {
6728
6731
  const e = oi(Ju);
6729
6732
  if (!e)
6730
6733
  return null;
@@ -6732,7 +6735,7 @@ async function Mv() {
6732
6735
  const t = decodeURIComponent(e).replace(
6733
6736
  /^"(.*)"$/,
6734
6737
  "$1"
6735
- ), r = await z(yp(t));
6738
+ ), r = await W(yp(t));
6736
6739
  return !r.results || r.results.length === 0 ? null : r.results[0];
6737
6740
  } catch {
6738
6741
  throw new Error(ie.t("ERROR_FETCHING_USER_DETAILS"));
@@ -6794,12 +6797,12 @@ const Hn = () => {
6794
6797
  }, ii = ee + "/idgen/identifiertype", Sp = (e) => ee + `/bahmni/app/setting?module=${e}`, Rp = "bahmni.primaryIdentifierType", Tp = ee + "/bahmnicore/patientprofile", Ap = (e) => ee + `/bahmnicore/patientprofile/${e}`, Op = (e) => ee + `/patientprofile/${e}?v=full`, Pp = (e, t, r = 20, n) => {
6795
6798
  let s = `/openmrs/module/addresshierarchy/ajax/getPossibleAddressHierarchyEntriesWithParents.form?addressField=${e}&limit=${r}&searchString=${encodeURIComponent(t)}`;
6796
6799
  return n && (s += `&parent=${n}`), s;
6797
- }, $p = "/openmrs/module/addresshierarchy/ajax/getOrderedAddressHierarchyLevels.form", Np = ee + "/relationshiptype?v=custom:(aIsToB,bIsToA,uuid)&limit=150", Ip = 20, Dp = 2, xv = 120, Uv = 50, qv = 15, Cp = /^[a-f0-9-]{36}$/i, Lp = (e) => Yu + `/patientImage?patientUuid=${e}`, kp = ee + "/personattributetype?v=custom:(uuid,name,sortWeight,description,format,concept:(uuid,display,answers:(uuid,name)))", Mp = async (e) => {
6800
+ }, $p = "/openmrs/module/addresshierarchy/ajax/getOrderedAddressHierarchyLevels.form", Np = ee + "/relationshiptype?v=custom:(aIsToB,bIsToA,uuid)&limit=150", Ip = 20, Dp = 2, Uv = 120, qv = 50, jv = 15, Cp = /^[a-f0-9-]{36}$/i, Lp = (e) => Yu + `/patientImage?patientUuid=${e}`, kp = ee + "/personattributetype?v=custom:(uuid,name,sortWeight,description,format,concept:(uuid,display,answers:(uuid,name)))", Mp = async (e) => {
6798
6801
  if (!e || e.trim() === "")
6799
6802
  throw new Error("Invalid patient UUID: UUID cannot be empty");
6800
6803
  if (!Cp.test(e))
6801
6804
  throw new Error(`Invalid patient UUID format: ${e}`);
6802
- return z(wp(e));
6805
+ return W(wp(e));
6803
6806
  }, xp = (e) => !e.extension || !Array.isArray(e.extension) ? [] : e.extension.flatMap((t) => t.extension && Array.isArray(t.extension) ? t.extension.filter((r) => r.valueString).map((r) => r.valueString) : []), Up = (e) => {
6804
6807
  if (!e.name || e.name.length === 0)
6805
6808
  return null;
@@ -6830,22 +6833,22 @@ const Hn = () => {
6830
6833
  identifiers: s,
6831
6834
  age: a
6832
6835
  };
6833
- }, jv = async (e) => {
6836
+ }, Fv = async (e) => {
6834
6837
  const t = await Mp(e);
6835
6838
  return Fp(t);
6836
- }, Fv = async (e) => {
6839
+ }, Vv = async (e) => {
6837
6840
  const t = await fetch(Lp(e));
6838
6841
  if (!t.ok) return null;
6839
6842
  const r = await t.blob();
6840
6843
  return await gp(r);
6841
- }, Vv = async (e, t) => {
6844
+ }, Hv = async (e, t) => {
6842
6845
  const r = Hn();
6843
- return await z(
6846
+ return await W(
6844
6847
  Ep(e, r.uuid, t)
6845
6848
  );
6846
- }, Hv = async (e, t, r, n, s) => {
6849
+ }, Bv = async (e, t, r, n, s) => {
6847
6850
  const a = Hn();
6848
- return await z(
6851
+ return await W(
6849
6852
  _p(
6850
6853
  e,
6851
6854
  t,
@@ -6854,11 +6857,11 @@ const Hn = () => {
6854
6857
  a.uuid
6855
6858
  )
6856
6859
  );
6857
- }, Bv = async () => z(ii), Vp = async () => (await z(Sp("core"))).find(
6860
+ }, zv = async () => W(ii), Vp = async () => (await W(Sp("core"))).find(
6858
6861
  (r) => r.property === Rp
6859
6862
  )?.value ?? null, Wv = async () => {
6860
6863
  const [e, t] = await Promise.all([
6861
- z(ii),
6864
+ W(ii),
6862
6865
  Vp()
6863
6866
  ]), r = [], n = /* @__PURE__ */ new Map();
6864
6867
  if (!t)
@@ -6873,14 +6876,14 @@ const Hn = () => {
6873
6876
  sourcesByPrefix: n,
6874
6877
  primaryIdentifierTypeUuid: t
6875
6878
  }) : { prefixes: r, sourcesByPrefix: n, primaryIdentifierTypeUuid: t };
6876
- }, zv = async (e) => Ve(Tp, e), Gv = async (e, t) => Ve(
6879
+ }, Gv = async (e) => Ve(Tp, e), Kv = async (e, t) => Ve(
6877
6880
  Ap(e),
6878
6881
  t
6879
- ), Kv = async () => z(Vo("mrs.genders")), Yv = async (e, t, r = Ip, n) => {
6882
+ ), Yv = async () => W(Vo("mrs.genders")), Jv = async (e, t, r = Ip, n) => {
6880
6883
  if (!t || t.length < Dp)
6881
6884
  return [];
6882
6885
  try {
6883
- return await z(
6886
+ return await W(
6884
6887
  Pp(e, t, r, n)
6885
6888
  );
6886
6889
  } catch (s) {
@@ -6888,9 +6891,9 @@ const Hn = () => {
6888
6891
  `Failed to fetch address hierarchy for field "${e}": ${s instanceof Error ? s.message : "Unknown error"}`
6889
6892
  );
6890
6893
  }
6891
- }, Jv = async () => z($p), Xv = async (e) => z(Op(e)), Qv = async () => {
6894
+ }, Xv = async () => W($p), Qv = async (e) => W(Op(e)), Zv = async () => {
6892
6895
  try {
6893
- return (await z(
6896
+ return (await W(
6894
6897
  Np
6895
6898
  )).results.map((t) => ({
6896
6899
  uuid: t.uuid,
@@ -6902,12 +6905,12 @@ const Hn = () => {
6902
6905
  `Failed to fetch relationship types: ${e instanceof Error ? e.message : "Unknown error"}`
6903
6906
  );
6904
6907
  }
6905
- }, Zv = async () => z(kp);
6908
+ }, eb = async () => W(kp);
6906
6909
  var Hp = /* @__PURE__ */ ((e) => (e.BOOLEAN = "java.lang.Boolean", e.BOOLEAN_DATATYPE = "org.openmrs.customdatatype.datatype.BooleanDatatype", e.CONCEPT = "org.openmrs.Concept", e.CODED_CONCEPT = "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype", e.CONCEPT_DATATYPE = "org.openmrs.customdatatype.datatype.ConceptDatatype", e.STRING = "java.lang.String", e.FREE_TEXT = "org.openmrs.customdatatype.datatype.FreeTextDatatype", e.REGEX_VALIDATED_TEXT = "org.openmrs.customdatatype.datatype.RegexValidatedTextDatatype", e.INTEGER = "java.lang.Integer", e.FLOAT = "java.lang.Float", e.ATTRIBUTABLE_DATE = "org.openmrs.util.AttributableDate", e.DATE_DATATYPE = "org.openmrs.customdatatype.datatype.DateDatatype", e))(Hp || {}), Bp = /* @__PURE__ */ ((e) => (e.CHECKBOX = "checkbox", e.DROPDOWN = "dropdown", e.TEXT = "text", e.NUMBER = "number", e.DATE = "date", e))(Bp || {});
6907
- const eb = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype.datatype.BooleanDatatype" ? "checkbox" : e === "org.openmrs.Concept" || e === "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype" || e === "org.openmrs.customdatatype.datatype.ConceptDatatype" ? "dropdown" : e === "java.lang.Integer" || e === "java.lang.Float" ? "number" : e === "org.openmrs.util.AttributableDate" || e === "org.openmrs.customdatatype.datatype.DateDatatype" ? "date" : "text", tb = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype.datatype.BooleanDatatype", rb = (e) => e === "org.openmrs.Concept" || e === "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype" || e === "org.openmrs.customdatatype.datatype.ConceptDatatype", nb = (e) => e === "java.lang.Integer" || e === "java.lang.Float", sb = (e) => e === "org.openmrs.util.AttributableDate" || e === "org.openmrs.customdatatype.datatype.DateDatatype", ab = (e) => e === "java.lang.String" || e === "org.openmrs.customdatatype.datatype.FreeTextDatatype" || e === "org.openmrs.customdatatype.datatype.RegexValidatedTextDatatype", Wp = (e) => {
6910
+ const tb = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype.datatype.BooleanDatatype" ? "checkbox" : e === "org.openmrs.Concept" || e === "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype" || e === "org.openmrs.customdatatype.datatype.ConceptDatatype" ? "dropdown" : e === "java.lang.Integer" || e === "java.lang.Float" ? "number" : e === "org.openmrs.util.AttributableDate" || e === "org.openmrs.customdatatype.datatype.DateDatatype" ? "date" : "text", rb = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype.datatype.BooleanDatatype", nb = (e) => e === "org.openmrs.Concept" || e === "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype" || e === "org.openmrs.customdatatype.datatype.ConceptDatatype", sb = (e) => e === "java.lang.Integer" || e === "java.lang.Float", ab = (e) => e === "org.openmrs.util.AttributableDate" || e === "org.openmrs.customdatatype.datatype.DateDatatype", ob = (e) => e === "java.lang.String" || e === "org.openmrs.customdatatype.datatype.FreeTextDatatype" || e === "org.openmrs.customdatatype.datatype.RegexValidatedTextDatatype", zp = (e) => {
6908
6911
  const t = new CustomEvent("bahmni-audit-log", { detail: e });
6909
6912
  window.dispatchEvent(t);
6910
- }, zp = (e) => {
6913
+ }, Wp = (e) => {
6911
6914
  const t = (r) => {
6912
6915
  e(r.detail);
6913
6916
  };
@@ -6957,10 +6960,10 @@ const eb = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype
6957
6960
  }
6958
6961
  }, Gp = ee + "/auditlog", Kp = {
6959
6962
  UNKNOWN_EVENT_TYPE: "AUDIT_LOG_ERROR_UNKNOWN_EVENT_TYPE"
6960
- }, Yp = () => ee + "/bahmnicore/config/bahmniencounter?callerContext=REGISTRATION_CONCEPTS", Jp = ee + "/visit", Xp = (e) => ee + `/visit?patient=${e}&includeInactive=false&v=custom:(uuid,visitType,startDatetime,stopDatetime)`, Qp = (e) => ee + `/bahmnicore/visitLocation/${e}`, ob = async () => z(Yp()), Zp = async (e) => z(Xp(e)), eh = async (e) => z(Qp(e)), th = async (e) => Ve(Jp, e), ib = async (e) => {
6963
+ }, Yp = () => ee + "/bahmnicore/config/bahmniencounter?callerContext=REGISTRATION_CONCEPTS", Jp = ee + "/visit", Xp = (e) => ee + `/visit?patient=${e}&includeInactive=false&v=custom:(uuid,visitType,startDatetime,stopDatetime)`, Qp = (e) => ee + `/bahmnicore/visitLocation/${e}`, ib = async () => W(Yp()), Zp = async (e) => W(Xp(e)), eh = async (e) => W(Qp(e)), th = async (e) => Ve(Jp, e), cb = async (e) => {
6961
6964
  const t = await Zp(e);
6962
6965
  return t?.results && t.results.length > 0;
6963
- }, cb = async (e, t) => {
6966
+ }, ub = async (e, t) => {
6964
6967
  const r = await eh(
6965
6968
  Hn().uuid
6966
6969
  ), n = {
@@ -6968,13 +6971,13 @@ const eb = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype
6968
6971
  visitType: t.uuid,
6969
6972
  location: r.uuid
6970
6973
  }, s = await th(n);
6971
- return Wp({
6974
+ return zp({
6972
6975
  eventType: Dn.OPEN_VISIT.eventType,
6973
6976
  patientUuid: e,
6974
6977
  messageParams: { visitType: t.name },
6975
6978
  module: Dn.OPEN_VISIT.module
6976
6979
  }), s;
6977
- }, rh = ee + "/appointments/search", ci = ee + "/appointments", nh = "bahmni.sqlGet.upComingAppointments", sh = "bahmni.sqlGet.pastAppointments", ah = (e) => `${ci}/${e}`, oh = (e) => `${jo}?patientUuid=${e}&q=${nh}&v=full`, ih = (e) => `${jo}?patientUuid=${e}&q=${sh}&v=full`, ch = (e) => `${ci}/${e}/status-change`, ub = async (e) => await Ve(
6980
+ }, rh = ee + "/appointments/search", ci = ee + "/appointments", nh = "bahmni.sqlGet.upComingAppointments", sh = "bahmni.sqlGet.pastAppointments", ah = (e) => `${ci}/${e}`, oh = (e) => `${jo}?patientUuid=${e}&q=${nh}&v=full`, ih = (e) => `${jo}?patientUuid=${e}&q=${sh}&v=full`, ch = (e) => `${ci}/${e}/status-change`, lb = async (e) => await Ve(
6978
6981
  rh,
6979
6982
  e
6980
6983
  ), ui = (e) => {
@@ -7032,16 +7035,16 @@ const eb = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype
7032
7035
  customAttributes: []
7033
7036
  }
7034
7037
  };
7035
- }, lb = async (e) => (await z(
7038
+ }, db = async (e) => (await W(
7036
7039
  oh(e)
7037
- ) || []).map(ui), db = async (e) => (await z(
7040
+ ) || []).map(ui), fb = async (e) => (await W(
7038
7041
  ih(e)
7039
- ) || []).map(ui), fb = async (e, t, r) => await Ve(
7042
+ ) || []).map(ui), pb = async (e, t, r) => await Ve(
7040
7043
  ch(e),
7041
7044
  { toStatus: t, onDate: r }
7042
7045
  );
7043
- async function pb(e) {
7044
- return await z(ah(e));
7046
+ async function hb(e) {
7047
+ return await W(ah(e));
7045
7048
  }
7046
7049
  const uh = () => {
7047
7050
  let e = null;
@@ -7072,21 +7075,21 @@ const uh = () => {
7072
7075
  );
7073
7076
  }
7074
7077
  };
7075
- }, on = uh(), lh = (e) => pe + `/ValueSet/${e}/$expand`, dh = (e) => pe + `/ValueSet/$expand?filter=${encodeURIComponent(e)}`, fh = (e, t, r) => ee + `/bahmni/terminologies/concepts?limit=${t}&locale=${r}&term=${e}`, ph = (e) => ee + `/concept/${e}`, hh = (e) => `${ee}/concept?s=byFullySpecifiedName&name=${encodeURIComponent(e)}`, mh = "SHORT", gh = "FULLY_SPECIFIED", hb = async (e, t = 20) => {
7078
+ }, on = uh(), lh = (e) => pe + `/ValueSet/${e}/$expand`, dh = (e) => pe + `/ValueSet/$expand?filter=${encodeURIComponent(e)}`, fh = (e, t, r) => ee + `/bahmni/terminologies/concepts?limit=${t}&locale=${r}&term=${e}`, ph = (e) => ee + `/concept/${e}`, hh = (e) => `${ee}/concept?s=byFullySpecifiedName&name=${encodeURIComponent(e)}`, mh = "SHORT", gh = "FULLY_SPECIFIED", mb = async (e, t = 20) => {
7076
7079
  const r = It(), n = fh(e, t, r);
7077
- return z(n);
7080
+ return W(n);
7078
7081
  }, Rr = async (e) => {
7079
7082
  const t = lh(e);
7080
- return z(t);
7083
+ return W(t);
7081
7084
  }, yh = async (e) => {
7082
7085
  const t = `${dh(e)}`;
7083
- return z(t);
7086
+ return W(t);
7084
7087
  };
7085
- async function mb(e) {
7086
- return await z(ph(e));
7087
- }
7088
7088
  async function gb(e) {
7089
- const t = hh(e), r = await z(t);
7089
+ return await W(ph(e));
7090
+ }
7091
+ async function yb(e) {
7092
+ const t = hh(e), r = await W(t);
7090
7093
  return !r.results || r.results.length === 0 ? null : r.results[0];
7091
7094
  }
7092
7095
  function vh(e) {
@@ -7121,7 +7124,7 @@ const bh = (e) => pe + `/AllergyIntolerance?patient=${e}&_count=100&_sort=-_last
7121
7124
  }), cn = (e, t) => {
7122
7125
  const r = e.expansion?.contains ?? [];
7123
7126
  return Eh(r).map((s) => _h(s, t));
7124
- }, yb = async (e, t, r) => {
7127
+ }, vb = async (e, t, r) => {
7125
7128
  const n = e ?? nt.MEDICATION.code, s = t ?? nt.FOOD.code, a = r ?? nt.ENVIRONMENT.code, [o, i, c] = await Promise.all([
7126
7129
  Rr(n),
7127
7130
  Rr(s),
@@ -7141,12 +7144,12 @@ const bh = (e) => pe + `/AllergyIntolerance?patient=${e}&_count=100&_sort=-_last
7141
7144
  nt.ENVIRONMENT.display
7142
7145
  )
7143
7146
  ];
7144
- }, vb = async (e) => {
7147
+ }, bb = async (e) => {
7145
7148
  const t = e ?? wh.code;
7146
7149
  return (await Rr(t)).compose?.include[0]?.concept ?? [];
7147
7150
  };
7148
7151
  async function Sh(e) {
7149
- return await z(`${bh(e)}`);
7152
+ return await W(`${bh(e)}`);
7150
7153
  }
7151
7154
  async function Rh(e) {
7152
7155
  return (await Sh(e)).entry?.map(
@@ -7175,19 +7178,19 @@ function Th(e) {
7175
7178
  };
7176
7179
  });
7177
7180
  }
7178
- async function bb(e) {
7181
+ async function wb(e) {
7179
7182
  const t = await Rh(e);
7180
7183
  return Th(t);
7181
7184
  }
7182
7185
  var Ah = /* @__PURE__ */ ((e) => (e.Active = "Active", e.Inactive = "Inactive", e))(Ah || {}), Oh = /* @__PURE__ */ ((e) => (e.mild = "mild", e.moderate = "moderate", e.severe = "severe", e))(Oh || {});
7183
- const wb = "http://fhir.openmrs.org/code-system/encounter-type", Ph = "problem-list-item", Eb = "http://terminology.hl7.org/CodeSystem/condition-ver-status", $h = "encounter-diagnosis", _b = "http://terminology.hl7.org/CodeSystem/condition-clinical", Sb = "http://terminology.hl7.org/CodeSystem/condition-category", Rb = "http://fhir.bahmni.org/ext/lab-order-concept-type", Tb = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", Ab = "http://fhir.bahmni.org/ext/observation/form-namespace-path", Ob = "http://fhir.bahmni.org/ext/observation/obs-value-attachment", Pb = "Numeric", $b = "Complex", Nb = "final", Ib = "Observation", Db = /^\d{4}-\d{2}-\d{2}/, Nh = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/, Cb = {
7186
+ const Eb = "http://fhir.openmrs.org/code-system/encounter-type", Ph = "problem-list-item", _b = "http://terminology.hl7.org/CodeSystem/condition-ver-status", $h = "encounter-diagnosis", Sb = "http://terminology.hl7.org/CodeSystem/condition-clinical", Rb = "http://terminology.hl7.org/CodeSystem/condition-category", Tb = "http://fhir.bahmni.org/ext/lab-order-concept-type", Ab = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", Ob = "http://fhir.bahmni.org/ext/observation/form-namespace-path", Pb = "http://fhir.bahmni.org/ext/observation/obs-value-attachment", $b = "Numeric", Nb = "Complex", Ib = "final", Db = "Observation", Cb = /^\d{4}-\d{2}-\d{2}/, Nh = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/, Lb = {
7184
7187
  ABNORMAL: { code: "A", display: "Abnormal" },
7185
7188
  NORMAL: { code: "N", display: "Normal" }
7186
7189
  }, Ih = (e) => pe + `/Condition?category=${Ph}&patient=${e}&_count=100&_sort=-_lastUpdated`;
7187
7190
  async function Dh(e) {
7188
- return await z(`${Ih(e)}`);
7191
+ return await W(`${Ih(e)}`);
7189
7192
  }
7190
- async function Lb(e) {
7193
+ async function kb(e) {
7191
7194
  return (await Dh(e)).entry?.filter((n) => n.resource?.resourceType === "Condition").map((n) => n.resource) ?? [];
7192
7195
  }
7193
7196
  const Ch = (e) => pe + `/Condition?category=${$h}&patient=${e}&_count=100&_sort=-_lastUpdated`, un = [
@@ -7204,7 +7207,7 @@ const Ch = (e) => pe + `/Condition?category=${$h}&patient=${e}&_count=100&_sort=
7204
7207
  ], Lh = "confirmed", kh = "provisional";
7205
7208
  async function Mh(e) {
7206
7209
  const t = Ch(e);
7207
- return await z(t);
7210
+ return await W(t);
7208
7211
  }
7209
7212
  const xh = (e) => {
7210
7213
  switch (e.verificationStatus?.coding?.[0]?.code) {
@@ -7243,7 +7246,7 @@ function jh(e) {
7243
7246
  }
7244
7247
  return Array.from(t.values());
7245
7248
  }
7246
- async function kb(e) {
7249
+ async function Mb(e) {
7247
7250
  const t = await Mh(e), r = qh(t);
7248
7251
  return jh(r);
7249
7252
  }
@@ -7262,7 +7265,7 @@ const St = {
7262
7265
  }, Vh = (e, t, r) => {
7263
7266
  let s = `${pe + "/MedicationRequest?" + St.SORT + "&" + St.COUNT + "&" + St.INCLUDE_MEDICATION}&patient=${e}`;
7264
7267
  return t && (s += `&code=${t}`), r && (s += `&encounter=${r}`), s;
7265
- }, Hh = ee + "/bahmnicore/config/drugOrders", Bh = (e, t) => pe + `/Medication?name=${encodeURIComponent(e)}&_count=${t}&_sort=-_lastUpdated`, Wh = pe + "/Medication?code=http://hl7.org/fhir/sid/cvx|&_count=100", zh = (e) => {
7268
+ }, Hh = ee + "/bahmnicore/config/drugOrders", Bh = (e, t) => pe + `/Medication?name=${encodeURIComponent(e)}&_count=${t}&_sort=-_lastUpdated`, zh = pe + "/Medication?code=http://hl7.org/fhir/sid/cvx|&_count=100", Wh = (e) => {
7266
7269
  switch (e.status) {
7267
7270
  case "active":
7268
7271
  return Ue.Active;
@@ -7288,7 +7291,7 @@ async function Gh(e, t, r, n = !1) {
7288
7291
  let a;
7289
7292
  t && t.length > 0 && (a = t.join(","));
7290
7293
  const i = (n ? Vh : Fh)(e, a, s);
7291
- return await z(i);
7294
+ return await W(i);
7292
7295
  }
7293
7296
  function Kh(e) {
7294
7297
  const t = e?.[0]?.doseAndRate?.[0]?.doseQuantity;
@@ -7376,7 +7379,7 @@ function sm(e) {
7376
7379
  const s = n.resource;
7377
7380
  s.resourceType === "Medication" && r.set(s.id, s);
7378
7381
  }), t.map((n) => {
7379
- const s = n.medicationReference, a = n.requester, o = zh(n), i = rm(
7382
+ const s = n.medicationReference, a = n.requester, o = Wh(n), i = rm(
7380
7383
  s,
7381
7384
  n,
7382
7385
  r
@@ -7410,7 +7413,7 @@ function sm(e) {
7410
7413
  });
7411
7414
  }
7412
7415
  const Ks = (e) => e.priority === "stat" || e.dosageInstruction?.[0]?.timing?.code?.text === "Immediately" || !1;
7413
- async function Mb(e, t, r, n = !1) {
7416
+ async function xb(e, t, r, n = !1) {
7414
7417
  const s = await Gh(
7415
7418
  e,
7416
7419
  t,
@@ -7419,18 +7422,18 @@ async function Mb(e, t, r, n = !1) {
7419
7422
  );
7420
7423
  return sm(s);
7421
7424
  }
7422
- async function xb() {
7423
- return await z(
7425
+ async function Ub() {
7426
+ return await W(
7424
7427
  Hh
7425
7428
  );
7426
7429
  }
7427
- async function Ub(e, t = 20) {
7428
- return await z(
7430
+ async function qb(e, t = 20) {
7431
+ return await W(
7429
7432
  Bh(e, t)
7430
7433
  );
7431
7434
  }
7432
- async function qb() {
7433
- return await z(Wh);
7435
+ async function jb() {
7436
+ return await W(zh);
7434
7437
  }
7435
7438
  const am = (e, t, r, n, s) => {
7436
7439
  let o = `${pe + "/ServiceRequest?_sort=-_lastUpdated"}&category=${e}&patient=${t}`;
@@ -7451,7 +7454,7 @@ function om(e) {
7451
7454
  async function Ct(e, t, r, n, s) {
7452
7455
  let a;
7453
7456
  r && r.length > 0 && (a = r.join(","));
7454
- const o = await z(
7457
+ const o = await W(
7455
7458
  am(
7456
7459
  e,
7457
7460
  t,
@@ -7462,7 +7465,7 @@ async function Ct(e, t, r, n, s) {
7462
7465
  );
7463
7466
  return o.entry && (o.entry = om(o.entry), o.total = o.entry.length), o;
7464
7467
  }
7465
- async function jb(e, t, r, n) {
7468
+ async function Fb(e, t, r, n) {
7466
7469
  return await Ct(
7467
7470
  t,
7468
7471
  e,
@@ -7470,7 +7473,7 @@ async function jb(e, t, r, n) {
7470
7473
  n
7471
7474
  );
7472
7475
  }
7473
- async function Fb(e, t, r, n) {
7476
+ async function Vb(e, t, r, n) {
7474
7477
  return await Ct(
7475
7478
  t,
7476
7479
  e,
@@ -7479,7 +7482,7 @@ async function Fb(e, t, r, n) {
7479
7482
  "ImagingStudy:basedon"
7480
7483
  );
7481
7484
  }
7482
- async function Vb(e, t, r, n) {
7485
+ async function Hb(e, t, r, n) {
7483
7486
  return (await Ct(
7484
7487
  t,
7485
7488
  e,
@@ -7487,7 +7490,7 @@ async function Vb(e, t, r, n) {
7487
7490
  n
7488
7491
  )).entry?.filter((o) => o.resource?.resourceType === "ServiceRequest").map((o) => o.resource) ?? [];
7489
7492
  }
7490
- async function Hb(e, t, r, n) {
7493
+ async function Bb(e, t, r, n) {
7491
7494
  return await Ct(
7492
7495
  t,
7493
7496
  e,
@@ -7499,29 +7502,29 @@ const im = (e, t) => {
7499
7502
  const r = `${pe}/DiagnosticReport?patient=${e}`;
7500
7503
  return t ? `${r}&based-on=${t}` : r;
7501
7504
  }, cm = (e) => `${pe}/DiagnosticReport/${e}/$fetch-bundle`, um = (e) => `${pe}/DiagnosticReport/${e}/$update-bundle`;
7502
- async function Bb(e, t = []) {
7505
+ async function zb(e, t = []) {
7503
7506
  const r = t.length > 0 ? t.join(",") : void 0, n = im(e, r);
7504
- return await z(n);
7507
+ return await W(n);
7505
7508
  }
7506
7509
  async function Wb(e) {
7507
7510
  const t = cm(e);
7508
- return await z(t);
7511
+ return await W(t);
7509
7512
  }
7510
- async function zb(e, t) {
7513
+ async function Gb(e, t) {
7511
7514
  const r = um(e);
7512
7515
  return await Ve(r, t);
7513
7516
  }
7514
- const Gb = [
7517
+ const Kb = [
7515
7518
  "preliminary",
7516
7519
  "final",
7517
7520
  "amended",
7518
7521
  "corrected",
7519
7522
  "appended"
7520
- ], Kb = [
7523
+ ], Yb = [
7521
7524
  "registered",
7522
7525
  "unknown",
7523
7526
  "partial"
7524
- ], lm = "All Orderables", dm = "/openmrs/ws/rest/v1/ordertype?v=custom:(uuid,display,conceptClasses:(uuid,name))", fm = "LabSet", pm = "http://fhir.bahmni.org/ext/ValueSet/concept-class", Yb = ["orderTypes"], hm = async () => await yh(lm), Wn = async () => await z(dm), mm = (e) => {
7527
+ ], lm = "All Orderables", dm = "/openmrs/ws/rest/v1/ordertype?v=custom:(uuid,display,conceptClasses:(uuid,name))", fm = "LabSet", pm = "http://fhir.bahmni.org/ext/ValueSet/concept-class", Jb = ["orderTypes"], hm = async () => await yh(lm), zn = async () => await W(dm), mm = (e) => {
7525
7528
  let t = e.display ?? "Unknown investigation";
7526
7529
  return li(e) === fm && (t += ` (${ie.t("INVESTIGATION_PANEL")})`), t;
7527
7530
  }, gm = (e) => {
@@ -7553,12 +7556,12 @@ const Gb = [
7553
7556
  });
7554
7557
  });
7555
7558
  }), r;
7556
- }, Jb = async () => {
7557
- const e = await hm(), t = await Wn();
7559
+ }, Xb = async () => {
7560
+ const e = await hm(), t = await zn();
7558
7561
  return ym(e, gm(t));
7559
- }, Xb = async (e) => e ? (await Wn()).results.find(
7562
+ }, Qb = async (e) => e ? (await zn()).results.find(
7560
7563
  (n) => n.display.toLowerCase() === e.toLowerCase()
7561
- )?.uuid : void 0, Qb = async () => (await Wn()).results.map((t) => t.display), Zb = async (e, t, r) => {
7564
+ )?.uuid : void 0, Zb = async () => (await zn()).results.map((t) => t.display), ew = async (e, t, r) => {
7562
7565
  const n = [];
7563
7566
  for (const s of e) {
7564
7567
  const a = s.uuid;
@@ -7889,7 +7892,7 @@ function Q() {
7889
7892
  }
7890
7893
  optimizeNames(b, T) {
7891
7894
  if (b[this.name.str])
7892
- return this.rhs && (this.rhs = W(this.rhs, b, T)), this;
7895
+ return this.rhs && (this.rhs = z(this.rhs, b, T)), this;
7893
7896
  }
7894
7897
  get names() {
7895
7898
  return this.rhs instanceof t._CodeOrName ? this.rhs.names : {};
@@ -7904,7 +7907,7 @@ function Q() {
7904
7907
  }
7905
7908
  optimizeNames(b, T) {
7906
7909
  if (!(this.lhs instanceof t.Name && !b[this.lhs.str] && !this.sideEffects))
7907
- return this.rhs = W(this.rhs, b, T), this;
7910
+ return this.rhs = z(this.rhs, b, T), this;
7908
7911
  }
7909
7912
  get names() {
7910
7913
  const b = this.lhs instanceof t.Name ? {} : { ...this.lhs.names };
@@ -7957,7 +7960,7 @@ function Q() {
7957
7960
  return `${this.code}` ? this : void 0;
7958
7961
  }
7959
7962
  optimizeNames(b, T) {
7960
- return this.code = W(this.code, b, T), this;
7963
+ return this.code = z(this.code, b, T), this;
7961
7964
  }
7962
7965
  get names() {
7963
7966
  return this.code instanceof t._CodeOrName ? this.code.names : {};
@@ -8028,7 +8031,7 @@ function Q() {
8028
8031
  optimizeNames(b, T) {
8029
8032
  var D;
8030
8033
  if (this.else = (D = this.else) === null || D === void 0 ? void 0 : D.optimizeNames(b, T), !!(super.optimizeNames(b, T) || this.else))
8031
- return this.condition = W(this.condition, b, T), this;
8034
+ return this.condition = z(this.condition, b, T), this;
8032
8035
  }
8033
8036
  get names() {
8034
8037
  const b = super.names;
@@ -8048,7 +8051,7 @@ function Q() {
8048
8051
  }
8049
8052
  optimizeNames(b, T) {
8050
8053
  if (super.optimizeNames(b, T))
8051
- return this.iteration = W(this.iteration, b, T), this;
8054
+ return this.iteration = z(this.iteration, b, T), this;
8052
8055
  }
8053
8056
  get names() {
8054
8057
  return j(super.names, this.iteration.names);
@@ -8076,7 +8079,7 @@ function Q() {
8076
8079
  }
8077
8080
  optimizeNames(b, T) {
8078
8081
  if (super.optimizeNames(b, T))
8079
- return this.iterable = W(this.iterable, b, T), this;
8082
+ return this.iterable = z(this.iterable, b, T), this;
8080
8083
  }
8081
8084
  get names() {
8082
8085
  return j(super.names, this.iterable.names);
@@ -8349,7 +8352,7 @@ function Q() {
8349
8352
  function V(N, b) {
8350
8353
  return b instanceof t._CodeOrName ? j(N, b.names) : N;
8351
8354
  }
8352
- function W(N, b, T) {
8355
+ function z(N, b, T) {
8353
8356
  if (N instanceof t.Name)
8354
8357
  return D(N);
8355
8358
  if (!F(N))
@@ -8673,15 +8676,15 @@ function bm() {
8673
8676
  }
8674
8677
  return Be;
8675
8678
  }
8676
- var ye = {}, We = {}, na;
8679
+ var ye = {}, ze = {}, na;
8677
8680
  function di() {
8678
- if (na) return We;
8679
- na = 1, Object.defineProperty(We, "__esModule", { value: !0 }), We.getRules = We.isJSONType = void 0;
8681
+ if (na) return ze;
8682
+ na = 1, Object.defineProperty(ze, "__esModule", { value: !0 }), ze.getRules = ze.isJSONType = void 0;
8680
8683
  const e = ["string", "number", "integer", "boolean", "null", "object", "array"], t = new Set(e);
8681
8684
  function r(s) {
8682
8685
  return typeof s == "string" && t.has(s);
8683
8686
  }
8684
- We.isJSONType = r;
8687
+ ze.isJSONType = r;
8685
8688
  function n() {
8686
8689
  const s = {
8687
8690
  number: { type: "number", rules: [] },
@@ -8697,7 +8700,7 @@ function di() {
8697
8700
  keywords: {}
8698
8701
  };
8699
8702
  }
8700
- return We.getRules = n, We;
8703
+ return ze.getRules = n, ze;
8701
8704
  }
8702
8705
  var Me = {}, sa;
8703
8706
  function fi() {
@@ -8951,8 +8954,8 @@ function Ce() {
8951
8954
  [r.default.rootData, r.default.rootData]
8952
8955
  ];
8953
8956
  P.opts.dynamicRef && V.push([r.default.dynamicAnchors, r.default.dynamicAnchors]);
8954
- const W = (0, e._)`${j}, ${w.object(...V)}`;
8955
- return q !== e.nil ? (0, e._)`${k}.call(${q}, ${W})` : (0, e._)`${k}(${W})`;
8957
+ const z = (0, e._)`${j}, ${w.object(...V)}`;
8958
+ return q !== e.nil ? (0, e._)`${k}.call(${q}, ${z})` : (0, e._)`${k}(${z})`;
8956
8959
  }
8957
8960
  ae.callValidateCode = S;
8958
8961
  const v = (0, e._)`new RegExp`;
@@ -9036,19 +9039,19 @@ function Em() {
9036
9039
  }
9037
9040
  function k() {
9038
9041
  const V = g.let("ruleErrs", null);
9039
- return g.try(() => U((0, e._)`await `), (W) => g.assign(R, !1).if((0, e._)`${W} instanceof ${w.ValidationError}`, () => g.assign(V, (0, e._)`${W}.errors`), () => g.throw(W))), V;
9042
+ return g.try(() => U((0, e._)`await `), (z) => g.assign(R, !1).if((0, e._)`${z} instanceof ${w.ValidationError}`, () => g.assign(V, (0, e._)`${z}.errors`), () => g.throw(z))), V;
9040
9043
  }
9041
9044
  function q() {
9042
9045
  const V = (0, e._)`${E}.errors`;
9043
9046
  return g.assign(V, null), U(e.nil), V;
9044
9047
  }
9045
9048
  function U(V = S.async ? (0, e._)`await ` : e.nil) {
9046
- const W = w.opts.passContext ? t.default.this : t.default.self, re = !("compile" in S && !h || S.schema === !1);
9047
- g.assign(R, (0, e._)`${V}${(0, r.callValidateCode)(y, E, W, re)}`, S.modifying);
9049
+ const z = w.opts.passContext ? t.default.this : t.default.self, re = !("compile" in S && !h || S.schema === !1);
9050
+ g.assign(R, (0, e._)`${V}${(0, r.callValidateCode)(y, E, z, re)}`, S.modifying);
9048
9051
  }
9049
9052
  function j(V) {
9050
- var W;
9051
- g.if((0, e.not)((W = S.valid) !== null && W !== void 0 ? W : R), V);
9053
+ var z;
9054
+ g.if((0, e.not)((z = S.valid) !== null && z !== void 0 ? z : R), V);
9052
9055
  }
9053
9056
  }
9054
9057
  Ie.funcKeywordCode = a;
@@ -9330,7 +9333,7 @@ function Br() {
9330
9333
  return r(g, { allKeys: !0 }, (q, U, j, V) => {
9331
9334
  if (V === void 0)
9332
9335
  return;
9333
- const W = _ + U;
9336
+ const z = _ + U;
9334
9337
  let re = w[V];
9335
9338
  typeof q[p] == "string" && (re = ne.call(this, q[p])), he.call(this, q.$anchor), he.call(this, q.$dynamicAnchor), w[U] = re;
9336
9339
  function ne(J) {
@@ -9339,7 +9342,7 @@ function Br() {
9339
9342
  throw k(J);
9340
9343
  R.add(J);
9341
9344
  let M = this.refs[J];
9342
- return typeof M == "string" && (M = this.refs[M]), typeof M == "object" ? P(q, M.schema, J) : J !== m(W) && (J[0] === "#" ? (P(q, E[J], J), E[J] = q) : this.refs[J] = W), J;
9345
+ return typeof M == "string" && (M = this.refs[M]), typeof M == "object" ? P(q, M.schema, J) : J !== m(z) && (J[0] === "#" ? (P(q, E[J], J), E[J] = q) : this.refs[J] = z), J;
9343
9346
  }
9344
9347
  function he(J) {
9345
9348
  if (typeof J == "string") {
@@ -9360,7 +9363,7 @@ function Br() {
9360
9363
  return be.getSchemaRefs = v, be;
9361
9364
  }
9362
9365
  var pa;
9363
- function Wr() {
9366
+ function zr() {
9364
9367
  if (pa) return ke;
9365
9368
  pa = 1, Object.defineProperty(ke, "__esModule", { value: !0 }), ke.getData = ke.KeywordCxt = ke.validateFunctionCode = void 0;
9366
9369
  const e = bm(), t = Cr(), r = fi(), n = Cr(), s = wm(), a = Em(), o = _m(), i = Q(), c = He(), l = Br(), d = te(), m = Hr();
@@ -9390,7 +9393,7 @@ function Wr() {
9390
9393
  function f(A) {
9391
9394
  const { schema: $, opts: L, gen: x } = A;
9392
9395
  S(A, () => {
9393
- L.$comment && $.$comment && V(A), q(A), x.let(c.default.vErrors, null), x.let(c.default.errors, 0), L.unevaluated && p(A), P(A), W(A);
9396
+ L.$comment && $.$comment && V(A), q(A), x.let(c.default.vErrors, null), x.let(c.default.errors, 0), L.unevaluated && p(A), P(A), z(A);
9394
9397
  });
9395
9398
  }
9396
9399
  function p(A) {
@@ -9459,7 +9462,7 @@ function Wr() {
9459
9462
  A.code((0, i._)`${c.default.self}.opts.$comment(${X}, ${me}, ${Ne}.schema)`);
9460
9463
  }
9461
9464
  }
9462
- function W(A) {
9465
+ function z(A) {
9463
9466
  const { gen: $, schemaEnv: L, validateName: x, ValidationError: H, opts: X } = A;
9464
9467
  L.$async ? $.if((0, i._)`${c.default.errors} === 0`, () => $.return(c.default.data), () => $.throw((0, i._)`new ${H}(${c.default.vErrors})`)) : ($.assign((0, i._)`${x}.errors`, c.default.vErrors), X.unevaluated && re(A), $.return((0, i._)`${c.default.errors} === 0`));
9465
9468
  }
@@ -9673,7 +9676,7 @@ function Wr() {
9673
9676
  return ke.getData = Z, ke;
9674
9677
  }
9675
9678
  var qt = {}, ha;
9676
- function zn() {
9679
+ function Wn() {
9677
9680
  if (ha) return qt;
9678
9681
  ha = 1, Object.defineProperty(qt, "__esModule", { value: !0 });
9679
9682
  class e extends Error {
@@ -9684,7 +9687,7 @@ function zn() {
9684
9687
  return qt.default = e, qt;
9685
9688
  }
9686
9689
  var jt = {}, ma;
9687
- function zr() {
9690
+ function Wr() {
9688
9691
  if (ma) return jt;
9689
9692
  ma = 1, Object.defineProperty(jt, "__esModule", { value: !0 });
9690
9693
  const e = Br();
@@ -9699,7 +9702,7 @@ var Te = {}, ga;
9699
9702
  function Gn() {
9700
9703
  if (ga) return Te;
9701
9704
  ga = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.resolveSchema = Te.getCompilingSchema = Te.resolveRef = Te.compileSchema = Te.SchemaEnv = void 0;
9702
- const e = Q(), t = zn(), r = He(), n = Br(), s = te(), a = Wr();
9705
+ const e = Q(), t = Wn(), r = He(), n = Br(), s = te(), a = zr();
9703
9706
  class o {
9704
9707
  constructor(p) {
9705
9708
  var u;
@@ -9753,11 +9756,11 @@ function Gn() {
9753
9756
  q = `${E.scopeRefs(r.default.scope)}return ${U}`, this.opts.code.process && (q = this.opts.code.process(q, f));
9754
9757
  const V = new Function(`${r.default.self}`, `${r.default.scope}`, q)(this, this.scope.get());
9755
9758
  if (this.scope.value(P, { ref: V }), V.errors = null, V.schema = f.schema, V.schemaEnv = f, f.$async && (V.$async = !0), this.opts.code.source === !0 && (V.source = { validateName: P, validateCode: U, scopeValues: E._values }), this.opts.unevaluated) {
9756
- const { props: W, items: re } = k;
9759
+ const { props: z, items: re } = k;
9757
9760
  V.evaluated = {
9758
- props: W instanceof e.Name ? void 0 : W,
9761
+ props: z instanceof e.Name ? void 0 : z,
9759
9762
  items: re instanceof e.Name ? void 0 : re,
9760
- dynamicProps: W instanceof e.Name,
9763
+ dynamicProps: z instanceof e.Name,
9761
9764
  dynamicItems: re instanceof e.Name
9762
9765
  }, V.source && (V.source.evaluated = (0, e.stringify)(V.evaluated));
9763
9766
  }
@@ -10227,7 +10230,7 @@ var _a;
10227
10230
  function Mm() {
10228
10231
  return _a || (_a = 1, (function(e) {
10229
10232
  Object.defineProperty(e, "__esModule", { value: !0 }), e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = void 0;
10230
- var t = Wr();
10233
+ var t = zr();
10231
10234
  Object.defineProperty(e, "KeywordCxt", { enumerable: !0, get: function() {
10232
10235
  return t.KeywordCxt;
10233
10236
  } });
@@ -10245,7 +10248,7 @@ function Mm() {
10245
10248
  } }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
10246
10249
  return r.CodeGen;
10247
10250
  } });
10248
- const n = zn(), s = zr(), a = di(), o = Gn(), i = Q(), c = Br(), l = Cr(), d = te(), m = Nm, y = km(), S = (M, O) => new RegExp(M, O);
10251
+ const n = Wn(), s = Wr(), a = di(), o = Gn(), i = Q(), c = Br(), l = Cr(), d = te(), m = Nm, y = km(), S = (M, O) => new RegExp(M, O);
10249
10252
  S.code = "new RegExp";
10250
10253
  const v = ["removeAdditional", "useDefaults", "coerceTypes"], g = /* @__PURE__ */ new Set([
10251
10254
  "validate",
@@ -10473,7 +10476,7 @@ function Mm() {
10473
10476
  throw new Error("addKeywords: keyword must be string or non-empty array");
10474
10477
  } else
10475
10478
  throw new Error("invalid addKeywords parameters");
10476
- if (W.call(this, N, C), !C)
10479
+ if (z.call(this, N, C), !C)
10477
10480
  return (0, d.eachItem)(N, (T) => re.call(this, T)), this;
10478
10481
  he.call(this, C);
10479
10482
  const b = {
@@ -10621,7 +10624,7 @@ function Mm() {
10621
10624
  throw new Error("logger must implement log, warn and error methods");
10622
10625
  }
10623
10626
  const V = /^[a-z_$][a-z0-9_$:-]*$/i;
10624
- function W(M, O) {
10627
+ function z(M, O) {
10625
10628
  const { RULES: C } = this;
10626
10629
  if ((0, d.eachItem)(M, (N) => {
10627
10630
  if (C.keywords[N])
@@ -10682,7 +10685,7 @@ var je = {}, Ra;
10682
10685
  function Um() {
10683
10686
  if (Ra) return je;
10684
10687
  Ra = 1, Object.defineProperty(je, "__esModule", { value: !0 }), je.callRef = je.getValidate = void 0;
10685
- const e = zr(), t = Ce(), r = Q(), n = He(), s = Gn(), a = te(), o = {
10688
+ const e = Wr(), t = Ce(), r = Q(), n = He(), s = Gn(), a = te(), o = {
10686
10689
  keyword: "$ref",
10687
10690
  schemaType: "string",
10688
10691
  code(l) {
@@ -10781,10 +10784,10 @@ function qm() {
10781
10784
  ];
10782
10785
  return Ht.default = r, Ht;
10783
10786
  }
10784
- var Wt = {}, zt = {}, Aa;
10787
+ var zt = {}, Wt = {}, Aa;
10785
10788
  function jm() {
10786
- if (Aa) return zt;
10787
- Aa = 1, Object.defineProperty(zt, "__esModule", { value: !0 });
10789
+ if (Aa) return Wt;
10790
+ Aa = 1, Object.defineProperty(Wt, "__esModule", { value: !0 });
10788
10791
  const e = Q(), t = e.operators, r = {
10789
10792
  maximum: { okStr: "<=", ok: t.LTE, fail: t.GT },
10790
10793
  minimum: { okStr: ">=", ok: t.GTE, fail: t.LT },
@@ -10804,7 +10807,7 @@ function jm() {
10804
10807
  a.fail$data((0, e._)`${i} ${r[o].fail} ${c} || isNaN(${i})`);
10805
10808
  }
10806
10809
  };
10807
- return zt.default = s, zt;
10810
+ return Wt.default = s, Wt;
10808
10811
  }
10809
10812
  var Gt = {}, Oa;
10810
10813
  function Fm() {
@@ -10883,7 +10886,7 @@ function Bm() {
10883
10886
  return Jt.default = n, Jt;
10884
10887
  }
10885
10888
  var Xt = {}, Ia;
10886
- function Wm() {
10889
+ function zm() {
10887
10890
  if (Ia) return Xt;
10888
10891
  Ia = 1, Object.defineProperty(Xt, "__esModule", { value: !0 });
10889
10892
  const e = Q(), r = {
@@ -10906,7 +10909,7 @@ function Wm() {
10906
10909
  return Xt.default = r, Xt;
10907
10910
  }
10908
10911
  var Qt = {}, Da;
10909
- function zm() {
10912
+ function Wm() {
10910
10913
  if (Da) return Qt;
10911
10914
  Da = 1, Object.defineProperty(Qt, "__esModule", { value: !0 });
10912
10915
  const e = Ce(), t = Q(), r = te(), s = {
@@ -11096,9 +11099,9 @@ function Jm() {
11096
11099
  }
11097
11100
  var Ua;
11098
11101
  function Xm() {
11099
- if (Ua) return Wt;
11100
- Ua = 1, Object.defineProperty(Wt, "__esModule", { value: !0 });
11101
- const e = jm(), t = Fm(), r = Hm(), n = Bm(), s = Wm(), a = zm(), o = Gm(), i = Km(), c = Ym(), l = Jm(), d = [
11102
+ if (Ua) return zt;
11103
+ Ua = 1, Object.defineProperty(zt, "__esModule", { value: !0 });
11104
+ const e = jm(), t = Fm(), r = Hm(), n = Bm(), s = zm(), a = Wm(), o = Gm(), i = Km(), c = Ym(), l = Jm(), d = [
11102
11105
  // number
11103
11106
  e.default,
11104
11107
  t.default,
@@ -11117,7 +11120,7 @@ function Xm() {
11117
11120
  c.default,
11118
11121
  l.default
11119
11122
  ];
11120
- return Wt.default = d, Wt;
11123
+ return zt.default = d, zt;
11121
11124
  }
11122
11125
  var sr = {}, st = {}, qa;
11123
11126
  function hi() {
@@ -11359,10 +11362,10 @@ function tg() {
11359
11362
  e.validateSchemaDeps = i, e.default = s;
11360
11363
  })(wn)), wn;
11361
11364
  }
11362
- var cr = {}, Wa;
11365
+ var cr = {}, za;
11363
11366
  function rg() {
11364
- if (Wa) return cr;
11365
- Wa = 1, Object.defineProperty(cr, "__esModule", { value: !0 });
11367
+ if (za) return cr;
11368
+ za = 1, Object.defineProperty(cr, "__esModule", { value: !0 });
11366
11369
  const e = Q(), t = te(), n = {
11367
11370
  keyword: "propertyNames",
11368
11371
  type: "object",
@@ -11391,10 +11394,10 @@ function rg() {
11391
11394
  };
11392
11395
  return cr.default = n, cr;
11393
11396
  }
11394
- var ur = {}, za;
11397
+ var ur = {}, Wa;
11395
11398
  function gi() {
11396
- if (za) return ur;
11397
- za = 1, Object.defineProperty(ur, "__esModule", { value: !0 });
11399
+ if (Wa) return ur;
11400
+ Wa = 1, Object.defineProperty(ur, "__esModule", { value: !0 });
11398
11401
  const e = Ce(), t = Q(), r = He(), n = te(), a = {
11399
11402
  keyword: "additionalProperties",
11400
11403
  type: ["object"],
@@ -11466,7 +11469,7 @@ var lr = {}, Ga;
11466
11469
  function ng() {
11467
11470
  if (Ga) return lr;
11468
11471
  Ga = 1, Object.defineProperty(lr, "__esModule", { value: !0 });
11469
- const e = Wr(), t = Ce(), r = te(), n = gi(), s = {
11472
+ const e = zr(), t = Ce(), r = te(), n = gi(), s = {
11470
11473
  keyword: "properties",
11471
11474
  type: "object",
11472
11475
  schemaType: "object",
@@ -11796,9 +11799,9 @@ function pg() {
11796
11799
  const t = [fg().default];
11797
11800
  return vr.default = t, vr;
11798
11801
  }
11799
- var ze = {}, so;
11802
+ var We = {}, so;
11800
11803
  function hg() {
11801
- return so || (so = 1, Object.defineProperty(ze, "__esModule", { value: !0 }), ze.contentVocabulary = ze.metadataVocabulary = void 0, ze.metadataVocabulary = [
11804
+ return so || (so = 1, Object.defineProperty(We, "__esModule", { value: !0 }), We.contentVocabulary = We.metadataVocabulary = void 0, We.metadataVocabulary = [
11802
11805
  "title",
11803
11806
  "description",
11804
11807
  "default",
@@ -11806,11 +11809,11 @@ function hg() {
11806
11809
  "readOnly",
11807
11810
  "writeOnly",
11808
11811
  "examples"
11809
- ], ze.contentVocabulary = [
11812
+ ], We.contentVocabulary = [
11810
11813
  "contentMediaType",
11811
11814
  "contentEncoding",
11812
11815
  "contentSchema"
11813
- ]), ze;
11816
+ ]), We;
11814
11817
  }
11815
11818
  var ao;
11816
11819
  function mg() {
@@ -11839,7 +11842,7 @@ var io;
11839
11842
  function yg() {
11840
11843
  if (io) return wr;
11841
11844
  io = 1, Object.defineProperty(wr, "__esModule", { value: !0 });
11842
- const e = Q(), t = gg(), r = Gn(), n = zr(), s = te(), o = {
11845
+ const e = Q(), t = gg(), r = Gn(), n = Wr(), s = te(), o = {
11843
11846
  keyword: "discriminator",
11844
11847
  type: "object",
11845
11848
  schemaType: "object",
@@ -11878,9 +11881,9 @@ function yg() {
11878
11881
  for (let U = 0; U < S.length; U++) {
11879
11882
  let j = S[U];
11880
11883
  if (j?.$ref && !(0, s.schemaHasRulesButRef)(j, y.self.RULES)) {
11881
- const W = j.$ref;
11882
- if (j = r.resolveRef.call(y.self, y.schemaEnv.root, y.baseId, W), j instanceof r.SchemaEnv && (j = j.schema), j === void 0)
11883
- throw new n.default(y.opts.uriResolver, y.baseId, W);
11884
+ const z = j.$ref;
11885
+ if (j = r.resolveRef.call(y.self, y.schemaEnv.root, y.baseId, z), j instanceof r.SchemaEnv && (j = j.schema), j === void 0)
11886
+ throw new n.default(y.opts.uriResolver, y.baseId, z);
11884
11887
  }
11885
11888
  const V = (w = j?.properties) === null || w === void 0 ? void 0 : w[v];
11886
11889
  if (typeof V != "object")
@@ -11941,7 +11944,7 @@ function Tg() {
11941
11944
  }
11942
11945
  }
11943
11946
  t.Ajv = c, e.exports = t = c, e.exports.Ajv = c, Object.defineProperty(t, "__esModule", { value: !0 }), t.default = c;
11944
- var l = Wr();
11947
+ var l = zr();
11945
11948
  Object.defineProperty(t, "KeywordCxt", { enumerable: !0, get: function() {
11946
11949
  return l.KeywordCxt;
11947
11950
  } });
@@ -11959,11 +11962,11 @@ function Tg() {
11959
11962
  } }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() {
11960
11963
  return d.CodeGen;
11961
11964
  } });
11962
- var m = zn();
11965
+ var m = Wn();
11963
11966
  Object.defineProperty(t, "ValidationError", { enumerable: !0, get: function() {
11964
11967
  return m.default;
11965
11968
  } });
11966
- var y = zr();
11969
+ var y = Wr();
11967
11970
  Object.defineProperty(t, "MissingRefError", { enumerable: !0, get: function() {
11968
11971
  return y.default;
11969
11972
  } });
@@ -11986,13 +11989,13 @@ const Og = /* @__PURE__ */ vm(Ag), Yn = "/bahmni_config/openmrs/apps/clinical/v2
11986
11989
  required: xg,
11987
11990
  additionalProperties: Ug,
11988
11991
  properties: qg
11989
- }, Fg = "http://json-schema.org/draft-07/schema#", Vg = "Clinical Dashboard Configuration Schema", Hg = "Schema for dashboards in clinical app which contains sections and associated controls", Bg = "object", Wg = !1, zg = ["sections"], Gg = { sections: { type: "array", description: "Section in a dashboard", items: { type: "object", additionalProperties: !1, required: ["name", "icon", "controls"], properties: { name: { type: "string", description: "Display name of the section" }, translationKey: { type: "string", description: "Translation key for the section name" }, icon: { type: "string", description: "Fontawesome Icon name for the section" }, controls: { type: "array", description: "List of controls in the section", items: [{ type: "object", additionalProperties: !1, required: ["type"], properties: { type: { type: "string", description: "Type of the control" }, config: { type: "object", description: "Configuration for the control" } } }] } } } } }, Kg = {
11992
+ }, Fg = "http://json-schema.org/draft-07/schema#", Vg = "Clinical Dashboard Configuration Schema", Hg = "Schema for dashboards in clinical app which contains sections and associated controls", Bg = "object", zg = !1, Wg = ["sections"], Gg = { sections: { type: "array", description: "Section in a dashboard", items: { type: "object", additionalProperties: !1, required: ["name", "icon", "controls"], properties: { name: { type: "string", description: "Display name of the section" }, translationKey: { type: "string", description: "Translation key for the section name" }, icon: { type: "string", description: "Fontawesome Icon name for the section" }, controls: { type: "array", description: "List of controls in the section", items: [{ type: "object", additionalProperties: !1, required: ["type"], properties: { type: { type: "string", description: "Type of the control" }, config: { type: "object", description: "Configuration for the control" } } }] } } } } }, Kg = {
11990
11993
  $schema: Fg,
11991
11994
  title: Vg,
11992
11995
  description: Hg,
11993
11996
  type: Bg,
11994
- additionalProperties: Wg,
11995
- required: zg,
11997
+ additionalProperties: zg,
11998
+ required: Wg,
11996
11999
  properties: Gg
11997
12000
  }, Yg = "http://json-schema.org/draft-07/schema#", Jg = "Medication Configuration Schema", Xg = "object", Qg = !1, Zg = { defaultDurationUnit: { type: "string", enum: ["min", "h", "d", "wk", "mo"], description: "Default unit for medication duration" }, defaultInstructions: { type: "string", description: "Default instructions for medication" }, drugFormDefaults: { type: "object", description: "Default dose units and routes for different drug forms", patternProperties: { "^.*$": { type: "object", additionalProperties: !1, properties: { doseUnits: { type: "string", description: "Default dose units for this drug form" }, route: { type: "string", description: "Default route of administration for this drug form" } } } } } }, ey = {
11998
12001
  $schema: Yg,
@@ -12007,7 +12010,7 @@ const Og = /* @__PURE__ */ vm(Ag), Yn = "/bahmni_config/openmrs/apps/clinical/v2
12007
12010
  type: sy,
12008
12011
  additionalProperties: ay,
12009
12012
  properties: oy
12010
- }, ew = async () => Gr($g, jg), tw = async (e) => {
12013
+ }, tw = async () => Gr($g, jg), rw = async (e) => {
12011
12014
  const t = await Gr(
12012
12015
  Dg(e),
12013
12016
  Kg
@@ -12016,10 +12019,10 @@ const Og = /* @__PURE__ */ vm(Ag), Yn = "/bahmni_config/openmrs/apps/clinical/v2
12016
12019
  ...r,
12017
12020
  id: hp()
12018
12021
  })), t;
12019
- }, rw = async () => Gr(
12022
+ }, nw = async () => Gr(
12020
12023
  Ig,
12021
12024
  ey
12022
- ), nw = async () => Gr(
12025
+ ), sw = async () => Gr(
12023
12026
  Ng,
12024
12027
  iy
12025
12028
  ), Gr = async (e, t) => {
@@ -12038,7 +12041,7 @@ const Og = /* @__PURE__ */ vm(Ag), Yn = "/bahmni_config/openmrs/apps/clinical/v2
12038
12041
  }
12039
12042
  }, cy = async (e) => {
12040
12043
  try {
12041
- return await z(e);
12044
+ return await W(e);
12042
12045
  } catch (t) {
12043
12046
  const { message: r } = ut(t);
12044
12047
  throw new Error(r);
@@ -12046,7 +12049,7 @@ const Og = /* @__PURE__ */ vm(Ag), Yn = "/bahmni_config/openmrs/apps/clinical/v2
12046
12049
  }, uy = async (e, t) => new Og().compile(t)(e), ly = (e) => ee + `/form/${e}?v=custom:(resources:(value))`, dy = (e) => {
12047
12050
  const t = ee + "/bahmniie/form/latestPublishedForms";
12048
12051
  return e ? t + `?episodeUuid=${e}` : t;
12049
- }, sw = (e) => ee + `/user/${e}?v=full`, fy = (e, t, r, n) => ee + `/bahmniie/form/translations?formName=${encodeURIComponent(e)}&formUuid=${t}&formVersion=${r}&locale=${n}`, Tr = "Bahmni", py = (e, t, r) => {
12052
+ }, aw = (e) => ee + `/user/${e}?v=full`, fy = (e, t, r, n) => ee + `/bahmniie/form/translations?formName=${encodeURIComponent(e)}&formUuid=${t}&formVersion=${r}&locale=${n}`, Tr = "Bahmni", py = (e, t, r) => {
12050
12053
  let s = ee + "/bahmnicore/patient/" + e + "/forms";
12051
12054
  return r ? s += `?patientProgramUuid=${r}` : t && (s += `?numberOfVisits=${t}`), s;
12052
12055
  }, hy = (e, t) => {
@@ -12058,25 +12061,25 @@ const Og = /* @__PURE__ */ vm(Ag), Yn = "/bahmni_config/openmrs/apps/clinical/v2
12058
12061
  };
12059
12062
  async function gy(e, t) {
12060
12063
  const r = hy(e, t);
12061
- return await z(r);
12064
+ return await W(r);
12062
12065
  }
12063
- async function aw(e, t) {
12066
+ async function ow(e, t) {
12064
12067
  const r = my(e, t);
12065
- return await z(r);
12068
+ return await W(r);
12066
12069
  }
12067
- async function ow(e, t) {
12070
+ async function iw(e, t) {
12068
12071
  return (await gy(e, t)).entry?.filter((s) => s.resource?.resourceType === "Observation").map((s) => s.resource) ?? [];
12069
12072
  }
12070
12073
  const yy = (e) => ee + `/provider?user=${e}&v=custom:(uuid,display,person)`;
12071
- async function iw(e) {
12072
- const t = await z(
12074
+ async function cw(e) {
12075
+ const t = await W(
12073
12076
  yy(e)
12074
12077
  );
12075
12078
  return !t.results || t.results.length === 0 ? null : t.results[0];
12076
12079
  }
12077
12080
  const vy = (e) => pe + `/Encounter?subject:Patient=${e}&_tag=visit`, by = (e) => `${pe}/Observation?encounter=${e}`;
12078
12081
  async function wy(e) {
12079
- return await z(vy(e));
12082
+ return await W(vy(e));
12080
12083
  }
12081
12084
  async function Ey(e) {
12082
12085
  return (await wy(e)).entry?.map((r) => r.resource).filter((r) => r !== void 0) ?? [];
@@ -12084,21 +12087,21 @@ async function Ey(e) {
12084
12087
  async function _y(e) {
12085
12088
  return (await Ey(e)).find((r) => !r.period?.end) ?? null;
12086
12089
  }
12087
- async function cw(e) {
12088
- return await z(by(e));
12090
+ async function uw(e) {
12091
+ return await W(by(e));
12089
12092
  }
12090
- const uw = (e, t) => e?.length === 0 ? !1 : t?.length === 0, Sy = pe + "/Encounter", Ry = ee + "/systemsetting/bahmni.encountersession.duration", Ty = "d34fe3ab-5e07-11ef-8f7c-0242ac120002";
12093
+ const lw = (e, t) => e?.length === 0 ? !1 : t?.length === 0, Sy = pe + "/Encounter", Ry = ee + "/systemsetting/bahmni.encountersession.duration", Ty = "d34fe3ab-5e07-11ef-8f7c-0242ac120002";
12091
12094
  async function Ay(e) {
12092
12095
  const t = new URLSearchParams();
12093
12096
  Object.entries(e).forEach(([s, a]) => {
12094
12097
  a && t.append(s, a);
12095
12098
  });
12096
12099
  const r = `${Sy}?${t.toString()}`;
12097
- return (await z(r)).entry?.map((s) => s.resource).filter((s) => s !== void 0) ?? [];
12100
+ return (await W(r)).entry?.map((s) => s.resource).filter((s) => s !== void 0) ?? [];
12098
12101
  }
12099
12102
  async function Oy() {
12100
12103
  try {
12101
- const e = await z(
12104
+ const e = await W(
12102
12105
  Ry
12103
12106
  ), t = Number(e.value);
12104
12107
  return !isNaN(t) && t > 0 ? t : 60;
@@ -12118,7 +12121,7 @@ async function Py(e, t) {
12118
12121
  return null;
12119
12122
  }
12120
12123
  }
12121
- async function lw(e, t, r) {
12124
+ async function dw(e, t, r) {
12122
12125
  try {
12123
12126
  if (!e) return null;
12124
12127
  const n = r ?? await Oy(), a = `ge${new Date(Date.now() - n * 60 * 1e3).toISOString()}`, o = {
@@ -12135,8 +12138,8 @@ async function lw(e, t, r) {
12135
12138
  }
12136
12139
  }
12137
12140
  const $y = (e) => pe + `/EpisodeOfCare?_revinclude=Encounter:episode-of-care&_id=${e}`;
12138
- async function dw(e) {
12139
- const t = e.join(","), r = await z($y(t));
12141
+ async function fw(e) {
12142
+ const t = e.join(","), r = await W($y(t));
12140
12143
  if (r.total === 0)
12141
12144
  throw new Error(
12142
12145
  "No episode of care found for the provided UUIDs: " + e.join(", ")
@@ -12151,7 +12154,7 @@ async function dw(e) {
12151
12154
  const En = /* @__PURE__ */ new Map(), Ny = async (e) => {
12152
12155
  if (En.has(e))
12153
12156
  return En.get(e) ?? null;
12154
- const t = await z(Vo(e)), r = t ? String(t) : null;
12157
+ const t = await W(Vo(e)), r = t ? String(t) : null;
12155
12158
  return En.set(e, r), r;
12156
12159
  }, Iy = async () => await Ny(nl) === "true", Dy = async (e, t, r, n = ot.CLINICAL) => {
12157
12160
  if (!await Iy())
@@ -12171,21 +12174,21 @@ const En = /* @__PURE__ */ new Map(), Ny = async (e) => {
12171
12174
  module: n
12172
12175
  };
12173
12176
  return await Ve(Gp, o), { logged: !0 };
12174
- }, fw = () => zp(async (t) => {
12177
+ }, pw = () => Wp(async (t) => {
12175
12178
  await Dy(
12176
12179
  t.patientUuid,
12177
12180
  t.eventType,
12178
12181
  t.messageParams,
12179
12182
  t.module
12180
12183
  );
12181
- }), pw = async () => {
12184
+ }), hw = async () => {
12182
12185
  try {
12183
- return await z(Xu);
12186
+ return await W(Xu);
12184
12187
  } catch (e) {
12185
12188
  const { message: t } = ut(e);
12186
12189
  throw new Error(t);
12187
12190
  }
12188
- }, hw = (e, t) => !e || e.length === 0 ? !1 : e.some((r) => r.name === t), Cy = async (e) => {
12191
+ }, mw = (e, t) => !e || e.length === 0 ? !1 : e.some((r) => r.name === t), Cy = async (e) => {
12189
12192
  let t;
12190
12193
  e && e.length > 0 && (t = e.join(","));
12191
12194
  const r = await fetch(dy(t));
@@ -12216,12 +12219,12 @@ const En = /* @__PURE__ */ new Map(), Ny = async (e) => {
12216
12219
  editable: n.editable
12217
12220
  }))
12218
12221
  };
12219
- }, mw = async (e) => {
12222
+ }, gw = async (e) => {
12220
12223
  const t = await Cy(e), r = It();
12221
12224
  return t.map(
12222
12225
  (n) => ky(n, r)
12223
12226
  );
12224
- }, gw = async (e) => {
12227
+ }, yw = async (e) => {
12225
12228
  const t = await fetch(ly(e));
12226
12229
  if (!t.ok)
12227
12230
  throw new Error(
@@ -12255,10 +12258,10 @@ const En = /* @__PURE__ */ new Map(), Ny = async (e) => {
12255
12258
  schema: n,
12256
12259
  translations: l
12257
12260
  };
12258
- }, yw = async (e, t, r) => {
12261
+ }, vw = async (e, t, r) => {
12259
12262
  let n;
12260
12263
  t && t.length > 0 && (n = t.join(","));
12261
- const s = py(e, r, n), a = await z(s);
12264
+ const s = py(e, r, n), a = await W(s);
12262
12265
  return Array.isArray(a) ? a : [];
12263
12266
  };
12264
12267
  function yi(e) {
@@ -12300,7 +12303,7 @@ function bi(e, t) {
12300
12303
  };
12301
12304
  return n(r.controls);
12302
12305
  }
12303
- function vw(e, t) {
12306
+ function bw(e, t) {
12304
12307
  if (!e.controls || e.controls.length === 0)
12305
12308
  return [];
12306
12309
  const r = [], n = (/* @__PURE__ */ new Date()).toISOString();
@@ -12345,7 +12348,7 @@ function vw(e, t) {
12345
12348
  s.interpretation && (o.interpretation = s.interpretation), s.comment && (o.comment = s.comment), r.push(o);
12346
12349
  }), r;
12347
12350
  }
12348
- function bw(e, t) {
12351
+ function ww(e, t) {
12349
12352
  if (!e || e.length === 0)
12350
12353
  return {
12351
12354
  controls: [],
@@ -12378,7 +12381,7 @@ function bw(e, t) {
12378
12381
  metadata: { formMetadata: t }
12379
12382
  };
12380
12383
  }
12381
- function ww(e) {
12384
+ function Ew(e) {
12382
12385
  const t = (n) => {
12383
12386
  const s = (l) => l == null ? null : typeof l == "string" || typeof l == "number" || typeof l == "boolean" || typeof l == "object" ? l : null, a = n.concept, o = typeof a == "object" && a !== null && "uuid" in a ? a.uuid : a, i = typeof a == "object" && a !== null && "datatype" in a ? a.datatype : void 0, c = {
12384
12387
  concept: {
@@ -12398,11 +12401,11 @@ function ww(e) {
12398
12401
  };
12399
12402
  return (e?.filter((n) => n.uuid && n.voided ? !0 : !(!n.uuid && n.voided || n.value && typeof n.value == "string" && n.value.endsWith("voided"))) ?? []).map(t);
12400
12403
  }
12401
- function Ew(e) {
12404
+ function _w(e) {
12402
12405
  if (!(!e || typeof e != "object"))
12403
12406
  return "toJS" in e && typeof e.toJS == "function" ? e.toJS() : e;
12404
12407
  }
12405
- function _w(e, t) {
12408
+ function Sw(e, t) {
12406
12409
  !e || !Array.isArray(e.children) || e.children.forEach((r) => {
12407
12410
  r && typeof r == "object" && wi(
12408
12411
  r,
@@ -12432,7 +12435,7 @@ function wi(e, t) {
12432
12435
  );
12433
12436
  });
12434
12437
  }
12435
- const My = ee + "/bahmnicore/diseaseSummaryData?", Sw = async (e, t, r, n) => {
12438
+ const My = ee + "/bahmnicore/diseaseSummaryData?", Rw = async (e, t, r, n) => {
12436
12439
  const s = new URLSearchParams({
12437
12440
  groupBy: n,
12438
12441
  latestCount: t.toString(),
@@ -12442,8 +12445,8 @@ const My = ee + "/bahmnicore/diseaseSummaryData?", Sw = async (e, t, r, n) => {
12442
12445
  s.append("obsConcepts", o);
12443
12446
  });
12444
12447
  const a = My + s.toString();
12445
- return z(a);
12446
- }, Ei = "custom:(uuid,episodeUuid,patient,program,display,dateEnrolled,dateCompleted,location,voided,allowedStates,outcome,states:(uuid,startDate,endDate,voided,state:(uuid,concept:(uuid,display,name,names)),auditInfo),auditInfo,attributes)", xy = (e) => `${ee}/bahmniprogramenrollment?patient=${e}&v=${Ei}`, _i = (e) => `${ee}/bahmniprogramenrollment/${e}`, Uy = (e) => `${_i(e)}?v=${Ei}`, Rw = async (e) => await z(xy(e)), Tw = async (e) => await z(Uy(e)), Aw = async (e, t) => {
12448
+ return W(a);
12449
+ }, Ei = "custom:(uuid,episodeUuid,patient,program,display,dateEnrolled,dateCompleted,location,voided,allowedStates,outcome,states:(uuid,startDate,endDate,voided,state:(uuid,concept:(uuid,display,name,names)),auditInfo),auditInfo,attributes)", xy = (e) => `${ee}/bahmniprogramenrollment?patient=${e}&v=${Ei}`, _i = (e) => `${ee}/bahmniprogramenrollment/${e}`, Uy = (e) => `${_i(e)}?v=${Ei}`, Tw = async (e) => await W(xy(e)), Aw = async (e) => await W(Uy(e)), Ow = async (e, t) => {
12447
12450
  const r = {
12448
12451
  uuid: e,
12449
12452
  states: [
@@ -12457,7 +12460,7 @@ const My = ee + "/bahmnicore/diseaseSummaryData?", Sw = async (e, t, r, n) => {
12457
12460
  r
12458
12461
  );
12459
12462
  };
12460
- function Ow(e) {
12463
+ function Pw(e) {
12461
12464
  if (e.states.length === 0)
12462
12465
  return null;
12463
12466
  let t;
@@ -12473,7 +12476,7 @@ function Ow(e) {
12473
12476
  t = e.states.find((r) => r.endDate === null);
12474
12477
  return t ? vh(t.state.concept.names) ?? t.state.concept.display : null;
12475
12478
  }
12476
- function Pw(e, t) {
12479
+ function $w(e, t) {
12477
12480
  if (t.length === 0)
12478
12481
  return {};
12479
12482
  const r = {};
@@ -12485,12 +12488,12 @@ function Pw(e, t) {
12485
12488
  }
12486
12489
  return r;
12487
12490
  }
12488
- const Cn = "consultation:saved", $w = (e) => {
12491
+ const Cn = "consultation:saved", Nw = (e) => {
12489
12492
  const t = new CustomEvent(Cn, {
12490
12493
  detail: e
12491
12494
  });
12492
12495
  window.dispatchEvent(t);
12493
- }, Nw = (e, t = []) => {
12496
+ }, Iw = (e, t = []) => {
12494
12497
  const r = _n(e);
12495
12498
  Sn(() => {
12496
12499
  r.current = e;
@@ -12511,144 +12514,145 @@ export {
12511
12514
  Hp as AttributeFormat,
12512
12515
  Bp as AttributeInputType,
12513
12516
  uv as BAHMNI_HOME_PATH,
12514
- $b as CONCEPT_DATATYPE_COMPLEX,
12515
- Pb as CONCEPT_DATATYPE_NUMERIC,
12517
+ Nb as CONCEPT_DATATYPE_COMPLEX,
12518
+ $b as CONCEPT_DATATYPE_NUMERIC,
12516
12519
  Cn as CONSULTATION_SAVED_EVENT,
12517
12520
  Nh as DATETIME_REGEX_PATTERN,
12518
12521
  up as DATE_FORMAT,
12519
12522
  gv as DATE_PICKER_INPUT_FORMAT,
12520
- Db as DATE_REGEX_PATTERN,
12523
+ Cb as DATE_REGEX_PATTERN,
12521
12524
  lp as DATE_TIME_FORMAT,
12522
12525
  pp as DURATION_UNIT_TO_DAYS,
12523
- wb as FHIR_ENCOUNTER_TYPE_CODE_SYSTEM,
12524
- Rb as FHIR_LAB_ORDER_CONCEPT_TYPE_EXTENSION_URL,
12525
- Ab as FHIR_OBSERVATION_FORM_NAMESPACE_PATH_URL,
12526
- Tb as FHIR_OBSERVATION_INTERPRETATION_SYSTEM,
12527
- Nb as FHIR_OBSERVATION_STATUS_FINAL,
12528
- Ob as FHIR_OBSERVATION_VALUE_ATTACHMENT_URL,
12529
- Ib as FHIR_RESOURCE_TYPE_OBSERVATION,
12526
+ Eb as FHIR_ENCOUNTER_TYPE_CODE_SYSTEM,
12527
+ Tb as FHIR_LAB_ORDER_CONCEPT_TYPE_EXTENSION_URL,
12528
+ Ob as FHIR_OBSERVATION_FORM_NAMESPACE_PATH_URL,
12529
+ Ab as FHIR_OBSERVATION_INTERPRETATION_SYSTEM,
12530
+ Ib as FHIR_OBSERVATION_STATUS_FINAL,
12531
+ Pb as FHIR_OBSERVATION_VALUE_ATTACHMENT_URL,
12532
+ Db as FHIR_RESOURCE_TYPE_OBSERVATION,
12530
12533
  pv as FULL_MONTH_DATE_FORMAT,
12531
- Sb as HL7_CONDITION_CATEGORY_CODE_SYSTEM,
12534
+ Rb as HL7_CONDITION_CATEGORY_CODE_SYSTEM,
12532
12535
  Ph as HL7_CONDITION_CATEGORY_CONDITION_CODE,
12533
12536
  $h as HL7_CONDITION_CATEGORY_DIAGNOSIS_CODE,
12534
- _b as HL7_CONDITION_CLINICAL_STATUS_CODE_SYSTEM,
12535
- Eb as HL7_CONDITION_VERIFICATION_STATUS_CODE_SYSTEM,
12536
- Cb as INTERPRETATION_TO_CODE,
12537
+ Sb as HL7_CONDITION_CLINICAL_STATUS_CODE_SYSTEM,
12538
+ _b as HL7_CONDITION_VERIFICATION_STATUS_CODE_SYSTEM,
12539
+ Lb as INTERPRETATION_TO_CODE,
12537
12540
  mv as ISO_DATE_FORMAT,
12538
- Uv as MAX_NAME_LENGTH,
12539
- xv as MAX_PATIENT_AGE_YEARS,
12540
- qv as MAX_PHONE_NUMBER_LENGTH,
12541
+ qv as MAX_NAME_LENGTH,
12542
+ Uv as MAX_PATIENT_AGE_YEARS,
12543
+ jv as MAX_PHONE_NUMBER_LENGTH,
12541
12544
  Ue as MedicationStatus,
12542
12545
  pe as OPENMRS_FHIR_R4,
12543
12546
  ee as OPENMRS_REST_V1,
12544
- Yb as ORDER_TYPE_QUERY_KEY,
12545
- Kb as PENDING_REPORT_STATUSES,
12546
- Gb as PROCESSED_REPORT_STATUSES,
12547
+ Jb as ORDER_TYPE_QUERY_KEY,
12548
+ Yb as PENDING_REPORT_STATUSES,
12549
+ Kb as PROCESSED_REPORT_STATUSES,
12547
12550
  hv as REGISTRATION_DATE_FORMAT,
12548
- sw as USER_PINNED_PREFERENCE_URL,
12551
+ aw as USER_PINNED_PREFERENCE_URL,
12549
12552
  fp as calculateAge,
12550
12553
  Sv as calculateAgeinYearsAndMonths,
12551
12554
  Rv as calculateEndDate,
12552
12555
  bv as calculateOnsetDate,
12553
12556
  kv as camelToScreamingSnakeCase,
12554
12557
  Pv as capitalize,
12555
- ib as checkIfActiveVisitExists,
12556
- Ew as convertImmutableToPlainObject,
12557
- zv as createPatient,
12558
- cb as createVisitForPatient,
12558
+ cb as checkIfActiveVisitExists,
12559
+ _w as convertImmutableToPlainObject,
12560
+ Mv as convertToSentenceCase,
12561
+ Gv as createPatient,
12562
+ ub as createVisitForPatient,
12559
12563
  cv as del,
12560
- Wp as dispatchAuditEvent,
12561
- $w as dispatchConsultationSaved,
12564
+ zp as dispatchAuditEvent,
12565
+ Nw as dispatchConsultationSaved,
12562
12566
  Tv as doDateRangesOverlap,
12563
- Pw as extractAttributes,
12564
- _w as extractNotesFromFormData,
12565
- yb as fetchAndFormatAllergenConcepts,
12566
- gw as fetchFormMetadata,
12567
- xb as fetchMedicationOrdersMetadata,
12568
- mw as fetchObservationForms,
12569
- vb as fetchReactionConcepts,
12567
+ $w as extractAttributes,
12568
+ Sw as extractNotesFromFormData,
12569
+ vb as fetchAndFormatAllergenConcepts,
12570
+ yw as fetchFormMetadata,
12571
+ Ub as fetchMedicationOrdersMetadata,
12572
+ gw as fetchObservationForms,
12573
+ bb as fetchReactionConcepts,
12570
12574
  Dv as filterReplacementEntries,
12571
- lw as findActiveEncounterInSession,
12575
+ dw as findActiveEncounterInSession,
12572
12576
  vv as formatDate,
12573
12577
  _v as formatDateAndTime,
12574
12578
  wv as formatDateDistance,
12575
12579
  yv as formatDateTime,
12576
12580
  Cv as formatUrl,
12577
12581
  hp as generateId,
12578
- z as get,
12582
+ W as get,
12579
12583
  _y as getActiveVisit,
12580
12584
  Zp as getActiveVisitByPatient,
12581
- Yv as getAddressHierarchyEntries,
12585
+ Jv as getAddressHierarchyEntries,
12582
12586
  Rh as getAllergies,
12583
- pb as getAppointmentById,
12584
- Xb as getCategoryUuidFromOrderTypes,
12585
- ew as getClinicalConfig,
12586
- mb as getConceptById,
12587
- Lb as getConditions,
12587
+ hb as getAppointmentById,
12588
+ Qb as getCategoryUuidFromOrderTypes,
12589
+ tw as getClinicalConfig,
12590
+ gb as getConceptById,
12591
+ kb as getConditions,
12588
12592
  oi as getCookieByName,
12589
- iw as getCurrentProvider,
12590
- Ow as getCurrentStateName,
12591
- Mv as getCurrentUser,
12592
- pw as getCurrentUserPrivileges,
12593
- tw as getDashboardConfig,
12593
+ cw as getCurrentProvider,
12594
+ Pw as getCurrentStateName,
12595
+ xv as getCurrentUser,
12596
+ hw as getCurrentUserPrivileges,
12597
+ rw as getDashboardConfig,
12594
12598
  Wb as getDiagnosticReportBundle,
12595
- Bb as getDiagnosticReports,
12596
- dw as getEncountersAndVisitsForEOC,
12597
- Zb as getExistingServiceRequestsForAllCategories,
12598
- Jb as getFlattenedInvestigations,
12599
- bb as getFormattedAllergies,
12599
+ zb as getDiagnosticReports,
12600
+ fw as getEncountersAndVisitsForEOC,
12601
+ ew as getExistingServiceRequestsForAllCategories,
12602
+ Xb as getFlattenedInvestigations,
12603
+ wb as getFormattedAllergies,
12600
12604
  ut as getFormattedError,
12601
- jv as getFormattedPatientById,
12602
- Kv as getGenders,
12605
+ Fv as getFormattedPatientById,
12606
+ Yv as getGenders,
12603
12607
  Wv as getIdentifierData,
12604
- Bv as getIdentifierTypes,
12605
- eb as getInputTypeForFormat,
12606
- Hb as getLabInvestigationsBundle,
12607
- rw as getMedicationConfig,
12608
- cw as getObservationsBundleByEncounterUuid,
12609
- Qb as getOrderTypeNames,
12610
- Wn as getOrderTypes,
12611
- Jv as getOrderedAddressHierarchyLevels,
12612
- db as getPastAppointments,
12608
+ zv as getIdentifierTypes,
12609
+ tb as getInputTypeForFormat,
12610
+ Bb as getLabInvestigationsBundle,
12611
+ nw as getMedicationConfig,
12612
+ uw as getObservationsBundleByEncounterUuid,
12613
+ Zb as getOrderTypeNames,
12614
+ zn as getOrderTypes,
12615
+ Xv as getOrderedAddressHierarchyLevels,
12616
+ fb as getPastAppointments,
12613
12617
  Mp as getPatientById,
12614
- kb as getPatientDiagnoses,
12615
- yw as getPatientFormData,
12616
- Fv as getPatientImageAsDataUrl,
12618
+ Mb as getPatientDiagnoses,
12619
+ vw as getPatientFormData,
12620
+ Vv as getPatientImageAsDataUrl,
12617
12621
  Gh as getPatientMedicationBundle,
12618
- Mb as getPatientMedications,
12619
- ow as getPatientObservations,
12622
+ xb as getPatientMedications,
12623
+ iw as getPatientObservations,
12620
12624
  gy as getPatientObservationsBundle,
12621
- aw as getPatientObservationsWithEncounterBundle,
12622
- Xv as getPatientProfile,
12623
- Rw as getPatientPrograms,
12624
- jb as getPatientRadiologyInvestigationBundle,
12625
- Fb as getPatientRadiologyInvestigationBundleWithImagingStudy,
12626
- Vb as getPatientRadiologyInvestigations,
12627
- Zv as getPersonAttributeTypes,
12625
+ ow as getPatientObservationsWithEncounterBundle,
12626
+ Qv as getPatientProfile,
12627
+ Tw as getPatientPrograms,
12628
+ Fb as getPatientRadiologyInvestigationBundle,
12629
+ Vb as getPatientRadiologyInvestigationBundleWithImagingStudy,
12630
+ Hb as getPatientRadiologyInvestigations,
12631
+ eb as getPersonAttributeTypes,
12628
12632
  Vp as getPrimaryIdentifierType,
12629
12633
  Nv as getPriorityByOrder,
12630
- Tw as getProgramByUUID,
12631
- nw as getRegistrationConfig,
12632
- Qv as getRelationshipTypes,
12634
+ Aw as getProgramByUUID,
12635
+ sw as getRegistrationConfig,
12636
+ Zv as getRelationshipTypes,
12633
12637
  Ct as getServiceRequests,
12634
12638
  Ev as getTodayDate,
12635
- lb as getUpcomingAppointments,
12639
+ db as getUpcomingAppointments,
12636
12640
  Hn as getUserLoginLocation,
12637
12641
  It as getUserPreferredLocale,
12638
- qb as getVaccinations,
12642
+ jb as getVaccinations,
12639
12643
  Lv as getValueType,
12640
- ob as getVisitTypes,
12641
- Sw as getVitalFlowSheetData,
12644
+ ib as getVisitTypes,
12645
+ Rw as getVitalFlowSheetData,
12642
12646
  Iv as groupByDate,
12643
- hw as hasPrivilege,
12647
+ mw as hasPrivilege,
12644
12648
  dv as initAppI18n,
12645
- fw as initializeAuditListener,
12646
- tb as isBooleanFormat,
12647
- rb as isConceptFormat,
12648
- sb as isDateFormat,
12649
- nb as isNumberFormat,
12649
+ pw as initializeAuditListener,
12650
+ rb as isBooleanFormat,
12651
+ nb as isConceptFormat,
12652
+ ab as isDateFormat,
12653
+ sb as isNumberFormat,
12650
12654
  $v as isStringEmpty,
12651
- ab as isTextFormat,
12655
+ ob as isTextFormat,
12652
12656
  Dy as logAuditEvent,
12653
12657
  lv as normalizeTranslationKey,
12654
12658
  on as notificationService,
@@ -12657,24 +12661,24 @@ export {
12657
12661
  Ve as post,
12658
12662
  ov as put,
12659
12663
  Ov as refreshQueries,
12660
- ub as searchAppointmentsByAttribute,
12661
- gb as searchConceptByName,
12662
- hb as searchConcepts,
12664
+ lb as searchAppointmentsByAttribute,
12665
+ yb as searchConceptByName,
12666
+ mb as searchConcepts,
12663
12667
  Rr as searchFHIRConcepts,
12664
12668
  yh as searchFHIRConceptsByName,
12665
- Ub as searchMedications,
12666
- Hv as searchPatientByCustomAttribute,
12667
- Vv as searchPatientByNameOrId,
12668
- uw as shouldEnableEncounterFilter,
12669
+ qb as searchMedications,
12670
+ Bv as searchPatientByCustomAttribute,
12671
+ Hv as searchPatientByNameOrId,
12672
+ lw as shouldEnableEncounterFilter,
12669
12673
  Av as sortByDate,
12670
- ww as transformContainerObservationsToForm2Observations,
12671
- vw as transformFormDataToObservations,
12672
- bw as transformObservationsToFormData,
12673
- fb as updateAppointmentStatus,
12674
- zb as updateDiagnosticReportBundle,
12675
- Gv as updatePatient,
12676
- Aw as updateProgramState,
12674
+ Ew as transformContainerObservationsToForm2Observations,
12675
+ bw as transformFormDataToObservations,
12676
+ ww as transformObservationsToFormData,
12677
+ pb as updateAppointmentStatus,
12678
+ Gb as updateDiagnosticReportBundle,
12679
+ Kv as updatePatient,
12680
+ Ow as updateProgramState,
12677
12681
  fv as useCamera,
12678
- Nw as useSubscribeConsultationSaved,
12679
- Cw as useTranslation
12682
+ Iw as useSubscribeConsultationSaved,
12683
+ Lw as useTranslation
12680
12684
  };