@bahmni/services 0.0.1-dev.100 → 0.0.1-dev.102

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 bi } from "react-i18next";
2
- import { useTranslation as Pw } from "react-i18next";
2
+ import { useTranslation as Nw } from "react-i18next";
3
3
  import { useRef as _n, useCallback as Xr, useEffect as Sn } from "react";
4
4
  function uo(e, t) {
5
5
  return function() {
@@ -1253,14 +1253,14 @@ const Oo = (e) => {
1253
1253
  }
1254
1254
  }
1255
1255
  D.isString(L) || (L = L ? "include" : "omit");
1256
- const K = a && "credentials" in r.prototype, he = {
1256
+ const Y = a && "credentials" in r.prototype, he = {
1257
1257
  ...j,
1258
1258
  signal: q,
1259
1259
  method: f.toUpperCase(),
1260
1260
  headers: O.normalize().toJSON(),
1261
1261
  body: h,
1262
1262
  duplex: "half",
1263
- credentials: K ? L : void 0
1263
+ credentials: Y ? L : void 0
1264
1264
  };
1265
1265
  U = a && new r(g, he);
1266
1266
  let ce = await (a ? t(U, j) : t(g, he));
@@ -1293,13 +1293,13 @@ const Oo = (e) => {
1293
1293
  request: U
1294
1294
  });
1295
1295
  });
1296
- } catch (K) {
1297
- throw F && F(), K && K.name === "TypeError" && /Load failed|fetch/i.test(K.message) ? Object.assign(
1296
+ } catch (Y) {
1297
+ throw F && F(), Y && Y.name === "TypeError" && /Load failed|fetch/i.test(Y.message) ? Object.assign(
1298
1298
  new G("Network Error", G.ERR_NETWORK, v, U),
1299
1299
  {
1300
- cause: K.cause || K
1300
+ cause: Y.cause || Y
1301
1301
  }
1302
- ) : G.from(K, K && K.code, v, U);
1302
+ ) : G.from(Y, Y && Y.code, v, U);
1303
1303
  }
1304
1304
  };
1305
1305
  }, Vc = /* @__PURE__ */ new Map(), No = (e) => {
@@ -1735,22 +1735,22 @@ ue.getAdapter = Do.getAdapter;
1735
1735
  ue.HttpStatusCode = On;
1736
1736
  ue.default = ue;
1737
1737
  const {
1738
- Axios: hy,
1739
- AxiosError: py,
1740
- CanceledError: my,
1741
- isCancel: gy,
1742
- CancelToken: yy,
1743
- VERSION: vy,
1744
- all: wy,
1745
- Cancel: by,
1746
- isAxiosError: Ey,
1747
- spread: _y,
1748
- toFormData: Sy,
1749
- AxiosHeaders: Ry,
1750
- HttpStatusCode: Ty,
1751
- formToJSON: Py,
1752
- getAdapter: Ay,
1753
- mergeConfig: Oy
1738
+ Axios: my,
1739
+ AxiosError: gy,
1740
+ CanceledError: yy,
1741
+ isCancel: vy,
1742
+ CancelToken: wy,
1743
+ VERSION: by,
1744
+ all: Ey,
1745
+ Cancel: _y,
1746
+ isAxiosError: Sy,
1747
+ spread: Ry,
1748
+ toFormData: Ty,
1749
+ AxiosHeaders: Py,
1750
+ HttpStatusCode: Ay,
1751
+ formToJSON: Oy,
1752
+ getAdapter: $y,
1753
+ mergeConfig: Ny
1754
1754
  } = ue, ct = (e) => {
1755
1755
  let t = "Error", r = "An unexpected error occurred";
1756
1756
  if (!e)
@@ -1941,7 +1941,7 @@ Ye.interceptors.response.use(
1941
1941
  return Promise.reject(`${t}: ${r}`);
1942
1942
  }
1943
1943
  );
1944
- const X = async (e) => (await Ye.get(e)).data, ht = async (e, t) => (await Ye.post(e, t)).data, $y = async (e, t) => (await Ye.put(e, t)).data, Ny = async (e) => (await Ye.delete(e)).data, W = (e) => typeof e == "string", yt = () => {
1944
+ const K = async (e) => (await Ye.get(e)).data, ht = async (e, t) => (await Ye.post(e, t)).data, Dy = async (e, t) => (await Ye.put(e, t)).data, Iy = async (e) => (await Ye.delete(e)).data, W = (e) => typeof e == "string", yt = () => {
1945
1945
  let e, t;
1946
1946
  const r = new Promise((n, s) => {
1947
1947
  e = n, t = s;
@@ -2313,17 +2313,17 @@ class $r extends qr {
2313
2313
  const q = Array.isArray(O), U = q ? [] : {}, F = q ? v : R;
2314
2314
  for (const z in O)
2315
2315
  if (Object.prototype.hasOwnProperty.call(O, z)) {
2316
- const K = `${F}${a}${z}`;
2317
- p && !y ? U[z] = this.translate(K, {
2316
+ const Y = `${F}${a}${z}`;
2317
+ p && !y ? U[z] = this.translate(Y, {
2318
2318
  ...r,
2319
2319
  defaultValue: ws(S) ? S[z] : void 0,
2320
2320
  joinArrays: !1,
2321
2321
  ns: i
2322
- }) : U[z] = this.translate(K, {
2322
+ }) : U[z] = this.translate(Y, {
2323
2323
  ...r,
2324
2324
  joinArrays: !1,
2325
2325
  ns: i
2326
- }), U[z] === K && (U[z] = O[z]);
2326
+ }), U[z] === Y && (U[z] = O[z]);
2327
2327
  }
2328
2328
  y = U;
2329
2329
  }
@@ -2332,9 +2332,9 @@ class $r extends qr {
2332
2332
  else {
2333
2333
  let q = !1, U = !1;
2334
2334
  !this.isValidLookup(y) && p && (q = !0, y = S), this.isValidLookup(y) || (U = !0, y = o);
2335
- const z = (r.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && U ? void 0 : y, K = p && S !== y && this.options.updateMissing;
2336
- if (U || q || K) {
2337
- if (this.logger.log(K ? "updateKey" : "missingKey", d, c, o, K ? S : y), a) {
2335
+ const z = (r.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && U ? void 0 : y, Y = p && S !== y && this.options.updateMissing;
2336
+ if (U || q || Y) {
2337
+ if (this.logger.log(Y ? "updateKey" : "missingKey", d, c, o, Y ? S : y), a) {
2338
2338
  const ie = this.resolve(o, {
2339
2339
  ...r,
2340
2340
  keySeparator: !1
@@ -2349,7 +2349,7 @@ class $r extends qr {
2349
2349
  else this.options.saveMissingTo === "all" ? he = this.languageUtils.toResolveHierarchy(r.lng || this.language) : he.push(r.lng || this.language);
2350
2350
  const ee = (ie, M, A) => {
2351
2351
  const C = p && A !== y ? A : z;
2352
- this.options.missingKeyHandler ? this.options.missingKeyHandler(ie, c, M, C, K, r) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(ie, c, M, C, K, r), this.emit("missingKey", ie, c, M, y);
2352
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(ie, c, M, C, Y, r) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(ie, c, M, C, Y, r), this.emit("missingKey", ie, c, M, y);
2353
2353
  };
2354
2354
  this.options.saveMissing && (this.options.saveMissingPlurals && u ? he.forEach((ie) => {
2355
2355
  const M = this.pluralResolver.getSuffixes(ie, r);
@@ -3615,9 +3615,9 @@ class Uo {
3615
3615
  }
3616
3616
  }
3617
3617
  Uo.type = "languageDetector";
3618
- const Uu = process.env.PUBLIC_URL ?? "/", De = "/openmrs/ws/fhir2/R4", ae = "/openmrs/ws/rest/v1", Fu = "/openmrs/ws/rest/v2", Vu = "bahmni.user", Dy = "/bahmni/home/index.html", Hu = ae + "/bahmnicore/whoami", Bu = (e) => `${ae}/bahmniprogramenrollment?patient=${e}&v=full`, zu = "en", Fo = "NG_TRANSLATE_LANG_KEY", Wu = (e, t) => Uu + `${e}/locales/locale_${t}.json`, Gu = (e, t) => `/bahmni_config/openmrs/i18n/${e}/locale_${t}.json`, Nt = () => localStorage.getItem(Fo) ?? zu, Ns = async (e) => {
3618
+ const Uu = process.env.PUBLIC_URL ?? "/", De = "/openmrs/ws/fhir2/R4", ne = "/openmrs/ws/rest/v1", Fu = "/openmrs/ws/rest/v2", Vu = "bahmni.user", Cy = "/bahmni/home/index.html", Hu = ne + "/bahmnicore/whoami", Bu = (e) => `${ne}/bahmniprogramenrollment?patient=${e}&v=full`, zu = "en", Fo = "NG_TRANSLATE_LANG_KEY", Wu = (e, t) => Uu + `${e}/locales/locale_${t}.json`, Gu = (e, t) => `/bahmni_config/openmrs/i18n/${e}/locale_${t}.json`, Nt = () => localStorage.getItem(Fo) ?? zu, Ns = async (e) => {
3619
3619
  try {
3620
- const t = await X(e);
3620
+ const t = await K(e);
3621
3621
  return t || (console.error(`Invalid response from ${e}`), {});
3622
3622
  } catch (t) {
3623
3623
  return console.error(`Failed to load translations from ${e}:`, t), {};
@@ -3639,7 +3639,7 @@ const Uu = process.env.PUBLIC_URL ?? "/", De = "/openmrs/ws/fhir2/R4", ae = "/op
3639
3639
  }, e !== "en" && (r.en = {
3640
3640
  [t]: await Ds(t, "en")
3641
3641
  }), r;
3642
- }, Iy = (e, t) => {
3642
+ }, ky = (e, t) => {
3643
3643
  const r = e.toUpperCase(), n = t.toUpperCase().replace(/\s+/g, "_").replace(/[^A-Z0-9_]/g, "");
3644
3644
  return `${r}_${n}`;
3645
3645
  }, Yu = (e, t) => {
@@ -3656,7 +3656,7 @@ const Uu = process.env.PUBLIC_URL ?? "/", De = "/openmrs/ws/fhir2/R4", ae = "/op
3656
3656
  labels: n.labels ?? {},
3657
3657
  concepts: n.concepts ?? {}
3658
3658
  };
3659
- }, Cy = async (e) => {
3659
+ }, Ly = async (e) => {
3660
3660
  const t = Nt(), r = await Ku(t, e);
3661
3661
  return await oe.use(Uo).use(bi).init({
3662
3662
  fallbackLng: "en",
@@ -3675,7 +3675,7 @@ const Uu = process.env.PUBLIC_URL ?? "/", De = "/openmrs/ws/fhir2/R4", ae = "/op
3675
3675
  }
3676
3676
  }), oe;
3677
3677
  };
3678
- function ky() {
3678
+ function My() {
3679
3679
  const e = _n(null), t = _n(null), r = Xr(async () => {
3680
3680
  t.current && (t.current.getTracks().forEach((o) => o.stop()), t.current = null);
3681
3681
  const a = await navigator.mediaDevices.getUserMedia({
@@ -3698,7 +3698,7 @@ function ky() {
3698
3698
  }, []);
3699
3699
  return Sn(() => () => n(), [n]), { videoRef: e, start: r, stop: n, capture: s };
3700
3700
  }
3701
- const Ju = "bahmni.enableAuditLog", Vo = (e) => `${ae}/bahmnicore/sql/globalproperty?property=${e}`, Ho = 6048e5, Xu = 864e5, Bo = 6e4, zo = 36e5, Is = /* @__PURE__ */ Symbol.for("constructDateFrom");
3701
+ const Ju = "bahmni.enableAuditLog", Vo = (e) => `${ne}/bahmnicore/sql/globalproperty?property=${e}`, Ho = 6048e5, Xu = 864e5, Bo = 6e4, zo = 36e5, Is = /* @__PURE__ */ Symbol.for("constructDateFrom");
3702
3702
  function Ae(e, t) {
3703
3703
  return typeof e == "function" ? e(t) : e && typeof e == "object" && Is in e ? e[Is](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
3704
3704
  }
@@ -4321,7 +4321,7 @@ function ql(e, t) {
4321
4321
  const r = fe(e, t?.in), n = +Tt(r, t) - +xl(r, t);
4322
4322
  return Math.round(n / Ho) + 1;
4323
4323
  }
4324
- function se(e, t) {
4324
+ function ae(e, t) {
4325
4325
  const r = e < 0 ? "-" : "", n = Math.abs(e).toString().padStart(t, "0");
4326
4326
  return r + n;
4327
4327
  }
@@ -4329,16 +4329,16 @@ const je = {
4329
4329
  // Year
4330
4330
  y(e, t) {
4331
4331
  const r = e.getFullYear(), n = r > 0 ? r : 1 - r;
4332
- return se(t === "yy" ? n % 100 : n, t.length);
4332
+ return ae(t === "yy" ? n % 100 : n, t.length);
4333
4333
  },
4334
4334
  // Month
4335
4335
  M(e, t) {
4336
4336
  const r = e.getMonth();
4337
- return t === "M" ? String(r + 1) : se(r + 1, 2);
4337
+ return t === "M" ? String(r + 1) : ae(r + 1, 2);
4338
4338
  },
4339
4339
  // Day of the month
4340
4340
  d(e, t) {
4341
- return se(e.getDate(), t.length);
4341
+ return ae(e.getDate(), t.length);
4342
4342
  },
4343
4343
  // AM or PM
4344
4344
  a(e, t) {
@@ -4357,26 +4357,26 @@ const je = {
4357
4357
  },
4358
4358
  // Hour [1-12]
4359
4359
  h(e, t) {
4360
- return se(e.getHours() % 12 || 12, t.length);
4360
+ return ae(e.getHours() % 12 || 12, t.length);
4361
4361
  },
4362
4362
  // Hour [0-23]
4363
4363
  H(e, t) {
4364
- return se(e.getHours(), t.length);
4364
+ return ae(e.getHours(), t.length);
4365
4365
  },
4366
4366
  // Minute
4367
4367
  m(e, t) {
4368
- return se(e.getMinutes(), t.length);
4368
+ return ae(e.getMinutes(), t.length);
4369
4369
  },
4370
4370
  // Second
4371
4371
  s(e, t) {
4372
- return se(e.getSeconds(), t.length);
4372
+ return ae(e.getSeconds(), t.length);
4373
4373
  },
4374
4374
  // Fraction of second
4375
4375
  S(e, t) {
4376
4376
  const r = t.length, n = e.getMilliseconds(), s = Math.trunc(
4377
4377
  n * Math.pow(10, r - 3)
4378
4378
  );
4379
- return se(s, t.length);
4379
+ return ae(s, t.length);
4380
4380
  }
4381
4381
  }, tt = {
4382
4382
  midnight: "midnight",
@@ -4415,14 +4415,14 @@ const je = {
4415
4415
  const s = Zo(e, n), a = s > 0 ? s : 1 - s;
4416
4416
  if (t === "YY") {
4417
4417
  const o = a % 100;
4418
- return se(o, 2);
4418
+ return ae(o, 2);
4419
4419
  }
4420
- return t === "Yo" ? r.ordinalNumber(a, { unit: "year" }) : se(a, t.length);
4420
+ return t === "Yo" ? r.ordinalNumber(a, { unit: "year" }) : ae(a, t.length);
4421
4421
  },
4422
4422
  // ISO week-numbering year
4423
4423
  R: function(e, t) {
4424
4424
  const r = Wo(e);
4425
- return se(r, t.length);
4425
+ return ae(r, t.length);
4426
4426
  },
4427
4427
  // Extended year. This is a single number designating the year of this calendar system.
4428
4428
  // The main difference between `y` and `u` localizers are B.C. years:
@@ -4435,7 +4435,7 @@ const je = {
4435
4435
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
4436
4436
  u: function(e, t) {
4437
4437
  const r = e.getFullYear();
4438
- return se(r, t.length);
4438
+ return ae(r, t.length);
4439
4439
  },
4440
4440
  // Quarter
4441
4441
  Q: function(e, t, r) {
@@ -4446,7 +4446,7 @@ const je = {
4446
4446
  return String(n);
4447
4447
  // 01, 02, 03, 04
4448
4448
  case "QQ":
4449
- return se(n, 2);
4449
+ return ae(n, 2);
4450
4450
  // 1st, 2nd, 3rd, 4th
4451
4451
  case "Qo":
4452
4452
  return r.ordinalNumber(n, { unit: "quarter" });
@@ -4478,7 +4478,7 @@ const je = {
4478
4478
  return String(n);
4479
4479
  // 01, 02, 03, 04
4480
4480
  case "qq":
4481
- return se(n, 2);
4481
+ return ae(n, 2);
4482
4482
  // 1st, 2nd, 3rd, 4th
4483
4483
  case "qo":
4484
4484
  return r.ordinalNumber(n, { unit: "quarter" });
@@ -4536,7 +4536,7 @@ const je = {
4536
4536
  return String(n + 1);
4537
4537
  // 01, 02, ..., 12
4538
4538
  case "LL":
4539
- return se(n + 1, 2);
4539
+ return ae(n + 1, 2);
4540
4540
  // 1st, 2nd, ..., 12th
4541
4541
  case "Lo":
4542
4542
  return r.ordinalNumber(n + 1, { unit: "month" });
@@ -4559,12 +4559,12 @@ const je = {
4559
4559
  // Local week of year
4560
4560
  w: function(e, t, r, n) {
4561
4561
  const s = ql(e, n);
4562
- return t === "wo" ? r.ordinalNumber(s, { unit: "week" }) : se(s, t.length);
4562
+ return t === "wo" ? r.ordinalNumber(s, { unit: "week" }) : ae(s, t.length);
4563
4563
  },
4564
4564
  // ISO week of year
4565
4565
  I: function(e, t, r) {
4566
4566
  const n = Ml(e);
4567
- return t === "Io" ? r.ordinalNumber(n, { unit: "week" }) : se(n, t.length);
4567
+ return t === "Io" ? r.ordinalNumber(n, { unit: "week" }) : ae(n, t.length);
4568
4568
  },
4569
4569
  // Day of the month
4570
4570
  d: function(e, t, r) {
@@ -4573,7 +4573,7 @@ const je = {
4573
4573
  // Day of year
4574
4574
  D: function(e, t, r) {
4575
4575
  const n = Ll(e);
4576
- return t === "Do" ? r.ordinalNumber(n, { unit: "dayOfYear" }) : se(n, t.length);
4576
+ return t === "Do" ? r.ordinalNumber(n, { unit: "dayOfYear" }) : ae(n, t.length);
4577
4577
  },
4578
4578
  // Day of week
4579
4579
  E: function(e, t, r) {
@@ -4615,7 +4615,7 @@ const je = {
4615
4615
  return String(a);
4616
4616
  // Padded numerical value
4617
4617
  case "ee":
4618
- return se(a, 2);
4618
+ return ae(a, 2);
4619
4619
  // 1st, 2nd, ..., 7th
4620
4620
  case "eo":
4621
4621
  return r.ordinalNumber(a, { unit: "day" });
@@ -4652,7 +4652,7 @@ const je = {
4652
4652
  return String(a);
4653
4653
  // Padded numerical value
4654
4654
  case "cc":
4655
- return se(a, t.length);
4655
+ return ae(a, t.length);
4656
4656
  // 1st, 2nd, ..., 7th
4657
4657
  case "co":
4658
4658
  return r.ordinalNumber(a, { unit: "day" });
@@ -4689,7 +4689,7 @@ const je = {
4689
4689
  return String(s);
4690
4690
  // 02
4691
4691
  case "ii":
4692
- return se(s, t.length);
4692
+ return ae(s, t.length);
4693
4693
  // 2nd
4694
4694
  case "io":
4695
4695
  return r.ordinalNumber(s, { unit: "day" });
@@ -4812,12 +4812,12 @@ const je = {
4812
4812
  // Hour [0-11]
4813
4813
  K: function(e, t, r) {
4814
4814
  const n = e.getHours() % 12;
4815
- return t === "Ko" ? r.ordinalNumber(n, { unit: "hour" }) : se(n, t.length);
4815
+ return t === "Ko" ? r.ordinalNumber(n, { unit: "hour" }) : ae(n, t.length);
4816
4816
  },
4817
4817
  // Hour [1-24]
4818
4818
  k: function(e, t, r) {
4819
4819
  let n = e.getHours();
4820
- return n === 0 && (n = 24), t === "ko" ? r.ordinalNumber(n, { unit: "hour" }) : se(n, t.length);
4820
+ return n === 0 && (n = 24), t === "ko" ? r.ordinalNumber(n, { unit: "hour" }) : ae(n, t.length);
4821
4821
  },
4822
4822
  // Minute
4823
4823
  m: function(e, t, r) {
@@ -4898,22 +4898,22 @@ const je = {
4898
4898
  // Seconds timestamp
4899
4899
  t: function(e, t, r) {
4900
4900
  const n = Math.trunc(+e / 1e3);
4901
- return se(n, t.length);
4901
+ return ae(n, t.length);
4902
4902
  },
4903
4903
  // Milliseconds timestamp
4904
4904
  T: function(e, t, r) {
4905
- return se(+e, t.length);
4905
+ return ae(+e, t.length);
4906
4906
  }
4907
4907
  };
4908
4908
  function xs(e, t = "") {
4909
4909
  const r = e > 0 ? "-" : "+", n = Math.abs(e), s = Math.trunc(n / 60), a = n % 60;
4910
- return a === 0 ? r + String(s) : r + String(s) + t + se(a, 2);
4910
+ return a === 0 ? r + String(s) : r + String(s) + t + ae(a, 2);
4911
4911
  }
4912
4912
  function qs(e, t) {
4913
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + se(Math.abs(e) / 60, 2) : ze(e, t);
4913
+ return e % 60 === 0 ? (e > 0 ? "-" : "+") + ae(Math.abs(e) / 60, 2) : ze(e, t);
4914
4914
  }
4915
4915
  function ze(e, t = "") {
4916
- const r = e > 0 ? "-" : "+", n = Math.abs(e), s = se(Math.trunc(n / 60), 2), a = se(n % 60, 2);
4916
+ const r = e > 0 ? "-" : "+", n = Math.abs(e), s = ae(Math.trunc(n / 60), 2), a = ae(n % 60, 2);
4917
4917
  return r + s + t + a;
4918
4918
  }
4919
4919
  const js = (e, t) => {
@@ -6353,7 +6353,7 @@ const Us = {
6353
6353
  weekStartsOn: 1,
6354
6354
  firstWeekContainsDate: 4
6355
6355
  }
6356
- }, nh = "dd/MM/yyyy", Ly = "MMMM dd, yyyy", My = "do MMM, yyyy", sh = "dd/MM/yyyy HH:mm", xy = "yyyy-MM-dd", qy = "d/m/Y", Pe = {
6356
+ }, nh = "dd/MM/yyyy", xy = "MMMM dd, yyyy", qy = "do MMM, yyyy", sh = "dd/MM/yyyy HH:mm", jy = "yyyy-MM-dd", Uy = "d/m/Y", Pe = {
6357
6357
  PARSE_ERROR: "DATE_ERROR_PARSE",
6358
6358
  FORMAT_ERROR: "DATE_ERROR_FORMAT",
6359
6359
  EMPTY_OR_INVALID: "DATE_ERROR_EMPTY_OR_INVALID",
@@ -6433,13 +6433,13 @@ function si(e, t, r) {
6433
6433
  const s = ah();
6434
6434
  return { formattedResult: Zl(n, t, { locale: s }) };
6435
6435
  }
6436
- function jy(e, t) {
6436
+ function Fy(e, t) {
6437
6437
  return si(e, sh, t);
6438
6438
  }
6439
6439
  function ih(e, t, r = nh) {
6440
6440
  return si(e, r, t);
6441
6441
  }
6442
- function Uy(e, t, r) {
6442
+ function Vy(e, t, r) {
6443
6443
  if (!e || !Dt(e) || t === null || t === void 0 || !r || typeof t != "number")
6444
6444
  return;
6445
6445
  const n = new Date(e);
@@ -6454,7 +6454,7 @@ function Uy(e, t, r) {
6454
6454
  return;
6455
6455
  }
6456
6456
  }
6457
- function Fy(e, t) {
6457
+ function Hy(e, t) {
6458
6458
  if (e == null)
6459
6459
  return {
6460
6460
  formattedResult: "",
@@ -6506,11 +6506,11 @@ function Fy(e, t) {
6506
6506
  }
6507
6507
  return { formattedResult: c };
6508
6508
  }
6509
- const Vy = () => {
6509
+ const By = () => {
6510
6510
  const e = /* @__PURE__ */ new Date();
6511
6511
  return e.setHours(0, 0, 0, 0), e;
6512
6512
  };
6513
- function Hy(e, t) {
6513
+ function zy(e, t) {
6514
6514
  const r = new Date(e), s = new Intl.DateTimeFormat("en-US", {
6515
6515
  day: "2-digit",
6516
6516
  month: "short",
@@ -6526,7 +6526,7 @@ function Hy(e, t) {
6526
6526
  }
6527
6527
  return c;
6528
6528
  }
6529
- function By(e, t) {
6529
+ function Wy(e, t) {
6530
6530
  const r = new Date(e), n = /* @__PURE__ */ new Date(), s = Fn(n, r), a = jn(r, s), o = Un(n, a), i = jr(a, o), c = Dn(n, i);
6531
6531
  if (s === 0 && o < 3) {
6532
6532
  const m = Dn(n, r);
@@ -6541,7 +6541,7 @@ function By(e, t) {
6541
6541
  [c, "REGISTRATION_DAYS_SHORT"]
6542
6542
  ].filter(([m]) => m > 0).map(([m, y]) => `${m}${t(y, { count: m })}`).join(" ") || "0d" : `${s} years ${o} months ${c} days`;
6543
6543
  }
6544
- function zy(e, t, r = !1) {
6544
+ function Gy(e, t, r = !1) {
6545
6545
  return !e || !Array.isArray(e) ? [] : e.sort((n, s) => {
6546
6546
  const a = new Date(n[t]), o = new Date(s[t]);
6547
6547
  if (isNaN(a.getTime()) && isNaN(o.getTime())) return 0;
@@ -6551,11 +6551,11 @@ function zy(e, t, r = !1) {
6551
6551
  return r ? i : -i;
6552
6552
  });
6553
6553
  }
6554
- const Wy = async (e, t, r) => {
6554
+ const Ky = async (e, t, r) => {
6555
6555
  const { exact: n = !0, refetchActiveNow: s = !0 } = r ?? {};
6556
6556
  await e.cancelQueries({ queryKey: t, exact: n }), await e.removeQueries({ queryKey: t, exact: n }), await e.invalidateQueries({ queryKey: t, exact: n }), s && await e.refetchQueries({ queryKey: t, exact: n, type: "active" });
6557
6557
  }, ch = () => Math.random().toString(36).substring(2, 9);
6558
- function Gy(e, t = " -") {
6558
+ function Yy(e, t = " -") {
6559
6559
  return e ? e.toLowerCase().split(new RegExp(`[${t}]+`)).map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join(" ") : "";
6560
6560
  }
6561
6561
  function ai(e) {
@@ -6567,7 +6567,7 @@ function ai(e) {
6567
6567
  }
6568
6568
  return "";
6569
6569
  }
6570
- const Ky = (e) => !e || e.trim().length === 0, Yy = (e, t) => {
6570
+ const Jy = (e) => !e || e.trim().length === 0, Xy = (e, t) => {
6571
6571
  if (!e || !t || t.length === 0)
6572
6572
  return 999;
6573
6573
  const r = t.findIndex(
@@ -6575,7 +6575,7 @@ const Ky = (e) => !e || e.trim().length === 0, Yy = (e, t) => {
6575
6575
  );
6576
6576
  return r === -1 ? 999 : r;
6577
6577
  };
6578
- function Jy(e, t) {
6578
+ function Qy(e, t) {
6579
6579
  if (!e || e.length === 0)
6580
6580
  return [];
6581
6581
  const r = /* @__PURE__ */ new Map();
@@ -6587,7 +6587,7 @@ function Jy(e, t) {
6587
6587
  items: s
6588
6588
  }));
6589
6589
  }
6590
- function Xy(e, t, r) {
6590
+ function Zy(e, t, r) {
6591
6591
  if (!e || e.length === 0)
6592
6592
  return [];
6593
6593
  const n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
@@ -6608,7 +6608,7 @@ function uh(e) {
6608
6608
  a[n(o[1])] = n(o[2]);
6609
6609
  return a;
6610
6610
  }
6611
- function Qy(e, t, r) {
6611
+ function ev(e, t, r) {
6612
6612
  const n = /{{([^}]*)}}/g, s = e.match(n);
6613
6613
  let a = e;
6614
6614
  const o = r ?? !1, i = o ? uh() : {};
@@ -6621,8 +6621,8 @@ function Qy(e, t, r) {
6621
6621
  const lh = (e) => new Promise((t, r) => {
6622
6622
  const n = new FileReader();
6623
6623
  n.onloadend = () => t(n.result), n.onerror = r, n.readAsDataURL(e);
6624
- }), dh = (e) => ae + `/user?username=${e}&v=custom:(username,uuid)`, fh = "bahmni.user.location";
6625
- async function Zy() {
6624
+ }), dh = (e) => ne + `/user?username=${e}&v=custom:(username,uuid)`, fh = "bahmni.user.location";
6625
+ async function tv() {
6626
6626
  const e = ai(Vu);
6627
6627
  if (!e)
6628
6628
  return null;
@@ -6630,7 +6630,7 @@ async function Zy() {
6630
6630
  const t = decodeURIComponent(e).replace(
6631
6631
  /^"(.*)"$/,
6632
6632
  "$1"
6633
- ), r = await X(dh(t));
6633
+ ), r = await K(dh(t));
6634
6634
  return !r.results || r.results.length === 0 ? null : r.results[0];
6635
6635
  } catch {
6636
6636
  throw new Error(oe.t("ERROR_FETCHING_USER_DETAILS"));
@@ -6678,7 +6678,7 @@ const Vn = () => {
6678
6678
  a && s.fields.forEach((o) => {
6679
6679
  n.append(a.searchFieldParam, o), n.append(a.resultParam, o);
6680
6680
  });
6681
- }), `${ae}/bahmni/search/patient/lucene?${n.toString()}`;
6681
+ }), `${ne}/bahmni/search/patient/lucene?${n.toString()}`;
6682
6682
  }, gh = (e, t, r, n, s) => {
6683
6683
  const a = e.trim(), o = new URLSearchParams({
6684
6684
  loginLocationUuid: s,
@@ -6688,16 +6688,16 @@ const Vn = () => {
6688
6688
  }), i = Hn[t];
6689
6689
  return i && (o.set(i.searchParam, a), r.forEach((c) => {
6690
6690
  o.append(i.searchFieldParam, c);
6691
- })), hh(o, n), ae + `/bahmni/search/patient?${o.toString()}`;
6692
- }, oi = ae + "/idgen/identifiertype", yh = (e) => ae + `/bahmni/app/setting?module=${e}`, vh = "bahmni.primaryIdentifierType", wh = ae + "/bahmnicore/patientprofile", bh = (e) => ae + `/bahmnicore/patientprofile/${e}`, Eh = (e) => ae + `/patientprofile/${e}?v=full`, _h = (e, t, r = 20, n) => {
6691
+ })), hh(o, n), ne + `/bahmni/search/patient?${o.toString()}`;
6692
+ }, oi = ne + "/idgen/identifiertype", yh = (e) => ne + `/bahmni/app/setting?module=${e}`, vh = "bahmni.primaryIdentifierType", wh = ne + "/bahmnicore/patientprofile", bh = (e) => ne + `/bahmnicore/patientprofile/${e}`, Eh = (e) => ne + `/patientprofile/${e}?v=full`, _h = (e, t, r = 20, n) => {
6693
6693
  let s = `/openmrs/module/addresshierarchy/ajax/getPossibleAddressHierarchyEntriesWithParents.form?addressField=${e}&limit=${r}&searchString=${encodeURIComponent(t)}`;
6694
6694
  return n && (s += `&parent=${n}`), s;
6695
- }, Sh = "/openmrs/module/addresshierarchy/ajax/getOrderedAddressHierarchyLevels.form", Rh = ae + "/relationshiptype?v=custom:(aIsToB,bIsToA,uuid)", Th = 20, Ph = 2, ev = 120, tv = 50, rv = 15, Ah = /^[a-f0-9-]{36}$/i, Oh = (e) => Fu + `/patientImage?patientUuid=${e}`, $h = ae + "/personattributetype?v=custom:(uuid,name,sortWeight,description,format,concept:(uuid,display,answers:(uuid,name)))", Nh = async (e) => {
6695
+ }, Sh = "/openmrs/module/addresshierarchy/ajax/getOrderedAddressHierarchyLevels.form", Rh = ne + "/relationshiptype?v=custom:(aIsToB,bIsToA,uuid)", Th = 20, Ph = 2, rv = 120, nv = 50, sv = 15, Ah = /^[a-f0-9-]{36}$/i, Oh = (e) => Fu + `/patientImage?patientUuid=${e}`, $h = ne + "/personattributetype?v=custom:(uuid,name,sortWeight,description,format,concept:(uuid,display,answers:(uuid,name)))", Nh = async (e) => {
6696
6696
  if (!e || e.trim() === "")
6697
6697
  throw new Error("Invalid patient UUID: UUID cannot be empty");
6698
6698
  if (!Ah.test(e))
6699
6699
  throw new Error(`Invalid patient UUID format: ${e}`);
6700
- return X(ph(e));
6700
+ return K(ph(e));
6701
6701
  }, Dh = (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) : []), Ih = (e) => {
6702
6702
  if (!e.name || e.name.length === 0)
6703
6703
  return null;
@@ -6728,22 +6728,22 @@ const Vn = () => {
6728
6728
  identifiers: s,
6729
6729
  age: a
6730
6730
  };
6731
- }, nv = async (e) => {
6731
+ }, av = async (e) => {
6732
6732
  const t = await Nh(e);
6733
6733
  return Lh(t);
6734
- }, sv = async (e) => {
6734
+ }, ov = async (e) => {
6735
6735
  const t = await fetch(Oh(e));
6736
6736
  if (!t.ok) return null;
6737
6737
  const r = await t.blob();
6738
6738
  return await lh(r);
6739
- }, av = async (e, t) => {
6739
+ }, iv = async (e, t) => {
6740
6740
  const r = Vn();
6741
- return await X(
6741
+ return await K(
6742
6742
  mh(e, r.uuid, t)
6743
6743
  );
6744
- }, ov = async (e, t, r, n, s) => {
6744
+ }, cv = async (e, t, r, n, s) => {
6745
6745
  const a = Vn();
6746
- return await X(
6746
+ return await K(
6747
6747
  gh(
6748
6748
  e,
6749
6749
  t,
@@ -6752,11 +6752,11 @@ const Vn = () => {
6752
6752
  a.uuid
6753
6753
  )
6754
6754
  );
6755
- }, iv = async () => X(oi), Mh = async () => (await X(yh("core"))).find(
6755
+ }, uv = async () => K(oi), Mh = async () => (await K(yh("core"))).find(
6756
6756
  (r) => r.property === vh
6757
- )?.value ?? null, cv = async () => {
6757
+ )?.value ?? null, lv = async () => {
6758
6758
  const [e, t] = await Promise.all([
6759
- X(oi),
6759
+ K(oi),
6760
6760
  Mh()
6761
6761
  ]), r = [], n = /* @__PURE__ */ new Map();
6762
6762
  if (!t)
@@ -6771,14 +6771,14 @@ const Vn = () => {
6771
6771
  sourcesByPrefix: n,
6772
6772
  primaryIdentifierTypeUuid: t
6773
6773
  }) : { prefixes: r, sourcesByPrefix: n, primaryIdentifierTypeUuid: t };
6774
- }, uv = async (e) => ht(wh, e), lv = async (e, t) => ht(
6774
+ }, dv = async (e) => ht(wh, e), fv = async (e, t) => ht(
6775
6775
  bh(e),
6776
6776
  t
6777
- ), dv = async () => X(Vo("mrs.genders")), fv = async (e, t, r = Th, n) => {
6777
+ ), hv = async () => K(Vo("mrs.genders")), pv = async (e, t, r = Th, n) => {
6778
6778
  if (!t || t.length < Ph)
6779
6779
  return [];
6780
6780
  try {
6781
- return await X(
6781
+ return await K(
6782
6782
  _h(e, t, r, n)
6783
6783
  );
6784
6784
  } catch (s) {
@@ -6786,9 +6786,9 @@ const Vn = () => {
6786
6786
  `Failed to fetch address hierarchy for field "${e}": ${s instanceof Error ? s.message : "Unknown error"}`
6787
6787
  );
6788
6788
  }
6789
- }, hv = async () => X(Sh), pv = async (e) => X(Eh(e)), mv = async () => {
6789
+ }, mv = async () => K(Sh), gv = async (e) => K(Eh(e)), yv = async () => {
6790
6790
  try {
6791
- return (await X(
6791
+ return (await K(
6792
6792
  Rh
6793
6793
  )).results.map((t) => ({
6794
6794
  uuid: t.uuid,
@@ -6800,9 +6800,9 @@ const Vn = () => {
6800
6800
  `Failed to fetch relationship types: ${e instanceof Error ? e.message : "Unknown error"}`
6801
6801
  );
6802
6802
  }
6803
- }, gv = async () => X($h);
6803
+ }, vv = async () => K($h);
6804
6804
  var xh = /* @__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))(xh || {}), qh = /* @__PURE__ */ ((e) => (e.CHECKBOX = "checkbox", e.DROPDOWN = "dropdown", e.TEXT = "text", e.NUMBER = "number", e.DATE = "date", e))(qh || {});
6805
- const yv = (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", vv = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype.datatype.BooleanDatatype", wv = (e) => e === "org.openmrs.Concept" || e === "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype" || e === "org.openmrs.customdatatype.datatype.ConceptDatatype", bv = (e) => e === "java.lang.Integer" || e === "java.lang.Float", Ev = (e) => e === "org.openmrs.util.AttributableDate" || e === "org.openmrs.customdatatype.datatype.DateDatatype", _v = (e) => e === "java.lang.String" || e === "org.openmrs.customdatatype.datatype.FreeTextDatatype" || e === "org.openmrs.customdatatype.datatype.RegexValidatedTextDatatype", jh = (e) => {
6805
+ const wv = (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", bv = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype.datatype.BooleanDatatype", Ev = (e) => e === "org.openmrs.Concept" || e === "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype" || e === "org.openmrs.customdatatype.datatype.ConceptDatatype", _v = (e) => e === "java.lang.Integer" || e === "java.lang.Float", Sv = (e) => e === "org.openmrs.util.AttributableDate" || e === "org.openmrs.customdatatype.datatype.DateDatatype", Rv = (e) => e === "java.lang.String" || e === "org.openmrs.customdatatype.datatype.FreeTextDatatype" || e === "org.openmrs.customdatatype.datatype.RegexValidatedTextDatatype", jh = (e) => {
6806
6806
  const t = new CustomEvent("bahmni-audit-log", { detail: e });
6807
6807
  window.dispatchEvent(t);
6808
6808
  }, Uh = (e) => {
@@ -6853,12 +6853,12 @@ const yv = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype
6853
6853
  eventType: "VIEWED_RADIOLOGY_RESULTS",
6854
6854
  message: "VIEWED_RADIOLOGY_RESULTS_MESSAGE"
6855
6855
  }
6856
- }, Fh = ae + "/auditlog", Vh = {
6856
+ }, Fh = ne + "/auditlog", Vh = {
6857
6857
  UNKNOWN_EVENT_TYPE: "AUDIT_LOG_ERROR_UNKNOWN_EVENT_TYPE"
6858
- }, Hh = () => ae + "/bahmnicore/config/bahmniencounter?callerContext=REGISTRATION_CONCEPTS", Bh = ae + "/visit", zh = (e) => ae + `/visit?patient=${e}&includeInactive=false&v=custom:(uuid,visitType,startDatetime,stopDatetime)`, Wh = (e) => ae + `/bahmnicore/visitLocation/${e}`, Sv = async () => X(Hh()), Gh = async (e) => X(zh(e)), Kh = async (e) => X(Wh(e)), Yh = async (e) => ht(Bh, e), Rv = async (e) => {
6858
+ }, Hh = () => ne + "/bahmnicore/config/bahmniencounter?callerContext=REGISTRATION_CONCEPTS", Bh = ne + "/visit", zh = (e) => ne + `/visit?patient=${e}&includeInactive=false&v=custom:(uuid,visitType,startDatetime,stopDatetime)`, Wh = (e) => ne + `/bahmnicore/visitLocation/${e}`, Tv = async () => K(Hh()), Gh = async (e) => K(zh(e)), Kh = async (e) => K(Wh(e)), Yh = async (e) => ht(Bh, e), Pv = async (e) => {
6859
6859
  const t = await Gh(e);
6860
6860
  return t?.results && t.results.length > 0;
6861
- }, Tv = async (e, t) => {
6861
+ }, Av = async (e, t) => {
6862
6862
  const r = await Kh(
6863
6863
  Vn().uuid
6864
6864
  ), n = {
@@ -6872,15 +6872,15 @@ const yv = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype
6872
6872
  messageParams: { visitType: t.name },
6873
6873
  module: Cn.OPEN_VISIT.module
6874
6874
  }), s;
6875
- }, Jh = ae + "/appointments/search", ii = ae + "/appointments", Pv = async (e) => await ht(
6875
+ }, Jh = ne + "/appointments/search", ii = ne + "/appointments", Ov = async (e) => await ht(
6876
6876
  Jh,
6877
6877
  e
6878
- ), Av = async (e, t, r) => await ht(
6878
+ ), $v = async (e, t, r) => await ht(
6879
6879
  `${ii}/${e}/status-change`,
6880
6880
  { toStatus: t, onDate: r }
6881
6881
  );
6882
- async function Ov(e) {
6883
- return await X(`${ii}/${e}`);
6882
+ async function Nv(e) {
6883
+ return await K(`${ii}/${e}`);
6884
6884
  }
6885
6885
  const Xh = () => {
6886
6886
  let e = null;
@@ -6911,18 +6911,18 @@ const Xh = () => {
6911
6911
  );
6912
6912
  }
6913
6913
  };
6914
- }, on = Xh(), Qh = (e) => De + `/ValueSet/${e}/$expand`, Zh = (e) => De + `/ValueSet/$expand?filter=${encodeURIComponent(e)}`, ep = (e, t, r) => ae + `/bahmni/terminologies/concepts?limit=${t}&locale=${r}&term=${e}`, tp = (e) => ae + `/concept/${e}`, $v = async (e, t = 20) => {
6914
+ }, on = Xh(), Qh = (e) => De + `/ValueSet/${e}/$expand`, Zh = (e) => De + `/ValueSet/$expand?filter=${encodeURIComponent(e)}`, ep = (e, t, r) => ne + `/bahmni/terminologies/concepts?limit=${t}&locale=${r}&term=${e}`, tp = (e) => ne + `/concept/${e}`, Dv = async (e, t = 20) => {
6915
6915
  const r = Nt(), n = ep(e, t, r);
6916
- return X(n);
6916
+ return K(n);
6917
6917
  }, _r = async (e) => {
6918
6918
  const t = Qh(e);
6919
- return X(t);
6919
+ return K(t);
6920
6920
  }, rp = async (e) => {
6921
6921
  const t = `${Zh(e)}`;
6922
- return X(t);
6922
+ return K(t);
6923
6923
  };
6924
- async function Nv(e) {
6925
- return await X(tp(e));
6924
+ async function Iv(e) {
6925
+ return await K(tp(e));
6926
6926
  }
6927
6927
  const np = (e) => De + `/AllergyIntolerance?patient=${e}&_count=100&_sort=-_lastUpdated`, rt = {
6928
6928
  FOOD: {
@@ -6946,7 +6946,7 @@ const np = (e) => De + `/AllergyIntolerance?patient=${e}&_count=100&_sort=-_last
6946
6946
  }), cn = (e, t) => {
6947
6947
  const r = e.expansion?.contains ?? [];
6948
6948
  return ap(r).map((s) => op(s, t));
6949
- }, Dv = async (e, t, r) => {
6949
+ }, Cv = async (e, t, r) => {
6950
6950
  const n = e ?? rt.MEDICATION.code, s = t ?? rt.FOOD.code, a = r ?? rt.ENVIRONMENT.code, [o, i, c] = await Promise.all([
6951
6951
  _r(n),
6952
6952
  _r(s),
@@ -6966,12 +6966,12 @@ const np = (e) => De + `/AllergyIntolerance?patient=${e}&_count=100&_sort=-_last
6966
6966
  rt.ENVIRONMENT.display
6967
6967
  )
6968
6968
  ];
6969
- }, Iv = async (e) => {
6969
+ }, kv = async (e) => {
6970
6970
  const t = e ?? sp.code;
6971
6971
  return (await _r(t)).compose?.include[0]?.concept ?? [];
6972
6972
  };
6973
6973
  async function ip(e) {
6974
- return await X(`${np(e)}`);
6974
+ return await K(`${np(e)}`);
6975
6975
  }
6976
6976
  async function cp(e) {
6977
6977
  return (await ip(e)).entry?.map(
@@ -7000,19 +7000,19 @@ function up(e) {
7000
7000
  };
7001
7001
  });
7002
7002
  }
7003
- async function Cv(e) {
7003
+ async function Lv(e) {
7004
7004
  const t = await cp(e);
7005
7005
  return up(t);
7006
7006
  }
7007
7007
  var lp = /* @__PURE__ */ ((e) => (e.Active = "Active", e.Inactive = "Inactive", e))(lp || {}), dp = /* @__PURE__ */ ((e) => (e.mild = "mild", e.moderate = "moderate", e.severe = "severe", e))(dp || {});
7008
- const kv = "http://fhir.openmrs.org/code-system/encounter-type", fp = "problem-list-item", Lv = "http://terminology.hl7.org/CodeSystem/condition-ver-status", hp = "encounter-diagnosis", Mv = "http://terminology.hl7.org/CodeSystem/condition-clinical", xv = "http://terminology.hl7.org/CodeSystem/condition-category", qv = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", jv = "http://fhir.bahmni.org/ext/observation/form-namespace-path", Uv = "http://fhir.bahmni.org/ext/observation/complex-data", Fv = "Numeric", Vv = "Complex", Hv = "final", Bv = "Observation", zv = /^\d{4}-\d{2}-\d{2}/, pp = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/, Wv = {
7008
+ const Mv = "http://fhir.openmrs.org/code-system/encounter-type", fp = "problem-list-item", xv = "http://terminology.hl7.org/CodeSystem/condition-ver-status", hp = "encounter-diagnosis", qv = "http://terminology.hl7.org/CodeSystem/condition-clinical", jv = "http://terminology.hl7.org/CodeSystem/condition-category", Uv = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", Fv = "http://fhir.bahmni.org/ext/observation/form-namespace-path", Vv = "http://fhir.bahmni.org/ext/observation/complex-data", Hv = "Numeric", Bv = "Complex", zv = "final", Wv = "Observation", Gv = /^\d{4}-\d{2}-\d{2}/, pp = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/, Kv = {
7009
7009
  ABNORMAL: { code: "A", display: "Abnormal" },
7010
7010
  NORMAL: { code: "N", display: "Normal" }
7011
7011
  }, mp = (e) => De + `/Condition?category=${fp}&patient=${e}&_count=100&_sort=-_lastUpdated`;
7012
7012
  async function gp(e) {
7013
- return await X(`${mp(e)}`);
7013
+ return await K(`${mp(e)}`);
7014
7014
  }
7015
- async function Gv(e) {
7015
+ async function Yv(e) {
7016
7016
  return (await gp(e)).entry?.filter((n) => n.resource?.resourceType === "Condition").map((n) => n.resource) ?? [];
7017
7017
  }
7018
7018
  const yp = (e) => De + `/Condition?category=${hp}&patient=${e}&_count=100&_sort=-_lastUpdated`, un = [
@@ -7029,7 +7029,7 @@ const yp = (e) => De + `/Condition?category=${hp}&patient=${e}&_count=100&_sort=
7029
7029
  ], vp = "confirmed", wp = "provisional";
7030
7030
  async function bp(e) {
7031
7031
  const t = yp(e);
7032
- return await X(t);
7032
+ return await K(t);
7033
7033
  }
7034
7034
  const Ep = (e) => {
7035
7035
  switch (e.verificationStatus?.coding?.[0]?.code) {
@@ -7055,7 +7055,7 @@ function Sp(e) {
7055
7055
  };
7056
7056
  });
7057
7057
  }
7058
- async function Kv(e) {
7058
+ async function Jv(e) {
7059
7059
  const t = await bp(e);
7060
7060
  return Sp(t);
7061
7061
  }
@@ -7082,7 +7082,7 @@ const Rp = (e) => De + `/MedicationRequest?patient=${e}&_count=100&_sort=-_lastU
7082
7082
  };
7083
7083
  async function Pp(e) {
7084
7084
  const t = Rp(e);
7085
- return await X(t);
7085
+ return await K(t);
7086
7086
  }
7087
7087
  function Ap(e) {
7088
7088
  const t = e?.[0]?.doseAndRate?.[0]?.doseQuantity;
@@ -7154,7 +7154,7 @@ function kp(e) {
7154
7154
  });
7155
7155
  }
7156
7156
  const Ws = (e) => e.priority === "stat" || e.dosageInstruction?.[0]?.timing?.code?.text === "Immediately" || !1;
7157
- async function Yv(e) {
7157
+ async function Xv(e) {
7158
7158
  const t = await Pp(e);
7159
7159
  return kp(t);
7160
7160
  }
@@ -7164,7 +7164,7 @@ const Lp = (e, t, r, n, s) => {
7164
7164
  };
7165
7165
  async function Vr(e, t, r, n, s) {
7166
7166
  let a;
7167
- return r && r.length > 0 && (a = r.join(",")), await X(
7167
+ return r && r.length > 0 && (a = r.join(",")), await K(
7168
7168
  Lp(
7169
7169
  e,
7170
7170
  t,
@@ -7174,7 +7174,7 @@ async function Vr(e, t, r, n, s) {
7174
7174
  )
7175
7175
  );
7176
7176
  }
7177
- async function Jv(e, t, r, n) {
7177
+ async function Qv(e, t, r, n) {
7178
7178
  return await Vr(
7179
7179
  t,
7180
7180
  e,
@@ -7182,7 +7182,7 @@ async function Jv(e, t, r, n) {
7182
7182
  n
7183
7183
  );
7184
7184
  }
7185
- async function Xv(e, t, r, n) {
7185
+ async function Zv(e, t, r, n) {
7186
7186
  return await Vr(
7187
7187
  t,
7188
7188
  e,
@@ -7191,7 +7191,7 @@ async function Xv(e, t, r, n) {
7191
7191
  "ImagingStudy:basedon"
7192
7192
  );
7193
7193
  }
7194
- async function Qv(e, t, r, n) {
7194
+ async function ew(e, t, r, n) {
7195
7195
  return (await Vr(
7196
7196
  t,
7197
7197
  e,
@@ -7250,7 +7250,7 @@ function Up(e, t) {
7250
7250
  };
7251
7251
  });
7252
7252
  }
7253
- function Zv(e) {
7253
+ function tw(e) {
7254
7254
  const t = /* @__PURE__ */ new Map();
7255
7255
  return e.forEach((r) => {
7256
7256
  const n = r.orderedDate.split("T")[0];
@@ -7263,7 +7263,7 @@ function Zv(e) {
7263
7263
  (r, n) => new Date(n.rawDate).getTime() - new Date(r.rawDate).getTime()
7264
7264
  );
7265
7265
  }
7266
- async function ew(e, t, r, n, s) {
7266
+ async function rw(e, t, r, n, s) {
7267
7267
  const a = await Vr(
7268
7268
  t,
7269
7269
  e,
@@ -7272,7 +7272,7 @@ async function ew(e, t, r, n, s) {
7272
7272
  ), o = qp(a);
7273
7273
  return Up(o, r);
7274
7274
  }
7275
- const Fp = "All Orderables", Vp = "/openmrs/ws/rest/v1/ordertype?v=custom:(uuid,display,conceptClasses:(uuid,name))", Hp = "LabSet", Bp = "http://fhir.bahmni.org/ext/ValueSet/concept-class", tw = ["orderTypes"], zp = async () => await rp(Fp), ci = async () => await X(Vp), Wp = (e) => {
7275
+ const Fp = "All Orderables", Vp = "/openmrs/ws/rest/v1/ordertype?v=custom:(uuid,display,conceptClasses:(uuid,name))", Hp = "LabSet", Bp = "http://fhir.bahmni.org/ext/ValueSet/concept-class", nw = ["orderTypes"], zp = async () => await rp(Fp), ci = async () => await K(Vp), Wp = (e) => {
7276
7276
  let t = e.display ?? "Unknown investigation";
7277
7277
  return ui(e) === Hp && (t += ` (${oe.t("INVESTIGATION_PANEL")})`), t;
7278
7278
  }, Gp = (e) => {
@@ -7304,10 +7304,10 @@ const Fp = "All Orderables", Vp = "/openmrs/ws/rest/v1/ordertype?v=custom:(uuid,
7304
7304
  });
7305
7305
  });
7306
7306
  }), r;
7307
- }, rw = async () => {
7307
+ }, sw = async () => {
7308
7308
  const e = await zp(), t = await ci();
7309
7309
  return Kp(e, Gp(t));
7310
- }, nw = async (e) => e ? (await ci()).results.find(
7310
+ }, aw = async (e) => e ? (await ci()).results.find(
7311
7311
  (n) => n.display.toLowerCase() === e.toLowerCase()
7312
7312
  )?.uuid : void 0;
7313
7313
  function Yp(e) {
@@ -7716,7 +7716,7 @@ function Q() {
7716
7716
  let V = I.length;
7717
7717
  for (; V--; ) {
7718
7718
  const B = I[V];
7719
- B.optimizeNames(w, T) || (K(w, B.names), I.splice(V, 1));
7719
+ B.optimizeNames(w, T) || (Y(w, B.names), I.splice(V, 1));
7720
7720
  }
7721
7721
  return I.length > 0 ? this : void 0;
7722
7722
  }
@@ -8095,7 +8095,7 @@ function Q() {
8095
8095
  return B instanceof t._Code && B._items.some((re) => re instanceof t.Name && w[re.str] === 1 && T[re.str] !== void 0);
8096
8096
  }
8097
8097
  }
8098
- function K(N, w) {
8098
+ function Y(N, w) {
8099
8099
  for (const T in w)
8100
8100
  N[T] = (N[T] || 0) - (w[T] || 0);
8101
8101
  }
@@ -8121,10 +8121,10 @@ function Q() {
8121
8121
  }
8122
8122
  })(fn)), fn;
8123
8123
  }
8124
- var Y = {}, Xs;
8124
+ var J = {}, Xs;
8125
8125
  function te() {
8126
- if (Xs) return Y;
8127
- Xs = 1, Object.defineProperty(Y, "__esModule", { value: !0 }), Y.checkStrictMode = Y.getErrorPath = Y.Type = Y.useFunc = Y.setEvaluated = Y.evaluatedPropsToName = Y.mergeEvaluated = Y.eachItem = Y.unescapeJsonPointer = Y.escapeJsonPointer = Y.escapeFragment = Y.unescapeFragment = Y.schemaRefOrVal = Y.schemaHasRulesButRef = Y.schemaHasRules = Y.checkUnknownRules = Y.alwaysValidSchema = Y.toHash = void 0;
8126
+ if (Xs) return J;
8127
+ Xs = 1, Object.defineProperty(J, "__esModule", { value: !0 }), J.checkStrictMode = J.getErrorPath = J.Type = J.useFunc = J.setEvaluated = J.evaluatedPropsToName = J.mergeEvaluated = J.eachItem = J.unescapeJsonPointer = J.escapeJsonPointer = J.escapeFragment = J.unescapeFragment = J.schemaRefOrVal = J.schemaHasRulesButRef = J.schemaHasRules = J.checkUnknownRules = J.alwaysValidSchema = J.toHash = void 0;
8128
8128
  const e = Q(), t = Dr();
8129
8129
  function r(_) {
8130
8130
  const E = {};
@@ -8132,11 +8132,11 @@ function te() {
8132
8132
  E[S] = !0;
8133
8133
  return E;
8134
8134
  }
8135
- Y.toHash = r;
8135
+ J.toHash = r;
8136
8136
  function n(_, E) {
8137
8137
  return typeof E == "boolean" ? E : Object.keys(E).length === 0 ? !0 : (s(_, E), !a(E, _.self.RULES.all));
8138
8138
  }
8139
- Y.alwaysValidSchema = n;
8139
+ J.alwaysValidSchema = n;
8140
8140
  function s(_, E = _.schema) {
8141
8141
  const { opts: S, self: O } = _;
8142
8142
  if (!S.strictSchema || typeof E == "boolean")
@@ -8145,7 +8145,7 @@ function te() {
8145
8145
  for (const j in E)
8146
8146
  L[j] || b(_, `unknown keyword: "${j}"`);
8147
8147
  }
8148
- Y.checkUnknownRules = s;
8148
+ J.checkUnknownRules = s;
8149
8149
  function a(_, E) {
8150
8150
  if (typeof _ == "boolean")
8151
8151
  return !_;
@@ -8154,7 +8154,7 @@ function te() {
8154
8154
  return !0;
8155
8155
  return !1;
8156
8156
  }
8157
- Y.schemaHasRules = a;
8157
+ J.schemaHasRules = a;
8158
8158
  function o(_, E) {
8159
8159
  if (typeof _ == "boolean")
8160
8160
  return !_;
@@ -8163,7 +8163,7 @@ function te() {
8163
8163
  return !0;
8164
8164
  return !1;
8165
8165
  }
8166
- Y.schemaHasRulesButRef = o;
8166
+ J.schemaHasRulesButRef = o;
8167
8167
  function i({ topSchemaRef: _, schemaPath: E }, S, O, L) {
8168
8168
  if (!L) {
8169
8169
  if (typeof S == "number" || typeof S == "boolean")
@@ -8173,23 +8173,23 @@ function te() {
8173
8173
  }
8174
8174
  return (0, e._)`${_}${E}${(0, e.getProperty)(O)}`;
8175
8175
  }
8176
- Y.schemaRefOrVal = i;
8176
+ J.schemaRefOrVal = i;
8177
8177
  function c(_) {
8178
8178
  return m(decodeURIComponent(_));
8179
8179
  }
8180
- Y.unescapeFragment = c;
8180
+ J.unescapeFragment = c;
8181
8181
  function d(_) {
8182
8182
  return encodeURIComponent(l(_));
8183
8183
  }
8184
- Y.escapeFragment = d;
8184
+ J.escapeFragment = d;
8185
8185
  function l(_) {
8186
8186
  return typeof _ == "number" ? `${_}` : _.replace(/~/g, "~0").replace(/\//g, "~1");
8187
8187
  }
8188
- Y.escapeJsonPointer = l;
8188
+ J.escapeJsonPointer = l;
8189
8189
  function m(_) {
8190
8190
  return _.replace(/~1/g, "/").replace(/~0/g, "~");
8191
8191
  }
8192
- Y.unescapeJsonPointer = m;
8192
+ J.unescapeJsonPointer = m;
8193
8193
  function y(_, E) {
8194
8194
  if (Array.isArray(_))
8195
8195
  for (const S of _)
@@ -8197,14 +8197,14 @@ function te() {
8197
8197
  else
8198
8198
  E(_);
8199
8199
  }
8200
- Y.eachItem = y;
8200
+ J.eachItem = y;
8201
8201
  function R({ mergeNames: _, mergeToName: E, mergeValues: S, resultToName: O }) {
8202
8202
  return (L, j, q, U) => {
8203
8203
  const F = q === void 0 ? j : q instanceof e.Name ? (j instanceof e.Name ? _(L, j, q) : E(L, j, q), q) : j instanceof e.Name ? (E(L, q, j), j) : S(j, q);
8204
8204
  return U === e.Name && !(F instanceof e.Name) ? O(L, F) : F;
8205
8205
  };
8206
8206
  }
8207
- Y.mergeEvaluated = {
8207
+ J.mergeEvaluated = {
8208
8208
  props: R({
8209
8209
  mergeNames: (_, E, S) => _.if((0, e._)`${S} !== true && ${E} !== undefined`, () => {
8210
8210
  _.if((0, e._)`${E} === true`, () => _.assign(S, !0), () => _.assign(S, (0, e._)`${S} || {}`).code((0, e._)`Object.assign(${S}, ${E})`));
@@ -8228,11 +8228,11 @@ function te() {
8228
8228
  const S = _.var("props", (0, e._)`{}`);
8229
8229
  return E !== void 0 && g(_, S, E), S;
8230
8230
  }
8231
- Y.evaluatedPropsToName = v;
8231
+ J.evaluatedPropsToName = v;
8232
8232
  function g(_, E, S) {
8233
8233
  Object.keys(S).forEach((O) => _.assign((0, e._)`${E}${(0, e.getProperty)(O)}`, !0));
8234
8234
  }
8235
- Y.setEvaluated = g;
8235
+ J.setEvaluated = g;
8236
8236
  const f = {};
8237
8237
  function h(_, E) {
8238
8238
  return _.scopeValue("func", {
@@ -8240,11 +8240,11 @@ function te() {
8240
8240
  code: f[E.code] || (f[E.code] = new t._Code(E.code))
8241
8241
  });
8242
8242
  }
8243
- Y.useFunc = h;
8243
+ J.useFunc = h;
8244
8244
  var u;
8245
8245
  (function(_) {
8246
8246
  _[_.Num = 0] = "Num", _[_.Str = 1] = "Str";
8247
- })(u || (Y.Type = u = {}));
8247
+ })(u || (J.Type = u = {}));
8248
8248
  function p(_, E, S) {
8249
8249
  if (_ instanceof e.Name) {
8250
8250
  const O = E === u.Num;
@@ -8252,7 +8252,7 @@ function te() {
8252
8252
  }
8253
8253
  return S ? (0, e.getProperty)(_).toString() : "/" + l(_);
8254
8254
  }
8255
- Y.getErrorPath = p;
8255
+ J.getErrorPath = p;
8256
8256
  function b(_, E, S = _.opts.strictSchema) {
8257
8257
  if (S) {
8258
8258
  if (E = `strict mode: ${E}`, S === !0)
@@ -8260,7 +8260,7 @@ function te() {
8260
8260
  _.self.logger.warn(E);
8261
8261
  }
8262
8262
  }
8263
- return Y.checkStrictMode = b, Y;
8263
+ return J.checkStrictMode = b, J;
8264
8264
  }
8265
8265
  var Mt = {}, Qs;
8266
8266
  function Fe() {
@@ -8625,10 +8625,10 @@ function Xp() {
8625
8625
  }
8626
8626
  return wt;
8627
8627
  }
8628
- var $e = {}, ne = {}, aa;
8628
+ var $e = {}, se = {}, aa;
8629
8629
  function Ie() {
8630
- if (aa) return ne;
8631
- aa = 1, Object.defineProperty(ne, "__esModule", { value: !0 }), ne.validateUnion = ne.validateArray = ne.usePattern = ne.callValidateCode = ne.schemaProperties = ne.allSchemaProperties = ne.noPropertyInData = ne.propertyInData = ne.isOwnProperty = ne.hasPropFunc = ne.reportMissingProp = ne.checkMissingProp = ne.checkReportMissingProp = void 0;
8630
+ if (aa) return se;
8631
+ aa = 1, Object.defineProperty(se, "__esModule", { value: !0 }), se.validateUnion = se.validateArray = se.usePattern = se.callValidateCode = se.schemaProperties = se.allSchemaProperties = se.noPropertyInData = se.propertyInData = se.isOwnProperty = se.hasPropFunc = se.reportMissingProp = se.checkMissingProp = se.checkReportMissingProp = void 0;
8632
8632
  const e = Q(), t = te(), r = Fe(), n = te();
8633
8633
  function s(u, p) {
8634
8634
  const { gen: b, data: _, it: E } = u;
@@ -8636,15 +8636,15 @@ function Ie() {
8636
8636
  u.setParams({ missingProperty: (0, e._)`${p}` }, !0), u.error();
8637
8637
  });
8638
8638
  }
8639
- ne.checkReportMissingProp = s;
8639
+ se.checkReportMissingProp = s;
8640
8640
  function a({ gen: u, data: p, it: { opts: b } }, _, E) {
8641
8641
  return (0, e.or)(..._.map((S) => (0, e.and)(l(u, p, S, b.ownProperties), (0, e._)`${E} = ${S}`)));
8642
8642
  }
8643
- ne.checkMissingProp = a;
8643
+ se.checkMissingProp = a;
8644
8644
  function o(u, p) {
8645
8645
  u.setParams({ missingProperty: p }, !0), u.error();
8646
8646
  }
8647
- ne.reportMissingProp = o;
8647
+ se.reportMissingProp = o;
8648
8648
  function i(u) {
8649
8649
  return u.scopeValue("func", {
8650
8650
  // eslint-disable-next-line @typescript-eslint/unbound-method
@@ -8652,29 +8652,29 @@ function Ie() {
8652
8652
  code: (0, e._)`Object.prototype.hasOwnProperty`
8653
8653
  });
8654
8654
  }
8655
- ne.hasPropFunc = i;
8655
+ se.hasPropFunc = i;
8656
8656
  function c(u, p, b) {
8657
8657
  return (0, e._)`${i(u)}.call(${p}, ${b})`;
8658
8658
  }
8659
- ne.isOwnProperty = c;
8659
+ se.isOwnProperty = c;
8660
8660
  function d(u, p, b, _) {
8661
8661
  const E = (0, e._)`${p}${(0, e.getProperty)(b)} !== undefined`;
8662
8662
  return _ ? (0, e._)`${E} && ${c(u, p, b)}` : E;
8663
8663
  }
8664
- ne.propertyInData = d;
8664
+ se.propertyInData = d;
8665
8665
  function l(u, p, b, _) {
8666
8666
  const E = (0, e._)`${p}${(0, e.getProperty)(b)} === undefined`;
8667
8667
  return _ ? (0, e.or)(E, (0, e.not)(c(u, p, b))) : E;
8668
8668
  }
8669
- ne.noPropertyInData = l;
8669
+ se.noPropertyInData = l;
8670
8670
  function m(u) {
8671
8671
  return u ? Object.keys(u).filter((p) => p !== "__proto__") : [];
8672
8672
  }
8673
- ne.allSchemaProperties = m;
8673
+ se.allSchemaProperties = m;
8674
8674
  function y(u, p) {
8675
8675
  return m(p).filter((b) => !(0, t.alwaysValidSchema)(u, p[b]));
8676
8676
  }
8677
- ne.schemaProperties = y;
8677
+ se.schemaProperties = y;
8678
8678
  function R({ schemaCode: u, data: p, it: { gen: b, topSchemaRef: _, schemaPath: E, errorPath: S }, it: O }, L, j, q) {
8679
8679
  const U = q ? (0, e._)`${u}, ${p}, ${_}${E}` : p, F = [
8680
8680
  [r.default.instancePath, (0, e.strConcat)(r.default.instancePath, S)],
@@ -8686,7 +8686,7 @@ function Ie() {
8686
8686
  const z = (0, e._)`${U}, ${b.object(...F)}`;
8687
8687
  return j !== e.nil ? (0, e._)`${L}.call(${j}, ${z})` : (0, e._)`${L}(${z})`;
8688
8688
  }
8689
- ne.callValidateCode = R;
8689
+ se.callValidateCode = R;
8690
8690
  const v = (0, e._)`new RegExp`;
8691
8691
  function g({ gen: u, it: { opts: p } }, b) {
8692
8692
  const _ = p.unicodeRegExp ? "u" : "", { regExp: E } = p.code, S = E(b, _);
@@ -8696,7 +8696,7 @@ function Ie() {
8696
8696
  code: (0, e._)`${E.code === "new RegExp" ? v : (0, n.useFunc)(u, E)}(${b}, ${_})`
8697
8697
  });
8698
8698
  }
8699
- ne.usePattern = g;
8699
+ se.usePattern = g;
8700
8700
  function f(u) {
8701
8701
  const { gen: p, data: b, keyword: _, it: E } = u, S = p.name("valid");
8702
8702
  if (E.allErrors) {
@@ -8715,7 +8715,7 @@ function Ie() {
8715
8715
  });
8716
8716
  }
8717
8717
  }
8718
- ne.validateArray = f;
8718
+ se.validateArray = f;
8719
8719
  function h(u) {
8720
8720
  const { gen: p, schema: b, keyword: _, it: E } = u;
8721
8721
  if (!Array.isArray(b))
@@ -8732,7 +8732,7 @@ function Ie() {
8732
8732
  p.assign(O, (0, e._)`${O} || ${L}`), u.mergeValidEvaluated(U, L) || p.if((0, e.not)(O));
8733
8733
  })), u.result(O, () => u.reset(), () => u.error(!0));
8734
8734
  }
8735
- return ne.validateUnion = h, ne;
8735
+ return se.validateUnion = h, se;
8736
8736
  }
8737
8737
  var oa;
8738
8738
  function Qp() {
@@ -8775,8 +8775,8 @@ function Qp() {
8775
8775
  return g.assign(F, null), q(e.nil), F;
8776
8776
  }
8777
8777
  function q(F = R.async ? (0, e._)`await ` : e.nil) {
8778
- const z = b.opts.passContext ? t.default.this : t.default.self, K = !("compile" in R && !p || R.schema === !1);
8779
- g.assign(S, (0, e._)`${F}${(0, r.callValidateCode)(y, E, z, K)}`, R.modifying);
8778
+ const z = b.opts.passContext ? t.default.this : t.default.self, Y = !("compile" in R && !p || R.schema === !1);
8779
+ g.assign(S, (0, e._)`${F}${(0, r.callValidateCode)(y, E, z, Y)}`, R.modifying);
8780
8780
  }
8781
8781
  function U(F) {
8782
8782
  var z;
@@ -9063,11 +9063,11 @@ function Br() {
9063
9063
  if (F === void 0)
9064
9064
  return;
9065
9065
  const z = _ + q;
9066
- let K = b[F];
9067
- typeof j[h] == "string" && (K = he.call(this, j[h])), ce.call(this, j.$anchor), ce.call(this, j.$dynamicAnchor), b[q] = K;
9066
+ let Y = b[F];
9067
+ typeof j[h] == "string" && (Y = he.call(this, j[h])), ce.call(this, j.$anchor), ce.call(this, j.$dynamicAnchor), b[q] = Y;
9068
9068
  function he(ee) {
9069
9069
  const ie = this.opts.uriResolver.resolve;
9070
- if (ee = m(K ? ie(K, ee) : ee), S.has(ee))
9070
+ if (ee = m(Y ? ie(Y, ee) : ee), S.has(ee))
9071
9071
  throw L(ee);
9072
9072
  S.add(ee);
9073
9073
  let M = this.refs[ee];
@@ -9104,10 +9104,10 @@ function zr() {
9104
9104
  R(P, () => (0, e.topBoolOrEmptySchema)(P));
9105
9105
  }
9106
9106
  Le.validateFunctionCode = y;
9107
- function R({ gen: P, validateName: $, schema: k, schemaEnv: x, opts: H }, J) {
9107
+ function R({ gen: P, validateName: $, schema: k, schemaEnv: x, opts: H }, X) {
9108
9108
  H.code.es5 ? P.func($, (0, i._)`${c.default.data}, ${c.default.valCxt}`, x.$async, () => {
9109
- P.code((0, i._)`"use strict"; ${u(k, H)}`), g(P, H), P.code(J);
9110
- }) : P.func($, (0, i._)`${c.default.data}, ${v(H)}`, x.$async, () => P.code(u(k, H)).code(J));
9109
+ P.code((0, i._)`"use strict"; ${u(k, H)}`), g(P, H), P.code(X);
9110
+ }) : P.func($, (0, i._)`${c.default.data}, ${v(H)}`, x.$async, () => P.code(u(k, H)).code(X));
9111
9111
  }
9112
9112
  function v(P) {
9113
9113
  return (0, i._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${P.dynamicRef ? (0, i._)`, ${c.default.dynamicAnchors}={}` : i.nil}}={}`;
@@ -9154,8 +9154,8 @@ function zr() {
9154
9154
  function E(P, $) {
9155
9155
  const { schema: k, gen: x, opts: H } = P;
9156
9156
  H.$comment && k.$comment && F(P), q(P), U(P);
9157
- const J = x.const("_errs", c.default.errors);
9158
- O(P, J), x.var($, (0, i._)`${J} === ${c.default.errors}`);
9157
+ const X = x.const("_errs", c.default.errors);
9158
+ O(P, X), x.var($, (0, i._)`${X} === ${c.default.errors}`);
9159
9159
  }
9160
9160
  function S(P) {
9161
9161
  (0, l.checkUnknownRules)(P), L(P);
@@ -9183,24 +9183,24 @@ function zr() {
9183
9183
  throw new Error("async schema in sync schema");
9184
9184
  }
9185
9185
  function F({ gen: P, schemaEnv: $, schema: k, errSchemaPath: x, opts: H }) {
9186
- const J = k.$comment;
9186
+ const X = k.$comment;
9187
9187
  if (H.$comment === !0)
9188
- P.code((0, i._)`${c.default.self}.logger.log(${J})`);
9188
+ P.code((0, i._)`${c.default.self}.logger.log(${X})`);
9189
9189
  else if (typeof H.$comment == "function") {
9190
9190
  const pe = (0, i.str)`${x}/$comment`, Oe = P.scopeValue("root", { ref: $.root });
9191
- P.code((0, i._)`${c.default.self}.opts.$comment(${J}, ${pe}, ${Oe}.schema)`);
9191
+ P.code((0, i._)`${c.default.self}.opts.$comment(${X}, ${pe}, ${Oe}.schema)`);
9192
9192
  }
9193
9193
  }
9194
9194
  function z(P) {
9195
- const { gen: $, schemaEnv: k, validateName: x, ValidationError: H, opts: J } = P;
9196
- k.$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), J.unevaluated && K(P), $.return((0, i._)`${c.default.errors} === 0`));
9195
+ const { gen: $, schemaEnv: k, validateName: x, ValidationError: H, opts: X } = P;
9196
+ k.$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 && Y(P), $.return((0, i._)`${c.default.errors} === 0`));
9197
9197
  }
9198
- function K({ gen: P, evaluated: $, props: k, items: x }) {
9198
+ function Y({ gen: P, evaluated: $, props: k, items: x }) {
9199
9199
  k instanceof i.Name && P.assign((0, i._)`${$}.props`, k), x instanceof i.Name && P.assign((0, i._)`${$}.items`, x);
9200
9200
  }
9201
9201
  function he(P, $, k, x) {
9202
- const { gen: H, schema: J, data: pe, allErrors: Oe, opts: be, self: Ee } = P, { RULES: me } = Ee;
9203
- if (J.$ref && (be.ignoreKeywordsWithRef || !(0, l.schemaHasRulesButRef)(J, me))) {
9202
+ const { gen: H, schema: X, data: pe, allErrors: Oe, opts: be, self: Ee } = P, { RULES: me } = Ee;
9203
+ if (X.$ref && (be.ignoreKeywordsWithRef || !(0, l.schemaHasRulesButRef)(X, me))) {
9204
9204
  H.block(() => V(P, "$ref", me.all.$ref.definition));
9205
9205
  return;
9206
9206
  }
@@ -9210,14 +9210,14 @@ function zr() {
9210
9210
  Je(me.post);
9211
9211
  });
9212
9212
  function Je(Te) {
9213
- (0, r.shouldUseGroup)(J, Te) && (Te.type ? (H.if((0, n.checkDataType)(Te.type, pe, be.strictNumbers)), ce(P, Te), $.length === 1 && $[0] === Te.type && k && (H.else(), (0, n.reportTypeError)(P)), H.endIf()) : ce(P, Te), Oe || H.if((0, i._)`${c.default.errors} === ${x || 0}`));
9213
+ (0, r.shouldUseGroup)(X, Te) && (Te.type ? (H.if((0, n.checkDataType)(Te.type, pe, be.strictNumbers)), ce(P, Te), $.length === 1 && $[0] === Te.type && k && (H.else(), (0, n.reportTypeError)(P)), H.endIf()) : ce(P, Te), Oe || H.if((0, i._)`${c.default.errors} === ${x || 0}`));
9214
9214
  }
9215
9215
  }
9216
9216
  function ce(P, $) {
9217
9217
  const { gen: k, schema: x, opts: { useDefaults: H } } = P;
9218
9218
  H && (0, s.assignDefaults)(P, $.type), k.block(() => {
9219
- for (const J of $.rules)
9220
- (0, r.shouldUseRule)(x, J) && V(P, J.keyword, J.definition, $.type);
9219
+ for (const X of $.rules)
9220
+ (0, r.shouldUseRule)(x, X) && V(P, X.keyword, X.definition, $.type);
9221
9221
  });
9222
9222
  }
9223
9223
  function ee(P, $) {
@@ -9242,8 +9242,8 @@ function zr() {
9242
9242
  for (const x in k) {
9243
9243
  const H = k[x];
9244
9244
  if (typeof H == "object" && (0, r.shouldUseRule)(P.schema, H)) {
9245
- const { type: J } = H.definition;
9246
- J.length && !J.some((pe) => C($, pe)) && T(P, `missing type "${J.join(",")}" for keyword "${x}"`);
9245
+ const { type: X } = H.definition;
9246
+ X.length && !X.some((pe) => C($, pe)) && T(P, `missing type "${X.join(",")}" for keyword "${x}"`);
9247
9247
  }
9248
9248
  }
9249
9249
  }
@@ -9325,18 +9325,18 @@ function zr() {
9325
9325
  check$data($ = i.nil, k = i.nil) {
9326
9326
  if (!this.$data)
9327
9327
  return;
9328
- const { gen: x, schemaCode: H, schemaType: J, def: pe } = this;
9329
- x.if((0, i.or)((0, i._)`${H} === undefined`, k)), $ !== i.nil && x.assign($, !0), (J.length || pe.validateSchema) && (x.elseIf(this.invalid$data()), this.$dataError(), $ !== i.nil && x.assign($, !1)), x.else();
9328
+ const { gen: x, schemaCode: H, schemaType: X, def: pe } = this;
9329
+ x.if((0, i.or)((0, i._)`${H} === undefined`, k)), $ !== i.nil && x.assign($, !0), (X.length || pe.validateSchema) && (x.elseIf(this.invalid$data()), this.$dataError(), $ !== i.nil && x.assign($, !1)), x.else();
9330
9330
  }
9331
9331
  invalid$data() {
9332
- const { gen: $, schemaCode: k, schemaType: x, def: H, it: J } = this;
9332
+ const { gen: $, schemaCode: k, schemaType: x, def: H, it: X } = this;
9333
9333
  return (0, i.or)(pe(), Oe());
9334
9334
  function pe() {
9335
9335
  if (x.length) {
9336
9336
  if (!(k instanceof i.Name))
9337
9337
  throw new Error("ajv implementation error");
9338
9338
  const be = Array.isArray(x) ? x : [x];
9339
- return (0, i._)`${(0, n.checkDataTypes)(be, k, J.opts.strictNumbers, n.DataType.Wrong)}`;
9339
+ return (0, i._)`${(0, n.checkDataTypes)(be, k, X.opts.strictNumbers, n.DataType.Wrong)}`;
9340
9340
  }
9341
9341
  return i.nil;
9342
9342
  }
@@ -9371,13 +9371,13 @@ function zr() {
9371
9371
  }
9372
9372
  const B = /^\/(?:[^~]|~0|~1)*$/, re = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
9373
9373
  function Z(P, { dataLevel: $, dataNames: k, dataPathArr: x }) {
9374
- let H, J;
9374
+ let H, X;
9375
9375
  if (P === "")
9376
9376
  return c.default.rootData;
9377
9377
  if (P[0] === "/") {
9378
9378
  if (!B.test(P))
9379
9379
  throw new Error(`Invalid JSON-pointer: ${P}`);
9380
- H = P, J = c.default.rootData;
9380
+ H = P, X = c.default.rootData;
9381
9381
  } else {
9382
9382
  const Ee = re.exec(P);
9383
9383
  if (!Ee)
@@ -9390,13 +9390,13 @@ function zr() {
9390
9390
  }
9391
9391
  if (me > $)
9392
9392
  throw new Error(be("data", me));
9393
- if (J = k[$ - me], !H)
9394
- return J;
9393
+ if (X = k[$ - me], !H)
9394
+ return X;
9395
9395
  }
9396
- let pe = J;
9396
+ let pe = X;
9397
9397
  const Oe = H.split("/");
9398
9398
  for (const Ee of Oe)
9399
- Ee && (J = (0, i._)`${J}${(0, i.getProperty)((0, l.unescapeJsonPointer)(Ee))}`, pe = (0, i._)`${pe} && ${J}`);
9399
+ Ee && (X = (0, i._)`${X}${(0, i.getProperty)((0, l.unescapeJsonPointer)(Ee))}`, pe = (0, i._)`${pe} && ${X}`);
9400
9400
  return pe;
9401
9401
  function be(Ee, me) {
9402
9402
  return `Cannot access ${Ee} ${me} levels up, current level is ${$}`;
@@ -9485,12 +9485,12 @@ function zn() {
9485
9485
  j = `${E.scopeRefs(r.default.scope)}return ${q}`, this.opts.code.process && (j = this.opts.code.process(j, f));
9486
9486
  const F = new Function(`${r.default.self}`, `${r.default.scope}`, j)(this, this.scope.get());
9487
9487
  if (this.scope.value(O, { ref: F }), F.errors = null, F.schema = f.schema, F.schemaEnv = f, f.$async && (F.$async = !0), this.opts.code.source === !0 && (F.source = { validateName: O, validateCode: q, scopeValues: E._values }), this.opts.unevaluated) {
9488
- const { props: z, items: K } = L;
9488
+ const { props: z, items: Y } = L;
9489
9489
  F.evaluated = {
9490
9490
  props: z instanceof e.Name ? void 0 : z,
9491
- items: K instanceof e.Name ? void 0 : K,
9491
+ items: Y instanceof e.Name ? void 0 : Y,
9492
9492
  dynamicProps: z instanceof e.Name,
9493
- dynamicItems: K instanceof e.Name
9493
+ dynamicItems: Y instanceof e.Name
9494
9494
  }, F.source && (F.source.evaluated = (0, e.stringify)(F.evaluated));
9495
9495
  }
9496
9496
  return f.validate = F, f;
@@ -10015,7 +10015,7 @@ function hm() {
10015
10015
  unicode: '"minLength"/"maxLength" account for unicode characters by default.'
10016
10016
  }, u = 200;
10017
10017
  function p(M) {
10018
- var A, C, N, w, T, I, V, B, re, Z, P, $, k, x, H, J, pe, Oe, be, Ee, me, Je, Te, Kr, Yr;
10018
+ var A, C, N, w, T, I, V, B, re, Z, P, $, k, x, H, X, pe, Oe, be, Ee, me, Je, Te, Kr, Yr;
10019
10019
  const mt = M.strict, Jr = (A = M.code) === null || A === void 0 ? void 0 : A.optimize, Kn = Jr === !0 || Jr === void 0 ? 1 : Jr || 0, Yn = (N = (C = M.code) === null || C === void 0 ? void 0 : C.regExp) !== null && N !== void 0 ? N : R, wi = (w = M.uriResolver) !== null && w !== void 0 ? w : y.default;
10020
10020
  return {
10021
10021
  strictSchema: (I = (T = M.strictSchema) !== null && T !== void 0 ? T : mt) !== null && I !== void 0 ? I : !0,
@@ -10025,7 +10025,7 @@ function hm() {
10025
10025
  strictRequired: (x = (k = M.strictRequired) !== null && k !== void 0 ? k : mt) !== null && x !== void 0 ? x : !1,
10026
10026
  code: M.code ? { ...M.code, optimize: Kn, regExp: Yn } : { optimize: Kn, regExp: Yn },
10027
10027
  loopRequired: (H = M.loopRequired) !== null && H !== void 0 ? H : u,
10028
- loopEnum: (J = M.loopEnum) !== null && J !== void 0 ? J : u,
10028
+ loopEnum: (X = M.loopEnum) !== null && X !== void 0 ? X : u,
10029
10029
  meta: (pe = M.meta) !== null && pe !== void 0 ? pe : !0,
10030
10030
  messages: (Oe = M.messages) !== null && Oe !== void 0 ? Oe : !0,
10031
10031
  inlineRefs: (be = M.inlineRefs) !== null && be !== void 0 ? be : !0,
@@ -10206,14 +10206,14 @@ function hm() {
10206
10206
  } else
10207
10207
  throw new Error("invalid addKeywords parameters");
10208
10208
  if (z.call(this, N, C), !C)
10209
- return (0, l.eachItem)(N, (T) => K.call(this, T)), this;
10209
+ return (0, l.eachItem)(N, (T) => Y.call(this, T)), this;
10210
10210
  ce.call(this, C);
10211
10211
  const w = {
10212
10212
  ...C,
10213
10213
  type: (0, d.getJSONTypes)(C.type),
10214
10214
  schemaType: (0, d.getJSONTypes)(C.schemaType)
10215
10215
  };
10216
- return (0, l.eachItem)(N, w.type.length === 0 ? (T) => K.call(this, T, w) : (T) => w.type.forEach((I) => K.call(this, T, w, I))), this;
10216
+ return (0, l.eachItem)(N, w.type.length === 0 ? (T) => Y.call(this, T, w) : (T) => w.type.forEach((I) => Y.call(this, T, w, I))), this;
10217
10217
  }
10218
10218
  getKeyword(A) {
10219
10219
  const C = this.RULES.all[A];
@@ -10363,7 +10363,7 @@ function hm() {
10363
10363
  }), !!A && A.$data && !("code" in A || "validate" in A))
10364
10364
  throw new Error('$data keyword must have "code" or "validate" function');
10365
10365
  }
10366
- function K(M, A, C) {
10366
+ function Y(M, A, C) {
10367
10367
  var N;
10368
10368
  const w = A?.post;
10369
10369
  if (C && w)
@@ -11739,7 +11739,7 @@ const sg = /* @__PURE__ */ Yp(ng), Gn = "/bahmni_config/openmrs/apps/clinical/v2
11739
11739
  type: Lg,
11740
11740
  additionalProperties: Mg,
11741
11741
  properties: xg
11742
- }, sw = async () => Gr(og, yg), aw = async (e) => {
11742
+ }, ow = async () => Gr(og, yg), iw = async (e) => {
11743
11743
  const t = await Gr(
11744
11744
  ug(e),
11745
11745
  Tg
@@ -11748,10 +11748,10 @@ const sg = /* @__PURE__ */ Yp(ng), Gn = "/bahmni_config/openmrs/apps/clinical/v2
11748
11748
  ...r,
11749
11749
  id: ch()
11750
11750
  })), t;
11751
- }, ow = async () => Gr(
11751
+ }, cw = async () => Gr(
11752
11752
  cg,
11753
11753
  Dg
11754
- ), iw = async () => Gr(
11754
+ ), uw = async () => Gr(
11755
11755
  ig,
11756
11756
  qg
11757
11757
  ), Gr = async (e, t) => {
@@ -11770,51 +11770,59 @@ const sg = /* @__PURE__ */ Yp(ng), Gn = "/bahmni_config/openmrs/apps/clinical/v2
11770
11770
  }
11771
11771
  }, jg = async (e) => {
11772
11772
  try {
11773
- return await X(e);
11773
+ return await K(e);
11774
11774
  } catch (t) {
11775
11775
  const { message: r } = ct(t);
11776
11776
  throw new Error(r);
11777
11777
  }
11778
- }, Ug = async (e, t) => new sg().compile(t)(e), Fg = (e) => ae + `/form/${e}?v=custom:(resources:(value))`, Vg = ae + "/bahmniie/form/latestPublishedForms", cw = (e) => ae + `/user/${e}?v=full`, Hg = (e, t, r, n) => ae + `/bahmniie/form/translations?formName=${encodeURIComponent(e)}&formUuid=${t}&formVersion=${r}&locale=${n}`, Rr = "Bahmni", Bg = (e) => ae + `/provider?user=${e}&v=custom:(uuid,display,person)`;
11779
- async function uw(e) {
11780
- const t = await X(
11781
- Bg(e)
11778
+ }, Ug = async (e, t) => new sg().compile(t)(e), Fg = (e) => ne + `/form/${e}?v=custom:(resources:(value))`, Vg = ne + "/bahmniie/form/latestPublishedForms", lw = (e) => ne + `/user/${e}?v=full`, Hg = (e, t, r, n) => ne + `/bahmniie/form/translations?formName=${encodeURIComponent(e)}&formUuid=${t}&formVersion=${r}&locale=${n}`, Rr = "Bahmni", Bg = (e, t, r) => {
11779
+ let s = ne + "/bahmnicore/patient/" + e + "/forms";
11780
+ return r ? s += `?patientProgramUuid=${r}` : t && (s += `?numberOfVisits=${t}`), s;
11781
+ }, zg = (e) => ne + `/provider?user=${e}&v=custom:(uuid,display,person)`;
11782
+ async function dw(e) {
11783
+ const t = await K(
11784
+ zg(e)
11782
11785
  );
11783
11786
  return !t.results || t.results.length === 0 ? null : t.results[0];
11784
11787
  }
11785
- const zg = (e) => De + `/Encounter?subject:Patient=${e}&_tag=visit`;
11786
- async function Wg(e) {
11787
- return await X(zg(e));
11788
+ const Wg = (e) => De + `/Encounter?subject:Patient=${e}&_tag=visit`, Gg = (e, t = !1) => `${ne}/bahmnicore/bahmniencounter/${e}?includeAll=${t}`;
11789
+ async function Kg(e) {
11790
+ return await K(Wg(e));
11788
11791
  }
11789
- async function Gg(e) {
11790
- return (await Wg(e)).entry?.map((r) => r.resource).filter((r) => r !== void 0) ?? [];
11792
+ async function Yg(e) {
11793
+ return (await Kg(e)).entry?.map((r) => r.resource).filter((r) => r !== void 0) ?? [];
11791
11794
  }
11792
- async function Kg(e) {
11793
- return (await Gg(e)).find((r) => !r.period?.end) ?? null;
11795
+ async function Jg(e) {
11796
+ return (await Yg(e)).find((r) => !r.period?.end) ?? null;
11794
11797
  }
11795
- const lw = (e, t) => e?.length === 0 ? !1 : t?.length === 0, Yg = De + "/Encounter", Jg = ae + "/systemsetting/bahmni.encountersession.duration", Xg = "d34fe3ab-5e07-11ef-8f7c-0242ac120002";
11796
- async function Qg(e) {
11798
+ async function fw(e, t = !1) {
11799
+ return await K(
11800
+ Gg(e, t)
11801
+ );
11802
+ }
11803
+ const hw = (e, t) => e?.length === 0 ? !1 : t?.length === 0, Xg = De + "/Encounter", Qg = ne + "/systemsetting/bahmni.encountersession.duration", Zg = "d34fe3ab-5e07-11ef-8f7c-0242ac120002";
11804
+ async function ey(e) {
11797
11805
  const t = new URLSearchParams();
11798
11806
  Object.entries(e).forEach(([s, a]) => {
11799
11807
  a && t.append(s, a);
11800
11808
  });
11801
- const r = `${Yg}?${t.toString()}`;
11802
- return (await X(r)).entry?.map((s) => s.resource).filter((s) => s !== void 0) ?? [];
11809
+ const r = `${Xg}?${t.toString()}`;
11810
+ return (await K(r)).entry?.map((s) => s.resource).filter((s) => s !== void 0) ?? [];
11803
11811
  }
11804
- async function Zg() {
11812
+ async function ty() {
11805
11813
  try {
11806
- const e = await X(
11807
- Jg
11814
+ const e = await K(
11815
+ Qg
11808
11816
  ), t = Number(e.value);
11809
11817
  return !isNaN(t) && t > 0 ? t : 60;
11810
11818
  } catch {
11811
11819
  return 30;
11812
11820
  }
11813
11821
  }
11814
- async function ey(e, t) {
11822
+ async function ry(e, t) {
11815
11823
  if (!e.length) return null;
11816
11824
  try {
11817
- const r = await Kg(t);
11825
+ const r = await Jg(t);
11818
11826
  return r ? e.find((n) => {
11819
11827
  const s = n.partOf?.reference?.split("/")[1];
11820
11828
  return r.id === s;
@@ -11823,25 +11831,25 @@ async function ey(e, t) {
11823
11831
  return null;
11824
11832
  }
11825
11833
  }
11826
- async function dw(e, t, r) {
11834
+ async function pw(e, t, r) {
11827
11835
  try {
11828
11836
  if (!e) return null;
11829
- const n = r ?? await Zg(), a = `ge${new Date(Date.now() - n * 60 * 1e3).toISOString()}`, o = {
11837
+ const n = r ?? await ty(), a = `ge${new Date(Date.now() - n * 60 * 1e3).toISOString()}`, o = {
11830
11838
  patient: e,
11831
11839
  _tag: "encounter",
11832
11840
  _lastUpdated: a,
11833
- type: Xg
11841
+ type: Zg
11834
11842
  };
11835
11843
  t && (o.participant = t);
11836
- const i = await Qg(o);
11837
- return i.length === 0 ? null : await ey(i, e);
11844
+ const i = await ey(o);
11845
+ return i.length === 0 ? null : await ry(i, e);
11838
11846
  } catch {
11839
11847
  return null;
11840
11848
  }
11841
11849
  }
11842
- const ty = (e) => De + `/EpisodeOfCare?_revinclude=Encounter:episode-of-care&_id=${e}`;
11843
- async function fw(e) {
11844
- const t = e.join(","), r = await X(ty(t));
11850
+ const ny = (e) => De + `/EpisodeOfCare?_revinclude=Encounter:episode-of-care&_id=${e}`;
11851
+ async function mw(e) {
11852
+ const t = e.join(","), r = await K(ny(t));
11845
11853
  if (r.total === 0)
11846
11854
  throw new Error(
11847
11855
  "No episode of care found for the provided UUIDs: " + e.join(", ")
@@ -11853,13 +11861,13 @@ async function fw(e) {
11853
11861
  c && s.add(c);
11854
11862
  }), { visitUuids: Array.from(s), encounterUuids: a };
11855
11863
  }
11856
- const En = /* @__PURE__ */ new Map(), ry = async (e) => {
11864
+ const En = /* @__PURE__ */ new Map(), sy = async (e) => {
11857
11865
  if (En.has(e))
11858
11866
  return En.get(e) ?? null;
11859
- const t = await X(Vo(e)), r = t ? String(t) : null;
11867
+ const t = await K(Vo(e)), r = t ? String(t) : null;
11860
11868
  return En.set(e, r), r;
11861
- }, ny = async () => await ry(Ju) === "true", sy = async (e, t, r, n = at.CLINICAL) => {
11862
- if (!await ny())
11869
+ }, ay = async () => await sy(Ju) === "true", oy = async (e, t, r, n = at.CLINICAL) => {
11870
+ if (!await ay())
11863
11871
  return { logged: !1 };
11864
11872
  const a = Cn[t];
11865
11873
  if (!a)
@@ -11876,21 +11884,21 @@ const En = /* @__PURE__ */ new Map(), ry = async (e) => {
11876
11884
  module: n
11877
11885
  };
11878
11886
  return await ht(Fh, o), { logged: !0 };
11879
- }, hw = () => Uh(async (t) => {
11880
- await sy(
11887
+ }, gw = () => Uh(async (t) => {
11888
+ await oy(
11881
11889
  t.patientUuid,
11882
11890
  t.eventType,
11883
11891
  t.messageParams,
11884
11892
  t.module
11885
11893
  );
11886
- }), pw = async () => {
11894
+ }), yw = async () => {
11887
11895
  try {
11888
- return await X(Hu);
11896
+ return await K(Hu);
11889
11897
  } catch (e) {
11890
11898
  const { message: t } = ct(e);
11891
11899
  throw new Error(t);
11892
11900
  }
11893
- }, mw = (e, t) => !e || e.length === 0 ? !1 : e.some((r) => r.name === t), ay = async () => {
11901
+ }, vw = (e, t) => !e || e.length === 0 ? !1 : e.some((r) => r.name === t), iy = async () => {
11894
11902
  const e = await fetch(Vg);
11895
11903
  if (!e.ok)
11896
11904
  throw new Error(
@@ -11898,7 +11906,7 @@ const En = /* @__PURE__ */ new Map(), ry = async (e) => {
11898
11906
  );
11899
11907
  const t = await e.json();
11900
11908
  return Array.isArray(t) ? t : [];
11901
- }, oy = (e, t) => {
11909
+ }, cy = (e, t) => {
11902
11910
  const r = JSON.parse(e.nameTranslation);
11903
11911
  if (Array.isArray(r) && r.length > 0) {
11904
11912
  const n = r.find(
@@ -11908,8 +11916,8 @@ const En = /* @__PURE__ */ new Map(), ry = async (e) => {
11908
11916
  return n.display;
11909
11917
  }
11910
11918
  return e.name;
11911
- }, iy = (e, t) => {
11912
- const r = oy(e, t);
11919
+ }, uy = (e, t) => {
11920
+ const r = cy(e, t);
11913
11921
  return {
11914
11922
  uuid: e.uuid,
11915
11923
  name: r,
@@ -11919,12 +11927,12 @@ const En = /* @__PURE__ */ new Map(), ry = async (e) => {
11919
11927
  editable: n.editable
11920
11928
  }))
11921
11929
  };
11922
- }, gw = async () => {
11923
- const e = await ay(), t = Nt();
11930
+ }, ww = async () => {
11931
+ const e = await iy(), t = Nt();
11924
11932
  return e.map(
11925
- (r) => iy(r, t)
11933
+ (r) => uy(r, t)
11926
11934
  );
11927
- }, yw = async (e) => {
11935
+ }, bw = async (e) => {
11928
11936
  const t = await fetch(Fg(e));
11929
11937
  if (!t.ok)
11930
11938
  throw new Error(
@@ -11960,6 +11968,17 @@ const En = /* @__PURE__ */ new Map(), ry = async (e) => {
11960
11968
  schema: n,
11961
11969
  translations: a
11962
11970
  };
11971
+ }, Ew = async (e, t, r) => {
11972
+ let n;
11973
+ t && t.length > 0 && (n = t.join(","));
11974
+ try {
11975
+ const s = Bg(e, r, n), a = await K(s);
11976
+ return Array.isArray(a) ? a : [];
11977
+ } catch (s) {
11978
+ throw new Error(
11979
+ `Failed to fetch form data for patient ${e}: ${s instanceof Error ? s.message : "Unknown error"}`
11980
+ );
11981
+ }
11963
11982
  };
11964
11983
  function gi(e) {
11965
11984
  const { value: t } = e;
@@ -12001,7 +12020,7 @@ function vi(e, t) {
12001
12020
  };
12002
12021
  return n(r.controls);
12003
12022
  }
12004
- function vw(e, t) {
12023
+ function _w(e, t) {
12005
12024
  if (!e.controls || e.controls.length === 0)
12006
12025
  return [];
12007
12026
  const r = [], n = (/* @__PURE__ */ new Date()).toISOString();
@@ -12045,7 +12064,7 @@ function vw(e, t) {
12045
12064
  s.interpretation && (o.interpretation = s.interpretation), r.push(o);
12046
12065
  }), r;
12047
12066
  }
12048
- function ww(e, t) {
12067
+ function Sw(e, t) {
12049
12068
  if (!e || e.length === 0)
12050
12069
  return {
12051
12070
  controls: [],
@@ -12078,7 +12097,7 @@ function ww(e, t) {
12078
12097
  metadata: { formMetadata: t }
12079
12098
  };
12080
12099
  }
12081
- const cy = ae + "/bahmnicore/diseaseSummaryData?", bw = async (e, t, r, n) => {
12100
+ const ly = ne + "/bahmnicore/diseaseSummaryData?", Rw = async (e, t, r, n) => {
12082
12101
  const s = new URLSearchParams({
12083
12102
  groupBy: n,
12084
12103
  latestCount: t.toString(),
@@ -12087,16 +12106,16 @@ const cy = ae + "/bahmnicore/diseaseSummaryData?", bw = async (e, t, r, n) => {
12087
12106
  r.forEach((o) => {
12088
12107
  s.append("obsConcepts", o);
12089
12108
  });
12090
- const a = cy + s.toString();
12091
- return X(a);
12092
- }, Ew = async (e) => await X(Bu(e)), kn = "consultation:saved", _w = (e) => {
12109
+ const a = ly + s.toString();
12110
+ return K(a);
12111
+ }, Tw = async (e) => await K(Bu(e)), kn = "consultation:saved", Pw = (e) => {
12093
12112
  setTimeout(() => {
12094
12113
  const t = new CustomEvent(kn, {
12095
12114
  detail: e
12096
12115
  });
12097
12116
  window.dispatchEvent(t);
12098
12117
  }, 0);
12099
- }, Sw = (e, t = []) => {
12118
+ }, Aw = (e, t = []) => {
12100
12119
  const r = _n(e);
12101
12120
  Sn(() => {
12102
12121
  r.current = e;
@@ -12116,142 +12135,144 @@ export {
12116
12135
  lp as AllergyStatus,
12117
12136
  xh as AttributeFormat,
12118
12137
  qh as AttributeInputType,
12119
- Dy as BAHMNI_HOME_PATH,
12120
- Vv as CONCEPT_DATATYPE_COMPLEX,
12121
- Fv as CONCEPT_DATATYPE_NUMERIC,
12138
+ Cy as BAHMNI_HOME_PATH,
12139
+ Bv as CONCEPT_DATATYPE_COMPLEX,
12140
+ Hv as CONCEPT_DATATYPE_NUMERIC,
12122
12141
  kn as CONSULTATION_SAVED_EVENT,
12123
12142
  pp as DATETIME_REGEX_PATTERN,
12124
12143
  nh as DATE_FORMAT,
12125
- qy as DATE_PICKER_INPUT_FORMAT,
12126
- zv as DATE_REGEX_PATTERN,
12144
+ Uy as DATE_PICKER_INPUT_FORMAT,
12145
+ Gv as DATE_REGEX_PATTERN,
12127
12146
  sh as DATE_TIME_FORMAT,
12128
- kv as FHIR_ENCOUNTER_TYPE_CODE_SYSTEM,
12129
- Uv as FHIR_OBSERVATION_COMPLEX_DATA_URL,
12130
- jv as FHIR_OBSERVATION_FORM_NAMESPACE_PATH_URL,
12131
- qv as FHIR_OBSERVATION_INTERPRETATION_SYSTEM,
12132
- Hv as FHIR_OBSERVATION_STATUS_FINAL,
12133
- Bv as FHIR_RESOURCE_TYPE_OBSERVATION,
12134
- Ly as FULL_MONTH_DATE_FORMAT,
12135
- xv as HL7_CONDITION_CATEGORY_CODE_SYSTEM,
12147
+ Mv as FHIR_ENCOUNTER_TYPE_CODE_SYSTEM,
12148
+ Vv as FHIR_OBSERVATION_COMPLEX_DATA_URL,
12149
+ Fv as FHIR_OBSERVATION_FORM_NAMESPACE_PATH_URL,
12150
+ Uv as FHIR_OBSERVATION_INTERPRETATION_SYSTEM,
12151
+ zv as FHIR_OBSERVATION_STATUS_FINAL,
12152
+ Wv as FHIR_RESOURCE_TYPE_OBSERVATION,
12153
+ xy as FULL_MONTH_DATE_FORMAT,
12154
+ jv as HL7_CONDITION_CATEGORY_CODE_SYSTEM,
12136
12155
  fp as HL7_CONDITION_CATEGORY_CONDITION_CODE,
12137
12156
  hp as HL7_CONDITION_CATEGORY_DIAGNOSIS_CODE,
12138
- Mv as HL7_CONDITION_CLINICAL_STATUS_CODE_SYSTEM,
12139
- Lv as HL7_CONDITION_VERIFICATION_STATUS_CODE_SYSTEM,
12140
- Wv as INTERPRETATION_TO_CODE,
12141
- xy as ISO_DATE_FORMAT,
12157
+ qv as HL7_CONDITION_CLINICAL_STATUS_CODE_SYSTEM,
12158
+ xv as HL7_CONDITION_VERIFICATION_STATUS_CODE_SYSTEM,
12159
+ Kv as INTERPRETATION_TO_CODE,
12160
+ jy as ISO_DATE_FORMAT,
12142
12161
  Sr as LabTestPriority,
12143
- tv as MAX_NAME_LENGTH,
12144
- ev as MAX_PATIENT_AGE_YEARS,
12145
- rv as MAX_PHONE_NUMBER_LENGTH,
12162
+ nv as MAX_NAME_LENGTH,
12163
+ rv as MAX_PATIENT_AGE_YEARS,
12164
+ sv as MAX_PHONE_NUMBER_LENGTH,
12146
12165
  qe as MedicationStatus,
12147
12166
  De as OPENMRS_FHIR_R4,
12148
- ae as OPENMRS_REST_V1,
12149
- tw as ORDER_TYPE_QUERY_KEY,
12150
- My as REGISTRATION_DATE_FORMAT,
12151
- cw as USER_PINNED_PREFERENCE_URL,
12167
+ ne as OPENMRS_REST_V1,
12168
+ nw as ORDER_TYPE_QUERY_KEY,
12169
+ qy as REGISTRATION_DATE_FORMAT,
12170
+ lw as USER_PINNED_PREFERENCE_URL,
12152
12171
  oh as calculateAge,
12153
- By as calculateAgeinYearsAndMonths,
12154
- Uy as calculateOnsetDate,
12155
- Gy as capitalize,
12156
- Rv as checkIfActiveVisitExists,
12157
- uv as createPatient,
12158
- Tv as createVisitForPatient,
12159
- Ny as del,
12172
+ Wy as calculateAgeinYearsAndMonths,
12173
+ Vy as calculateOnsetDate,
12174
+ Yy as capitalize,
12175
+ Pv as checkIfActiveVisitExists,
12176
+ dv as createPatient,
12177
+ Av as createVisitForPatient,
12178
+ Iy as del,
12160
12179
  jh as dispatchAuditEvent,
12161
- _w as dispatchConsultationSaved,
12162
- Dv as fetchAndFormatAllergenConcepts,
12163
- yw as fetchFormMetadata,
12164
- gw as fetchObservationForms,
12165
- Iv as fetchReactionConcepts,
12166
- Xy as filterReplacementEntries,
12167
- dw as findActiveEncounterInSession,
12180
+ Pw as dispatchConsultationSaved,
12181
+ Cv as fetchAndFormatAllergenConcepts,
12182
+ bw as fetchFormMetadata,
12183
+ ww as fetchObservationForms,
12184
+ kv as fetchReactionConcepts,
12185
+ Zy as filterReplacementEntries,
12186
+ pw as findActiveEncounterInSession,
12168
12187
  ih as formatDate,
12169
- Hy as formatDateAndTime,
12170
- Fy as formatDateDistance,
12171
- jy as formatDateTime,
12188
+ zy as formatDateAndTime,
12189
+ Hy as formatDateDistance,
12190
+ Fy as formatDateTime,
12172
12191
  Up as formatLabTests,
12173
- Qy as formatUrl,
12192
+ ev as formatUrl,
12174
12193
  ch as generateId,
12175
- X as get,
12176
- Kg as getActiveVisit,
12194
+ K as get,
12195
+ Jg as getActiveVisit,
12177
12196
  Gh as getActiveVisitByPatient,
12178
- fv as getAddressHierarchyEntries,
12197
+ pv as getAddressHierarchyEntries,
12179
12198
  cp as getAllergies,
12180
- Ov as getAppointmentById,
12181
- nw as getCategoryUuidFromOrderTypes,
12182
- sw as getClinicalConfig,
12183
- Nv as getConceptById,
12184
- Gv as getConditions,
12199
+ Nv as getAppointmentById,
12200
+ aw as getCategoryUuidFromOrderTypes,
12201
+ ow as getClinicalConfig,
12202
+ Iv as getConceptById,
12203
+ Yv as getConditions,
12185
12204
  ai as getCookieByName,
12186
- uw as getCurrentProvider,
12187
- Zy as getCurrentUser,
12188
- pw as getCurrentUserPrivileges,
12189
- aw as getDashboardConfig,
12190
- fw as getEncountersAndVisitsForEOC,
12191
- rw as getFlattenedInvestigations,
12192
- Cv as getFormattedAllergies,
12205
+ dw as getCurrentProvider,
12206
+ tv as getCurrentUser,
12207
+ yw as getCurrentUserPrivileges,
12208
+ iw as getDashboardConfig,
12209
+ mw as getEncountersAndVisitsForEOC,
12210
+ sw as getFlattenedInvestigations,
12211
+ Lv as getFormattedAllergies,
12193
12212
  ct as getFormattedError,
12194
- nv as getFormattedPatientById,
12195
- dv as getGenders,
12196
- cv as getIdentifierData,
12197
- iv as getIdentifierTypes,
12198
- yv as getInputTypeForFormat,
12199
- ow as getMedicationConfig,
12213
+ av as getFormattedPatientById,
12214
+ fw as getFormsDataByEncounterUuid,
12215
+ hv as getGenders,
12216
+ lv as getIdentifierData,
12217
+ uv as getIdentifierTypes,
12218
+ wv as getInputTypeForFormat,
12219
+ cw as getMedicationConfig,
12200
12220
  ci as getOrderTypes,
12201
- hv as getOrderedAddressHierarchyLevels,
12221
+ mv as getOrderedAddressHierarchyLevels,
12202
12222
  Nh as getPatientById,
12203
- Kv as getPatientDiagnoses,
12204
- sv as getPatientImageAsDataUrl,
12205
- ew as getPatientLabInvestigations,
12223
+ Jv as getPatientDiagnoses,
12224
+ Ew as getPatientFormData,
12225
+ ov as getPatientImageAsDataUrl,
12226
+ rw as getPatientLabInvestigations,
12206
12227
  Pp as getPatientMedicationBundle,
12207
- Yv as getPatientMedications,
12208
- pv as getPatientProfile,
12209
- Ew as getPatientPrograms,
12210
- Jv as getPatientRadiologyInvestigationBundle,
12211
- Xv as getPatientRadiologyInvestigationBundleWithImagingStudy,
12212
- Qv as getPatientRadiologyInvestigations,
12213
- gv as getPersonAttributeTypes,
12228
+ Xv as getPatientMedications,
12229
+ gv as getPatientProfile,
12230
+ Tw as getPatientPrograms,
12231
+ Qv as getPatientRadiologyInvestigationBundle,
12232
+ Zv as getPatientRadiologyInvestigationBundleWithImagingStudy,
12233
+ ew as getPatientRadiologyInvestigations,
12234
+ vv as getPersonAttributeTypes,
12214
12235
  Mh as getPrimaryIdentifierType,
12215
- Yy as getPriorityByOrder,
12216
- iw as getRegistrationConfig,
12217
- mv as getRelationshipTypes,
12236
+ Xy as getPriorityByOrder,
12237
+ uw as getRegistrationConfig,
12238
+ yv as getRelationshipTypes,
12218
12239
  Vr as getServiceRequests,
12219
- Vy as getTodayDate,
12240
+ By as getTodayDate,
12220
12241
  Vn as getUserLoginLocation,
12221
12242
  Nt as getUserPreferredLocale,
12222
- Sv as getVisitTypes,
12223
- bw as getVitalFlowSheetData,
12224
- Jy as groupByDate,
12225
- Zv as groupLabTestsByDate,
12226
- mw as hasPrivilege,
12227
- Cy as initAppI18n,
12228
- hw as initializeAuditListener,
12229
- vv as isBooleanFormat,
12230
- wv as isConceptFormat,
12231
- Ev as isDateFormat,
12232
- bv as isNumberFormat,
12233
- Ky as isStringEmpty,
12234
- _v as isTextFormat,
12235
- sy as logAuditEvent,
12236
- Iy as normalizeTranslationKey,
12243
+ Tv as getVisitTypes,
12244
+ Rw as getVitalFlowSheetData,
12245
+ Qy as groupByDate,
12246
+ tw as groupLabTestsByDate,
12247
+ vw as hasPrivilege,
12248
+ Ly as initAppI18n,
12249
+ gw as initializeAuditListener,
12250
+ bv as isBooleanFormat,
12251
+ Ev as isConceptFormat,
12252
+ Sv as isDateFormat,
12253
+ _v as isNumberFormat,
12254
+ Jy as isStringEmpty,
12255
+ Rv as isTextFormat,
12256
+ oy as logAuditEvent,
12257
+ ky as normalizeTranslationKey,
12237
12258
  on as notificationService,
12238
12259
  uh as parseQueryParams,
12239
12260
  ht as post,
12240
- $y as put,
12241
- Wy as refreshQueries,
12242
- Pv as searchAppointmentsByAttribute,
12243
- $v as searchConcepts,
12261
+ Dy as put,
12262
+ Ky as refreshQueries,
12263
+ Ov as searchAppointmentsByAttribute,
12264
+ Dv as searchConcepts,
12244
12265
  _r as searchFHIRConcepts,
12245
12266
  rp as searchFHIRConceptsByName,
12246
- ov as searchPatientByCustomAttribute,
12247
- av as searchPatientByNameOrId,
12248
- lw as shouldEnableEncounterFilter,
12249
- zy as sortByDate,
12250
- vw as transformFormDataToObservations,
12251
- ww as transformObservationsToFormData,
12252
- Av as updateAppointmentStatus,
12253
- lv as updatePatient,
12254
- ky as useCamera,
12255
- Sw as useConsultationSaved,
12256
- Pw as useTranslation
12267
+ cv as searchPatientByCustomAttribute,
12268
+ iv as searchPatientByNameOrId,
12269
+ hw as shouldEnableEncounterFilter,
12270
+ Gy as sortByDate,
12271
+ _w as transformFormDataToObservations,
12272
+ Sw as transformObservationsToFormData,
12273
+ $v as updateAppointmentStatus,
12274
+ fv as updatePatient,
12275
+ My as useCamera,
12276
+ Aw as useConsultationSaved,
12277
+ Nw as useTranslation
12257
12278
  };