@bahmni/services 0.0.1-dev.348 → 0.0.1-dev.349

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 wc } from "react-i18next";
2
- import { useTranslation as Ov } from "react-i18next";
2
+ import { useTranslation as Nv } from "react-i18next";
3
3
  import { useRef as Ut, useCallback as _n, useEffect as nt, useSyncExternalStore as Ec } from "react";
4
4
  function Fa(t, e) {
5
5
  return function() {
@@ -2288,23 +2288,23 @@ he.getAdapter = ci.getAdapter;
2288
2288
  he.HttpStatusCode = Wn;
2289
2289
  he.default = he;
2290
2290
  const {
2291
- Axios: Lw,
2292
- AxiosError: xw,
2293
- CanceledError: kw,
2294
- isCancel: Mw,
2295
- CancelToken: Uw,
2296
- VERSION: qw,
2297
- all: Fw,
2298
- Cancel: jw,
2299
- isAxiosError: Vw,
2300
- spread: Hw,
2301
- toFormData: Bw,
2302
- AxiosHeaders: zw,
2303
- HttpStatusCode: Yw,
2304
- formToJSON: Gw,
2305
- getAdapter: Kw,
2306
- mergeConfig: Ww,
2307
- create: Jw
2291
+ Axios: kw,
2292
+ AxiosError: Mw,
2293
+ CanceledError: Uw,
2294
+ isCancel: qw,
2295
+ CancelToken: Fw,
2296
+ VERSION: jw,
2297
+ all: Vw,
2298
+ Cancel: Hw,
2299
+ isAxiosError: Bw,
2300
+ spread: zw,
2301
+ toFormData: Yw,
2302
+ AxiosHeaders: Gw,
2303
+ HttpStatusCode: Kw,
2304
+ formToJSON: Ww,
2305
+ getAdapter: Jw,
2306
+ mergeConfig: Qw,
2307
+ create: Xw
2308
2308
  } = he, wl = (t) => typeof t == "object" && t !== null && "resourceType" in t && t.resourceType === "OperationOutcome", El = (t) => {
2309
2309
  if (!t.issue || !Array.isArray(t.issue))
2310
2310
  return null;
@@ -2472,7 +2472,7 @@ function Il(t, e) {
2472
2472
  const $l = process.env.PUBLIC_URL ?? "/", se = "/openmrs/ws/fhir2/R4", W = "/openmrs/ws/rest/v1", pi = "bahmni.user", hi = "bahmni.user.location", Dl = [
2473
2473
  pi,
2474
2474
  hi
2475
- ], Cl = "/bahmni-v2", Qw = Cl + "/home", hs = W + "/session", ms = `${W}/bahmnicore/template/api`, Jn = (t) => {
2475
+ ], Cl = "/bahmni-v2", Zw = Cl + "/home", hs = W + "/session", ms = `${W}/bahmnicore/template/api`, Jn = (t) => {
2476
2476
  if (typeof t == "string")
2477
2477
  return Il(t);
2478
2478
  if (Array.isArray(t))
@@ -2512,7 +2512,7 @@ Ke.interceptors.response.use(
2512
2512
  return r.startsWith("ERROR_") || /^[A-Z_]+$/.test(r) ? Promise.reject(new Error(r)) : Promise.reject(`${e}: ${r}`);
2513
2513
  }
2514
2514
  );
2515
- const H = async (t, e) => (await Ke.get(t, e)).data, ve = async (t, e) => (await Ke.post(t, e)).data, gs = async (t, e) => (await Ke.put(t, e)).data, Xw = async (t, e) => (await Ke.patch(t, e)).data, mi = async (t) => (await Ke.delete(t)).data, J = (t) => typeof t == "string", Pt = () => {
2515
+ const H = async (t, e) => (await Ke.get(t, e)).data, ve = async (t, e) => (await Ke.post(t, e)).data, gs = async (t, e) => (await Ke.put(t, e)).data, eE = async (t, e) => (await Ke.patch(t, e)).data, mi = async (t) => (await Ke.delete(t)).data, J = (t) => typeof t == "string", Pt = () => {
2516
2516
  let t, e;
2517
2517
  const r = new Promise((n, s) => {
2518
2518
  t = n, e = s;
@@ -4210,7 +4210,7 @@ const gd = "en", _i = "NG_TRANSLATE_LANG_KEY", yd = (t, e) => $l + `${t}/locales
4210
4210
  }, t !== "en" && (r.en = {
4211
4211
  [e]: await ho(e, "en")
4212
4212
  }), r;
4213
- }, Zw = (t, e) => {
4213
+ }, tE = (t, e) => {
4214
4214
  const r = t.toUpperCase(), n = e.toUpperCase().replace(/\s+/g, "_").replace(/[^A-Z0-9_]/g, "");
4215
4215
  return `${r}_${n}`;
4216
4216
  }, bd = (t, e) => {
@@ -4227,7 +4227,7 @@ const gd = "en", _i = "NG_TRANSLATE_LANG_KEY", yd = (t, e) => $l + `${t}/locales
4227
4227
  labels: n.labels ?? {},
4228
4228
  concepts: n.concepts ?? {}
4229
4229
  };
4230
- }, eE = async (t) => {
4230
+ }, rE = async (t) => {
4231
4231
  const e = sn(), r = await Ed(e, t);
4232
4232
  return de.isInitialized ? (Object.entries(r).forEach(([n, s]) => {
4233
4233
  Object.entries(s).forEach(([o, a]) => {
@@ -4250,7 +4250,7 @@ const gd = "en", _i = "NG_TRANSLATE_LANG_KEY", yd = (t, e) => $l + `${t}/locales
4250
4250
  }
4251
4251
  }), de;
4252
4252
  };
4253
- function tE() {
4253
+ function nE() {
4254
4254
  const t = Ut(null), e = Ut(null), r = _n(async () => {
4255
4255
  e.current && (e.current.getTracks().forEach((a) => a.stop()), e.current = null);
4256
4256
  const o = await navigator.mediaDevices.getUserMedia({
@@ -4290,13 +4290,13 @@ function tE() {
4290
4290
  );
4291
4291
  return nt(() => () => n(), [n]), { videoRef: t, start: r, stop: n, capture: s };
4292
4292
  }
4293
- const _d = "bahmni.enableAuditLog", vi = (t) => `${W}/bahmnicore/sql/globalproperty?property=${t}`, vd = "http://hl7.org/fhir/StructureDefinition/patient-birthTime", Td = "http://fhir.openmrs.org/code-system/encounter-type", Sd = "http://terminology.hl7.org/CodeSystem/v3-ActCode", Rd = "http://fhir.openmrs.org/ext/encounter-tag", Ti = "problem-list-item", rE = "http://terminology.hl7.org/CodeSystem/condition-ver-status", Si = "encounter-diagnosis", Od = "http://terminology.hl7.org/CodeSystem/condition-clinical", nE = "http://terminology.hl7.org/CodeSystem/condition-category", sE = "http://fhir.bahmni.org/ext/lab-order-concept-type", oE = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", aE = "http://fhir.bahmni.org/ext/observation/form-namespace-path", iE = "http://fhir.bahmni.org/ext/observation/obs-value-attachment", cE = "Numeric", uE = "Complex", lE = "final", dE = "Observation", fE = /^\d{4}-\d{2}-\d{2}/, Ad = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/, pE = {
4293
+ const _d = "bahmni.enableAuditLog", vi = (t) => `${W}/bahmnicore/sql/globalproperty?property=${t}`, vd = "http://hl7.org/fhir/StructureDefinition/patient-birthTime", Td = "http://fhir.openmrs.org/code-system/encounter-type", Sd = "http://terminology.hl7.org/CodeSystem/v3-ActCode", Rd = "http://fhir.openmrs.org/ext/encounter-tag", Ti = "problem-list-item", sE = "http://terminology.hl7.org/CodeSystem/condition-ver-status", Si = "encounter-diagnosis", Od = "http://terminology.hl7.org/CodeSystem/condition-clinical", oE = "http://terminology.hl7.org/CodeSystem/condition-category", aE = "http://fhir.bahmni.org/ext/lab-order-concept-type", iE = "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", cE = "http://fhir.bahmni.org/ext/observation/form-namespace-path", uE = "http://fhir.bahmni.org/ext/observation/obs-value-attachment", lE = "Numeric", dE = "Complex", fE = "final", pE = "Observation", hE = /^\d{4}-\d{2}-\d{2}/, Ad = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/, mE = {
4294
4294
  ABNORMAL: { code: "A", display: "Abnormal" },
4295
4295
  NORMAL: { code: "N", display: "Normal" }
4296
- }, hE = async (t, e, r) => {
4296
+ }, gE = async (t, e, r) => {
4297
4297
  const { exact: n = !0, refetchActiveNow: s = !0 } = r ?? {};
4298
4298
  await t.cancelQueries({ queryKey: e, exact: n }), await t.removeQueries({ queryKey: e, exact: n }), await t.invalidateQueries({ queryKey: e, exact: n }), s && await t.refetchQueries({ queryKey: e, exact: n, type: "active" });
4299
- }, mE = () => Math.random().toString(36).substring(2, 9), Wr = () => {
4299
+ }, yE = () => Math.random().toString(36).substring(2, 9), Wr = () => {
4300
4300
  if (typeof globalThis < "u" && globalThis.crypto?.randomUUID)
4301
4301
  return globalThis.crypto.randomUUID();
4302
4302
  const t = globalThis.crypto || globalThis.msCrypto;
@@ -4308,7 +4308,7 @@ const _d = "bahmni.enableAuditLog", vi = (t) => `${W}/bahmnicore/sql/globalprope
4308
4308
  "Crypto API (crypto.randomUUID or crypto.getRandomValues) is not available. UUID generation requires cryptographically secure random number generation."
4309
4309
  );
4310
4310
  };
4311
- function gE(t, e = " -") {
4311
+ function wE(t, e = " -") {
4312
4312
  return t ? t.toLowerCase().split(new RegExp(`[${e}]+`)).map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join(" ") : "";
4313
4313
  }
4314
4314
  function Ri(t) {
@@ -4323,10 +4323,10 @@ function Ri(t) {
4323
4323
  function Pd(t, e = "/") {
4324
4324
  document.cookie = `${t}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${e};`;
4325
4325
  }
4326
- function yE(t, e) {
4326
+ function EE(t, e) {
4327
4327
  document.cookie = `${t}=${e}; path=/;`;
4328
4328
  }
4329
- const wE = (t) => !t || t.trim().length === 0, EE = (t, e) => {
4329
+ const bE = (t) => !t || t.trim().length === 0, _E = (t, e) => {
4330
4330
  if (!t || !e || e.length === 0)
4331
4331
  return 999;
4332
4332
  const r = e.findIndex(
@@ -4334,7 +4334,7 @@ const wE = (t) => !t || t.trim().length === 0, EE = (t, e) => {
4334
4334
  );
4335
4335
  return r === -1 ? 999 : r;
4336
4336
  };
4337
- function bE(t, e) {
4337
+ function vE(t, e) {
4338
4338
  if (!t || t.length === 0)
4339
4339
  return [];
4340
4340
  const r = /* @__PURE__ */ new Map();
@@ -4346,7 +4346,7 @@ function bE(t, e) {
4346
4346
  items: s
4347
4347
  }));
4348
4348
  }
4349
- function _E(t, e, r) {
4349
+ function TE(t, e, r) {
4350
4350
  if (!t || t.length === 0)
4351
4351
  return [];
4352
4352
  const n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
@@ -4367,7 +4367,7 @@ function Nd(t) {
4367
4367
  o[n(a[1])] = n(a[2]);
4368
4368
  return o;
4369
4369
  }
4370
- function vE(t, e, r) {
4370
+ function SE(t, e, r) {
4371
4371
  const n = /{{([^}]*)}}/g, s = t.match(n);
4372
4372
  let o = t;
4373
4373
  const a = r ?? !1, i = a ? Nd() : {};
@@ -4380,7 +4380,7 @@ function vE(t, e, r) {
4380
4380
  const Id = (t) => new Promise((e, r) => {
4381
4381
  const n = new FileReader();
4382
4382
  n.onloadend = () => e(n.result), n.onerror = r, n.readAsDataURL(t);
4383
- }), TE = (t) => {
4383
+ }), RE = (t) => {
4384
4384
  if (typeof t == "number" && !isNaN(t))
4385
4385
  return "number";
4386
4386
  if (typeof t != "string")
@@ -4388,21 +4388,21 @@ const Id = (t) => new Promise((e, r) => {
4388
4388
  const e = t.toLowerCase();
4389
4389
  return e.endsWith(".pdf") ? "PDF" : [".png", ".jpg", ".jpeg", ".gif", ".bmp", ".svg"].some((s) => e.endsWith(s)) ? "Image" : [".mp4", ".ogg", ".webm", ".mkv", ".flv"].some((s) => e.endsWith(s)) ? "Video" : typeof t == "string" ? "string" : "object";
4390
4390
  };
4391
- function SE(t) {
4391
+ function OE(t) {
4392
4392
  return t.replace(/[\s-]+/g, "_").replace(/([a-z])([A-Z])/g, "$1_$2").replace(/([A-Z])([A-Z][a-z])/g, "$1_$2").toUpperCase();
4393
4393
  }
4394
- function RE(t, e, r, n, s) {
4394
+ function AE(t, e, r, n, s) {
4395
4395
  const o = (a) => ({
4396
4396
  ...n(a),
4397
4397
  disabled: !0
4398
4398
  });
4399
4399
  return t ? [o(s.loading)] : e ? [o(s.error)] : r.length ? r : [o(s.empty)];
4400
4400
  }
4401
- function OE(t) {
4401
+ function PE(t) {
4402
4402
  return t ? t.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(/^./, (e) => e.toUpperCase()) : "";
4403
4403
  }
4404
4404
  const $d = (t) => W + `/user?username=${t}&v=custom:(display,username,uuid)`, Dd = `${W}/location?tags=Login Location&v=default`, Cd = (t) => W + `/user/${t}?v=full`, Ld = (t) => W + `/bahmni/app/setting?module=${t}`, xd = "default_dateFormat", kd = hs;
4405
- async function AE() {
4405
+ async function NE() {
4406
4406
  const t = Ri(pi);
4407
4407
  if (!t)
4408
4408
  return null;
@@ -4426,13 +4426,13 @@ const on = () => {
4426
4426
  if (!e.uuid)
4427
4427
  throw new Error(de.t("ERROR_FETCHING_USER_LOCATION_DETAILS"));
4428
4428
  return e;
4429
- }, PE = async () => (await H(Ld("commons"))).find(
4429
+ }, IE = async () => (await H(Ld("commons"))).find(
4430
4430
  (r) => r.property === xd
4431
- )?.value ?? null, NE = async () => (await H(Dd)).results ?? [], IE = async (t, e) => {
4431
+ )?.value ?? null, $E = async () => (await H(Dd)).results ?? [], DE = async (t, e) => {
4432
4432
  await ve(Cd(t), {
4433
4433
  userProperties: { loginLocation: e.uuid }
4434
4434
  });
4435
- }, $E = async (t) => {
4435
+ }, CE = async (t) => {
4436
4436
  await ve(kd, { sessionLocation: t });
4437
4437
  }, ys = {
4438
4438
  person: {
@@ -4480,7 +4480,7 @@ const on = () => {
4480
4480
  }, Ai = W + "/idgen/identifiertype", Fd = (t) => W + `/bahmni/app/setting?module=${t}`, jd = "bahmni.primaryIdentifierType", Vd = W + "/bahmnicore/patientprofile", Hd = (t) => W + `/bahmnicore/patientprofile/${t}`, Bd = se + "/Patient", zd = (t) => W + `/idgen/identifiersource/${t}/identifier`, Yd = (t) => W + `/patientprofile/${t}?v=full`, Gd = (t, e, r = 20, n) => {
4481
4481
  let s = `/openmrs/module/addresshierarchy/ajax/getPossibleAddressHierarchyEntriesWithParents.form?addressField=${t}&limit=${r}&searchString=${encodeURIComponent(e)}`;
4482
4482
  return n && (s += `&parent=${n}`), s;
4483
- }, Kd = "/openmrs/module/addresshierarchy/ajax/getOrderedAddressHierarchyLevels.form", Wd = W + "/relationshiptype?v=custom:(aIsToB,bIsToA,uuid)&limit=150", Jd = 20, Qd = 2, DE = 120, CE = 50, LE = 15, Xd = /^[a-f0-9-]{36}$/i, Zd = W + "/personattributetype?v=custom:(uuid,name,sortWeight,description,format,concept:(uuid,display,answers:(uuid,name)))", xE = (t) => t === "male" ? "M" : t === "female" ? "F" : t === "other" ? "O" : "U", ef = async (t) => {
4483
+ }, Kd = "/openmrs/module/addresshierarchy/ajax/getOrderedAddressHierarchyLevels.form", Wd = W + "/relationshiptype?v=custom:(aIsToB,bIsToA,uuid)&limit=150", Jd = 20, Qd = 2, LE = 120, xE = 50, kE = 15, Xd = /^[a-f0-9-]{36}$/i, Zd = W + "/personattributetype?v=custom:(uuid,name,sortWeight,description,format,concept:(uuid,display,answers:(uuid,name)))", ME = (t) => t === "male" ? "M" : t === "female" ? "F" : t === "other" ? "O" : "U", ef = async (t) => {
4484
4484
  if (!t || t.trim() === "")
4485
4485
  throw new Error("Invalid patient UUID: UUID cannot be empty");
4486
4486
  if (!Xd.test(t))
@@ -4520,22 +4520,22 @@ const on = () => {
4520
4520
  identifier: o,
4521
4521
  photoUrl: t.photo?.[0]?.url
4522
4522
  };
4523
- }, kE = async (t) => {
4523
+ }, UE = async (t) => {
4524
4524
  const e = await ef(t);
4525
4525
  return of(e);
4526
- }, ME = async (t) => {
4526
+ }, qE = async (t) => {
4527
4527
  if (!t.startsWith("/"))
4528
4528
  throw new Error("Photo URL must be a relative path");
4529
4529
  const e = await H(t, {
4530
4530
  responseType: "blob"
4531
4531
  });
4532
4532
  return await Id(e);
4533
- }, UE = async (t, e) => {
4533
+ }, FE = async (t, e) => {
4534
4534
  const r = on();
4535
4535
  return await H(
4536
4536
  Ud(t, r.uuid, e)
4537
4537
  );
4538
- }, qE = async (t, e, r, n, s) => {
4538
+ }, jE = async (t, e, r, n, s) => {
4539
4539
  const o = on();
4540
4540
  return await H(
4541
4541
  qd(
@@ -4546,9 +4546,9 @@ const on = () => {
4546
4546
  o.uuid
4547
4547
  )
4548
4548
  );
4549
- }, FE = async () => H(Ai), af = async () => (await H(Fd("core"))).find(
4549
+ }, VE = async () => H(Ai), af = async () => (await H(Fd("core"))).find(
4550
4550
  (r) => r.property === jd
4551
- )?.value ?? null, jE = async () => {
4551
+ )?.value ?? null, HE = async () => {
4552
4552
  const [t, e] = await Promise.all([
4553
4553
  H(Ai),
4554
4554
  af()
@@ -4576,10 +4576,10 @@ const on = () => {
4576
4576
  primaryIdentifierTypeUuid: e,
4577
4577
  primaryIdentifierTypeName: null
4578
4578
  };
4579
- }, VE = async (t) => ve(Vd, t), HE = async (t, e) => ve(
4579
+ }, BE = async (t) => ve(Vd, t), zE = async (t, e) => ve(
4580
4580
  Hd(t),
4581
4581
  e
4582
- ), BE = (t) => ve(Bd, t), zE = (t) => ve(zd(t), {}), YE = (t, e) => gs(Oi(t), e), GE = async () => H(vi("mrs.genders")), KE = async (t, e, r = Jd, n) => {
4582
+ ), YE = (t) => ve(Bd, t), GE = (t) => ve(zd(t), {}), KE = (t, e) => gs(Oi(t), e), WE = async () => H(vi("mrs.genders")), JE = async (t, e, r = Jd, n) => {
4583
4583
  if (!e || e.length < Qd)
4584
4584
  return [];
4585
4585
  try {
@@ -4591,7 +4591,7 @@ const on = () => {
4591
4591
  `Failed to fetch address hierarchy for field "${t}": ${s instanceof Error ? s.message : "Unknown error"}`
4592
4592
  );
4593
4593
  }
4594
- }, WE = async () => H(Kd), JE = async (t) => H(Yd(t)), QE = async () => {
4594
+ }, QE = async () => H(Kd), XE = async (t) => H(Yd(t)), ZE = async () => {
4595
4595
  try {
4596
4596
  return (await H(
4597
4597
  Wd
@@ -4605,9 +4605,9 @@ const on = () => {
4605
4605
  `Failed to fetch relationship types: ${t instanceof Error ? t.message : "Unknown error"}`
4606
4606
  );
4607
4607
  }
4608
- }, XE = async () => H(Zd);
4608
+ }, eb = async () => H(Zd);
4609
4609
  var cf = /* @__PURE__ */ ((t) => (t.BOOLEAN = "java.lang.Boolean", t.BOOLEAN_DATATYPE = "org.openmrs.customdatatype.datatype.BooleanDatatype", t.CONCEPT = "org.openmrs.Concept", t.CODED_CONCEPT = "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype", t.CONCEPT_DATATYPE = "org.openmrs.customdatatype.datatype.ConceptDatatype", t.STRING = "java.lang.String", t.FREE_TEXT = "org.openmrs.customdatatype.datatype.FreeTextDatatype", t.REGEX_VALIDATED_TEXT = "org.openmrs.customdatatype.datatype.RegexValidatedTextDatatype", t.INTEGER = "java.lang.Integer", t.FLOAT = "java.lang.Float", t.ATTRIBUTABLE_DATE = "org.openmrs.util.AttributableDate", t.DATE_DATATYPE = "org.openmrs.customdatatype.datatype.DateDatatype", t))(cf || {}), uf = /* @__PURE__ */ ((t) => (t.CHECKBOX = "checkbox", t.DROPDOWN = "dropdown", t.TEXT = "text", t.NUMBER = "number", t.DATE = "date", t))(uf || {});
4610
- const ZE = (t) => t === "java.lang.Boolean" || t === "org.openmrs.customdatatype.datatype.BooleanDatatype" ? "checkbox" : t === "org.openmrs.Concept" || t === "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype" || t === "org.openmrs.customdatatype.datatype.ConceptDatatype" ? "dropdown" : t === "java.lang.Integer" || t === "java.lang.Float" ? "number" : t === "org.openmrs.util.AttributableDate" || t === "org.openmrs.customdatatype.datatype.DateDatatype" ? "date" : "text", eb = (t) => t === "java.lang.Boolean" || t === "org.openmrs.customdatatype.datatype.BooleanDatatype", tb = (t) => t === "org.openmrs.Concept" || t === "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype" || t === "org.openmrs.customdatatype.datatype.ConceptDatatype", rb = (t) => t === "java.lang.Integer" || t === "java.lang.Float", nb = (t) => t === "org.openmrs.util.AttributableDate" || t === "org.openmrs.customdatatype.datatype.DateDatatype", sb = (t) => t === "java.lang.String" || t === "org.openmrs.customdatatype.datatype.FreeTextDatatype" || t === "org.openmrs.customdatatype.datatype.RegexValidatedTextDatatype", lf = (t) => {
4610
+ const tb = (t) => t === "java.lang.Boolean" || t === "org.openmrs.customdatatype.datatype.BooleanDatatype" ? "checkbox" : t === "org.openmrs.Concept" || t === "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype" || t === "org.openmrs.customdatatype.datatype.ConceptDatatype" ? "dropdown" : t === "java.lang.Integer" || t === "java.lang.Float" ? "number" : t === "org.openmrs.util.AttributableDate" || t === "org.openmrs.customdatatype.datatype.DateDatatype" ? "date" : "text", rb = (t) => t === "java.lang.Boolean" || t === "org.openmrs.customdatatype.datatype.BooleanDatatype", nb = (t) => t === "org.openmrs.Concept" || t === "org.bahmni.module.bahmnicore.customdatatype.datatype.CodedConceptDatatype" || t === "org.openmrs.customdatatype.datatype.ConceptDatatype", sb = (t) => t === "java.lang.Integer" || t === "java.lang.Float", ob = (t) => t === "org.openmrs.util.AttributableDate" || t === "org.openmrs.customdatatype.datatype.DateDatatype", ab = (t) => t === "java.lang.String" || t === "org.openmrs.customdatatype.datatype.FreeTextDatatype" || t === "org.openmrs.customdatatype.datatype.RegexValidatedTextDatatype", lf = (t) => {
4611
4611
  const e = new CustomEvent("bahmni-audit-log", { detail: t });
4612
4612
  window.dispatchEvent(e);
4613
4613
  }, df = (t) => {
@@ -4673,10 +4673,10 @@ const ZE = (t) => t === "java.lang.Boolean" || t === "org.openmrs.customdatatype
4673
4673
  }
4674
4674
  }, ff = W + "/auditlog", pf = {
4675
4675
  UNKNOWN_EVENT_TYPE: "AUDIT_LOG_ERROR_UNKNOWN_EVENT_TYPE"
4676
- }, hf = () => W + "/bahmnicore/config/bahmniencounter?callerContext=REGISTRATION_CONCEPTS", mf = W + "/visit", gf = (t) => W + `/visit?patient=${t}&includeInactive=false&v=custom:(uuid,visitType,startDatetime,stopDatetime)`, yf = (t) => W + `/bahmnicore/visitLocation/${t}`, ob = async () => H(hf()), wf = async (t) => H(gf(t)), Ef = async (t) => H(yf(t)), bf = async (t) => ve(mf, t), ab = async (t) => {
4676
+ }, hf = () => W + "/bahmnicore/config/bahmniencounter?callerContext=REGISTRATION_CONCEPTS", mf = W + "/visit", gf = (t) => W + `/visit?patient=${t}&includeInactive=false&v=custom:(uuid,visitType,startDatetime,stopDatetime)`, yf = (t) => W + `/bahmnicore/visitLocation/${t}`, ib = async () => H(hf()), wf = async (t) => H(gf(t)), Ef = async (t) => H(yf(t)), bf = async (t) => ve(mf, t), cb = async (t) => {
4677
4677
  const e = await wf(t);
4678
4678
  return e?.results && e.results.length > 0;
4679
- }, ib = async (t, e) => {
4679
+ }, ub = async (t, e) => {
4680
4680
  const r = await Ef(
4681
4681
  on().uuid
4682
4682
  ), n = {
@@ -7607,7 +7607,7 @@ function qh(t, e, r) {
7607
7607
  function Fh(t, e, r) {
7608
7608
  return un(t, -e, r);
7609
7609
  }
7610
- const cb = {
7610
+ const lb = {
7611
7611
  PROPOSED: "proposed",
7612
7612
  PENDING: "pending",
7613
7613
  BOOKED: "booked",
@@ -7618,51 +7618,51 @@ const cb = {
7618
7618
  CHECKED_IN: "checked-in",
7619
7619
  WAITLIST: "waitlist",
7620
7620
  ENTERED_IN_ERROR: "entered-in-error"
7621
- }, jh = W + "/appointments/search", Hi = W + "/appointments", ub = "http://fhir.bahmni.org/code-system/appointments", Vh = (t) => `${Hi}/${t}`, pn = (t, e, r, n) => {
7621
+ }, jh = W + "/appointments/search", Hi = W + "/appointments", db = "http://fhir.bahmni.org/code-system/appointments", Vh = (t) => `${Hi}/${t}`, pn = (t, e, r, n) => {
7622
7622
  const s = e === "upcoming", o = s ? "ge" : "le", a = s ? "date" : "-date", i = s ? (/* @__PURE__ */ new Date()).toISOString() : qh(/* @__PURE__ */ new Date()).toISOString();
7623
7623
  let c = `${se}/Appointment?patient=${t}&date=${o}${i}&_sort=${a}`;
7624
7624
  return r !== void 0 && r > 0 && (c += `&_count=${r}`), n !== void 0 && n > 0 && (c += `&_getpagesoffset=${n}`), c;
7625
- }, Hh = (t) => pn(t, "upcoming"), Bh = (t, e) => pn(t, "past", e), zh = (t) => `${Hi}/${t}/status-change`, Yh = W + "/appointmentService/all/full", Gh = (t) => `${W}/appointmentService?uuid=${t}`, Kh = (t, e = 10, r = 0) => pn(t, "upcoming", e, r), Wh = (t, e = 10, r = 0) => pn(t, "past", e, r), Bi = W + "/appointmentUnavailability", lb = async (t) => await ve(jh, t);
7626
- async function db(t) {
7625
+ }, Hh = (t) => pn(t, "upcoming"), Bh = (t, e) => pn(t, "past", e), zh = (t) => `${Hi}/${t}/status-change`, Yh = W + "/appointmentService/all/full", Gh = (t) => `${W}/appointmentService?uuid=${t}`, Kh = (t, e = 10, r = 0) => pn(t, "upcoming", e, r), Wh = (t, e = 10, r = 0) => pn(t, "past", e, r), Bi = W + "/appointmentUnavailability", fb = async (t) => await ve(jh, t);
7626
+ async function pb(t) {
7627
7627
  return await H(Hh(t));
7628
7628
  }
7629
- async function fb(t, e) {
7629
+ async function hb(t, e) {
7630
7630
  return await H(
7631
7631
  Bh(t, e)
7632
7632
  );
7633
7633
  }
7634
- const pb = async (t, e, r) => await ve(zh(t), {
7634
+ const mb = async (t, e, r) => await ve(zh(t), {
7635
7635
  toStatus: e,
7636
7636
  onDate: r
7637
- }), hb = async (t, e) => ve(t, { appointmentUuid: e });
7638
- async function mb(t) {
7637
+ }), gb = async (t, e) => ve(t, { appointmentUuid: e });
7638
+ async function yb(t) {
7639
7639
  return await H(Vh(t));
7640
7640
  }
7641
- const gb = async () => await H(Yh), yb = async (t) => {
7641
+ const wb = async () => await H(Yh), Eb = async (t) => {
7642
7642
  await mi(Gh(t));
7643
7643
  };
7644
- async function wb(t, e = 10, r = 1) {
7644
+ async function bb(t, e = 10, r = 1) {
7645
7645
  const n = (r - 1) * e, s = await H(
7646
7646
  Kh(t, e, n)
7647
7647
  );
7648
7648
  return { bundle: s, total: s.total ?? s.entry?.length ?? 0 };
7649
7649
  }
7650
- async function Eb(t, e = 10, r = 1) {
7650
+ async function _b(t, e = 10, r = 1) {
7651
7651
  const n = (r - 1) * e, s = await H(
7652
7652
  Wh(t, e, n)
7653
7653
  );
7654
7654
  return { bundle: s, total: s.total ?? s.entry?.length ?? 0 };
7655
7655
  }
7656
- const bb = async () => await H(Bi), _b = async (t) => {
7656
+ const vb = async () => await H(Bi), Tb = async (t) => {
7657
7657
  await ve(Bi, t);
7658
- }, zi = "dd/MM/yyyy", Jh = "default_dateFormat", Qh = "h:mm a", vb = "yyyy-MM-dd", Le = {
7658
+ }, zi = "dd/MM/yyyy", Jh = "default_dateFormat", Qh = "h:mm a", Sb = "yyyy-MM-dd", Le = {
7659
7659
  PARSE_ERROR: "DATE_ERROR_PARSE",
7660
7660
  FORMAT_ERROR: "DATE_ERROR_FORMAT",
7661
7661
  EMPTY_OR_INVALID: "DATE_ERROR_EMPTY_OR_INVALID",
7662
7662
  INVALID_FORMAT: "DATE_ERROR_INVALID_FORMAT",
7663
7663
  NULL_OR_UNDEFINED: "DATE_ERROR_NULL_OR_UNDEFINED"
7664
7664
  };
7665
- function Tb(t) {
7665
+ function Rb(t) {
7666
7666
  if (!t) return null;
7667
7667
  const e = fn(t);
7668
7668
  if (!at(e)) return null;
@@ -7671,7 +7671,7 @@ function Tb(t) {
7671
7671
  const n = jt(r, e), s = dn(r, e), o = un(e, s), a = ln(r, o), i = Gt(o, a), c = jt(r, i), u = `${s}y ${a}m ${c}d`;
7672
7672
  return { year: s, month: a, day: c, ageInDays: n, ageText: u };
7673
7673
  }
7674
- function Sb(t) {
7674
+ function Ob(t) {
7675
7675
  if (typeof t != "string" || !/^\d{4}-\d{2}-\d{2}$/.test(t))
7676
7676
  return null;
7677
7677
  const e = fn(t);
@@ -7739,7 +7739,7 @@ function Zh() {
7739
7739
  return zi;
7740
7740
  }
7741
7741
  }
7742
- function Rb(t, e, r = !1, n) {
7742
+ function Ab(t, e, r = !1, n) {
7743
7743
  const s = e ?? ((a) => a);
7744
7744
  let o;
7745
7745
  try {
@@ -7749,7 +7749,7 @@ function Rb(t, e, r = !1, n) {
7749
7749
  }
7750
7750
  return r && !n && (o = `${o} ${Qh}`), Xh(t, o, s);
7751
7751
  }
7752
- function Ob(t, e, r) {
7752
+ function Pb(t, e, r) {
7753
7753
  if (!t || !at(t) || e === null || e === void 0 || !r || typeof e != "number")
7754
7754
  return;
7755
7755
  const n = new Date(t);
@@ -7764,7 +7764,7 @@ function Ob(t, e, r) {
7764
7764
  return;
7765
7765
  }
7766
7766
  }
7767
- function Ab(t, e) {
7767
+ function Nb(t, e) {
7768
7768
  if (t == null)
7769
7769
  return {
7770
7770
  formattedResult: "",
@@ -7816,11 +7816,11 @@ function Ab(t, e) {
7816
7816
  }
7817
7817
  return { formattedResult: c };
7818
7818
  }
7819
- const Pb = () => {
7819
+ const Ib = () => {
7820
7820
  const t = /* @__PURE__ */ new Date();
7821
7821
  return t.setHours(0, 0, 0, 0), t;
7822
7822
  };
7823
- function Nb(t, e) {
7823
+ function $b(t, e) {
7824
7824
  const r = typeof t == "string" ? fn(t) : new Date(t), n = /* @__PURE__ */ new Date(), s = dn(n, r), o = un(r, s), a = ln(n, o), i = Gt(o, a), c = jt(n, i), u = {
7825
7825
  years: "YEARS",
7826
7826
  months: "MONTHS",
@@ -7854,14 +7854,14 @@ const em = {
7854
7854
  h: 1 / 24,
7855
7855
  min: 1 / 1440,
7856
7856
  s: 1 / 86400
7857
- }, Ib = (t, e, r) => {
7857
+ }, Db = (t, e, r) => {
7858
7858
  const n = typeof t == "string" ? new Date(t) : t;
7859
7859
  if (isNaN(n.getTime()))
7860
7860
  throw new Error(`Invalid date: ${t}`);
7861
7861
  const s = em[r] ?? 1, o = e * s;
7862
7862
  return cn(n, o);
7863
- }, $b = (t, e, r, n) => t <= n && r <= e;
7864
- function Db(t, e, r = !1) {
7863
+ }, Cb = (t, e, r, n) => t <= n && r <= e;
7864
+ function Lb(t, e, r = !1) {
7865
7865
  return !t || !Array.isArray(t) ? [] : t.sort((n, s) => {
7866
7866
  const o = new Date(n[e]), a = new Date(s[e]);
7867
7867
  if (isNaN(o.getTime()) && isNaN(a.getTime())) return 0;
@@ -7876,7 +7876,7 @@ function tm(t) {
7876
7876
  const e = bh(t, "hh:mm aa", /* @__PURE__ */ new Date());
7877
7877
  return at(e) ? Mi(e, "HH:mm") : "";
7878
7878
  }
7879
- function Cb(t) {
7879
+ function xb(t) {
7880
7880
  const e = tm(t);
7881
7881
  if (!e) return null;
7882
7882
  const [r, n] = e.split(":").map(Number);
@@ -7911,10 +7911,10 @@ const rm = () => {
7911
7911
  );
7912
7912
  }
7913
7913
  };
7914
- }, Lb = rm(), nm = (t) => se + `/ValueSet/${t}/$expand`, sm = (t) => se + `/ValueSet/$expand?filter=${encodeURIComponent(t)}`, om = (t, e, r) => W + `/bahmni/terminologies/concepts?limit=${e}&locale=${r}&term=${t}`, am = (t) => W + `/concept/${t}`, im = (t, e) => {
7914
+ }, kb = rm(), nm = (t) => se + `/ValueSet/${t}/$expand`, sm = (t) => se + `/ValueSet/$expand?filter=${encodeURIComponent(t)}`, om = (t, e, r) => W + `/bahmni/terminologies/concepts?limit=${e}&locale=${r}&term=${t}`, am = (t) => W + `/concept/${t}`, im = (t, e) => {
7915
7915
  const r = `${W}/concept?s=byFullySpecifiedName&name=${encodeURIComponent(t)}`;
7916
7916
  return e ? `${r}&v=${encodeURIComponent(e)}` : r;
7917
- }, cm = "SHORT", um = "FULLY_SPECIFIED", xb = async (t, e = 20) => {
7917
+ }, cm = "SHORT", um = "FULLY_SPECIFIED", Mb = async (t, e = 20) => {
7918
7918
  const r = sn(), n = om(t, e, r);
7919
7919
  return H(n);
7920
7920
  }, qr = async (t) => {
@@ -7924,7 +7924,7 @@ const rm = () => {
7924
7924
  const e = `${sm(t)}`;
7925
7925
  return H(e);
7926
7926
  };
7927
- async function kb(t) {
7927
+ async function Ub(t) {
7928
7928
  return await H(am(t));
7929
7929
  }
7930
7930
  async function dm(t, e) {
@@ -7963,7 +7963,7 @@ const pm = (t) => se + `/AllergyIntolerance?patient=${t}&_count=100&_sort=-_last
7963
7963
  }), Dn = (t, e) => {
7964
7964
  const r = t.expansion?.contains ?? [];
7965
7965
  return mm(r).map((s) => gm(s, e));
7966
- }, Mb = async (t, e, r) => {
7966
+ }, qb = async (t, e, r) => {
7967
7967
  const n = t ?? pt.MEDICATION.code, s = e ?? pt.FOOD.code, o = r ?? pt.ENVIRONMENT.code, [a, i, c] = await Promise.all([
7968
7968
  qr(n),
7969
7969
  qr(s),
@@ -7983,7 +7983,7 @@ const pm = (t) => se + `/AllergyIntolerance?patient=${t}&_count=100&_sort=-_last
7983
7983
  pt.ENVIRONMENT.display
7984
7984
  )
7985
7985
  ];
7986
- }, Ub = async (t) => {
7986
+ }, Fb = async (t) => {
7987
7987
  const e = t ?? hm.code;
7988
7988
  return (await qr(e)).compose?.include[0]?.concept ?? [];
7989
7989
  };
@@ -8023,12 +8023,12 @@ function Em(t) {
8023
8023
  };
8024
8024
  });
8025
8025
  }
8026
- async function qb(t) {
8026
+ async function jb(t) {
8027
8027
  const e = await wm(t);
8028
8028
  return Em(e);
8029
8029
  }
8030
8030
  var bm = /* @__PURE__ */ ((t) => (t.Active = "Active", t.Inactive = "Inactive", t))(bm || {}), _m = /* @__PURE__ */ ((t) => (t.mild = "mild", t.moderate = "moderate", t.severe = "severe", t))(_m || {});
8031
- function Fb(t) {
8031
+ function Vb(t) {
8032
8032
  const e = t.code?.coding?.[0]?.code ?? t.id ?? "", r = t.reaction?.[0]?.severity, n = /* @__PURE__ */ new Set(), s = [];
8033
8033
  for (const o of t.reaction ?? [])
8034
8034
  for (const a of o.manifestation ?? [])
@@ -8054,10 +8054,10 @@ const vm = se + "/Condition", Tm = (t) => se + `/Condition?category=${Ti}&patien
8054
8054
  async function Rm(t) {
8055
8055
  return await H(`${Tm(t)}`);
8056
8056
  }
8057
- async function jb(t) {
8057
+ async function Hb(t) {
8058
8058
  return (await Rm(t)).entry?.filter((n) => n.resource?.resourceType === "Condition").map((n) => n.resource) ?? [];
8059
8059
  }
8060
- async function Vb(t, e = 10, r = 1, n) {
8060
+ async function Bb(t, e = 10, r = 1, n) {
8061
8061
  const s = (r - 1) * e, o = await H(
8062
8062
  Sm(t, e, s, n)
8063
8063
  );
@@ -8066,7 +8066,7 @@ async function Vb(t, e = 10, r = 1, n) {
8066
8066
  total: o.total
8067
8067
  };
8068
8068
  }
8069
- async function Hb(t) {
8069
+ async function zb(t) {
8070
8070
  const e = {
8071
8071
  ...t,
8072
8072
  clinicalStatus: {
@@ -8142,11 +8142,11 @@ function Lm(t) {
8142
8142
  }
8143
8143
  return Array.from(e.values());
8144
8144
  }
8145
- async function Bb(t) {
8145
+ async function Yb(t) {
8146
8146
  const e = await Im(t), r = Gi(e);
8147
8147
  return Lm(r);
8148
8148
  }
8149
- async function zb(t, e = 10, r = 1) {
8149
+ async function Gb(t, e = 10, r = 1) {
8150
8150
  const n = (r - 1) * e, s = await $m(
8151
8151
  t,
8152
8152
  e,
@@ -8172,7 +8172,7 @@ const Mt = {
8172
8172
  }, km = (t, e, r) => {
8173
8173
  let s = `${se + "/MedicationRequest?" + Mt.SORT + "&" + Mt.COUNT + "&" + Mt.INCLUDE_MEDICATION}&patient=${t}`;
8174
8174
  return e && (s += `&code=${e}`), r && (s += `&encounter=${r}`), s;
8175
- }, Mm = W + "/bahmnicore/config/drugOrders", Um = (t, e) => se + `/Medication?name=${encodeURIComponent(t)}&_count=${e}&_sort=-_lastUpdated`, qm = se + "/Medication?code=http://hl7.org/fhir/sid/cvx|&_count=100", Yb = "medication", Fm = (t) => {
8175
+ }, Mm = W + "/bahmnicore/config/drugOrders", Um = (t, e) => se + `/Medication?name=${encodeURIComponent(t)}&_count=${e}&_sort=-_lastUpdated`, qm = se + "/Medication?code=http://hl7.org/fhir/sid/cvx|&_count=100", Kb = "medication", Fm = (t) => {
8176
8176
  switch (t.status) {
8177
8177
  case "active":
8178
8178
  return Be.Active;
@@ -8329,7 +8329,7 @@ function Xm(t) {
8329
8329
  });
8330
8330
  }
8331
8331
  const vo = (t) => t.priority === "stat";
8332
- async function Gb(t, e, r, n = !1) {
8332
+ async function Wb(t, e, r, n = !1) {
8333
8333
  const s = await jm(
8334
8334
  t,
8335
8335
  e,
@@ -8338,21 +8338,21 @@ async function Gb(t, e, r, n = !1) {
8338
8338
  );
8339
8339
  return Xm(s);
8340
8340
  }
8341
- async function Kb() {
8341
+ async function Jb() {
8342
8342
  return await H(
8343
8343
  Mm
8344
8344
  );
8345
8345
  }
8346
- async function Wb(t, e = 20) {
8346
+ async function Qb(t, e = 20) {
8347
8347
  return await H(
8348
8348
  Um(t, e)
8349
8349
  );
8350
8350
  }
8351
- async function Jb() {
8351
+ async function Xb() {
8352
8352
  return await H(qm);
8353
8353
  }
8354
8354
  const Zm = (t) => `${se}/Medication/${t}`;
8355
- async function Qb(t) {
8355
+ async function Zb(t) {
8356
8356
  return await H(Zm(t));
8357
8357
  }
8358
8358
  const eg = 200, tg = (t, e, r, n, s) => {
@@ -8372,7 +8372,7 @@ async function Kt(t, e, r, n, s) {
8372
8372
  );
8373
8373
  }
8374
8374
  const rg = (t) => `${se}/ImagingStudy/${t}/$fetch-quality-assessment`;
8375
- async function Xb(t, e, r, n) {
8375
+ async function e_(t, e, r, n) {
8376
8376
  return await Kt(
8377
8377
  e,
8378
8378
  t,
@@ -8380,7 +8380,7 @@ async function Xb(t, e, r, n) {
8380
8380
  n
8381
8381
  );
8382
8382
  }
8383
- async function Zb(t, e, r, n) {
8383
+ async function t_(t, e, r, n) {
8384
8384
  return await Kt(
8385
8385
  e,
8386
8386
  t,
@@ -8389,7 +8389,7 @@ async function Zb(t, e, r, n) {
8389
8389
  "ImagingStudy:basedon"
8390
8390
  );
8391
8391
  }
8392
- async function e_(t, e, r, n) {
8392
+ async function r_(t, e, r, n) {
8393
8393
  return (await Kt(
8394
8394
  e,
8395
8395
  t,
@@ -8397,10 +8397,10 @@ async function e_(t, e, r, n) {
8397
8397
  n
8398
8398
  )).entry?.filter((a) => a.resource?.resourceType === "ServiceRequest").map((a) => a.resource) ?? [];
8399
8399
  }
8400
- async function t_(t) {
8400
+ async function n_(t) {
8401
8401
  return await H(rg(t));
8402
8402
  }
8403
- async function r_(t, e, r, n) {
8403
+ async function s_(t, e, r, n) {
8404
8404
  return await Kt(
8405
8405
  e,
8406
8406
  t,
@@ -8412,29 +8412,29 @@ const ng = (t, e) => {
8412
8412
  const r = `${se}/DiagnosticReport?patient=${t}`;
8413
8413
  return e ? `${r}&based-on=${e}` : r;
8414
8414
  }, sg = (t) => `${se}/DiagnosticReport/${t}/$fetch-bundle`, og = (t) => `${se}/DiagnosticReport/${t}/$update-bundle`;
8415
- async function n_(t, e = []) {
8415
+ async function o_(t, e = []) {
8416
8416
  const r = e.length > 0 ? e.join(",") : void 0, n = ng(t, r);
8417
8417
  return await H(n);
8418
8418
  }
8419
- async function s_(t) {
8419
+ async function a_(t) {
8420
8420
  const e = sg(t);
8421
8421
  return await H(e);
8422
8422
  }
8423
- async function o_(t, e) {
8423
+ async function i_(t, e) {
8424
8424
  const r = og(t);
8425
8425
  return await ve(r, e);
8426
8426
  }
8427
- const a_ = [
8427
+ const c_ = [
8428
8428
  "preliminary",
8429
8429
  "final",
8430
8430
  "amended",
8431
8431
  "corrected",
8432
8432
  "appended"
8433
- ], i_ = [
8433
+ ], u_ = [
8434
8434
  "registered",
8435
8435
  "unknown",
8436
8436
  "partial"
8437
- ], ag = "All Orderables", ig = "/openmrs/ws/rest/v1/ordertype?v=custom:(uuid,display,conceptClasses:(uuid,name))", cg = "LabSet", ug = "http://fhir.bahmni.org/ext/ValueSet/concept-class", c_ = ["orderTypes"], lg = async () => await lm(ag), vs = async () => await H(ig), dg = (t) => {
8437
+ ], ag = "All Orderables", ig = "/openmrs/ws/rest/v1/ordertype?v=custom:(uuid,display,conceptClasses:(uuid,name))", cg = "LabSet", ug = "http://fhir.bahmni.org/ext/ValueSet/concept-class", l_ = ["orderTypes"], lg = async () => await lm(ag), vs = async () => await H(ig), dg = (t) => {
8438
8438
  let e = t.display ?? "Unknown investigation";
8439
8439
  return Ki(t) === cg && (e += ` (${de.t("INVESTIGATION_PANEL")})`), e;
8440
8440
  }, fg = (t) => {
@@ -8466,12 +8466,12 @@ const a_ = [
8466
8466
  });
8467
8467
  });
8468
8468
  }), r;
8469
- }, u_ = async () => {
8469
+ }, d_ = async () => {
8470
8470
  const t = await lg(), e = await vs();
8471
8471
  return pg(t, fg(e));
8472
- }, l_ = async (t) => t ? (await vs()).results.find(
8472
+ }, f_ = async (t) => t ? (await vs()).results.find(
8473
8473
  (n) => n.display.toLowerCase() === t.toLowerCase()
8474
- )?.uuid ?? null : null, d_ = async () => (await vs()).results.map((e) => e.display), f_ = async (t, e, r) => {
8474
+ )?.uuid ?? null : null, p_ = async () => (await vs()).results.map((e) => e.display), h_ = async (t, e, r) => {
8475
8475
  const n = [];
8476
8476
  for (const s of t) {
8477
8477
  const o = s.uuid;
@@ -13021,19 +13021,19 @@ var by = Ey();
13021
13021
  const _y = /* @__PURE__ */ hg(by), ka = {
13022
13022
  CONFIG_NOT_FOUND: "CONFIG_ERROR_NOT_FOUND",
13023
13023
  VALIDATION_FAILED: "CONFIG_ERROR_VALIDATION_FAILED"
13024
- }, p_ = async (t, e) => {
13024
+ }, m_ = async (t, e) => {
13025
13025
  const r = await vy(t);
13026
13026
  if (!r)
13027
13027
  throw new Error(ka.CONFIG_NOT_FOUND);
13028
13028
  if (!await Ty(r, e))
13029
13029
  throw new Error(ka.VALIDATION_FAILED);
13030
13030
  return r;
13031
- }, vy = async (t) => await H(t), Ty = async (t, e) => new _y().compile(e)(t), h_ = async () => {
13031
+ }, vy = async (t) => await H(t), Ty = async (t, e) => new _y().compile(e)(t), g_ = async () => {
13032
13032
  await mi(hs), Dl.forEach((t) => Pd(t)), globalThis.location.href = di;
13033
- }, Sy = (t) => W + `/form/${t}?v=custom:(resources:(value))`, Ry = (t) => {
13033
+ }, Sy = (t) => W + `/form/${t}?v=custom:(uuid,name,version,published,resources:(value))`, Ry = (t) => {
13034
13034
  const e = W + "/bahmniie/form/latestPublishedForms";
13035
13035
  return t ? e + `?episodeUuid=${t}` : e;
13036
- }, m_ = (t) => W + `/user/${t}?v=full`, Oy = (t, e, r, n) => W + `/bahmniie/form/translations?formName=${encodeURIComponent(t)}&formUuid=${e}&formVersion=${r}&locale=${n}`, Fr = "Bahmni", Ay = (t, e, r) => {
13036
+ }, y_ = (t) => W + `/user/${t}?v=full`, Oy = (t, e, r, n) => W + `/bahmniie/form/translations?formName=${encodeURIComponent(t)}&formUuid=${e}&formVersion=${r}&locale=${n}`, Fr = "Bahmni", Ay = (t) => W + `/form?q=${encodeURIComponent(t)}&v=custom:(uuid,name,version,published,auditInfo:(dateCreated))`, Py = (t, e, r) => {
13037
13037
  let s = W + "/bahmnicore/patient/" + t + "/forms";
13038
13038
  return r ? s += `?patientProgramUuid=${r}` : e && (s += `?numberOfVisits=${e}`), s;
13039
13039
  }, rc = (t, e, r, n) => {
@@ -13043,35 +13043,35 @@ const _y = /* @__PURE__ */ hg(by), ka = {
13043
13043
  s += `&code=${o}`, n && (s += "&_include=Observation:has-member&_include=Observation:encounter");
13044
13044
  }
13045
13045
  return r && (s += `&based-on=${r}`), s;
13046
- }, Py = (t) => `${se}/Observation/$fetch-all?encounter=${t}`;
13047
- async function Ny(t, e, r) {
13046
+ }, Ny = (t) => `${se}/Observation/$fetch-all?encounter=${t}`;
13047
+ async function Iy(t, e, r) {
13048
13048
  const n = rc(t, e, r);
13049
13049
  return await H(n);
13050
13050
  }
13051
- async function g_(t, e) {
13051
+ async function w_(t, e) {
13052
13052
  const r = rc(t, e, void 0, !0);
13053
13053
  return await H(r);
13054
13054
  }
13055
- async function y_(t, e, r) {
13056
- return (await Ny(
13055
+ async function E_(t, e, r) {
13056
+ return (await Iy(
13057
13057
  t,
13058
13058
  e,
13059
13059
  r
13060
13060
  )).entry?.filter((o) => o.resource?.resourceType === "Observation").map((o) => o.resource) ?? [];
13061
13061
  }
13062
- async function w_(t) {
13062
+ async function b_(t) {
13063
13063
  return await H(
13064
- Py(t)
13064
+ Ny(t)
13065
13065
  );
13066
13066
  }
13067
- const Iy = (t) => t.split("/").pop() ?? "", E_ = (t, e) => {
13067
+ const $y = (t) => t.split("/").pop() ?? "", __ = (t, e) => {
13068
13068
  const r = /* @__PURE__ */ new Map(), n = e.entry?.filter((o) => o.resource?.resourceType === "Encounter").map((o) => o.resource) ?? [], s = /* @__PURE__ */ new Map();
13069
13069
  return n.forEach((o) => {
13070
13070
  o.id && s.set(o.id, o);
13071
13071
  }), t.forEach((o) => {
13072
13072
  const a = o.encounter?.reference;
13073
13073
  if (!a) return;
13074
- const i = Iy(a), c = s.get(i);
13074
+ const i = $y(a), c = s.get(i);
13075
13075
  if (c) {
13076
13076
  if (!r.has(i)) {
13077
13077
  const u = c.period?.start ? new Date(c.period.start).getTime() : 0, l = c.participant?.[0]?.individual?.display ?? "Unknown";
@@ -13087,23 +13087,23 @@ const Iy = (t) => t.split("/").pop() ?? "", E_ = (t, e) => {
13087
13087
  }), Array.from(r.values()).sort(
13088
13088
  (o, a) => a.encounterDateTime - o.encounterDateTime
13089
13089
  );
13090
- }, nc = (t) => W + `/provider?user=${t}&v=custom:(uuid,display,person,attributes)`, $y = W + "/provider?v=custom:(uuid,display,person,attributes)";
13091
- async function b_(t) {
13090
+ }, nc = (t) => W + `/provider?user=${t}&v=custom:(uuid,display,person,attributes)`, Dy = W + "/provider?v=custom:(uuid,display,person,attributes)";
13091
+ async function v_(t) {
13092
13092
  const e = await H(
13093
13093
  nc(t)
13094
13094
  );
13095
13095
  return !e.results || e.results.length === 0 ? null : e.results[0];
13096
13096
  }
13097
- async function __() {
13097
+ async function T_() {
13098
13098
  const t = [];
13099
- let e = $y;
13099
+ let e = Dy;
13100
13100
  for (; e; ) {
13101
13101
  const r = await H(e);
13102
13102
  t.push(...r.results ?? []), e = r.links?.find((s) => s.rel === "next")?.uri ?? null;
13103
13103
  }
13104
13104
  return t;
13105
13105
  }
13106
- async function v_(t) {
13106
+ async function S_(t) {
13107
13107
  const e = await H(nc(t));
13108
13108
  if (!e.results || e.results.length === 0)
13109
13109
  return [];
@@ -13112,19 +13112,19 @@ async function v_(t) {
13112
13112
  (n) => !n.voided && n.attributeType.display === "Login Locations"
13113
13113
  ).map((n) => n.value) : [];
13114
13114
  }
13115
- const Dy = (t) => `${W}/encountertype?q=${encodeURIComponent(t)}&v=custom:(uuid,name)`, Cy = (t) => se + `/Encounter?subject:Patient=${t}&_tag=visit&_sort=-_lastUpdated`, Ly = (t, e = 100, r = 0) => se + `/Encounter?subject:Patient=${t}&_sort=-_lastUpdated&_count=${e}&_getpagesoffset=${r}`, sc = se + "/Encounter";
13116
- async function xy(t) {
13117
- return await H(Cy(t));
13118
- }
13115
+ const Cy = (t) => `${W}/encountertype?q=${encodeURIComponent(t)}&v=custom:(uuid,name)`, Ly = (t) => se + `/Encounter?subject:Patient=${t}&_tag=visit&_sort=-_lastUpdated`, xy = (t, e = 100, r = 0) => se + `/Encounter?subject:Patient=${t}&_sort=-_lastUpdated&_count=${e}&_getpagesoffset=${r}`, sc = se + "/Encounter";
13119
13116
  async function ky(t) {
13120
- return (await xy(t)).entry?.map((r) => r.resource).filter((r) => r !== void 0) ?? [];
13117
+ return await H(Ly(t));
13118
+ }
13119
+ async function My(t) {
13120
+ return (await ky(t)).entry?.map((r) => r.resource).filter((r) => r !== void 0) ?? [];
13121
13121
  }
13122
- async function T_(t) {
13122
+ async function R_(t) {
13123
13123
  const r = [];
13124
13124
  let n = 0;
13125
13125
  for (; ; ) {
13126
13126
  const o = ((await H(
13127
- Ly(t, 100, n)
13127
+ xy(t, 100, n)
13128
13128
  )).entry ?? []).map((a) => a.resource).filter((a) => a !== void 0);
13129
13129
  if (r.push(...o), o.length < 100)
13130
13130
  break;
@@ -13132,27 +13132,27 @@ async function T_(t) {
13132
13132
  }
13133
13133
  return r;
13134
13134
  }
13135
- async function S_(t) {
13135
+ async function O_(t) {
13136
13136
  return ((await H(
13137
- Dy(t)
13137
+ Cy(t)
13138
13138
  )).results ?? []).find((n) => n.name === t) ?? null;
13139
13139
  }
13140
13140
  async function oc(t) {
13141
- return (await ky(t)).find((r) => !r.period?.end) ?? null;
13141
+ return (await My(t)).find((r) => !r.period?.end) ?? null;
13142
13142
  }
13143
- async function R_(t, e) {
13143
+ async function A_(t, e) {
13144
13144
  return await H(
13145
13145
  `/openmrs/ws/fhir2/R4/Encounter/${t}`,
13146
13146
  e
13147
13147
  );
13148
13148
  }
13149
- async function O_(t) {
13149
+ async function P_(t) {
13150
13150
  return await ve(sc, t);
13151
13151
  }
13152
- async function A_(t, e) {
13152
+ async function N_(t, e) {
13153
13153
  return await gs(`${sc}/${t}`, e);
13154
13154
  }
13155
- const P_ = (t, e) => t?.length === 0 ? !1 : e?.length === 0, My = se + "/Encounter", Uy = W + "/systemsetting/bahmni.encountersession.duration", N_ = {
13155
+ const I_ = (t, e) => t?.length === 0 ? !1 : e?.length === 0, Uy = se + "/Encounter", qy = W + "/systemsetting/bahmni.encountersession.duration", $_ = {
13156
13156
  MATCHED: "ENCOUNTER_MATCH_REASON_MATCHED",
13157
13157
  NO_ACTIVE_VISIT: "ENCOUNTER_MATCH_REASON_NO_ACTIVE_VISIT",
13158
13158
  NO_ACTIVE_ENCOUNTER: "ENCOUNTER_MATCH_REASON_NO_ACTIVE_ENCOUNTER",
@@ -13165,20 +13165,20 @@ async function ts(t) {
13165
13165
  Object.entries(t).forEach(([s, o]) => {
13166
13166
  o && e.append(s, o);
13167
13167
  });
13168
- const r = `${My}?${e.toString()}`;
13168
+ const r = `${Uy}?${e.toString()}`;
13169
13169
  return (await H(r)).entry?.map((s) => s.resource).filter((s) => s !== void 0) ?? [];
13170
13170
  }
13171
13171
  async function ac() {
13172
13172
  try {
13173
13173
  const t = await H(
13174
- Uy
13174
+ qy
13175
13175
  ), e = Number(t.value);
13176
13176
  return !isNaN(e) && e > 0 ? e : 60;
13177
13177
  } catch {
13178
13178
  return 30;
13179
13179
  }
13180
13180
  }
13181
- async function qy(t, e) {
13181
+ async function Fy(t, e) {
13182
13182
  if (!t.length) return null;
13183
13183
  try {
13184
13184
  const r = await oc(e);
@@ -13190,7 +13190,7 @@ async function qy(t, e) {
13190
13190
  return null;
13191
13191
  }
13192
13192
  }
13193
- async function I_(t, e, r, n) {
13193
+ async function D_(t, e, r, n) {
13194
13194
  try {
13195
13195
  if (!t) return null;
13196
13196
  const s = r ?? await ac(), a = `ge${new Date(Date.now() - s * 60 * 1e3).toISOString()}`, i = {
@@ -13201,7 +13201,7 @@ async function I_(t, e, r, n) {
13201
13201
  };
13202
13202
  e && (i.participant = e);
13203
13203
  const c = await ts(i);
13204
- return c.length === 0 ? null : await qy(c, t);
13204
+ return c.length === 0 ? null : await Fy(c, t);
13205
13205
  } catch {
13206
13206
  return null;
13207
13207
  }
@@ -13227,7 +13227,7 @@ function Bn(t) {
13227
13227
  return new Date(r.period?.start ?? 0).getTime() - n;
13228
13228
  });
13229
13229
  }
13230
- async function $_(t, e, r, n) {
13230
+ async function C_(t, e, r, n) {
13231
13231
  try {
13232
13232
  const s = await oc(t);
13233
13233
  if (!s?.id)
@@ -13292,7 +13292,7 @@ async function $_(t, e, r, n) {
13292
13292
  };
13293
13293
  }
13294
13294
  }
13295
- function D_(t) {
13295
+ function L_(t) {
13296
13296
  return t.matched || t.reasons.includes("LOCATION_MISMATCH") && !t.reasons.includes("SESSION_EXPIRED") && !t.reasons.includes("PROVIDER_MISMATCH");
13297
13297
  }
13298
13298
  const ic = {
@@ -13300,7 +13300,7 @@ const ic = {
13300
13300
  activeEncounter: null,
13301
13301
  canEditOrCreate: !1,
13302
13302
  isLoading: !1
13303
- }, Fy = [
13303
+ }, jy = [
13304
13304
  "MATCHED",
13305
13305
  "LOCATION_MISMATCH",
13306
13306
  "PROVIDER_MISMATCH"
@@ -13310,17 +13310,17 @@ const rs = /* @__PURE__ */ new Set();
13310
13310
  function As() {
13311
13311
  rs.forEach((t) => t());
13312
13312
  }
13313
- function jy(t) {
13313
+ function Vy(t) {
13314
13314
  return rs.add(t), () => {
13315
13315
  rs.delete(t);
13316
13316
  };
13317
13317
  }
13318
- function Vy() {
13318
+ function Hy() {
13319
13319
  return Vt;
13320
13320
  }
13321
- function C_(t) {
13321
+ function x_(t) {
13322
13322
  const e = t.reasons.some(
13323
- (r) => Fy.includes(r)
13323
+ (r) => jy.includes(r)
13324
13324
  );
13325
13325
  Vt = {
13326
13326
  matchReasons: t.reasons,
@@ -13329,21 +13329,21 @@ function C_(t) {
13329
13329
  isLoading: !1
13330
13330
  }, As();
13331
13331
  }
13332
- function L_(t) {
13332
+ function k_(t) {
13333
13333
  Vt = { ...Vt, isLoading: t }, As();
13334
13334
  }
13335
- function x_() {
13335
+ function M_() {
13336
13336
  Vt = { ...ic }, As();
13337
13337
  }
13338
- function k_() {
13338
+ function U_() {
13339
13339
  return Ec(
13340
- jy,
13341
- Vy
13340
+ Vy,
13341
+ Hy
13342
13342
  );
13343
13343
  }
13344
- const Hy = (t) => se + `/EpisodeOfCare?_revinclude=Encounter:episode-of-care&_id=${t}`;
13345
- async function M_(t) {
13346
- const e = t.join(","), r = await H(Hy(e));
13344
+ const By = (t) => se + `/EpisodeOfCare?_revinclude=Encounter:episode-of-care&_id=${t}`;
13345
+ async function q_(t) {
13346
+ const e = t.join(","), r = await H(By(e));
13347
13347
  if (r.total === 0)
13348
13348
  throw new Error(
13349
13349
  "No episode of care found for the provided UUIDs: " + t.join(", ")
@@ -13355,7 +13355,7 @@ async function M_(t) {
13355
13355
  c && s.add(c);
13356
13356
  }), { visitUuids: Array.from(s), encounterUuids: o };
13357
13357
  }
13358
- const By = (t) => ({
13358
+ const zy = (t) => ({
13359
13359
  resourceType: "EncounterBundle",
13360
13360
  type: "transaction",
13361
13361
  id: Wr(),
@@ -13368,13 +13368,13 @@ const By = (t) => ({
13368
13368
  method: r,
13369
13369
  url: n ?? e.resourceType
13370
13370
  }
13371
- }), zy = `${se}/EncounterBundle`, zn = /* @__PURE__ */ new Map(), Yy = async (t) => {
13371
+ }), Yy = `${se}/EncounterBundle`, zn = /* @__PURE__ */ new Map(), Gy = async (t) => {
13372
13372
  if (zn.has(t))
13373
13373
  return zn.get(t) ?? null;
13374
13374
  const e = await H(vi(t)), r = e ? String(e) : null;
13375
13375
  return zn.set(t, r), r;
13376
- }, Gy = async () => await Yy(_d) === "true", Ky = async (t, e, r, n = Ze.CLINICAL) => {
13377
- if (!await Gy())
13376
+ }, Ky = async () => await Gy(_d) === "true", Wy = async (t, e, r, n = Ze.CLINICAL) => {
13377
+ if (!await Ky())
13378
13378
  return { logged: !1 };
13379
13379
  const o = Xn[e];
13380
13380
  if (!o)
@@ -13391,14 +13391,14 @@ const By = (t) => ({
13391
13391
  module: n
13392
13392
  };
13393
13393
  return await ve(ff, a), { logged: !0 };
13394
- }, U_ = () => df(async (e) => {
13395
- await Ky(
13394
+ }, F_ = () => df(async (e) => {
13395
+ await Wy(
13396
13396
  e.patientUuid,
13397
13397
  e.eventType,
13398
13398
  e.messageParams,
13399
13399
  e.module
13400
13400
  );
13401
- }), q_ = async () => {
13401
+ }), j_ = async () => {
13402
13402
  try {
13403
13403
  const t = await H(hs);
13404
13404
  return t.user ? t.user.privileges : null;
@@ -13406,7 +13406,7 @@ const By = (t) => ({
13406
13406
  const { message: e } = Br(t);
13407
13407
  throw new Error(e);
13408
13408
  }
13409
- }, F_ = (t, e) => {
13409
+ }, V_ = (t, e) => {
13410
13410
  if (!t || t.length === 0)
13411
13411
  return !1;
13412
13412
  if (!e || e.length === 0)
@@ -13415,7 +13415,7 @@ const By = (t) => ({
13415
13415
  return t.some(
13416
13416
  (n) => r.includes(n.name)
13417
13417
  );
13418
- }, Wy = async (t) => {
13418
+ }, Jy = async (t) => {
13419
13419
  let e;
13420
13420
  t && t.length > 0 && (e = t.join(","));
13421
13421
  const r = await fetch(Ry(e));
@@ -13425,7 +13425,7 @@ const By = (t) => ({
13425
13425
  );
13426
13426
  const n = await r.json();
13427
13427
  return Array.isArray(n) ? n : [];
13428
- }, Jy = (t, e) => {
13428
+ }, Qy = (t, e) => {
13429
13429
  const r = JSON.parse(t.nameTranslation);
13430
13430
  if (Array.isArray(r) && r.length > 0) {
13431
13431
  const n = r.find(
@@ -13435,8 +13435,8 @@ const By = (t) => ({
13435
13435
  return n.display;
13436
13436
  }
13437
13437
  return t.name;
13438
- }, Qy = (t, e) => {
13439
- const r = Jy(t, e);
13438
+ }, Xy = (t, e) => {
13439
+ const r = Qy(t, e);
13440
13440
  return {
13441
13441
  uuid: t.uuid,
13442
13442
  name: r,
@@ -13446,12 +13446,12 @@ const By = (t) => ({
13446
13446
  editable: n.editable
13447
13447
  }))
13448
13448
  };
13449
- }, j_ = async (t) => {
13450
- const e = await Wy(t), r = sn();
13449
+ }, H_ = async (t) => {
13450
+ const e = await Jy(t), r = sn();
13451
13451
  return e.map(
13452
- (n) => Qy(n, r)
13452
+ (n) => Xy(n, r)
13453
13453
  );
13454
- }, V_ = async (t) => {
13454
+ }, B_ = async (t) => {
13455
13455
  const e = await fetch(Sy(t));
13456
13456
  if (!e.ok)
13457
13457
  throw new Error(
@@ -13485,10 +13485,32 @@ const By = (t) => ({
13485
13485
  schema: n,
13486
13486
  translations: u
13487
13487
  };
13488
- }, H_ = async (t, e, r) => {
13488
+ }, z_ = async (t, e, r) => {
13489
+ const n = await fetch(Ay(t));
13490
+ if (!n.ok) return null;
13491
+ const s = await n.json(), a = (Array.isArray(s.results) ? s.results : []).filter(
13492
+ (u) => u.name.toLowerCase() === t.toLowerCase() && u.published
13493
+ );
13494
+ if (a.length === 0) return null;
13495
+ if (e && e > 1) {
13496
+ const u = a.find(
13497
+ (l) => String(l.version) === String(e)
13498
+ );
13499
+ if (u) return u.uuid;
13500
+ }
13501
+ const i = a.filter((u) => !!u.auditInfo?.dateCreated);
13502
+ if (i.length === 0) return null;
13503
+ if (i.sort(
13504
+ (u, l) => new Date(u.auditInfo.dateCreated).getTime() - new Date(l.auditInfo.dateCreated).getTime()
13505
+ ), !r) return i[0].uuid;
13506
+ const c = i.filter(
13507
+ (u) => new Date(u.auditInfo.dateCreated).getTime() <= r
13508
+ );
13509
+ return c.length === 0 ? i[0].uuid : c.at(-1).uuid;
13510
+ }, Y_ = async (t, e, r) => {
13489
13511
  let n;
13490
13512
  e && e.length > 0 && (n = e.join(","));
13491
- const s = Ay(t, r, n), o = await H(s);
13513
+ const s = Py(t, r, n), o = await H(s);
13492
13514
  return Array.isArray(o) ? o : [];
13493
13515
  };
13494
13516
  function cc(t) {
@@ -13530,7 +13552,7 @@ function lc(t, e) {
13530
13552
  };
13531
13553
  return n(r.controls);
13532
13554
  }
13533
- function B_(t, e) {
13555
+ function G_(t, e) {
13534
13556
  if (!t.controls || t.controls.length === 0)
13535
13557
  return [];
13536
13558
  const r = [], n = (/* @__PURE__ */ new Date()).toISOString();
@@ -13575,7 +13597,7 @@ function B_(t, e) {
13575
13597
  s.interpretation && (a.interpretation = s.interpretation), s.comment && (a.comment = s.comment), r.push(a);
13576
13598
  }), r;
13577
13599
  }
13578
- function z_(t, e) {
13600
+ function K_(t, e) {
13579
13601
  if (!t || t.length === 0)
13580
13602
  return {
13581
13603
  controls: [],
@@ -13608,31 +13630,30 @@ function z_(t, e) {
13608
13630
  metadata: { formMetadata: e }
13609
13631
  };
13610
13632
  }
13611
- function Y_(t) {
13633
+ function Zy(t) {
13634
+ return t == null ? null : typeof t == "string" || typeof t == "number" || typeof t == "boolean" || typeof t == "object" ? t : null;
13635
+ }
13636
+ function W_(t) {
13612
13637
  const e = (n) => {
13613
- const s = (u) => u == null ? null : typeof u == "string" || typeof u == "number" || typeof u == "boolean" || typeof u == "object" ? u : 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 = {
13638
+ const s = n.concept, o = typeof s == "object" && s !== null && "uuid" in s ? s.uuid : s, a = typeof s == "object" && s !== null && "datatype" in s ? s.datatype : void 0, i = {
13614
13639
  concept: {
13615
- uuid: a,
13616
- datatype: i
13640
+ uuid: o,
13641
+ datatype: a
13617
13642
  },
13618
- value: s(n.value),
13643
+ value: Zy(n.value),
13619
13644
  obsDatetime: typeof n.observationDateTime == "string" ? n.observationDateTime : (/* @__PURE__ */ new Date()).toISOString(),
13620
13645
  formNamespace: typeof n.formNamespace == "string" ? n.formNamespace : "Bahmni",
13621
13646
  formFieldPath: typeof n.formFieldPath == "string" ? n.formFieldPath : void 0
13622
13647
  };
13623
- if (n.comment && typeof n.comment == "string" && (c.comment = n.comment), n.interpretation && typeof n.interpretation == "string" && (c.interpretation = n.interpretation), n.groupMembers && Array.isArray(n.groupMembers)) {
13624
- const u = n.groupMembers.filter((l) => !(l.voided ?? (l.value && typeof l.value == "string" && l.value.endsWith("voided"))));
13625
- c.groupMembers = u.map(e);
13626
- }
13627
- return c;
13648
+ return typeof n.uuid == "string" && (i.uuid = n.uuid), n.voided === !0 && (i.voided = !0), typeof n.status == "string" && (i.status = n.status), typeof n.comment == "string" && (i.comment = n.comment), typeof n.interpretation == "string" && (i.interpretation = n.interpretation), n.groupMembers && Array.isArray(n.groupMembers) && (i.groupMembers = n.groupMembers.map(e)), i;
13628
13649
  };
13629
13650
  return (t?.filter((n) => n.uuid && n.voided ? !0 : !(!n.uuid && n.voided || n.value && typeof n.value == "string" && n.value.endsWith("voided"))) ?? []).map(e);
13630
13651
  }
13631
- function G_(t) {
13652
+ function J_(t) {
13632
13653
  if (!(!t || typeof t != "object"))
13633
13654
  return "toJS" in t && typeof t.toJS == "function" ? t.toJS() : t;
13634
13655
  }
13635
- function K_(t, e) {
13656
+ function Q_(t, e) {
13636
13657
  !t || !Array.isArray(t.children) || t.children.forEach((r) => {
13637
13658
  r && typeof r == "object" && dc(
13638
13659
  r,
@@ -13662,7 +13683,7 @@ function dc(t, e) {
13662
13683
  );
13663
13684
  });
13664
13685
  }
13665
- function Xy(t) {
13686
+ function ew(t) {
13666
13687
  const e = t.value && typeof t.value == "object" ? t.value : null;
13667
13688
  if (!e)
13668
13689
  return t.value === null || t.value === void 0 || t.value === "";
@@ -13672,14 +13693,14 @@ function Xy(t) {
13672
13693
  const n = e.concept;
13673
13694
  return n != null ? Array.isArray(n) ? n.length === 0 : !1 : !0;
13674
13695
  }
13675
- function Zy(t) {
13696
+ function tw(t) {
13676
13697
  if (!t || typeof t != "object") return !1;
13677
13698
  const e = t.children, r = Array.isArray(e) && e.length > 0, s = t.control?.properties;
13678
- return !r && s?.mandatory === !0 && !t.hidden && !t.voided && Xy(t) ? !0 : t.hidden || t.voided ? !1 : r ? e.some(
13679
- (o) => o && typeof o == "object" && Zy(o)
13699
+ return !r && s?.mandatory === !0 && !t.hidden && !t.voided && ew(t) ? !0 : t.hidden || t.voided ? !1 : r ? e.some(
13700
+ (o) => o && typeof o == "object" && tw(o)
13680
13701
  ) : !1;
13681
13702
  }
13682
- const ew = W + "/bahmnicore/diseaseSummaryData?", W_ = async (t, e, r, n) => {
13703
+ const rw = W + "/bahmnicore/diseaseSummaryData?", X_ = async (t, e, r, n) => {
13683
13704
  const s = new URLSearchParams({
13684
13705
  groupBy: n,
13685
13706
  latestCount: e.toString(),
@@ -13688,17 +13709,17 @@ const ew = W + "/bahmnicore/diseaseSummaryData?", W_ = async (t, e, r, n) => {
13688
13709
  r.forEach((a) => {
13689
13710
  s.append("obsConcepts", a);
13690
13711
  });
13691
- const o = ew + s.toString();
13712
+ const o = rw + s.toString();
13692
13713
  return H(o);
13693
- }, Ps = "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)", tw = (t) => `${W}/bahmniprogramenrollment?patient=${t}&v=${Ps}`, rw = (t, e = 15, r = 0) => `${W}/bahmniprogramenrollment?patient=${t}&v=${Ps}&limit=${e}&startIndex=${r}&totalCount=true`, fc = (t) => `${W}/bahmniprogramenrollment/${t}`, nw = (t) => `${fc(t)}?v=${Ps}`, J_ = async (t) => await H(tw(t)), Q_ = async (t, e = 15, r = 1) => {
13714
+ }, Ps = "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)", nw = (t) => `${W}/bahmniprogramenrollment?patient=${t}&v=${Ps}`, sw = (t, e = 15, r = 0) => `${W}/bahmniprogramenrollment?patient=${t}&v=${Ps}&limit=${e}&startIndex=${r}&totalCount=true`, fc = (t) => `${W}/bahmniprogramenrollment/${t}`, ow = (t) => `${fc(t)}?v=${Ps}`, Z_ = async (t) => await H(nw(t)), ev = async (t, e = 15, r = 1) => {
13694
13715
  const n = (r - 1) * e, s = await H(
13695
- rw(t, e, n)
13716
+ sw(t, e, n)
13696
13717
  );
13697
13718
  return {
13698
13719
  programs: s.results,
13699
13720
  total: s.totalCount
13700
13721
  };
13701
- }, X_ = async (t) => await H(nw(t)), Z_ = async (t, e) => {
13722
+ }, tv = async (t) => await H(ow(t)), rv = async (t, e) => {
13702
13723
  const r = {
13703
13724
  uuid: t,
13704
13725
  states: [
@@ -13712,7 +13733,7 @@ const ew = W + "/bahmnicore/diseaseSummaryData?", W_ = async (t, e, r, n) => {
13712
13733
  r
13713
13734
  );
13714
13735
  };
13715
- function ev(t) {
13736
+ function nv(t) {
13716
13737
  if (t.states.length === 0)
13717
13738
  return null;
13718
13739
  let e;
@@ -13728,7 +13749,7 @@ function ev(t) {
13728
13749
  e = t.states.find((r) => r.endDate === null);
13729
13750
  return e ? fm(e.state.concept.names) ?? e.state.concept.display : null;
13730
13751
  }
13731
- function tv(t, e) {
13752
+ function sv(t, e) {
13732
13753
  if (e.length === 0)
13733
13754
  return {};
13734
13755
  const r = {};
@@ -13740,12 +13761,12 @@ function tv(t, e) {
13740
13761
  }
13741
13762
  return r;
13742
13763
  }
13743
- const ns = "consultation:saved", rv = (t) => {
13764
+ const ns = "consultation:saved", ov = (t) => {
13744
13765
  const e = new CustomEvent(ns, {
13745
13766
  detail: t
13746
13767
  });
13747
13768
  window.dispatchEvent(e);
13748
- }, nv = (t, e = []) => {
13769
+ }, av = (t, e = []) => {
13749
13770
  const r = Ut(t);
13750
13771
  nt(() => {
13751
13772
  r.current = t;
@@ -13758,17 +13779,17 @@ const ns = "consultation:saved", rv = (t) => {
13758
13779
  window.removeEventListener(ns, n);
13759
13780
  };
13760
13781
  }, e);
13761
- }, ss = "cdss:check", os = "cdss:results", sv = (t) => {
13782
+ }, ss = "cdss:check", os = "cdss:results", iv = (t) => {
13762
13783
  const e = new CustomEvent(ss, {
13763
13784
  detail: t
13764
13785
  });
13765
13786
  globalThis.dispatchEvent(e);
13766
- }, ov = (t) => {
13787
+ }, cv = (t) => {
13767
13788
  const e = new CustomEvent(os, {
13768
13789
  detail: t
13769
13790
  });
13770
13791
  globalThis.dispatchEvent(e);
13771
- }, av = (t) => {
13792
+ }, uv = (t) => {
13772
13793
  const e = Ut(t);
13773
13794
  nt(() => {
13774
13795
  e.current = t;
@@ -13781,7 +13802,7 @@ const ns = "consultation:saved", rv = (t) => {
13781
13802
  globalThis.removeEventListener(ss, r);
13782
13803
  };
13783
13804
  }, []);
13784
- }, iv = (t) => {
13805
+ }, lv = (t) => {
13785
13806
  const e = Ut(t);
13786
13807
  nt(() => {
13787
13808
  e.current = t;
@@ -13794,17 +13815,17 @@ const ns = "consultation:saved", rv = (t) => {
13794
13815
  globalThis.removeEventListener(os, r);
13795
13816
  };
13796
13817
  }, []);
13797
- }, sw = `${se}/DocumentReference`, ow = "bahmni.documentUpload.maxFileSizeInMB", aw = `${W}/systemsetting?q=${ow}&v=custom:(property,value)`, pc = (t, e, r = 100, n = 0) => {
13818
+ }, aw = `${se}/DocumentReference`, iw = "bahmni.documentUpload.maxFileSizeInMB", cw = `${W}/systemsetting?q=${iw}&v=custom:(property,value)`, pc = (t, e, r = 100, n = 0) => {
13798
13819
  const s = `${se}/DocumentReference?patient=${t}&_sort=-_lastUpdated&_count=${r}&_getpagesoffset=${n}`;
13799
13820
  return e && e.length > 0 ? `${s}&encounter=${encodeURIComponent(e.join(","))}` : s;
13800
13821
  };
13801
- async function cv() {
13822
+ async function dv() {
13802
13823
  const t = await H(
13803
- aw
13824
+ cw
13804
13825
  ), e = Number(t.results?.[0]?.value);
13805
13826
  return Number.isFinite(e) && e > 0 ? e : void 0;
13806
13827
  }
13807
- async function uv(t) {
13828
+ async function fv(t) {
13808
13829
  return ((await dm(t, "custom:(setMembers:(uuid,display))"))?.setMembers ?? []).map((n) => ({
13809
13830
  id: n.uuid,
13810
13831
  label: n.display ?? ""
@@ -13827,17 +13848,17 @@ function hc(t) {
13827
13848
  };
13828
13849
  });
13829
13850
  }
13830
- async function iw(t, e) {
13851
+ async function uw(t, e) {
13831
13852
  const r = pc(t, e);
13832
13853
  return H(r);
13833
13854
  }
13834
- async function lv(t, e) {
13835
- const n = ((await iw(t, e)).entry ?? []).filter(
13855
+ async function pv(t, e) {
13856
+ const n = ((await uw(t, e)).entry ?? []).filter(
13836
13857
  (s) => !!s.resource
13837
13858
  );
13838
13859
  return hc(n);
13839
13860
  }
13840
- async function dv(t, e, r = 10, n = 1) {
13861
+ async function hv(t, e, r = 10, n = 1) {
13841
13862
  const s = (n - 1) * r, o = pc(
13842
13863
  t,
13843
13864
  e,
@@ -13877,7 +13898,7 @@ function mc(t, e) {
13877
13898
  }
13878
13899
  ]), r;
13879
13900
  }
13880
- function cw(t, e, r, n, s, o) {
13901
+ function lw(t, e, r, n, s, o) {
13881
13902
  const a = {
13882
13903
  resourceType: "Encounter",
13883
13904
  status: "finished",
@@ -13922,16 +13943,16 @@ function cw(t, e, r, n, s, o) {
13922
13943
  }
13923
13944
  ]), a;
13924
13945
  }
13925
- async function uw(t) {
13946
+ async function dw(t) {
13926
13947
  const e = mc(
13927
13948
  t,
13928
13949
  `Encounter/${t.encounterUuid}`
13929
13950
  );
13930
- return ve(sw, e);
13951
+ return ve(aw, e);
13931
13952
  }
13932
- async function fv(t) {
13953
+ async function mv(t) {
13933
13954
  if (t.encounterUuid)
13934
- return uw({
13955
+ return dw({
13935
13956
  ...t,
13936
13957
  encounterUuid: t.encounterUuid
13937
13958
  });
@@ -13939,40 +13960,40 @@ async function fv(t) {
13939
13960
  throw new Error(
13940
13961
  "saveDocument requires either encounterUuid or createEncounterInVisit"
13941
13962
  );
13942
- const { visitUuid: e, encounterTypeUuid: r, encounterTypeDisplay: n } = t.createEncounterInVisit, s = `urn:uuid:${Wr()}`, o = cw(
13963
+ const { visitUuid: e, encounterTypeUuid: r, encounterTypeDisplay: n } = t.createEncounterInVisit, s = `urn:uuid:${Wr()}`, o = lw(
13943
13964
  t.patientUuid,
13944
13965
  e,
13945
13966
  r,
13946
13967
  on().uuid,
13947
13968
  n,
13948
13969
  t.authorPractitionerUuid
13949
- ), a = mc(t, s), i = By([
13970
+ ), a = mc(t, s), i = zy([
13950
13971
  qa(s, o, "POST"),
13951
13972
  qa(`urn:uuid:${Wr()}`, a, "POST")
13952
13973
  ]);
13953
- return ve(zy, i);
13974
+ return ve(Yy, i);
13954
13975
  }
13955
- const lw = (t) => `${W}/location?operator=ALL&s=byTags&tags=${encodeURIComponent(t)}&v=custom:(uuid,display,childLocations:(uuid,display,retired))`, dw = (t) => `${se}/Location?_tag=${encodeURIComponent(t)}`;
13956
- async function pv(t) {
13957
- return (await H(lw(t))).results ?? [];
13976
+ const fw = (t) => `${W}/location?operator=ALL&s=byTags&tags=${encodeURIComponent(t)}&v=custom:(uuid,display,childLocations:(uuid,display,retired))`, pw = (t) => `${se}/Location?_tag=${encodeURIComponent(t)}`;
13977
+ async function gv(t) {
13978
+ return (await H(fw(t))).results ?? [];
13958
13979
  }
13959
- async function hv(t) {
13960
- return await H(dw(t));
13980
+ async function yv(t) {
13981
+ return await H(pw(t));
13961
13982
  }
13962
- const fw = se + "/Immunization", pw = (t, e) => {
13963
- let r = `${fw}?patient=${t}&_sort=-date&_count=100`;
13983
+ const hw = se + "/Immunization", mw = (t, e) => {
13984
+ let r = `${hw}?patient=${t}&_sort=-date&_count=100`;
13964
13985
  return e && (r += `&status=${e}`), r;
13965
13986
  };
13966
- async function mv(t, e) {
13967
- return (await hw(t, e)).entry?.filter((n) => n.resource?.resourceType === "Immunization").map((n) => n.resource) ?? [];
13987
+ async function wv(t, e) {
13988
+ return (await gw(t, e)).entry?.filter((n) => n.resource?.resourceType === "Immunization").map((n) => n.resource) ?? [];
13968
13989
  }
13969
- async function hw(t, e) {
13990
+ async function gw(t, e) {
13970
13991
  return H(
13971
- pw(t, e)
13992
+ mw(t, e)
13972
13993
  );
13973
13994
  }
13974
- const mw = W + "/bahmnicore/visitDocument/uploadDocument", gw = "application";
13975
- async function yw(t) {
13995
+ const yw = W + "/bahmnicore/visitDocument/uploadDocument", ww = "application";
13996
+ async function Ew(t) {
13976
13997
  return new Promise((e, r) => {
13977
13998
  const n = new FileReader();
13978
13999
  n.onload = () => {
@@ -13985,7 +14006,7 @@ async function yw(t) {
13985
14006
  let a = o, i = "";
13986
14007
  const c = o.lastIndexOf(".");
13987
14008
  c !== -1 && (a = o.substring(0, c), i = o.substring(c + 1).toLowerCase());
13988
- const u = t.type ? t.type.split("/")[0] : gw;
14009
+ const u = t.type ? t.type.split("/")[0] : ww;
13989
14010
  e({
13990
14011
  content: s,
13991
14012
  fileName: a,
@@ -13997,8 +14018,8 @@ async function yw(t) {
13997
14018
  }, n.readAsDataURL(t);
13998
14019
  });
13999
14020
  }
14000
- async function gv(t, e, r) {
14001
- const n = await yw(t), s = {
14021
+ async function Ev(t, e, r) {
14022
+ const n = await Ew(t), s = {
14002
14023
  content: n.content,
14003
14024
  encounterTypeName: e,
14004
14025
  fileName: n.fileName,
@@ -14006,29 +14027,29 @@ async function gv(t, e, r) {
14006
14027
  format: n.format,
14007
14028
  patientUuid: r
14008
14029
  };
14009
- return ve(mw, s);
14030
+ return ve(yw, s);
14010
14031
  }
14011
- const ww = "/bahmni_config/openmrs/apps", gc = "org.bahmni.home.dashboard", Ew = (t) => Array.isArray(t) ? t : Object.values(t), bw = async (t = "home") => {
14032
+ const bw = "/bahmni_config/openmrs/apps", gc = "org.bahmni.home.dashboard", _w = (t) => Array.isArray(t) ? t : Object.values(t), vw = async (t = "home") => {
14012
14033
  try {
14013
- const e = `${ww}/${t}/v2/extension.json`, r = await fetch(e);
14034
+ const e = `${bw}/${t}/v2/extension.json`, r = await fetch(e);
14014
14035
  if (!r.ok)
14015
14036
  throw new Error(`Failed to load base extensions: ${r.status}`);
14016
- return Ew(await r.json());
14037
+ return _w(await r.json());
14017
14038
  } catch (e) {
14018
14039
  throw console.error("Error fetching module extensions:", e), e;
14019
14040
  }
14020
- }, _w = (t, e = gc, r = "link") => t.filter((n) => {
14041
+ }, Tw = (t, e = gc, r = "link") => t.filter((n) => {
14021
14042
  const s = n.extensionPointId === e, o = r === "all" || n.type === r;
14022
14043
  return s && o;
14023
- }), vw = (t, e) => e === void 0 ? t : t.filter((r) => r.requiredPrivilege ? e.includes(r.requiredPrivilege) : !0), Tw = (t) => {
14044
+ }), Sw = (t, e) => e === void 0 ? t : t.filter((r) => r.requiredPrivilege ? e.includes(r.requiredPrivilege) : !0), Rw = (t) => {
14024
14045
  const e = navigator.onLine;
14025
14046
  return t.filter((r) => !(r.exclusiveOnlineModule && !e || r.exclusiveOfflineModule && e));
14026
- }, Sw = (t) => [...t].sort((e, r) => (e.order ?? 0) - (r.order ?? 0)), yv = async (t = gc, e) => {
14027
- const r = await bw("home"), n = _w(r, t), s = vw(n, e), o = Tw(s);
14028
- return Sw(o);
14029
- }, Rw = (t, e) => W + `/availableStocks?productUuid=${t}&locationUuid=${e}`, wv = async (t, e) => await H(
14030
- Rw(t, e)
14031
- ), Ow = (t, e, r) => {
14047
+ }, Ow = (t) => [...t].sort((e, r) => (e.order ?? 0) - (r.order ?? 0)), bv = async (t = gc, e) => {
14048
+ const r = await vw("home"), n = Tw(r, t), s = Sw(n, e), o = Rw(s);
14049
+ return Ow(o);
14050
+ }, Aw = (t, e) => W + `/availableStocks?productUuid=${t}&locationUuid=${e}`, _v = async (t, e) => await H(
14051
+ Aw(t, e)
14052
+ ), Pw = (t, e, r) => {
14032
14053
  const n = t.find((o) => o.server === e);
14033
14054
  if (!n)
14034
14055
  throw new Error(`CDSS server "${e}" not found in configuration`);
@@ -14040,7 +14061,7 @@ const ww = "/bahmni_config/openmrs/apps", gc = "org.bahmni.home.dashboard", Ew =
14040
14061
  `CDSS service "${r}" not found in server "${e}"`
14041
14062
  );
14042
14063
  return { serverConfig: n, serviceConfig: s };
14043
- }, Aw = (t, e) => {
14064
+ }, Nw = (t, e) => {
14044
14065
  if (!e || e.length === 0)
14045
14066
  return {};
14046
14067
  const r = {};
@@ -14054,8 +14075,8 @@ const ww = "/bahmni_config/openmrs/apps", gc = "org.bahmni.home.dashboard", Ew =
14054
14075
  entry: s
14055
14076
  });
14056
14077
  }), r;
14057
- }, Ev = async (t, e, r, n) => {
14058
- const s = Ow(t, e.server, e.service), { serverConfig: o, serviceConfig: a } = s, i = Aw(
14078
+ }, vv = async (t, e, r, n) => {
14079
+ const s = Pw(t, e.server, e.service), { serverConfig: o, serviceConfig: a } = s, i = Nw(
14059
14080
  n,
14060
14081
  a.contextResourceMap
14061
14082
  ), c = `${o.url}/${a.name}`, u = {
@@ -14072,7 +14093,7 @@ const ww = "/bahmni_config/openmrs/apps", gc = "org.bahmni.home.dashboard", Ew =
14072
14093
  c,
14073
14094
  u
14074
14095
  )).cards || [];
14075
- }, bv = (t, e) => {
14096
+ }, Tv = (t, e) => {
14076
14097
  const r = [];
14077
14098
  return t.forEach((n) => {
14078
14099
  !n.suggestions || n.suggestions.length === 0 || n.suggestions.forEach((s) => {
@@ -14089,281 +14110,282 @@ const ww = "/bahmni_config/openmrs/apps", gc = "org.bahmni.home.dashboard", Ew =
14089
14110
  });
14090
14111
  }), r;
14091
14112
  };
14092
- async function _v() {
14113
+ async function Sv() {
14093
14114
  return H(`${ms}/templates`);
14094
14115
  }
14095
- async function vv(t) {
14116
+ async function Rv(t) {
14096
14117
  return (await ve(
14097
14118
  `${ms}/render`,
14098
14119
  t
14099
14120
  )).html;
14100
14121
  }
14101
- const Pw = (t, e, r) => {
14122
+ const Iw = (t, e, r) => {
14102
14123
  let s = se + "/Task?_sort=-_lastUpdated";
14103
14124
  return t && (s += `&subject:Patient=${t}`), e && (s += `&based-on=${e}`), r && r.length > 0 && (s += `&encounter=${r.join(",")}`), s;
14104
14125
  };
14105
- async function Tv(t, e, r) {
14126
+ async function Ov(t, e, r) {
14106
14127
  return H(
14107
- Pw(t, e, r)
14128
+ Iw(t, e, r)
14108
14129
  );
14109
14130
  }
14110
14131
  export {
14111
- ub as APPOINTMENT_IDENTIFIER_SYSTEM,
14112
- cb as APPOINTMENT_STATUSES,
14132
+ db as APPOINTMENT_IDENTIFIER_SYSTEM,
14133
+ lb as APPOINTMENT_STATUSES,
14113
14134
  Xn as AUDIT_LOG_EVENT_DETAILS,
14114
14135
  _m as AllergySeverity,
14115
14136
  bm as AllergyStatus,
14116
14137
  cf as AttributeFormat,
14117
14138
  uf as AttributeInputType,
14118
14139
  Cl as BAHMNI_APP_BASE_PATH,
14119
- Qw as BAHMNI_HOME_PATH,
14140
+ Zw as BAHMNI_HOME_PATH,
14120
14141
  hi as BAHMNI_USER_LOCATION_COOKIE,
14121
14142
  vd as BIRTH_TIME_EXT_URL,
14122
14143
  ss as CDSS_CHECK_EVENT,
14123
14144
  os as CDSS_RESULTS_EVENT,
14124
- uE as CONCEPT_DATATYPE_COMPLEX,
14125
- cE as CONCEPT_DATATYPE_NUMERIC,
14145
+ dE as CONCEPT_DATATYPE_COMPLEX,
14146
+ lE as CONCEPT_DATATYPE_NUMERIC,
14126
14147
  ns as CONSULTATION_SAVED_EVENT,
14127
14148
  Ad as DATETIME_REGEX_PATTERN,
14128
- fE as DATE_REGEX_PATTERN,
14149
+ hE as DATE_REGEX_PATTERN,
14129
14150
  zi as DEFAULT_DATE_FORMAT,
14130
14151
  Jh as DEFAULT_DATE_FORMAT_STORAGE_KEY,
14131
14152
  Qh as DEFAULT_TIME_FORMAT,
14132
14153
  em as DURATION_UNIT_TO_DAYS,
14133
- zy as ENCOUNTER_BUNDLE_URL,
14154
+ Yy as ENCOUNTER_BUNDLE_URL,
14134
14155
  Sd as FHIR_ENCOUNTER_CLASS_CODE_SYSTEM,
14135
14156
  Rd as FHIR_ENCOUNTER_TAG_SYSTEM,
14136
14157
  Td as FHIR_ENCOUNTER_TYPE_CODE_SYSTEM,
14137
- sE as FHIR_LAB_ORDER_CONCEPT_TYPE_EXTENSION_URL,
14138
- aE as FHIR_OBSERVATION_FORM_NAMESPACE_PATH_URL,
14139
- oE as FHIR_OBSERVATION_INTERPRETATION_SYSTEM,
14140
- lE as FHIR_OBSERVATION_STATUS_FINAL,
14141
- iE as FHIR_OBSERVATION_VALUE_ATTACHMENT_URL,
14142
- dE as FHIR_RESOURCE_TYPE_OBSERVATION,
14143
- nE as HL7_CONDITION_CATEGORY_CODE_SYSTEM,
14158
+ aE as FHIR_LAB_ORDER_CONCEPT_TYPE_EXTENSION_URL,
14159
+ cE as FHIR_OBSERVATION_FORM_NAMESPACE_PATH_URL,
14160
+ iE as FHIR_OBSERVATION_INTERPRETATION_SYSTEM,
14161
+ fE as FHIR_OBSERVATION_STATUS_FINAL,
14162
+ uE as FHIR_OBSERVATION_VALUE_ATTACHMENT_URL,
14163
+ pE as FHIR_RESOURCE_TYPE_OBSERVATION,
14164
+ oE as HL7_CONDITION_CATEGORY_CODE_SYSTEM,
14144
14165
  Ti as HL7_CONDITION_CATEGORY_CONDITION_CODE,
14145
14166
  Si as HL7_CONDITION_CATEGORY_DIAGNOSIS_CODE,
14146
14167
  Od as HL7_CONDITION_CLINICAL_STATUS_CODE_SYSTEM,
14147
- rE as HL7_CONDITION_VERIFICATION_STATUS_CODE_SYSTEM,
14148
- pE as INTERPRETATION_TO_CODE,
14149
- vb as ISO_DATE_FORMAT,
14168
+ sE as HL7_CONDITION_VERIFICATION_STATUS_CODE_SYSTEM,
14169
+ mE as INTERPRETATION_TO_CODE,
14170
+ Sb as ISO_DATE_FORMAT,
14150
14171
  di as LOGIN_PATH,
14151
- N_ as MATCH_REASON_MESSAGES,
14152
- CE as MAX_NAME_LENGTH,
14153
- DE as MAX_PATIENT_AGE_YEARS,
14154
- LE as MAX_PHONE_NUMBER_LENGTH,
14155
- Yb as MEDICATIONS_INPUT_CONTROL_KEY,
14172
+ $_ as MATCH_REASON_MESSAGES,
14173
+ xE as MAX_NAME_LENGTH,
14174
+ LE as MAX_PATIENT_AGE_YEARS,
14175
+ kE as MAX_PHONE_NUMBER_LENGTH,
14176
+ Kb as MEDICATIONS_INPUT_CONTROL_KEY,
14156
14177
  Be as MedicationStatus,
14157
14178
  se as OPENMRS_FHIR_R4,
14158
14179
  W as OPENMRS_REST_V1,
14159
- c_ as ORDER_TYPE_QUERY_KEY,
14160
- i_ as PENDING_REPORT_STATUSES,
14161
- a_ as PROCESSED_REPORT_STATUSES,
14162
- m_ as USER_PINNED_PREFERENCE_URL,
14163
- Sb as calculateAge,
14164
- Ib as calculateEndDate,
14165
- Ob as calculateOnsetDate,
14166
- SE as camelToScreamingSnakeCase,
14167
- D_ as canResumeOwnInSessionEncounter,
14168
- gE as capitalize,
14169
- ab as checkIfActiveVisitExists,
14170
- hb as checkInAppointment,
14171
- Tb as computeAgeDetails,
14172
- G_ as convertImmutableToPlainObject,
14180
+ l_ as ORDER_TYPE_QUERY_KEY,
14181
+ u_ as PENDING_REPORT_STATUSES,
14182
+ c_ as PROCESSED_REPORT_STATUSES,
14183
+ y_ as USER_PINNED_PREFERENCE_URL,
14184
+ Ob as calculateAge,
14185
+ Db as calculateEndDate,
14186
+ Pb as calculateOnsetDate,
14187
+ OE as camelToScreamingSnakeCase,
14188
+ L_ as canResumeOwnInSessionEncounter,
14189
+ wE as capitalize,
14190
+ cb as checkIfActiveVisitExists,
14191
+ gb as checkInAppointment,
14192
+ Rb as computeAgeDetails,
14193
+ J_ as convertImmutableToPlainObject,
14173
14194
  tm as convertTo24HourFormat,
14174
- OE as convertToSentenceCase,
14175
- _b as createAppointmentUnavailability,
14195
+ PE as convertToSentenceCase,
14196
+ Tb as createAppointmentUnavailability,
14176
14197
  qa as createBundleEntry,
14177
- uw as createDocumentReference,
14178
- By as createEncounterBundle,
14179
- O_ as createFhirEncounter,
14180
- BE as createFhirPatient,
14181
- VE as createPatient,
14182
- ib as createVisitForPatient,
14198
+ dw as createDocumentReference,
14199
+ zy as createEncounterBundle,
14200
+ P_ as createFhirEncounter,
14201
+ YE as createFhirPatient,
14202
+ BE as createPatient,
14203
+ ub as createVisitForPatient,
14183
14204
  mi as del,
14184
- yb as deleteAppointmentService,
14205
+ Eb as deleteAppointmentService,
14185
14206
  Pd as deleteCookie,
14186
14207
  lf as dispatchAuditEvent,
14187
- sv as dispatchCDSSCheck,
14188
- ov as dispatchCDSSResults,
14189
- rv as dispatchConsultationSaved,
14190
- $b as doDateRangesOverlap,
14191
- tv as extractAttributes,
14192
- K_ as extractNotesFromFormData,
14193
- __ as fetchAllProviders,
14194
- Mb as fetchAndFormatAllergenConcepts,
14195
- V_ as fetchFormMetadata,
14196
- Kb as fetchMedicationOrdersMetadata,
14197
- bw as fetchModuleExtensions,
14198
- j_ as fetchObservationForms,
14199
- ME as fetchPatientPhotoFromUrl,
14200
- t_ as fetchQualityAssessment,
14201
- Ub as fetchReactionConcepts,
14202
- Tw as filterByOnlineStatus,
14203
- vw as filterByPrivilege,
14204
- bv as filterCdsCardsForItems,
14205
- _E as filterReplacementEntries,
14206
- I_ as findActiveEncounterInSession,
14207
- Ab as formatDateDistance,
14208
- Rb as formatDateTime,
14209
- vE as formatUrl,
14210
- mE as generateId,
14211
- zE as generateIdentifier,
14208
+ iv as dispatchCDSSCheck,
14209
+ cv as dispatchCDSSResults,
14210
+ ov as dispatchConsultationSaved,
14211
+ Cb as doDateRangesOverlap,
14212
+ sv as extractAttributes,
14213
+ Q_ as extractNotesFromFormData,
14214
+ T_ as fetchAllProviders,
14215
+ qb as fetchAndFormatAllergenConcepts,
14216
+ B_ as fetchFormMetadata,
14217
+ z_ as fetchFormUuidByObservationDate,
14218
+ Jb as fetchMedicationOrdersMetadata,
14219
+ vw as fetchModuleExtensions,
14220
+ H_ as fetchObservationForms,
14221
+ qE as fetchPatientPhotoFromUrl,
14222
+ n_ as fetchQualityAssessment,
14223
+ Fb as fetchReactionConcepts,
14224
+ Rw as filterByOnlineStatus,
14225
+ Sw as filterByPrivilege,
14226
+ Tv as filterCdsCardsForItems,
14227
+ TE as filterReplacementEntries,
14228
+ D_ as findActiveEncounterInSession,
14229
+ Nb as formatDateDistance,
14230
+ Ab as formatDateTime,
14231
+ SE as formatUrl,
14232
+ yE as generateId,
14233
+ GE as generateIdentifier,
14212
14234
  Wr as generateUUID,
14213
14235
  H as get,
14214
14236
  oc as getActiveVisit,
14215
14237
  wf as getActiveVisitByPatient,
14216
- KE as getAddressHierarchyEntries,
14217
- gb as getAllAppointmentServices,
14238
+ JE as getAddressHierarchyEntries,
14239
+ wb as getAllAppointmentServices,
14218
14240
  wm as getAllergies,
14219
- mb as getAppointmentById,
14220
- bb as getAppointmentUnavailabilities,
14221
- NE as getAvailableLocations,
14222
- wv as getAvailableStocks,
14223
- l_ as getCategoryUuidFromOrderTypes,
14224
- kb as getConceptById,
14225
- Vb as getConditionPage,
14226
- jb as getConditions,
14227
- p_ as getConfig,
14241
+ yb as getAppointmentById,
14242
+ vb as getAppointmentUnavailabilities,
14243
+ $E as getAvailableLocations,
14244
+ _v as getAvailableStocks,
14245
+ f_ as getCategoryUuidFromOrderTypes,
14246
+ Ub as getConceptById,
14247
+ Bb as getConditionPage,
14248
+ Hb as getConditions,
14249
+ m_ as getConfig,
14228
14250
  Ri as getCookieByName,
14229
- b_ as getCurrentProvider,
14230
- ev as getCurrentStateName,
14231
- AE as getCurrentUser,
14232
- q_ as getCurrentUserPrivileges,
14233
- PE as getDefaultDateFormat,
14234
- zb as getDiagnosesPage,
14235
- s_ as getDiagnosticReportBundle,
14236
- n_ as getDiagnosticReports,
14237
- dv as getDocumentReferencePage,
14238
- iw as getDocumentReferences,
14239
- uv as getDocumentTypes,
14240
- cv as getDocumentUploadMaxSizeMb,
14241
- R_ as getEncounterByUuid,
14251
+ v_ as getCurrentProvider,
14252
+ nv as getCurrentStateName,
14253
+ NE as getCurrentUser,
14254
+ j_ as getCurrentUserPrivileges,
14255
+ IE as getDefaultDateFormat,
14256
+ Gb as getDiagnosesPage,
14257
+ a_ as getDiagnosticReportBundle,
14258
+ o_ as getDiagnosticReports,
14259
+ hv as getDocumentReferencePage,
14260
+ uw as getDocumentReferences,
14261
+ fv as getDocumentTypes,
14262
+ dv as getDocumentUploadMaxSizeMb,
14263
+ A_ as getEncounterByUuid,
14242
14264
  ac as getEncounterSessionDuration,
14243
- Vy as getEncounterSessionSnapshot,
14244
- S_ as getEncounterTypeByName,
14245
- M_ as getEncountersAndVisitsForEOC,
14246
- f_ as getExistingServiceRequestsForAllCategories,
14247
- _w as getExtensionsByPoint,
14248
- hv as getFHIRLocationsByTag,
14249
- u_ as getFlattenedInvestigations,
14250
- Nb as getFormattedAge,
14251
- qb as getFormattedAllergies,
14252
- lv as getFormattedDocumentReferences,
14265
+ Hy as getEncounterSessionSnapshot,
14266
+ O_ as getEncounterTypeByName,
14267
+ q_ as getEncountersAndVisitsForEOC,
14268
+ h_ as getExistingServiceRequestsForAllCategories,
14269
+ Tw as getExtensionsByPoint,
14270
+ yv as getFHIRLocationsByTag,
14271
+ d_ as getFlattenedInvestigations,
14272
+ $b as getFormattedAge,
14273
+ jb as getFormattedAllergies,
14274
+ pv as getFormattedDocumentReferences,
14253
14275
  Br as getFormattedError,
14254
- kE as getFormattedPatientById,
14255
- GE as getGenders,
14256
- jE as getIdentifierData,
14257
- FE as getIdentifierTypes,
14258
- ZE as getInputTypeForFormat,
14259
- r_ as getLabInvestigationsBundle,
14260
- pv as getLocationByTag,
14261
- Qb as getMedicationByUuid,
14262
- w_ as getObservationsBundleByEncounterUuid,
14263
- d_ as getOrderTypeNames,
14276
+ UE as getFormattedPatientById,
14277
+ WE as getGenders,
14278
+ HE as getIdentifierData,
14279
+ VE as getIdentifierTypes,
14280
+ tb as getInputTypeForFormat,
14281
+ s_ as getLabInvestigationsBundle,
14282
+ gv as getLocationByTag,
14283
+ Zb as getMedicationByUuid,
14284
+ b_ as getObservationsBundleByEncounterUuid,
14285
+ p_ as getOrderTypeNames,
14264
14286
  vs as getOrderTypes,
14265
- WE as getOrderedAddressHierarchyLevels,
14266
- fb as getPastAppointments,
14267
- Eb as getPastAppointmentsPage,
14287
+ QE as getOrderedAddressHierarchyLevels,
14288
+ hb as getPastAppointments,
14289
+ _b as getPastAppointmentsPage,
14268
14290
  ef as getPatientById,
14269
- Bb as getPatientDiagnoses,
14270
- T_ as getPatientEncounters,
14271
- H_ as getPatientFormData,
14272
- mv as getPatientImmunizations,
14291
+ Yb as getPatientDiagnoses,
14292
+ R_ as getPatientEncounters,
14293
+ Y_ as getPatientFormData,
14294
+ wv as getPatientImmunizations,
14273
14295
  jm as getPatientMedicationBundle,
14274
- Gb as getPatientMedications,
14275
- y_ as getPatientObservations,
14276
- Ny as getPatientObservationsBundle,
14277
- g_ as getPatientObservationsWithEncounterBundle,
14278
- JE as getPatientProfile,
14279
- J_ as getPatientPrograms,
14280
- Q_ as getPatientProgramsPage,
14281
- Xb as getPatientRadiologyInvestigationBundle,
14282
- Zb as getPatientRadiologyInvestigationBundleWithImagingStudy,
14283
- e_ as getPatientRadiologyInvestigations,
14284
- XE as getPersonAttributeTypes,
14296
+ Wb as getPatientMedications,
14297
+ E_ as getPatientObservations,
14298
+ Iy as getPatientObservationsBundle,
14299
+ w_ as getPatientObservationsWithEncounterBundle,
14300
+ XE as getPatientProfile,
14301
+ Z_ as getPatientPrograms,
14302
+ ev as getPatientProgramsPage,
14303
+ e_ as getPatientRadiologyInvestigationBundle,
14304
+ t_ as getPatientRadiologyInvestigationBundleWithImagingStudy,
14305
+ r_ as getPatientRadiologyInvestigations,
14306
+ eb as getPersonAttributeTypes,
14285
14307
  af as getPrimaryIdentifierType,
14286
- EE as getPriorityByOrder,
14287
- X_ as getProgramByUUID,
14288
- v_ as getProviderLoginLocations,
14289
- QE as getRelationshipTypes,
14308
+ _E as getPriorityByOrder,
14309
+ tv as getProgramByUUID,
14310
+ S_ as getProviderLoginLocations,
14311
+ ZE as getRelationshipTypes,
14290
14312
  Kt as getServiceRequests,
14291
- Tv as getTasks,
14292
- _v as getTemplates,
14293
- Cb as getTimeInMinutes,
14294
- Pb as getTodayDate,
14295
- db as getUpcomingAppointments,
14296
- wb as getUpcomingAppointmentsPage,
14313
+ Ov as getTasks,
14314
+ Sv as getTemplates,
14315
+ xb as getTimeInMinutes,
14316
+ Ib as getTodayDate,
14317
+ pb as getUpcomingAppointments,
14318
+ bb as getUpcomingAppointmentsPage,
14297
14319
  on as getUserLoginLocation,
14298
14320
  sn as getUserPreferredLocale,
14299
- Jb as getVaccinations,
14300
- TE as getValueType,
14301
- yv as getVisibleModules,
14302
- ob as getVisitTypes,
14303
- ky as getVisits,
14304
- W_ as getVitalFlowSheetData,
14305
- bE as groupByDate,
14306
- E_ as groupObservationsByEncounter,
14307
- Zy as hasMissingMandatoryVisibleField,
14308
- F_ as hasPrivilege,
14309
- eE as initAppI18n,
14310
- U_ as initializeAuditListener,
14311
- Ev as invokeCDSSRule,
14312
- eb as isBooleanFormat,
14313
- tb as isConceptFormat,
14314
- nb as isDateFormat,
14315
- rb as isNumberFormat,
14316
- wE as isStringEmpty,
14317
- sb as isTextFormat,
14318
- Ky as logAuditEvent,
14319
- h_ as logout,
14320
- Fb as mapAllergyToInputEntry,
14321
- xE as mapGenderFromFhir,
14322
- Hb as markConditionAsInactive,
14323
- Zw as normalizeTranslationKey,
14324
- Lb as notificationService,
14321
+ Xb as getVaccinations,
14322
+ RE as getValueType,
14323
+ bv as getVisibleModules,
14324
+ ib as getVisitTypes,
14325
+ My as getVisits,
14326
+ X_ as getVitalFlowSheetData,
14327
+ vE as groupByDate,
14328
+ __ as groupObservationsByEncounter,
14329
+ tw as hasMissingMandatoryVisibleField,
14330
+ V_ as hasPrivilege,
14331
+ rE as initAppI18n,
14332
+ F_ as initializeAuditListener,
14333
+ vv as invokeCDSSRule,
14334
+ rb as isBooleanFormat,
14335
+ nb as isConceptFormat,
14336
+ ob as isDateFormat,
14337
+ sb as isNumberFormat,
14338
+ bE as isStringEmpty,
14339
+ ab as isTextFormat,
14340
+ Wy as logAuditEvent,
14341
+ g_ as logout,
14342
+ Vb as mapAllergyToInputEntry,
14343
+ ME as mapGenderFromFhir,
14344
+ zb as markConditionAsInactive,
14345
+ tE as normalizeTranslationKey,
14346
+ kb as notificationService,
14325
14347
  Nd as parseQueryParams,
14326
- Xw as patch,
14348
+ eE as patch,
14327
14349
  ve as post,
14328
14350
  gs as put,
14329
- hE as refreshQueries,
14330
- vv as renderAsHtml,
14331
- x_ as resetEncounterSession,
14332
- RE as resolveComboBoxItems,
14333
- $_ as resolveEncounterMatchDecision,
14334
- fv as saveDocument,
14335
- IE as saveUserLocation,
14336
- lb as searchAppointmentsByAttribute,
14351
+ gE as refreshQueries,
14352
+ Rv as renderAsHtml,
14353
+ M_ as resetEncounterSession,
14354
+ AE as resolveComboBoxItems,
14355
+ C_ as resolveEncounterMatchDecision,
14356
+ mv as saveDocument,
14357
+ DE as saveUserLocation,
14358
+ fb as searchAppointmentsByAttribute,
14337
14359
  dm as searchConceptByName,
14338
- xb as searchConcepts,
14360
+ Mb as searchConcepts,
14339
14361
  ts as searchEncounters,
14340
14362
  qr as searchFHIRConcepts,
14341
14363
  lm as searchFHIRConceptsByName,
14342
- Wb as searchMedications,
14343
- qE as searchPatientByCustomAttribute,
14344
- UE as searchPatientByNameOrId,
14345
- yE as setCookie,
14346
- C_ as setEncounterSessionDecision,
14347
- L_ as setEncounterSessionLoading,
14348
- P_ as shouldEnableEncounterFilter,
14349
- Db as sortByDate,
14350
- Sw as sortByOrder,
14351
- jy as subscribeEncounterSession,
14352
- Y_ as transformContainerObservationsToForm2Observations,
14353
- B_ as transformFormDataToObservations,
14354
- z_ as transformObservationsToFormData,
14355
- pb as updateAppointmentStatus,
14356
- o_ as updateDiagnosticReportBundle,
14357
- A_ as updateFhirEncounter,
14358
- YE as updateFhirPatient,
14359
- HE as updatePatient,
14360
- Z_ as updateProgramState,
14361
- $E as updateSessionLocation,
14362
- gv as uploadDocument,
14363
- av as useCDSSCheckListener,
14364
- iv as useCDSSResultsListener,
14365
- tE as useCamera,
14366
- k_ as useEncounterSessionStore,
14367
- nv as useSubscribeConsultationSaved,
14368
- Ov as useTranslation
14364
+ Qb as searchMedications,
14365
+ jE as searchPatientByCustomAttribute,
14366
+ FE as searchPatientByNameOrId,
14367
+ EE as setCookie,
14368
+ x_ as setEncounterSessionDecision,
14369
+ k_ as setEncounterSessionLoading,
14370
+ I_ as shouldEnableEncounterFilter,
14371
+ Lb as sortByDate,
14372
+ Ow as sortByOrder,
14373
+ Vy as subscribeEncounterSession,
14374
+ W_ as transformContainerObservationsToForm2Observations,
14375
+ G_ as transformFormDataToObservations,
14376
+ K_ as transformObservationsToFormData,
14377
+ mb as updateAppointmentStatus,
14378
+ i_ as updateDiagnosticReportBundle,
14379
+ N_ as updateFhirEncounter,
14380
+ KE as updateFhirPatient,
14381
+ zE as updatePatient,
14382
+ rv as updateProgramState,
14383
+ CE as updateSessionLocation,
14384
+ Ev as uploadDocument,
14385
+ uv as useCDSSCheckListener,
14386
+ lv as useCDSSResultsListener,
14387
+ nE as useCamera,
14388
+ U_ as useEncounterSessionStore,
14389
+ av as useSubscribeConsultationSaved,
14390
+ Nv as useTranslation
14369
14391
  };