@bahmni/services 0.0.1-dev.218 → 0.0.1-dev.220

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 vi } from "react-i18next";
2
- import { useTranslation as Wv } from "react-i18next";
2
+ import { useTranslation as Zv } from "react-i18next";
3
3
  import { useRef as bn, useCallback as Wr, useEffect as _n } from "react";
4
4
  function aa(e, t) {
5
5
  return function() {
@@ -1379,8 +1379,8 @@ const Sa = (e) => {
1379
1379
  };
1380
1380
  B = o && new r(g, fe);
1381
1381
  let Q = await (o ? q(B, M) : q(g, fe));
1382
- const ce = l && (R === "stream" || R === "response");
1383
- if (l && (_ || ce && G)) {
1382
+ const ue = l && (R === "stream" || R === "response");
1383
+ if (l && (_ || ue && G)) {
1384
1384
  const A = {};
1385
1385
  ["status", "statusText", "headers"].forEach((T) => {
1386
1386
  A[T] = Q[T];
@@ -1401,7 +1401,7 @@ const Sa = (e) => {
1401
1401
  Q,
1402
1402
  y
1403
1403
  );
1404
- return !ce && G && G(), await new Promise((A, D) => {
1404
+ return !ue && G && G(), await new Promise((A, D) => {
1405
1405
  ba(A, D, {
1406
1406
  data: U,
1407
1407
  headers: be.from(Q.headers),
@@ -1896,22 +1896,22 @@ le.getAdapter = Ta.getAdapter;
1896
1896
  le.HttpStatusCode = On;
1897
1897
  le.default = le;
1898
1898
  const {
1899
- Axios: Km,
1900
- AxiosError: Ym,
1901
- CanceledError: Wm,
1902
- isCancel: Jm,
1903
- CancelToken: Qm,
1904
- VERSION: Xm,
1905
- all: Zm,
1906
- Cancel: eg,
1907
- isAxiosError: tg,
1908
- spread: rg,
1909
- toFormData: ng,
1910
- AxiosHeaders: sg,
1911
- HttpStatusCode: og,
1912
- formToJSON: ag,
1913
- getAdapter: ig,
1914
- mergeConfig: cg
1899
+ Axios: Jm,
1900
+ AxiosError: Qm,
1901
+ CanceledError: Xm,
1902
+ isCancel: Zm,
1903
+ CancelToken: eg,
1904
+ VERSION: tg,
1905
+ all: rg,
1906
+ Cancel: ng,
1907
+ isAxiosError: sg,
1908
+ spread: og,
1909
+ toFormData: ag,
1910
+ AxiosHeaders: ig,
1911
+ HttpStatusCode: cg,
1912
+ formToJSON: ug,
1913
+ getAdapter: lg,
1914
+ mergeConfig: dg
1915
1915
  } = le, Zc = (e) => typeof e == "object" && e !== null && "resourceType" in e && e.resourceType === "OperationOutcome", eu = (e) => {
1916
1916
  if (!e.issue || !Array.isArray(e.issue))
1917
1917
  return null;
@@ -2116,7 +2116,7 @@ Me.interceptors.response.use(
2116
2116
  return r.startsWith("ERROR_") || /^[A-Z_]+$/.test(r) ? Promise.reject(new Error(r)) : Promise.reject(`${t}: ${r}`);
2117
2117
  }
2118
2118
  );
2119
- const F = async (e) => (await Me.get(e)).data, Ce = async (e, t) => (await Me.post(e, t)).data, ug = async (e, t) => (await Me.put(e, t)).data, lg = async (e, t) => (await Me.patch(e, t)).data, Pa = async (e) => (await Me.delete(e)).data, Y = (e) => typeof e == "string", ft = () => {
2119
+ const F = async (e) => (await Me.get(e)).data, Ce = async (e, t) => (await Me.post(e, t)).data, fg = async (e, t) => (await Me.put(e, t)).data, pg = async (e, t) => (await Me.patch(e, t)).data, Pa = async (e) => (await Me.delete(e)).data, Y = (e) => typeof e == "string", ft = () => {
2120
2120
  let e, t;
2121
2121
  const r = new Promise((n, s) => {
2122
2122
  e = n, t = s;
@@ -2510,26 +2510,26 @@ class Nr extends xr {
2510
2510
  const G = (r.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && j ? void 0 : v, re = h && R !== v && this.options.updateMissing;
2511
2511
  if (j || q || re) {
2512
2512
  if (this.logger.log(re ? "updateKey" : "missingKey", d, c, a, re ? R : v), o) {
2513
- const ce = this.resolve(a, {
2513
+ const ue = this.resolve(a, {
2514
2514
  ...r,
2515
2515
  keySeparator: !1
2516
2516
  });
2517
- ce && ce.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
2517
+ ue && ue.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
2518
2518
  }
2519
2519
  let ne = [];
2520
2520
  const fe = this.languageUtils.getFallbackCodes(this.options.fallbackLng, r.lng || this.language);
2521
2521
  if (this.options.saveMissingTo === "fallback" && fe && fe[0])
2522
- for (let ce = 0; ce < fe.length; ce++)
2523
- ne.push(fe[ce]);
2522
+ for (let ue = 0; ue < fe.length; ue++)
2523
+ ne.push(fe[ue]);
2524
2524
  else this.options.saveMissingTo === "all" ? ne = this.languageUtils.toResolveHierarchy(r.lng || this.language) : ne.push(r.lng || this.language);
2525
- const Q = (ce, U, A) => {
2525
+ const Q = (ue, U, A) => {
2526
2526
  const D = h && A !== v ? A : G;
2527
- this.options.missingKeyHandler ? this.options.missingKeyHandler(ce, c, U, D, re, r) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(ce, c, U, D, re, r), this.emit("missingKey", ce, c, U, v);
2527
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(ue, c, U, D, re, r) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(ue, c, U, D, re, r), this.emit("missingKey", ue, c, U, v);
2528
2528
  };
2529
- this.options.saveMissing && (this.options.saveMissingPlurals && u ? ne.forEach((ce) => {
2530
- const U = this.pluralResolver.getSuffixes(ce, r);
2529
+ this.options.saveMissing && (this.options.saveMissingPlurals && u ? ne.forEach((ue) => {
2530
+ const U = this.pluralResolver.getSuffixes(ue, r);
2531
2531
  b && r[`defaultValue${this.options.pluralSeparator}zero`] && U.indexOf(`${this.options.pluralSeparator}zero`) < 0 && U.push(`${this.options.pluralSeparator}zero`), U.forEach((A) => {
2532
- Q([ce], a + A, r[`defaultValue${A}`] || R);
2532
+ Q([ue], a + A, r[`defaultValue${A}`] || R);
2533
2533
  });
2534
2534
  }) : Q(ne, a, R));
2535
2535
  }
@@ -3790,7 +3790,7 @@ class ka {
3790
3790
  }
3791
3791
  }
3792
3792
  ka.type = "languageDetector";
3793
- const Ku = process.env.PUBLIC_URL ?? "/", ue = "/openmrs/ws/fhir2/R4", W = "/openmrs/ws/rest/v1", Yu = "/openmrs/ws/rest/v2", Ua = "bahmni.user", dg = "/bahmni/home/index.html", xa = W + "/session", Wu = "en", qa = "NG_TRANSLATE_LANG_KEY", Ju = (e, t) => Ku + `${e}/locales/locale_${t}.json`, Qu = (e, t) => `/bahmni_config/openmrs/i18n/${e}/locale_${t}.json`, qr = () => localStorage.getItem(qa) ?? Wu, Ds = async (e) => {
3793
+ const Ku = process.env.PUBLIC_URL ?? "/", ce = "/openmrs/ws/fhir2/R4", W = "/openmrs/ws/rest/v1", Yu = "/openmrs/ws/rest/v2", Ua = "bahmni.user", hg = "/bahmni/home/index.html", xa = W + "/session", Wu = "en", qa = "NG_TRANSLATE_LANG_KEY", Ju = (e, t) => Ku + `${e}/locales/locale_${t}.json`, Qu = (e, t) => `/bahmni_config/openmrs/i18n/${e}/locale_${t}.json`, qr = () => localStorage.getItem(qa) ?? Wu, Ds = async (e) => {
3794
3794
  try {
3795
3795
  const t = await F(e);
3796
3796
  return t || (console.error(`Invalid response from ${e}`), {});
@@ -3814,7 +3814,7 @@ const Ku = process.env.PUBLIC_URL ?? "/", ue = "/openmrs/ws/fhir2/R4", W = "/ope
3814
3814
  }, e !== "en" && (r.en = {
3815
3815
  [t]: await Ls(t, "en")
3816
3816
  }), r;
3817
- }, fg = (e, t) => {
3817
+ }, mg = (e, t) => {
3818
3818
  const r = e.toUpperCase(), n = t.toUpperCase().replace(/\s+/g, "_").replace(/[^A-Z0-9_]/g, "");
3819
3819
  return `${r}_${n}`;
3820
3820
  }, Zu = (e, t) => {
@@ -3831,7 +3831,7 @@ const Ku = process.env.PUBLIC_URL ?? "/", ue = "/openmrs/ws/fhir2/R4", W = "/ope
3831
3831
  labels: n.labels ?? {},
3832
3832
  concepts: n.concepts ?? {}
3833
3833
  };
3834
- }, pg = async (e) => {
3834
+ }, gg = async (e) => {
3835
3835
  const t = qr(), r = await Xu(t, e);
3836
3836
  return ie.isInitialized ? (Object.entries(r).forEach(([n, s]) => {
3837
3837
  Object.entries(s).forEach(([o, a]) => {
@@ -3854,7 +3854,7 @@ const Ku = process.env.PUBLIC_URL ?? "/", ue = "/openmrs/ws/fhir2/R4", W = "/ope
3854
3854
  }
3855
3855
  }), ie;
3856
3856
  };
3857
- function hg() {
3857
+ function yg() {
3858
3858
  const e = bn(null), t = bn(null), r = Wr(async () => {
3859
3859
  t.current && (t.current.getTracks().forEach((a) => a.stop()), t.current = null);
3860
3860
  const o = await navigator.mediaDevices.getUserMedia({
@@ -3877,10 +3877,10 @@ function hg() {
3877
3877
  }, []);
3878
3878
  return _n(() => () => n(), [n]), { videoRef: e, start: r, stop: n, capture: s };
3879
3879
  }
3880
- const el = "bahmni.enableAuditLog", Ma = (e) => `${W}/bahmnicore/sql/globalproperty?property=${e}`, mg = async (e, t, r) => {
3880
+ const el = "bahmni.enableAuditLog", Ma = (e) => `${W}/bahmnicore/sql/globalproperty?property=${e}`, vg = async (e, t, r) => {
3881
3881
  const { exact: n = !0, refetchActiveNow: s = !0 } = r ?? {};
3882
3882
  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" });
3883
- }, gg = () => Math.random().toString(36).substring(2, 9), yg = () => {
3883
+ }, wg = () => Math.random().toString(36).substring(2, 9), Eg = () => {
3884
3884
  if (typeof globalThis < "u" && globalThis.crypto?.randomUUID)
3885
3885
  return globalThis.crypto.randomUUID();
3886
3886
  const e = globalThis.crypto || globalThis.msCrypto;
@@ -3892,7 +3892,7 @@ const el = "bahmni.enableAuditLog", Ma = (e) => `${W}/bahmnicore/sql/globalprope
3892
3892
  "Crypto API (crypto.randomUUID or crypto.getRandomValues) is not available. UUID generation requires cryptographically secure random number generation."
3893
3893
  );
3894
3894
  };
3895
- function vg(e, t = " -") {
3895
+ function bg(e, t = " -") {
3896
3896
  return e ? e.toLowerCase().split(new RegExp(`[${t}]+`)).map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join(" ") : "";
3897
3897
  }
3898
3898
  function Fa(e) {
@@ -3907,10 +3907,10 @@ function Fa(e) {
3907
3907
  function tl(e) {
3908
3908
  document.cookie = `${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;
3909
3909
  }
3910
- function wg(e, t) {
3910
+ function _g(e, t) {
3911
3911
  document.cookie = `${e}=${t}; path=/;`;
3912
3912
  }
3913
- const Eg = (e) => !e || e.trim().length === 0, bg = (e, t) => {
3913
+ const Sg = (e) => !e || e.trim().length === 0, Rg = (e, t) => {
3914
3914
  if (!e || !t || t.length === 0)
3915
3915
  return 999;
3916
3916
  const r = t.findIndex(
@@ -3918,7 +3918,7 @@ const Eg = (e) => !e || e.trim().length === 0, bg = (e, t) => {
3918
3918
  );
3919
3919
  return r === -1 ? 999 : r;
3920
3920
  };
3921
- function _g(e, t) {
3921
+ function Tg(e, t) {
3922
3922
  if (!e || e.length === 0)
3923
3923
  return [];
3924
3924
  const r = /* @__PURE__ */ new Map();
@@ -3930,7 +3930,7 @@ function _g(e, t) {
3930
3930
  items: s
3931
3931
  }));
3932
3932
  }
3933
- function Sg(e, t, r) {
3933
+ function Og(e, t, r) {
3934
3934
  if (!e || e.length === 0)
3935
3935
  return [];
3936
3936
  const n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
@@ -3951,7 +3951,7 @@ function rl(e) {
3951
3951
  o[n(a[1])] = n(a[2]);
3952
3952
  return o;
3953
3953
  }
3954
- function Rg(e, t, r) {
3954
+ function Ag(e, t, r) {
3955
3955
  const n = /{{([^}]*)}}/g, s = e.match(n);
3956
3956
  let o = e;
3957
3957
  const a = r ?? !1, i = a ? rl() : {};
@@ -3964,7 +3964,7 @@ function Rg(e, t, r) {
3964
3964
  const nl = (e) => new Promise((t, r) => {
3965
3965
  const n = new FileReader();
3966
3966
  n.onloadend = () => t(n.result), n.onerror = r, n.readAsDataURL(e);
3967
- }), Tg = (e) => {
3967
+ }), Ng = (e) => {
3968
3968
  if (typeof e == "number" && !isNaN(e))
3969
3969
  return "number";
3970
3970
  if (typeof e != "string")
@@ -3972,10 +3972,10 @@ const nl = (e) => new Promise((t, r) => {
3972
3972
  const t = e.toLowerCase();
3973
3973
  return t.endsWith(".pdf") ? "PDF" : [".png", ".jpg", ".jpeg", ".gif", ".bmp", ".svg"].some((s) => t.endsWith(s)) ? "Image" : [".mp4", ".ogg", ".webm", ".mkv", ".flv"].some((s) => t.endsWith(s)) ? "Video" : typeof e == "string" ? "string" : "object";
3974
3974
  };
3975
- function Og(e) {
3975
+ function $g(e) {
3976
3976
  return e.replace(/[\s-]+/g, "_").replace(/([a-z])([A-Z])/g, "$1_$2").replace(/([A-Z])([A-Z][a-z])/g, "$1_$2").toUpperCase();
3977
3977
  }
3978
- function Ag(e) {
3978
+ function Pg(e) {
3979
3979
  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()) : "";
3980
3980
  }
3981
3981
  const sl = (e) => W + `/user?username=${e}&v=custom:(display,username,uuid)`, ja = "bahmni.user.location", ol = `${W}/location?tags=Login Location&v=default`, al = (e) => W + `/user/${e}?v=full`, il = (e) => W + `/bahmni/app/setting?module=${e}`, cl = "default_dateFormat", ul = xa, ll = [
@@ -3984,7 +3984,7 @@ const sl = (e) => W + `/user?username=${e}&v=custom:(display,username,uuid)`, ja
3984
3984
  ], dl = {
3985
3985
  LOGOUT_FAILED: "USER_LOGOUT_FAILED"
3986
3986
  };
3987
- async function Ng() {
3987
+ async function Ig() {
3988
3988
  const e = Fa(Ua);
3989
3989
  if (!e)
3990
3990
  return null;
@@ -4008,15 +4008,15 @@ const qn = () => {
4008
4008
  if (!t.uuid)
4009
4009
  throw new Error(ie.t("ERROR_FETCHING_USER_LOCATION_DETAILS"));
4010
4010
  return t;
4011
- }, $g = async () => (await F(il("commons"))).find(
4011
+ }, Cg = async () => (await F(il("commons"))).find(
4012
4012
  (r) => r.property === cl
4013
- )?.value ?? null, Pg = async () => {
4013
+ )?.value ?? null, Dg = async () => {
4014
4014
  try {
4015
4015
  return (await F(ol)).results ?? [];
4016
4016
  } catch (e) {
4017
4017
  return console.error("Failed to fetch available locations:", e), [];
4018
4018
  }
4019
- }, Ig = async () => {
4019
+ }, Lg = async () => {
4020
4020
  try {
4021
4021
  await Pa(ul), ll.forEach((e) => {
4022
4022
  tl(e);
@@ -4024,7 +4024,7 @@ const qn = () => {
4024
4024
  } catch (e) {
4025
4025
  throw console.error("Logout failed:", e), new Error(ie.t(dl.LOGOUT_FAILED));
4026
4026
  }
4027
- }, Cg = async (e, t) => {
4027
+ }, kg = async (e, t) => {
4028
4028
  await Ce(al(e), {
4029
4029
  userProperties: { loginLocation: t.uuid }
4030
4030
  });
@@ -4046,7 +4046,7 @@ const qn = () => {
4046
4046
  e.append(n.resultParam, s);
4047
4047
  });
4048
4048
  });
4049
- }, pl = (e) => ue + `/Patient/${e}`, hl = (e, t, r) => {
4049
+ }, pl = (e) => ce + `/Patient/${e}`, hl = (e, t, r) => {
4050
4050
  const n = new URLSearchParams({
4051
4051
  filterOnAllIdentifiers: "false",
4052
4052
  identifier: e,
@@ -4074,7 +4074,7 @@ const qn = () => {
4074
4074
  }, Va = W + "/idgen/identifiertype", gl = (e) => W + `/bahmni/app/setting?module=${e}`, yl = "bahmni.primaryIdentifierType", vl = W + "/bahmnicore/patientprofile", wl = (e) => W + `/bahmnicore/patientprofile/${e}`, El = (e) => W + `/patientprofile/${e}?v=full`, bl = (e, t, r = 20, n) => {
4075
4075
  let s = `/openmrs/module/addresshierarchy/ajax/getPossibleAddressHierarchyEntriesWithParents.form?addressField=${e}&limit=${r}&searchString=${encodeURIComponent(t)}`;
4076
4076
  return n && (s += `&parent=${n}`), s;
4077
- }, _l = "/openmrs/module/addresshierarchy/ajax/getOrderedAddressHierarchyLevels.form", Sl = W + "/relationshiptype?v=custom:(aIsToB,bIsToA,uuid)&limit=150", Rl = 20, Tl = 2, Dg = 120, Lg = 50, kg = 15, Ol = /^[a-f0-9-]{36}$/i, Al = (e) => Yu + `/patientImage?patientUuid=${e}`, Nl = W + "/personattributetype?v=custom:(uuid,name,sortWeight,description,format,concept:(uuid,display,answers:(uuid,name)))", $l = async (e) => {
4077
+ }, _l = "/openmrs/module/addresshierarchy/ajax/getOrderedAddressHierarchyLevels.form", Sl = W + "/relationshiptype?v=custom:(aIsToB,bIsToA,uuid)&limit=150", Rl = 20, Tl = 2, Ug = 120, xg = 50, qg = 15, Ol = /^[a-f0-9-]{36}$/i, Al = (e) => Yu + `/patientImage?patientUuid=${e}`, Nl = W + "/personattributetype?v=custom:(uuid,name,sortWeight,description,format,concept:(uuid,display,answers:(uuid,name)))", $l = async (e) => {
4078
4078
  if (!e || e.trim() === "")
4079
4079
  throw new Error("Invalid patient UUID: UUID cannot be empty");
4080
4080
  if (!Ol.test(e))
@@ -4107,20 +4107,20 @@ const qn = () => {
4107
4107
  formattedContact: r,
4108
4108
  identifiers: s
4109
4109
  };
4110
- }, Ug = async (e) => {
4110
+ }, Mg = async (e) => {
4111
4111
  const t = await $l(e);
4112
4112
  return Ll(t);
4113
- }, xg = async (e) => {
4113
+ }, Fg = async (e) => {
4114
4114
  const t = await fetch(Al(e));
4115
4115
  if (!t.ok) return null;
4116
4116
  const r = await t.blob();
4117
4117
  return await nl(r);
4118
- }, qg = async (e, t) => {
4118
+ }, jg = async (e, t) => {
4119
4119
  const r = qn();
4120
4120
  return await F(
4121
4121
  hl(e, r.uuid, t)
4122
4122
  );
4123
- }, Mg = async (e, t, r, n, s) => {
4123
+ }, Vg = async (e, t, r, n, s) => {
4124
4124
  const o = qn();
4125
4125
  return await F(
4126
4126
  ml(
@@ -4131,9 +4131,9 @@ const qn = () => {
4131
4131
  o.uuid
4132
4132
  )
4133
4133
  );
4134
- }, Fg = async () => F(Va), kl = async () => (await F(gl("core"))).find(
4134
+ }, Bg = async () => F(Va), kl = async () => (await F(gl("core"))).find(
4135
4135
  (r) => r.property === yl
4136
- )?.value ?? null, jg = async () => {
4136
+ )?.value ?? null, Hg = async () => {
4137
4137
  const [e, t] = await Promise.all([
4138
4138
  F(Va),
4139
4139
  kl()
@@ -4150,10 +4150,10 @@ const qn = () => {
4150
4150
  sourcesByPrefix: n,
4151
4151
  primaryIdentifierTypeUuid: t
4152
4152
  }) : { prefixes: r, sourcesByPrefix: n, primaryIdentifierTypeUuid: t };
4153
- }, Vg = async (e) => Ce(vl, e), Bg = async (e, t) => Ce(
4153
+ }, zg = async (e) => Ce(vl, e), Gg = async (e, t) => Ce(
4154
4154
  wl(e),
4155
4155
  t
4156
- ), Hg = async () => F(Ma("mrs.genders")), zg = async (e, t, r = Rl, n) => {
4156
+ ), Kg = async () => F(Ma("mrs.genders")), Yg = async (e, t, r = Rl, n) => {
4157
4157
  if (!t || t.length < Tl)
4158
4158
  return [];
4159
4159
  try {
@@ -4165,7 +4165,7 @@ const qn = () => {
4165
4165
  `Failed to fetch address hierarchy for field "${e}": ${s instanceof Error ? s.message : "Unknown error"}`
4166
4166
  );
4167
4167
  }
4168
- }, Gg = async () => F(_l), Kg = async (e) => F(El(e)), Yg = async () => {
4168
+ }, Wg = async () => F(_l), Jg = async (e) => F(El(e)), Qg = async () => {
4169
4169
  try {
4170
4170
  return (await F(
4171
4171
  Sl
@@ -4179,9 +4179,9 @@ const qn = () => {
4179
4179
  `Failed to fetch relationship types: ${e instanceof Error ? e.message : "Unknown error"}`
4180
4180
  );
4181
4181
  }
4182
- }, Wg = async () => F(Nl);
4182
+ }, Xg = async () => F(Nl);
4183
4183
  var Ul = /* @__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))(Ul || {}), xl = /* @__PURE__ */ ((e) => (e.CHECKBOX = "checkbox", e.DROPDOWN = "dropdown", e.TEXT = "text", e.NUMBER = "number", e.DATE = "date", e))(xl || {});
4184
- const Jg = (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", Qg = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype.datatype.BooleanDatatype", Xg = (e) => e === "org.openmrs.Concept" || e === "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype" || e === "org.openmrs.customdatatype.datatype.ConceptDatatype", Zg = (e) => e === "java.lang.Integer" || e === "java.lang.Float", ey = (e) => e === "org.openmrs.util.AttributableDate" || e === "org.openmrs.customdatatype.datatype.DateDatatype", ty = (e) => e === "java.lang.String" || e === "org.openmrs.customdatatype.datatype.FreeTextDatatype" || e === "org.openmrs.customdatatype.datatype.RegexValidatedTextDatatype", ql = (e) => {
4184
+ const Zg = (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", ey = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype.datatype.BooleanDatatype", ty = (e) => e === "org.openmrs.Concept" || e === "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype" || e === "org.openmrs.customdatatype.datatype.ConceptDatatype", ry = (e) => e === "java.lang.Integer" || e === "java.lang.Float", ny = (e) => e === "org.openmrs.util.AttributableDate" || e === "org.openmrs.customdatatype.datatype.DateDatatype", sy = (e) => e === "java.lang.String" || e === "org.openmrs.customdatatype.datatype.FreeTextDatatype" || e === "org.openmrs.customdatatype.datatype.RegexValidatedTextDatatype", ql = (e) => {
4185
4185
  const t = new CustomEvent("bahmni-audit-log", { detail: e });
4186
4186
  window.dispatchEvent(t);
4187
4187
  }, Ml = (e) => {
@@ -4234,10 +4234,10 @@ const Jg = (e) => e === "java.lang.Boolean" || e === "org.openmrs.customdatatype
4234
4234
  }
4235
4235
  }, Fl = W + "/auditlog", jl = {
4236
4236
  UNKNOWN_EVENT_TYPE: "AUDIT_LOG_ERROR_UNKNOWN_EVENT_TYPE"
4237
- }, Vl = () => W + "/bahmnicore/config/bahmniencounter?callerContext=REGISTRATION_CONCEPTS", Bl = W + "/visit", Hl = (e) => W + `/visit?patient=${e}&includeInactive=false&v=custom:(uuid,visitType,startDatetime,stopDatetime)`, zl = (e) => W + `/bahmnicore/visitLocation/${e}`, ry = async () => F(Vl()), Gl = async (e) => F(Hl(e)), Kl = async (e) => F(zl(e)), Yl = async (e) => Ce(Bl, e), ny = async (e) => {
4237
+ }, Vl = () => W + "/bahmnicore/config/bahmniencounter?callerContext=REGISTRATION_CONCEPTS", Bl = W + "/visit", Hl = (e) => W + `/visit?patient=${e}&includeInactive=false&v=custom:(uuid,visitType,startDatetime,stopDatetime)`, zl = (e) => W + `/bahmnicore/visitLocation/${e}`, oy = async () => F(Vl()), Gl = async (e) => F(Hl(e)), Kl = async (e) => F(zl(e)), Yl = async (e) => Ce(Bl, e), ay = async (e) => {
4238
4238
  const t = await Gl(e);
4239
4239
  return t?.results && t.results.length > 0;
4240
- }, sy = async (e, t) => {
4240
+ }, iy = async (e, t) => {
4241
4241
  const r = await Kl(
4242
4242
  qn().uuid
4243
4243
  ), n = {
@@ -5704,7 +5704,7 @@ function Sf(e, t, r) {
5704
5704
  function Rf(e, t, r) {
5705
5705
  return jn(e, -t, r);
5706
5706
  }
5707
- const oy = {
5707
+ const cy = {
5708
5708
  PROPOSED: "proposed",
5709
5709
  PENDING: "pending",
5710
5710
  BOOKED: "booked",
@@ -5715,36 +5715,36 @@ const oy = {
5715
5715
  CHECKED_IN: "checked-in",
5716
5716
  WAITLIST: "waitlist",
5717
5717
  ENTERED_IN_ERROR: "entered-in-error"
5718
- }, Tf = W + "/appointments/search", Qa = W + "/appointments", ay = "http://fhir.bahmni.org/code-system/appointments", Of = (e) => `${Qa}/${e}`, jr = (e, t, r, n) => {
5718
+ }, Tf = W + "/appointments/search", Qa = W + "/appointments", uy = "http://fhir.bahmni.org/code-system/appointments", Of = (e) => `${Qa}/${e}`, jr = (e, t, r, n) => {
5719
5719
  const s = t === "upcoming", o = s ? "ge" : "le", a = s ? "date" : "-date", i = s ? (/* @__PURE__ */ new Date()).toISOString() : Sf(/* @__PURE__ */ new Date()).toISOString();
5720
- let c = `${ue}/Appointment?patient=${e}&date=${o}${i}&_sort=${a}`;
5720
+ let c = `${ce}/Appointment?patient=${e}&date=${o}${i}&_sort=${a}`;
5721
5721
  return r !== void 0 && r > 0 && (c += `&_count=${r}`), n !== void 0 && n > 0 && (c += `&_getpagesoffset=${n}`), c;
5722
- }, Af = (e) => jr(e, "upcoming"), Nf = (e, t) => jr(e, "past", t), $f = (e) => `${Qa}/${e}/status-change`, Pf = W + "/appointmentService/all/full", If = (e) => `${W}/appointmentService?uuid=${e}`, Cf = (e, t = 10, r = 0) => jr(e, "upcoming", t, r), Df = (e, t = 10, r = 0) => jr(e, "past", t, r), iy = async (e) => await Ce(Tf, e);
5723
- async function cy(e) {
5722
+ }, Af = (e) => jr(e, "upcoming"), Nf = (e, t) => jr(e, "past", t), $f = (e) => `${Qa}/${e}/status-change`, Pf = W + "/appointmentService/all/full", If = (e) => `${W}/appointmentService?uuid=${e}`, Cf = (e, t = 10, r = 0) => jr(e, "upcoming", t, r), Df = (e, t = 10, r = 0) => jr(e, "past", t, r), ly = async (e) => await Ce(Tf, e);
5723
+ async function dy(e) {
5724
5724
  return await F(Af(e));
5725
5725
  }
5726
- async function uy(e, t) {
5726
+ async function fy(e, t) {
5727
5727
  return await F(
5728
5728
  Nf(e, t)
5729
5729
  );
5730
5730
  }
5731
- const ly = async (e, t, r) => await Ce($f(e), {
5731
+ const py = async (e, t, r) => await Ce($f(e), {
5732
5732
  toStatus: t,
5733
5733
  onDate: r
5734
5734
  });
5735
- async function dy(e) {
5735
+ async function hy(e) {
5736
5736
  return await F(Of(e));
5737
5737
  }
5738
- const fy = async () => await F(Pf), py = async (e) => {
5738
+ const my = async () => await F(Pf), gy = async (e) => {
5739
5739
  await Pa(If(e));
5740
5740
  };
5741
- async function hy(e, t = 10, r = 1) {
5741
+ async function yy(e, t = 10, r = 1) {
5742
5742
  const n = (r - 1) * t, s = await F(
5743
5743
  Cf(e, t, n)
5744
5744
  );
5745
5745
  return { bundle: s, total: s.total ?? s.entry?.length ?? 0 };
5746
5746
  }
5747
- async function my(e, t = 10, r = 1) {
5747
+ async function vy(e, t = 10, r = 1) {
5748
5748
  const n = (r - 1) * t, s = await F(
5749
5749
  Df(e, t, n)
5750
5750
  );
@@ -5757,7 +5757,7 @@ const Xa = "dd/MM/yyyy", Lf = "default_dateFormat", kf = "h:mm a", Te = {
5757
5757
  INVALID_FORMAT: "DATE_ERROR_INVALID_FORMAT",
5758
5758
  NULL_OR_UNDEFINED: "DATE_ERROR_NULL_OR_UNDEFINED"
5759
5759
  };
5760
- function gy(e) {
5760
+ function wy(e) {
5761
5761
  if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}$/.test(e))
5762
5762
  return null;
5763
5763
  const t = Hn(e);
@@ -5825,7 +5825,7 @@ function xf() {
5825
5825
  return Xa;
5826
5826
  }
5827
5827
  }
5828
- function yy(e, t, r = !1, n) {
5828
+ function Ey(e, t, r = !1, n) {
5829
5829
  const s = t ?? ((a) => a);
5830
5830
  let o;
5831
5831
  try {
@@ -5835,7 +5835,7 @@ function yy(e, t, r = !1, n) {
5835
5835
  }
5836
5836
  return r && !n && (o = `${o} ${kf}`), Uf(e, o, s);
5837
5837
  }
5838
- function vy(e, t, r) {
5838
+ function by(e, t, r) {
5839
5839
  if (!e || !$t(e) || t === null || t === void 0 || !r || typeof t != "number")
5840
5840
  return;
5841
5841
  const n = new Date(e);
@@ -5850,7 +5850,7 @@ function vy(e, t, r) {
5850
5850
  return;
5851
5851
  }
5852
5852
  }
5853
- function wy(e, t) {
5853
+ function _y(e, t) {
5854
5854
  if (e == null)
5855
5855
  return {
5856
5856
  formattedResult: "",
@@ -5902,11 +5902,11 @@ function wy(e, t) {
5902
5902
  }
5903
5903
  return { formattedResult: c };
5904
5904
  }
5905
- const Ey = () => {
5905
+ const Sy = () => {
5906
5906
  const e = /* @__PURE__ */ new Date();
5907
5907
  return e.setHours(0, 0, 0, 0), e;
5908
5908
  };
5909
- function by(e, t) {
5909
+ function Ry(e, t) {
5910
5910
  const r = typeof e == "string" ? Hn(e) : new Date(e), n = /* @__PURE__ */ new Date(), s = Bn(n, r), o = jn(r, s), a = Vn(n, o), i = Mr(o, a), c = Pn(n, i), d = {
5911
5911
  years: "YEARS",
5912
5912
  months: "MONTHS",
@@ -5940,14 +5940,14 @@ const qf = {
5940
5940
  h: 1 / 24,
5941
5941
  min: 1 / 1440,
5942
5942
  s: 1 / 86400
5943
- }, _y = (e, t, r) => {
5943
+ }, Ty = (e, t, r) => {
5944
5944
  const n = typeof e == "string" ? new Date(e) : e;
5945
5945
  if (isNaN(n.getTime()))
5946
5946
  throw new Error(`Invalid date: ${e}`);
5947
5947
  const s = qf[r] ?? 1, o = t * s;
5948
5948
  return za(n, o);
5949
- }, Sy = (e, t, r, n) => e <= n && r <= t;
5950
- function Ry(e, t, r = !1) {
5949
+ }, Oy = (e, t, r, n) => e <= n && r <= t;
5950
+ function Ay(e, t, r = !1) {
5951
5951
  return !e || !Array.isArray(e) ? [] : e.sort((n, s) => {
5952
5952
  const o = new Date(n[t]), a = new Date(s[t]);
5953
5953
  if (isNaN(o.getTime()) && isNaN(a.getTime())) return 0;
@@ -5986,7 +5986,7 @@ const Mf = () => {
5986
5986
  );
5987
5987
  }
5988
5988
  };
5989
- }, Ty = Mf(), Ff = (e) => ue + `/ValueSet/${e}/$expand`, jf = (e) => ue + `/ValueSet/$expand?filter=${encodeURIComponent(e)}`, Vf = (e, t, r) => W + `/bahmni/terminologies/concepts?limit=${t}&locale=${r}&term=${e}`, Bf = (e) => W + `/concept/${e}`, Hf = (e) => `${W}/concept?s=byFullySpecifiedName&name=${encodeURIComponent(e)}`, zf = "SHORT", Gf = "FULLY_SPECIFIED", Oy = async (e, t = 20) => {
5989
+ }, Ny = Mf(), Ff = (e) => ce + `/ValueSet/${e}/$expand`, jf = (e) => ce + `/ValueSet/$expand?filter=${encodeURIComponent(e)}`, Vf = (e, t, r) => W + `/bahmni/terminologies/concepts?limit=${t}&locale=${r}&term=${e}`, Bf = (e) => W + `/concept/${e}`, Hf = (e) => `${W}/concept?s=byFullySpecifiedName&name=${encodeURIComponent(e)}`, zf = "SHORT", Gf = "FULLY_SPECIFIED", $y = async (e, t = 20) => {
5990
5990
  const r = qr(), n = Vf(e, t, r);
5991
5991
  return F(n);
5992
5992
  }, br = async (e) => {
@@ -5996,10 +5996,10 @@ const Mf = () => {
5996
5996
  const t = `${jf(e)}`;
5997
5997
  return F(t);
5998
5998
  };
5999
- async function Ay(e) {
5999
+ async function Py(e) {
6000
6000
  return await F(Bf(e));
6001
6001
  }
6002
- async function Ny(e) {
6002
+ async function Iy(e) {
6003
6003
  const t = Hf(e), r = await F(t);
6004
6004
  return !r.results || r.results.length === 0 ? null : r.results[0];
6005
6005
  }
@@ -6013,7 +6013,7 @@ function Yf(e) {
6013
6013
  }
6014
6014
  return t ?? e[0].name ?? null;
6015
6015
  }
6016
- const Wf = (e) => ue + `/AllergyIntolerance?patient=${e}&_count=100&_sort=-_lastUpdated`, et = {
6016
+ const Wf = (e) => ce + `/AllergyIntolerance?patient=${e}&_count=100&_sort=-_lastUpdated`, et = {
6017
6017
  FOOD: {
6018
6018
  code: "162553AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
6019
6019
  display: "food"
@@ -6035,7 +6035,7 @@ const Wf = (e) => ue + `/AllergyIntolerance?patient=${e}&_count=100&_sort=-_last
6035
6035
  }), an = (e, t) => {
6036
6036
  const r = e.expansion?.contains ?? [];
6037
6037
  return Qf(r).map((s) => Xf(s, t));
6038
- }, $y = async (e, t, r) => {
6038
+ }, Cy = async (e, t, r) => {
6039
6039
  const n = e ?? et.MEDICATION.code, s = t ?? et.FOOD.code, o = r ?? et.ENVIRONMENT.code, [a, i, c] = await Promise.all([
6040
6040
  br(n),
6041
6041
  br(s),
@@ -6055,7 +6055,7 @@ const Wf = (e) => ue + `/AllergyIntolerance?patient=${e}&_count=100&_sort=-_last
6055
6055
  et.ENVIRONMENT.display
6056
6056
  )
6057
6057
  ];
6058
- }, Py = async (e) => {
6058
+ }, Dy = async (e) => {
6059
6059
  const t = e ?? Jf.code;
6060
6060
  return (await br(t)).compose?.include[0]?.concept ?? [];
6061
6061
  };
@@ -6089,22 +6089,22 @@ function tp(e) {
6089
6089
  };
6090
6090
  });
6091
6091
  }
6092
- async function Iy(e) {
6092
+ async function Ly(e) {
6093
6093
  const t = await ep(e);
6094
6094
  return tp(t);
6095
6095
  }
6096
6096
  var rp = /* @__PURE__ */ ((e) => (e.Active = "Active", e.Inactive = "Inactive", e))(rp || {}), np = /* @__PURE__ */ ((e) => (e.mild = "mild", e.moderate = "moderate", e.severe = "severe", e))(np || {});
6097
- const Cy = "http://fhir.openmrs.org/code-system/encounter-type", ei = "problem-list-item", Dy = "http://terminology.hl7.org/CodeSystem/condition-ver-status", ti = "encounter-diagnosis", Ly = "http://terminology.hl7.org/CodeSystem/condition-clinical", ky = "http://terminology.hl7.org/CodeSystem/condition-category", Uy = "http://fhir.bahmni.org/ext/lab-order-concept-type", xy = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", qy = "http://fhir.bahmni.org/ext/observation/form-namespace-path", My = "http://fhir.bahmni.org/ext/observation/obs-value-attachment", Fy = "Numeric", jy = "Complex", Vy = "final", By = "Observation", Hy = /^\d{4}-\d{2}-\d{2}/, sp = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/, zy = {
6097
+ const ky = "http://fhir.openmrs.org/code-system/encounter-type", ei = "problem-list-item", Uy = "http://terminology.hl7.org/CodeSystem/condition-ver-status", ti = "encounter-diagnosis", xy = "http://terminology.hl7.org/CodeSystem/condition-clinical", qy = "http://terminology.hl7.org/CodeSystem/condition-category", My = "http://fhir.bahmni.org/ext/lab-order-concept-type", Fy = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", jy = "http://fhir.bahmni.org/ext/observation/form-namespace-path", Vy = "http://fhir.bahmni.org/ext/observation/obs-value-attachment", By = "Numeric", Hy = "Complex", zy = "final", Gy = "Observation", Ky = /^\d{4}-\d{2}-\d{2}/, sp = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/, Yy = {
6098
6098
  ABNORMAL: { code: "A", display: "Abnormal" },
6099
6099
  NORMAL: { code: "N", display: "Normal" }
6100
- }, op = (e) => ue + `/Condition?category=${ei}&patient=${e}&_count=100&_sort=-_lastUpdated`, ap = (e, t = 10, r = 0) => ue + `/Condition?category=${ei}&patient=${e}&_count=${t}&_getpagesoffset=${r}&_sort=-_lastUpdated`;
6100
+ }, op = (e) => ce + `/Condition?category=${ei}&patient=${e}&_count=100&_sort=-_lastUpdated`, ap = (e, t = 10, r = 0) => ce + `/Condition?category=${ei}&patient=${e}&_count=${t}&_getpagesoffset=${r}&_sort=-_lastUpdated`;
6101
6101
  async function ip(e) {
6102
6102
  return await F(`${op(e)}`);
6103
6103
  }
6104
- async function Gy(e) {
6104
+ async function Wy(e) {
6105
6105
  return (await ip(e)).entry?.filter((n) => n.resource?.resourceType === "Condition").map((n) => n.resource) ?? [];
6106
6106
  }
6107
- async function Ky(e, t = 10, r = 1) {
6107
+ async function Jy(e, t = 10, r = 1) {
6108
6108
  const n = (r - 1) * t, s = await F(
6109
6109
  ap(e, t, n)
6110
6110
  );
@@ -6113,7 +6113,7 @@ async function Ky(e, t = 10, r = 1) {
6113
6113
  total: s.total
6114
6114
  };
6115
6115
  }
6116
- const cp = (e) => ue + `/Condition?category=${ti}&patient=${e}&_count=100&_sort=-_lastUpdated`, up = (e, t = 10, r = 0) => ue + `/Condition?category=${ti}&patient=${e}&_count=${t}&_getpagesoffset=${r}&_sort=-_lastUpdated`, cn = [
6116
+ const cp = (e) => ce + `/Condition?category=${ti}&patient=${e}&_count=100&_sort=-_lastUpdated`, up = (e, t = 10, r = 0) => ce + `/Condition?category=${ti}&patient=${e}&_count=${t}&_getpagesoffset=${r}&_sort=-_lastUpdated`, cn = [
6117
6117
  {
6118
6118
  code: "confirmed",
6119
6119
  display: "CERTAINITY_CONFIRMED",
@@ -6170,11 +6170,11 @@ function gp(e) {
6170
6170
  }
6171
6171
  return Array.from(t.values());
6172
6172
  }
6173
- async function Yy(e) {
6173
+ async function Qy(e) {
6174
6174
  const t = await fp(e), r = ri(t);
6175
6175
  return gp(r);
6176
6176
  }
6177
- async function Wy(e, t = 10, r = 1) {
6177
+ async function Xy(e, t = 10, r = 1) {
6178
6178
  const n = (r - 1) * t, s = await pp(
6179
6179
  e,
6180
6180
  t,
@@ -6195,12 +6195,12 @@ const bt = {
6195
6195
  // Use only when medication details are needed immediately
6196
6196
  INCLUDE_MEDICATION: "_include=MedicationRequest:medication"
6197
6197
  }, yp = (e, t, r) => {
6198
- let s = `${ue + "/MedicationRequest?" + bt.SORT + "&" + bt.COUNT}&patient=${e}`;
6198
+ let s = `${ce + "/MedicationRequest?" + bt.SORT + "&" + bt.COUNT}&patient=${e}`;
6199
6199
  return t && (s += `&code=${t}`), r && (s += `&encounter=${r}`), s;
6200
6200
  }, vp = (e, t, r) => {
6201
- let s = `${ue + "/MedicationRequest?" + bt.SORT + "&" + bt.COUNT + "&" + bt.INCLUDE_MEDICATION}&patient=${e}`;
6201
+ let s = `${ce + "/MedicationRequest?" + bt.SORT + "&" + bt.COUNT + "&" + bt.INCLUDE_MEDICATION}&patient=${e}`;
6202
6202
  return t && (s += `&code=${t}`), r && (s += `&encounter=${r}`), s;
6203
- }, wp = W + "/bahmnicore/config/drugOrders", Ep = (e, t) => ue + `/Medication?name=${encodeURIComponent(e)}&_count=${t}&_sort=-_lastUpdated`, bp = ue + "/Medication?code=http://hl7.org/fhir/sid/cvx|&_count=100", _p = (e) => {
6203
+ }, wp = W + "/bahmnicore/config/drugOrders", Ep = (e, t) => ce + `/Medication?name=${encodeURIComponent(e)}&_count=${t}&_sort=-_lastUpdated`, bp = ce + "/Medication?code=http://hl7.org/fhir/sid/cvx|&_count=100", _p = (e) => {
6204
6204
  switch (e.status) {
6205
6205
  case "active":
6206
6206
  return Ue.Active;
@@ -6348,7 +6348,7 @@ function Lp(e) {
6348
6348
  });
6349
6349
  }
6350
6350
  const Bs = (e) => e.priority === "stat" || e.dosageInstruction?.[0]?.timing?.code?.text === "Immediately" || !1;
6351
- async function Jy(e, t, r, n = !1) {
6351
+ async function Zy(e, t, r, n = !1) {
6352
6352
  const s = await Sp(
6353
6353
  e,
6354
6354
  t,
@@ -6357,21 +6357,21 @@ async function Jy(e, t, r, n = !1) {
6357
6357
  );
6358
6358
  return Lp(s);
6359
6359
  }
6360
- async function Qy() {
6360
+ async function ev() {
6361
6361
  return await F(
6362
6362
  wp
6363
6363
  );
6364
6364
  }
6365
- async function Xy(e, t = 20) {
6365
+ async function tv(e, t = 20) {
6366
6366
  return await F(
6367
6367
  Ep(e, t)
6368
6368
  );
6369
6369
  }
6370
- async function Zy() {
6370
+ async function rv() {
6371
6371
  return await F(bp);
6372
6372
  }
6373
6373
  const kp = 200, Up = (e, t, r, n, s) => {
6374
- let a = `${ue + `/ServiceRequest?_count=${kp}&_sort=-_lastUpdated`}&category=${e}&patient=${t}`;
6374
+ let a = `${ce + `/ServiceRequest?_count=${kp}&_sort=-_lastUpdated`}&category=${e}&patient=${t}`;
6375
6375
  return s && (a += `&_revinclude=${s}`), r ? a += `&encounter=${r}` : n && (a += `&numberOfVisits=${n}`), a;
6376
6376
  };
6377
6377
  function xp(e) {
@@ -6400,8 +6400,8 @@ async function Pt(e, t, r, n, s) {
6400
6400
  );
6401
6401
  return a.entry && (a.entry = xp(a.entry), a.total = a.entry.length), a;
6402
6402
  }
6403
- const qp = (e) => `${ue}/ImagingStudy/${e}/$fetch-quality-assessment`;
6404
- async function ev(e, t, r, n) {
6403
+ const qp = (e) => `${ce}/ImagingStudy/${e}/$fetch-quality-assessment`;
6404
+ async function nv(e, t, r, n) {
6405
6405
  return await Pt(
6406
6406
  t,
6407
6407
  e,
@@ -6409,7 +6409,7 @@ async function ev(e, t, r, n) {
6409
6409
  n
6410
6410
  );
6411
6411
  }
6412
- async function tv(e, t, r, n) {
6412
+ async function sv(e, t, r, n) {
6413
6413
  return await Pt(
6414
6414
  t,
6415
6415
  e,
@@ -6418,7 +6418,7 @@ async function tv(e, t, r, n) {
6418
6418
  "ImagingStudy:basedon"
6419
6419
  );
6420
6420
  }
6421
- async function rv(e, t, r, n) {
6421
+ async function ov(e, t, r, n) {
6422
6422
  return (await Pt(
6423
6423
  t,
6424
6424
  e,
@@ -6426,10 +6426,10 @@ async function rv(e, t, r, n) {
6426
6426
  n
6427
6427
  )).entry?.filter((a) => a.resource?.resourceType === "ServiceRequest").map((a) => a.resource) ?? [];
6428
6428
  }
6429
- async function nv(e) {
6429
+ async function av(e) {
6430
6430
  return await F(qp(e));
6431
6431
  }
6432
- async function sv(e, t, r, n) {
6432
+ async function iv(e, t, r, n) {
6433
6433
  return await Pt(
6434
6434
  t,
6435
6435
  e,
@@ -6438,32 +6438,32 @@ async function sv(e, t, r, n) {
6438
6438
  );
6439
6439
  }
6440
6440
  const Mp = (e, t) => {
6441
- const r = `${ue}/DiagnosticReport?patient=${e}`;
6441
+ const r = `${ce}/DiagnosticReport?patient=${e}`;
6442
6442
  return t ? `${r}&based-on=${t}` : r;
6443
- }, Fp = (e) => `${ue}/DiagnosticReport/${e}/$fetch-bundle`, jp = (e) => `${ue}/DiagnosticReport/${e}/$update-bundle`;
6444
- async function ov(e, t = []) {
6443
+ }, Fp = (e) => `${ce}/DiagnosticReport/${e}/$fetch-bundle`, jp = (e) => `${ce}/DiagnosticReport/${e}/$update-bundle`;
6444
+ async function cv(e, t = []) {
6445
6445
  const r = t.length > 0 ? t.join(",") : void 0, n = Mp(e, r);
6446
6446
  return await F(n);
6447
6447
  }
6448
- async function av(e) {
6448
+ async function uv(e) {
6449
6449
  const t = Fp(e);
6450
6450
  return await F(t);
6451
6451
  }
6452
- async function iv(e, t) {
6452
+ async function lv(e, t) {
6453
6453
  const r = jp(e);
6454
6454
  return await Ce(r, t);
6455
6455
  }
6456
- const cv = [
6456
+ const dv = [
6457
6457
  "preliminary",
6458
6458
  "final",
6459
6459
  "amended",
6460
6460
  "corrected",
6461
6461
  "appended"
6462
- ], uv = [
6462
+ ], fv = [
6463
6463
  "registered",
6464
6464
  "unknown",
6465
6465
  "partial"
6466
- ], Vp = "All Orderables", Bp = "/openmrs/ws/rest/v1/ordertype?v=custom:(uuid,display,conceptClasses:(uuid,name))", Hp = "LabSet", zp = "http://fhir.bahmni.org/ext/ValueSet/concept-class", lv = ["orderTypes"], Gp = async () => await Kf(Vp), zn = async () => await F(Bp), Kp = (e) => {
6466
+ ], Vp = "All Orderables", Bp = "/openmrs/ws/rest/v1/ordertype?v=custom:(uuid,display,conceptClasses:(uuid,name))", Hp = "LabSet", zp = "http://fhir.bahmni.org/ext/ValueSet/concept-class", pv = ["orderTypes"], Gp = async () => await Kf(Vp), zn = async () => await F(Bp), Kp = (e) => {
6467
6467
  let t = e.display ?? "Unknown investigation";
6468
6468
  return ni(e) === Hp && (t += ` (${ie.t("INVESTIGATION_PANEL")})`), t;
6469
6469
  }, Yp = (e) => {
@@ -6495,12 +6495,12 @@ const cv = [
6495
6495
  });
6496
6496
  });
6497
6497
  }), r;
6498
- }, dv = async () => {
6498
+ }, hv = async () => {
6499
6499
  const e = await Gp(), t = await zn();
6500
6500
  return Wp(e, Yp(t));
6501
- }, fv = async (e) => e ? (await zn()).results.find(
6501
+ }, mv = async (e) => e ? (await zn()).results.find(
6502
6502
  (n) => n.display.toLowerCase() === e.toLowerCase()
6503
- )?.uuid : void 0, pv = async () => (await zn()).results.map((t) => t.display), hv = async (e, t, r) => {
6503
+ )?.uuid : void 0, gv = async () => (await zn()).results.map((t) => t.display), yv = async (e, t, r) => {
6504
6504
  const n = [];
6505
6505
  for (const s of e) {
6506
6506
  const o = s.uuid;
@@ -7318,9 +7318,9 @@ function Z() {
7318
7318
  return P.reduce(fe);
7319
7319
  }
7320
7320
  e.and = Q;
7321
- const ce = A(e.operators.OR);
7321
+ const ue = A(e.operators.OR);
7322
7322
  function U(...P) {
7323
- return P.reduce(ce);
7323
+ return P.reduce(ue);
7324
7324
  }
7325
7325
  e.or = U;
7326
7326
  function A(P) {
@@ -8276,8 +8276,8 @@ function Br() {
8276
8276
  let re = E[B];
8277
8277
  typeof M[p] == "string" && (re = ne.call(this, M[p])), fe.call(this, M.$anchor), fe.call(this, M.$dynamicAnchor), E[q] = re;
8278
8278
  function ne(Q) {
8279
- const ce = this.opts.uriResolver.resolve;
8280
- if (Q = m(re ? ce(re, Q) : Q), R.has(Q))
8279
+ const ue = this.opts.uriResolver.resolve;
8280
+ if (Q = m(re ? ue(re, Q) : Q), R.has(Q))
8281
8281
  throw k(Q);
8282
8282
  R.add(Q);
8283
8283
  let U = this.refs[Q];
@@ -8431,9 +8431,9 @@ function Hr() {
8431
8431
  });
8432
8432
  }
8433
8433
  function Q(O, $) {
8434
- O.schemaEnv.meta || !O.opts.strictTypes || (ce(O, $), O.opts.allowUnionTypes || U(O, $), A(O, O.dataTypes));
8434
+ O.schemaEnv.meta || !O.opts.strictTypes || (ue(O, $), O.opts.allowUnionTypes || U(O, $), A(O, O.dataTypes));
8435
8435
  }
8436
- function ce(O, $) {
8436
+ function ue(O, $) {
8437
8437
  if ($.length) {
8438
8438
  if (!O.dataTypes.length) {
8439
8439
  O.dataTypes = $;
@@ -9459,7 +9459,7 @@ function hh() {
9459
9459
  if (typeof z != "object")
9460
9460
  continue;
9461
9461
  const { $data: se } = z.definition, ee = C[V];
9462
- se && ee && (C[V] = ce(ee));
9462
+ se && ee && (C[V] = ue(ee));
9463
9463
  }
9464
9464
  }
9465
9465
  return A;
@@ -9598,12 +9598,12 @@ function hh() {
9598
9598
  }
9599
9599
  function fe(U) {
9600
9600
  let { metaSchema: A } = U;
9601
- A !== void 0 && (U.$data && this.opts.$data && (A = ce(A)), U.validateSchema = this.compile(A, !0));
9601
+ A !== void 0 && (U.$data && this.opts.$data && (A = ue(A)), U.validateSchema = this.compile(A, !0));
9602
9602
  }
9603
9603
  const Q = {
9604
9604
  $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
9605
9605
  };
9606
- function ce(U) {
9606
+ function ue(U) {
9607
9607
  return { anyOf: [U, Q] };
9608
9608
  }
9609
9609
  })(un)), un;
@@ -10915,7 +10915,7 @@ var sm = nm();
10915
10915
  const om = /* @__PURE__ */ Jp(sm), oa = {
10916
10916
  CONFIG_NOT_FOUND: "CONFIG_ERROR_NOT_FOUND",
10917
10917
  VALIDATION_FAILED: "CONFIG_ERROR_VALIDATION_FAILED"
10918
- }, mv = async (e, t) => {
10918
+ }, vv = async (e, t) => {
10919
10919
  const r = await am(e);
10920
10920
  if (!r)
10921
10921
  throw new Error(oa.CONFIG_NOT_FOUND);
@@ -10925,35 +10925,35 @@ const om = /* @__PURE__ */ Jp(sm), oa = {
10925
10925
  }, am = async (e) => await F(e), im = async (e, t) => new om().compile(t)(e), cm = (e) => W + `/form/${e}?v=custom:(resources:(value))`, um = (e) => {
10926
10926
  const t = W + "/bahmniie/form/latestPublishedForms";
10927
10927
  return e ? t + `?episodeUuid=${e}` : t;
10928
- }, gv = (e) => W + `/user/${e}?v=full`, lm = (e, t, r, n) => W + `/bahmniie/form/translations?formName=${encodeURIComponent(e)}&formUuid=${t}&formVersion=${r}&locale=${n}`, _r = "Bahmni", dm = (e, t, r) => {
10928
+ }, wv = (e) => W + `/user/${e}?v=full`, lm = (e, t, r, n) => W + `/bahmniie/form/translations?formName=${encodeURIComponent(e)}&formUuid=${t}&formVersion=${r}&locale=${n}`, _r = "Bahmni", dm = (e, t, r) => {
10929
10929
  let s = W + "/bahmnicore/patient/" + e + "/forms";
10930
10930
  return r ? s += `?patientProgramUuid=${r}` : t && (s += `?numberOfVisits=${t}`), s;
10931
10931
  }, fm = (e, t) => {
10932
10932
  const r = t.join(",");
10933
- return `${ue}/Observation?patient=${e}&code=${r}&_include=Observation:has-member&_sort=-_lastUpdated`;
10933
+ return `${ce}/Observation?patient=${e}&code=${r}&_include=Observation:has-member&_sort=-_lastUpdated`;
10934
10934
  }, pm = (e, t) => {
10935
10935
  const r = t.join(",");
10936
- return `${ue}/Observation?patient=${e}&code=${r}&_include=Observation:has-member&_include=Observation:encounter&_sort=-_lastUpdated`;
10936
+ return `${ce}/Observation?patient=${e}&code=${r}&_include=Observation:has-member&_include=Observation:encounter&_sort=-_lastUpdated`;
10937
10937
  };
10938
10938
  async function hm(e, t) {
10939
10939
  const r = fm(e, t);
10940
10940
  return await F(r);
10941
10941
  }
10942
- async function yv(e, t) {
10942
+ async function Ev(e, t) {
10943
10943
  const r = pm(e, t);
10944
10944
  return await F(r);
10945
10945
  }
10946
- async function vv(e, t) {
10946
+ async function bv(e, t) {
10947
10947
  return (await hm(e, t)).entry?.filter((s) => s.resource?.resourceType === "Observation").map((s) => s.resource) ?? [];
10948
10948
  }
10949
10949
  const mm = (e) => W + `/provider?user=${e}&v=custom:(uuid,display,person)`;
10950
- async function wv(e) {
10950
+ async function _v(e) {
10951
10951
  const t = await F(
10952
10952
  mm(e)
10953
10953
  );
10954
10954
  return !t.results || t.results.length === 0 ? null : t.results[0];
10955
10955
  }
10956
- const gm = (e) => ue + `/Encounter?subject:Patient=${e}&_tag=visit`, ym = (e) => `${ue}/Observation/$fetch-all?encounter=${e}`;
10956
+ const gm = (e) => ce + `/Encounter?subject:Patient=${e}&_tag=visit`, ym = (e) => `${ce}/Observation/$fetch-all?encounter=${e}`;
10957
10957
  async function vm(e) {
10958
10958
  return await F(gm(e));
10959
10959
  }
@@ -10963,12 +10963,12 @@ async function wm(e) {
10963
10963
  async function Em(e) {
10964
10964
  return (await wm(e)).find((r) => !r.period?.end) ?? null;
10965
10965
  }
10966
- async function Ev(e) {
10966
+ async function Sv(e) {
10967
10967
  return await F(
10968
10968
  ym(e)
10969
10969
  );
10970
10970
  }
10971
- const bv = (e, t) => e?.length === 0 ? !1 : t?.length === 0, bm = ue + "/Encounter", _m = W + "/systemsetting/bahmni.encountersession.duration", Sm = "d34fe3ab-5e07-11ef-8f7c-0242ac120002";
10971
+ const Rv = (e, t) => e?.length === 0 ? !1 : t?.length === 0, bm = ce + "/Encounter", _m = W + "/systemsetting/bahmni.encountersession.duration", Sm = "d34fe3ab-5e07-11ef-8f7c-0242ac120002";
10972
10972
  async function Rm(e) {
10973
10973
  const t = new URLSearchParams();
10974
10974
  Object.entries(e).forEach(([s, o]) => {
@@ -10999,7 +10999,7 @@ async function Om(e, t) {
10999
10999
  return null;
11000
11000
  }
11001
11001
  }
11002
- async function _v(e, t, r) {
11002
+ async function Tv(e, t, r) {
11003
11003
  try {
11004
11004
  if (!e) return null;
11005
11005
  const n = r ?? await Tm(), o = `ge${new Date(Date.now() - n * 60 * 1e3).toISOString()}`, a = {
@@ -11015,8 +11015,8 @@ async function _v(e, t, r) {
11015
11015
  return null;
11016
11016
  }
11017
11017
  }
11018
- const Am = (e) => ue + `/EpisodeOfCare?_revinclude=Encounter:episode-of-care&_id=${e}`;
11019
- async function Sv(e) {
11018
+ const Am = (e) => ce + `/EpisodeOfCare?_revinclude=Encounter:episode-of-care&_id=${e}`;
11019
+ async function Ov(e) {
11020
11020
  const t = e.join(","), r = await F(Am(t));
11021
11021
  if (r.total === 0)
11022
11022
  throw new Error(
@@ -11052,21 +11052,21 @@ const En = /* @__PURE__ */ new Map(), Nm = async (e) => {
11052
11052
  module: n
11053
11053
  };
11054
11054
  return await Ce(Fl, a), { logged: !0 };
11055
- }, Rv = () => Ml(async (t) => {
11055
+ }, Av = () => Ml(async (t) => {
11056
11056
  await Pm(
11057
11057
  t.patientUuid,
11058
11058
  t.eventType,
11059
11059
  t.messageParams,
11060
11060
  t.module
11061
11061
  );
11062
- }), Tv = async () => {
11062
+ }), Nv = async () => {
11063
11063
  try {
11064
11064
  return (await F(xa)).user.privileges;
11065
11065
  } catch (e) {
11066
11066
  const { message: t } = Rr(e);
11067
11067
  throw new Error(t);
11068
11068
  }
11069
- }, Ov = (e, t) => {
11069
+ }, $v = (e, t) => {
11070
11070
  if (!e || e.length === 0)
11071
11071
  return !1;
11072
11072
  if (!t || t.length === 0)
@@ -11106,12 +11106,12 @@ const En = /* @__PURE__ */ new Map(), Nm = async (e) => {
11106
11106
  editable: n.editable
11107
11107
  }))
11108
11108
  };
11109
- }, Av = async (e) => {
11109
+ }, Pv = async (e) => {
11110
11110
  const t = await Im(e), r = qr();
11111
11111
  return t.map(
11112
11112
  (n) => Dm(n, r)
11113
11113
  );
11114
- }, Nv = async (e) => {
11114
+ }, Iv = async (e) => {
11115
11115
  const t = await fetch(cm(e));
11116
11116
  if (!t.ok)
11117
11117
  throw new Error(
@@ -11145,7 +11145,7 @@ const En = /* @__PURE__ */ new Map(), Nm = async (e) => {
11145
11145
  schema: n,
11146
11146
  translations: d
11147
11147
  };
11148
- }, $v = async (e, t, r) => {
11148
+ }, Cv = async (e, t, r) => {
11149
11149
  let n;
11150
11150
  t && t.length > 0 && (n = t.join(","));
11151
11151
  const s = dm(e, r, n), o = await F(s);
@@ -11190,7 +11190,7 @@ function fi(e, t) {
11190
11190
  };
11191
11191
  return n(r.controls);
11192
11192
  }
11193
- function Pv(e, t) {
11193
+ function Dv(e, t) {
11194
11194
  if (!e.controls || e.controls.length === 0)
11195
11195
  return [];
11196
11196
  const r = [], n = (/* @__PURE__ */ new Date()).toISOString();
@@ -11235,7 +11235,7 @@ function Pv(e, t) {
11235
11235
  s.interpretation && (a.interpretation = s.interpretation), s.comment && (a.comment = s.comment), r.push(a);
11236
11236
  }), r;
11237
11237
  }
11238
- function Iv(e, t) {
11238
+ function Lv(e, t) {
11239
11239
  if (!e || e.length === 0)
11240
11240
  return {
11241
11241
  controls: [],
@@ -11268,7 +11268,7 @@ function Iv(e, t) {
11268
11268
  metadata: { formMetadata: t }
11269
11269
  };
11270
11270
  }
11271
- function Cv(e) {
11271
+ function kv(e) {
11272
11272
  const t = (n) => {
11273
11273
  const s = (d) => d == null ? null : typeof d == "string" || typeof d == "number" || typeof d == "boolean" || typeof d == "object" ? d : null, o = n.concept, a = typeof o == "object" && o !== null && "uuid" in o ? o.uuid : o, i = typeof o == "object" && o !== null && "datatype" in o ? o.datatype : void 0, c = {
11274
11274
  concept: {
@@ -11288,11 +11288,11 @@ function Cv(e) {
11288
11288
  };
11289
11289
  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);
11290
11290
  }
11291
- function Dv(e) {
11291
+ function Uv(e) {
11292
11292
  if (!(!e || typeof e != "object"))
11293
11293
  return "toJS" in e && typeof e.toJS == "function" ? e.toJS() : e;
11294
11294
  }
11295
- function Lv(e, t) {
11295
+ function xv(e, t) {
11296
11296
  !e || !Array.isArray(e.children) || e.children.forEach((r) => {
11297
11297
  r && typeof r == "object" && pi(
11298
11298
  r,
@@ -11322,7 +11322,7 @@ function pi(e, t) {
11322
11322
  );
11323
11323
  });
11324
11324
  }
11325
- const Lm = W + "/bahmnicore/diseaseSummaryData?", kv = async (e, t, r, n) => {
11325
+ const Lm = W + "/bahmnicore/diseaseSummaryData?", qv = async (e, t, r, n) => {
11326
11326
  const s = new URLSearchParams({
11327
11327
  groupBy: n,
11328
11328
  latestCount: t.toString(),
@@ -11333,7 +11333,7 @@ const Lm = W + "/bahmnicore/diseaseSummaryData?", kv = async (e, t, r, n) => {
11333
11333
  });
11334
11334
  const o = Lm + s.toString();
11335
11335
  return F(o);
11336
- }, Wn = "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)", km = (e) => `${W}/bahmniprogramenrollment?patient=${e}&v=${Wn}`, Um = (e, t = 15, r = 0) => `${W}/bahmniprogramenrollment?patient=${e}&v=${Wn}&limit=${t}&startIndex=${r}&totalCount=true`, hi = (e) => `${W}/bahmniprogramenrollment/${e}`, xm = (e) => `${hi(e)}?v=${Wn}`, Uv = async (e) => await F(km(e)), xv = async (e, t = 15, r = 1) => {
11336
+ }, Wn = "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)", km = (e) => `${W}/bahmniprogramenrollment?patient=${e}&v=${Wn}`, Um = (e, t = 15, r = 0) => `${W}/bahmniprogramenrollment?patient=${e}&v=${Wn}&limit=${t}&startIndex=${r}&totalCount=true`, hi = (e) => `${W}/bahmniprogramenrollment/${e}`, xm = (e) => `${hi(e)}?v=${Wn}`, Mv = async (e) => await F(km(e)), Fv = async (e, t = 15, r = 1) => {
11337
11337
  const n = (r - 1) * t, s = await F(
11338
11338
  Um(e, t, n)
11339
11339
  );
@@ -11341,7 +11341,7 @@ const Lm = W + "/bahmnicore/diseaseSummaryData?", kv = async (e, t, r, n) => {
11341
11341
  programs: s.results,
11342
11342
  total: s.totalCount
11343
11343
  };
11344
- }, qv = async (e) => await F(xm(e)), Mv = async (e, t) => {
11344
+ }, jv = async (e) => await F(xm(e)), Vv = async (e, t) => {
11345
11345
  const r = {
11346
11346
  uuid: e,
11347
11347
  states: [
@@ -11355,7 +11355,7 @@ const Lm = W + "/bahmnicore/diseaseSummaryData?", kv = async (e, t, r, n) => {
11355
11355
  r
11356
11356
  );
11357
11357
  };
11358
- function Fv(e) {
11358
+ function Bv(e) {
11359
11359
  if (e.states.length === 0)
11360
11360
  return null;
11361
11361
  let t;
@@ -11371,7 +11371,7 @@ function Fv(e) {
11371
11371
  t = e.states.find((r) => r.endDate === null);
11372
11372
  return t ? Yf(t.state.concept.names) ?? t.state.concept.display : null;
11373
11373
  }
11374
- function jv(e, t) {
11374
+ function Hv(e, t) {
11375
11375
  if (t.length === 0)
11376
11376
  return {};
11377
11377
  const r = {};
@@ -11383,12 +11383,12 @@ function jv(e, t) {
11383
11383
  }
11384
11384
  return r;
11385
11385
  }
11386
- const In = "consultation:saved", Vv = (e) => {
11386
+ const In = "consultation:saved", zv = (e) => {
11387
11387
  const t = new CustomEvent(In, {
11388
11388
  detail: e
11389
11389
  });
11390
11390
  window.dispatchEvent(t);
11391
- }, Bv = (e, t = []) => {
11391
+ }, Gv = (e, t = []) => {
11392
11392
  const r = bn(e);
11393
11393
  _n(() => {
11394
11394
  r.current = e;
@@ -11402,7 +11402,7 @@ const In = "consultation:saved", Vv = (e) => {
11402
11402
  };
11403
11403
  }, t);
11404
11404
  }, mi = (e, t, r = 100, n = 0) => {
11405
- const s = `${ue}/DocumentReference?patient=${e}&_sort=-_lastUpdated&_count=${r}&_getpagesoffset=${n}`;
11405
+ const s = `${ce}/DocumentReference?patient=${e}&_sort=-_lastUpdated&_count=${r}&_getpagesoffset=${n}`;
11406
11406
  return t && t.length > 0 ? `${s}&encounter=${t.join(",")}` : s;
11407
11407
  };
11408
11408
  function gi(e) {
@@ -11424,13 +11424,13 @@ async function qm(e, t) {
11424
11424
  const r = mi(e, t);
11425
11425
  return F(r);
11426
11426
  }
11427
- async function Hv(e, t) {
11427
+ async function Kv(e, t) {
11428
11428
  const n = ((await qm(e, t)).entry ?? []).filter(
11429
11429
  (s) => !!s.resource
11430
11430
  );
11431
11431
  return gi(n);
11432
11432
  }
11433
- async function zv(e, t, r = 10, n = 1) {
11433
+ async function Yv(e, t, r = 10, n = 1) {
11434
11434
  const s = (n - 1) * r, o = mi(
11435
11435
  e,
11436
11436
  t,
@@ -11444,8 +11444,20 @@ async function zv(e, t, r = 10, n = 1) {
11444
11444
  total: a.total ?? i.length
11445
11445
  };
11446
11446
  }
11447
- const Mm = W + "/bahmnicore/visitDocument/uploadDocument", Fm = "application";
11448
- async function jm(e) {
11447
+ const Mm = ce + "/Immunization", Fm = (e, t) => {
11448
+ let r = `${Mm}?patient=${e}&_sort=-_lastUpdated&_count=100`;
11449
+ return t && (r += `&status=${t}`), r;
11450
+ };
11451
+ async function Wv(e, t) {
11452
+ return (await jm(e, t)).entry?.filter((n) => n.resource?.resourceType === "Immunization").map((n) => n.resource) ?? [];
11453
+ }
11454
+ async function jm(e, t) {
11455
+ return F(
11456
+ Fm(e, t)
11457
+ );
11458
+ }
11459
+ const Vm = W + "/bahmnicore/visitDocument/uploadDocument", Bm = "application";
11460
+ async function Hm(e) {
11449
11461
  return new Promise((t, r) => {
11450
11462
  const n = new FileReader();
11451
11463
  n.onload = () => {
@@ -11458,7 +11470,7 @@ async function jm(e) {
11458
11470
  let a = o, i = "";
11459
11471
  const c = o.lastIndexOf(".");
11460
11472
  c !== -1 && (a = o.substring(0, c), i = o.substring(c + 1).toLowerCase());
11461
- const d = e.type ? e.type.split("/")[0] : Fm;
11473
+ const d = e.type ? e.type.split("/")[0] : Bm;
11462
11474
  t({
11463
11475
  content: s,
11464
11476
  fileName: a,
@@ -11470,8 +11482,8 @@ async function jm(e) {
11470
11482
  }, n.readAsDataURL(e);
11471
11483
  });
11472
11484
  }
11473
- async function Gv(e, t, r) {
11474
- const n = await jm(e), s = {
11485
+ async function Jv(e, t, r) {
11486
+ const n = await Hm(e), s = {
11475
11487
  content: n.content,
11476
11488
  encounterTypeName: t,
11477
11489
  fileName: n.fileName,
@@ -11479,193 +11491,194 @@ async function Gv(e, t, r) {
11479
11491
  format: n.format,
11480
11492
  patientUuid: r
11481
11493
  };
11482
- return Ce(Mm, s);
11494
+ return Ce(Vm, s);
11483
11495
  }
11484
11496
  export {
11485
- ay as APPOINTMENT_IDENTIFIER_SYSTEM,
11486
- oy as APPOINTMENT_STATUSES,
11497
+ uy as APPOINTMENT_IDENTIFIER_SYSTEM,
11498
+ cy as APPOINTMENT_STATUSES,
11487
11499
  $n as AUDIT_LOG_EVENT_DETAILS,
11488
11500
  np as AllergySeverity,
11489
11501
  rp as AllergyStatus,
11490
11502
  Ul as AttributeFormat,
11491
11503
  xl as AttributeInputType,
11492
- dg as BAHMNI_HOME_PATH,
11493
- jy as CONCEPT_DATATYPE_COMPLEX,
11494
- Fy as CONCEPT_DATATYPE_NUMERIC,
11504
+ hg as BAHMNI_HOME_PATH,
11505
+ Hy as CONCEPT_DATATYPE_COMPLEX,
11506
+ By as CONCEPT_DATATYPE_NUMERIC,
11495
11507
  In as CONSULTATION_SAVED_EVENT,
11496
11508
  sp as DATETIME_REGEX_PATTERN,
11497
- Hy as DATE_REGEX_PATTERN,
11509
+ Ky as DATE_REGEX_PATTERN,
11498
11510
  Xa as DEFAULT_DATE_FORMAT,
11499
11511
  Lf as DEFAULT_DATE_FORMAT_STORAGE_KEY,
11500
11512
  kf as DEFAULT_TIME_FORMAT,
11501
11513
  qf as DURATION_UNIT_TO_DAYS,
11502
- Cy as FHIR_ENCOUNTER_TYPE_CODE_SYSTEM,
11503
- Uy as FHIR_LAB_ORDER_CONCEPT_TYPE_EXTENSION_URL,
11504
- qy as FHIR_OBSERVATION_FORM_NAMESPACE_PATH_URL,
11505
- xy as FHIR_OBSERVATION_INTERPRETATION_SYSTEM,
11506
- Vy as FHIR_OBSERVATION_STATUS_FINAL,
11507
- My as FHIR_OBSERVATION_VALUE_ATTACHMENT_URL,
11508
- By as FHIR_RESOURCE_TYPE_OBSERVATION,
11509
- ky as HL7_CONDITION_CATEGORY_CODE_SYSTEM,
11514
+ ky as FHIR_ENCOUNTER_TYPE_CODE_SYSTEM,
11515
+ My as FHIR_LAB_ORDER_CONCEPT_TYPE_EXTENSION_URL,
11516
+ jy as FHIR_OBSERVATION_FORM_NAMESPACE_PATH_URL,
11517
+ Fy as FHIR_OBSERVATION_INTERPRETATION_SYSTEM,
11518
+ zy as FHIR_OBSERVATION_STATUS_FINAL,
11519
+ Vy as FHIR_OBSERVATION_VALUE_ATTACHMENT_URL,
11520
+ Gy as FHIR_RESOURCE_TYPE_OBSERVATION,
11521
+ qy as HL7_CONDITION_CATEGORY_CODE_SYSTEM,
11510
11522
  ei as HL7_CONDITION_CATEGORY_CONDITION_CODE,
11511
11523
  ti as HL7_CONDITION_CATEGORY_DIAGNOSIS_CODE,
11512
- Ly as HL7_CONDITION_CLINICAL_STATUS_CODE_SYSTEM,
11513
- Dy as HL7_CONDITION_VERIFICATION_STATUS_CODE_SYSTEM,
11514
- zy as INTERPRETATION_TO_CODE,
11515
- Lg as MAX_NAME_LENGTH,
11516
- Dg as MAX_PATIENT_AGE_YEARS,
11517
- kg as MAX_PHONE_NUMBER_LENGTH,
11524
+ xy as HL7_CONDITION_CLINICAL_STATUS_CODE_SYSTEM,
11525
+ Uy as HL7_CONDITION_VERIFICATION_STATUS_CODE_SYSTEM,
11526
+ Yy as INTERPRETATION_TO_CODE,
11527
+ xg as MAX_NAME_LENGTH,
11528
+ Ug as MAX_PATIENT_AGE_YEARS,
11529
+ qg as MAX_PHONE_NUMBER_LENGTH,
11518
11530
  Ue as MedicationStatus,
11519
- ue as OPENMRS_FHIR_R4,
11531
+ ce as OPENMRS_FHIR_R4,
11520
11532
  W as OPENMRS_REST_V1,
11521
- lv as ORDER_TYPE_QUERY_KEY,
11522
- uv as PENDING_REPORT_STATUSES,
11523
- cv as PROCESSED_REPORT_STATUSES,
11524
- gv as USER_PINNED_PREFERENCE_URL,
11525
- gy as calculateAge,
11526
- _y as calculateEndDate,
11527
- vy as calculateOnsetDate,
11528
- Og as camelToScreamingSnakeCase,
11529
- vg as capitalize,
11530
- ny as checkIfActiveVisitExists,
11531
- Dv as convertImmutableToPlainObject,
11532
- Ag as convertToSentenceCase,
11533
- Vg as createPatient,
11534
- sy as createVisitForPatient,
11533
+ pv as ORDER_TYPE_QUERY_KEY,
11534
+ fv as PENDING_REPORT_STATUSES,
11535
+ dv as PROCESSED_REPORT_STATUSES,
11536
+ wv as USER_PINNED_PREFERENCE_URL,
11537
+ wy as calculateAge,
11538
+ Ty as calculateEndDate,
11539
+ by as calculateOnsetDate,
11540
+ $g as camelToScreamingSnakeCase,
11541
+ bg as capitalize,
11542
+ ay as checkIfActiveVisitExists,
11543
+ Uv as convertImmutableToPlainObject,
11544
+ Pg as convertToSentenceCase,
11545
+ zg as createPatient,
11546
+ iy as createVisitForPatient,
11535
11547
  Pa as del,
11536
- py as deleteAppointmentService,
11548
+ gy as deleteAppointmentService,
11537
11549
  tl as deleteCookie,
11538
11550
  ql as dispatchAuditEvent,
11539
- Vv as dispatchConsultationSaved,
11540
- Sy as doDateRangesOverlap,
11541
- jv as extractAttributes,
11542
- Lv as extractNotesFromFormData,
11543
- $y as fetchAndFormatAllergenConcepts,
11544
- Nv as fetchFormMetadata,
11545
- Qy as fetchMedicationOrdersMetadata,
11546
- Av as fetchObservationForms,
11547
- nv as fetchQualityAssessment,
11548
- Py as fetchReactionConcepts,
11549
- Sg as filterReplacementEntries,
11550
- _v as findActiveEncounterInSession,
11551
- wy as formatDateDistance,
11552
- yy as formatDateTime,
11553
- Rg as formatUrl,
11554
- gg as generateId,
11555
- yg as generateUUID,
11551
+ zv as dispatchConsultationSaved,
11552
+ Oy as doDateRangesOverlap,
11553
+ Hv as extractAttributes,
11554
+ xv as extractNotesFromFormData,
11555
+ Cy as fetchAndFormatAllergenConcepts,
11556
+ Iv as fetchFormMetadata,
11557
+ ev as fetchMedicationOrdersMetadata,
11558
+ Pv as fetchObservationForms,
11559
+ av as fetchQualityAssessment,
11560
+ Dy as fetchReactionConcepts,
11561
+ Og as filterReplacementEntries,
11562
+ Tv as findActiveEncounterInSession,
11563
+ _y as formatDateDistance,
11564
+ Ey as formatDateTime,
11565
+ Ag as formatUrl,
11566
+ wg as generateId,
11567
+ Eg as generateUUID,
11556
11568
  F as get,
11557
11569
  Em as getActiveVisit,
11558
11570
  Gl as getActiveVisitByPatient,
11559
- zg as getAddressHierarchyEntries,
11560
- fy as getAllAppointmentServices,
11571
+ Yg as getAddressHierarchyEntries,
11572
+ my as getAllAppointmentServices,
11561
11573
  ep as getAllergies,
11562
- dy as getAppointmentById,
11563
- Pg as getAvailableLocations,
11564
- fv as getCategoryUuidFromOrderTypes,
11565
- Ay as getConceptById,
11566
- Ky as getConditionPage,
11567
- Gy as getConditions,
11568
- mv as getConfig,
11574
+ hy as getAppointmentById,
11575
+ Dg as getAvailableLocations,
11576
+ mv as getCategoryUuidFromOrderTypes,
11577
+ Py as getConceptById,
11578
+ Jy as getConditionPage,
11579
+ Wy as getConditions,
11580
+ vv as getConfig,
11569
11581
  Fa as getCookieByName,
11570
- wv as getCurrentProvider,
11571
- Fv as getCurrentStateName,
11572
- Ng as getCurrentUser,
11573
- Tv as getCurrentUserPrivileges,
11574
- $g as getDefaultDateFormat,
11575
- Wy as getDiagnosesPage,
11576
- av as getDiagnosticReportBundle,
11577
- ov as getDiagnosticReports,
11578
- zv as getDocumentReferencePage,
11582
+ _v as getCurrentProvider,
11583
+ Bv as getCurrentStateName,
11584
+ Ig as getCurrentUser,
11585
+ Nv as getCurrentUserPrivileges,
11586
+ Cg as getDefaultDateFormat,
11587
+ Xy as getDiagnosesPage,
11588
+ uv as getDiagnosticReportBundle,
11589
+ cv as getDiagnosticReports,
11590
+ Yv as getDocumentReferencePage,
11579
11591
  qm as getDocumentReferences,
11580
- Sv as getEncountersAndVisitsForEOC,
11581
- hv as getExistingServiceRequestsForAllCategories,
11582
- dv as getFlattenedInvestigations,
11583
- by as getFormattedAge,
11584
- Iy as getFormattedAllergies,
11585
- Hv as getFormattedDocumentReferences,
11592
+ Ov as getEncountersAndVisitsForEOC,
11593
+ yv as getExistingServiceRequestsForAllCategories,
11594
+ hv as getFlattenedInvestigations,
11595
+ Ry as getFormattedAge,
11596
+ Ly as getFormattedAllergies,
11597
+ Kv as getFormattedDocumentReferences,
11586
11598
  Rr as getFormattedError,
11587
- Ug as getFormattedPatientById,
11588
- Hg as getGenders,
11589
- jg as getIdentifierData,
11590
- Fg as getIdentifierTypes,
11591
- Jg as getInputTypeForFormat,
11592
- sv as getLabInvestigationsBundle,
11593
- Ev as getObservationsBundleByEncounterUuid,
11594
- pv as getOrderTypeNames,
11599
+ Mg as getFormattedPatientById,
11600
+ Kg as getGenders,
11601
+ Hg as getIdentifierData,
11602
+ Bg as getIdentifierTypes,
11603
+ Zg as getInputTypeForFormat,
11604
+ iv as getLabInvestigationsBundle,
11605
+ Sv as getObservationsBundleByEncounterUuid,
11606
+ gv as getOrderTypeNames,
11595
11607
  zn as getOrderTypes,
11596
- Gg as getOrderedAddressHierarchyLevels,
11597
- uy as getPastAppointments,
11598
- my as getPastAppointmentsPage,
11608
+ Wg as getOrderedAddressHierarchyLevels,
11609
+ fy as getPastAppointments,
11610
+ vy as getPastAppointmentsPage,
11599
11611
  $l as getPatientById,
11600
- Yy as getPatientDiagnoses,
11601
- $v as getPatientFormData,
11602
- xg as getPatientImageAsDataUrl,
11612
+ Qy as getPatientDiagnoses,
11613
+ Cv as getPatientFormData,
11614
+ Fg as getPatientImageAsDataUrl,
11615
+ Wv as getPatientImmunizations,
11603
11616
  Sp as getPatientMedicationBundle,
11604
- Jy as getPatientMedications,
11605
- vv as getPatientObservations,
11617
+ Zy as getPatientMedications,
11618
+ bv as getPatientObservations,
11606
11619
  hm as getPatientObservationsBundle,
11607
- yv as getPatientObservationsWithEncounterBundle,
11608
- Kg as getPatientProfile,
11609
- Uv as getPatientPrograms,
11610
- xv as getPatientProgramsPage,
11611
- ev as getPatientRadiologyInvestigationBundle,
11612
- tv as getPatientRadiologyInvestigationBundleWithImagingStudy,
11613
- rv as getPatientRadiologyInvestigations,
11614
- Wg as getPersonAttributeTypes,
11620
+ Ev as getPatientObservationsWithEncounterBundle,
11621
+ Jg as getPatientProfile,
11622
+ Mv as getPatientPrograms,
11623
+ Fv as getPatientProgramsPage,
11624
+ nv as getPatientRadiologyInvestigationBundle,
11625
+ sv as getPatientRadiologyInvestigationBundleWithImagingStudy,
11626
+ ov as getPatientRadiologyInvestigations,
11627
+ Xg as getPersonAttributeTypes,
11615
11628
  kl as getPrimaryIdentifierType,
11616
- bg as getPriorityByOrder,
11617
- qv as getProgramByUUID,
11618
- Yg as getRelationshipTypes,
11629
+ Rg as getPriorityByOrder,
11630
+ jv as getProgramByUUID,
11631
+ Qg as getRelationshipTypes,
11619
11632
  Pt as getServiceRequests,
11620
- Ey as getTodayDate,
11621
- cy as getUpcomingAppointments,
11622
- hy as getUpcomingAppointmentsPage,
11633
+ Sy as getTodayDate,
11634
+ dy as getUpcomingAppointments,
11635
+ yy as getUpcomingAppointmentsPage,
11623
11636
  qn as getUserLoginLocation,
11624
11637
  qr as getUserPreferredLocale,
11625
- Zy as getVaccinations,
11626
- Tg as getValueType,
11627
- ry as getVisitTypes,
11628
- kv as getVitalFlowSheetData,
11629
- _g as groupByDate,
11630
- Ov as hasPrivilege,
11631
- pg as initAppI18n,
11632
- Rv as initializeAuditListener,
11633
- Qg as isBooleanFormat,
11634
- Xg as isConceptFormat,
11635
- ey as isDateFormat,
11636
- Zg as isNumberFormat,
11637
- Eg as isStringEmpty,
11638
- ty as isTextFormat,
11638
+ rv as getVaccinations,
11639
+ Ng as getValueType,
11640
+ oy as getVisitTypes,
11641
+ qv as getVitalFlowSheetData,
11642
+ Tg as groupByDate,
11643
+ $v as hasPrivilege,
11644
+ gg as initAppI18n,
11645
+ Av as initializeAuditListener,
11646
+ ey as isBooleanFormat,
11647
+ ty as isConceptFormat,
11648
+ ny as isDateFormat,
11649
+ ry as isNumberFormat,
11650
+ Sg as isStringEmpty,
11651
+ sy as isTextFormat,
11639
11652
  Pm as logAuditEvent,
11640
- Ig as logout,
11641
- fg as normalizeTranslationKey,
11642
- Ty as notificationService,
11653
+ Lg as logout,
11654
+ mg as normalizeTranslationKey,
11655
+ Ny as notificationService,
11643
11656
  rl as parseQueryParams,
11644
- lg as patch,
11657
+ pg as patch,
11645
11658
  Ce as post,
11646
- ug as put,
11647
- mg as refreshQueries,
11648
- Cg as saveUserLocation,
11649
- iy as searchAppointmentsByAttribute,
11650
- Ny as searchConceptByName,
11651
- Oy as searchConcepts,
11659
+ fg as put,
11660
+ vg as refreshQueries,
11661
+ kg as saveUserLocation,
11662
+ ly as searchAppointmentsByAttribute,
11663
+ Iy as searchConceptByName,
11664
+ $y as searchConcepts,
11652
11665
  br as searchFHIRConcepts,
11653
11666
  Kf as searchFHIRConceptsByName,
11654
- Xy as searchMedications,
11655
- Mg as searchPatientByCustomAttribute,
11656
- qg as searchPatientByNameOrId,
11657
- wg as setCookie,
11658
- bv as shouldEnableEncounterFilter,
11659
- Ry as sortByDate,
11660
- Cv as transformContainerObservationsToForm2Observations,
11661
- Pv as transformFormDataToObservations,
11662
- Iv as transformObservationsToFormData,
11663
- ly as updateAppointmentStatus,
11664
- iv as updateDiagnosticReportBundle,
11665
- Bg as updatePatient,
11666
- Mv as updateProgramState,
11667
- Gv as uploadDocument,
11668
- hg as useCamera,
11669
- Bv as useSubscribeConsultationSaved,
11670
- Wv as useTranslation
11667
+ tv as searchMedications,
11668
+ Vg as searchPatientByCustomAttribute,
11669
+ jg as searchPatientByNameOrId,
11670
+ _g as setCookie,
11671
+ Rv as shouldEnableEncounterFilter,
11672
+ Ay as sortByDate,
11673
+ kv as transformContainerObservationsToForm2Observations,
11674
+ Dv as transformFormDataToObservations,
11675
+ Lv as transformObservationsToFormData,
11676
+ py as updateAppointmentStatus,
11677
+ lv as updateDiagnosticReportBundle,
11678
+ Gg as updatePatient,
11679
+ Vv as updateProgramState,
11680
+ Jv as uploadDocument,
11681
+ yg as useCamera,
11682
+ Gv as useSubscribeConsultationSaved,
11683
+ Zv as useTranslation
11671
11684
  };