@bahmni/clinical-app 0.0.1-dev.188 → 0.0.1-dev.190

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { jsxs as N, jsx as w, Fragment as St } from "react/jsx-runtime";
2
- import { p as kt, u as jt, o as Wt, a as Pt, b as Ut, A as $t, $ as Kt, m as Ft, K as h, g as Yt } from "./index-DKAMCXFf.js";
2
+ import { p as kt, u as jt, o as Wt, a as Pt, b as Ut, A as $t, $ as Kt, m as Ft, K as h, g as Yt } from "./index-CQlX16AU.js";
3
3
  import e, { useState as A, useCallback as g, useEffect as qt, useMemo as z } from "react";
4
4
  function Gt(t, r, n) {
5
5
  return (r = Xt(r)) in t ? Object.defineProperty(t, r, {
@@ -1,5 +1,5 @@
1
1
  import { jsx as s, jsxs as p, Fragment as k } from "react/jsx-runtime";
2
- import { u as ee, p as re, y as ae, c as te, a as A, d as oe, b as ne, e as se, A as q, Y as de, G as me, $ as ie, P as le, Z as U, h as ce, m as ue, T as R, f as be, F as pe, q as fe, W as _e, i as $e, w as he, j as ve, k as ge, l as ye } from "./index-DKAMCXFf.js";
2
+ import { u as ee, p as re, y as ae, c as te, a as A, d as oe, b as ne, e as se, A as q, Y as de, G as me, $ as ie, P as le, Z as U, h as ce, m as ue, T as R, f as be, F as pe, q as fe, W as _e, i as $e, w as he, j as ve, k as ge, l as ye } from "./index-CQlX16AU.js";
3
3
  import { useState as P, useMemo as g, useCallback as F } from "react";
4
4
  const Ne = "_formsTableBody_1pd36_1", Ae = "_customAccordianItem_1pd36_6", Fe = "_formContent_1pd36_18", Re = "_formDetailsContainer_1pd36_25", Le = "_observation_1pd36_30", Ce = "_groupContainer_1pd36_39", Oe = "_rowContainer_1pd36_43", Ie = "_groupLabel_1pd36_48", Te = "_rowLabel_1pd36_58", Me = "_rowValue_1pd36_67", Ve = "_groupMembers_1pd36_75", Se = "_memberRow_1pd36_81", we = "_memberLabel_1pd36_86", De = "_memberValue_1pd36_94", xe = "_abnormalValue_1pd36_102", Ee = "_commentSection_1pd36_110", Be = "_commentText_1pd36_116", Ge = "_nestedGroup_1pd36_125", qe = "_nestedGroupLabel_1pd36_132", Ue = "_nestedGroupMembers_1pd36_141", o = {
5
5
  formsTableBody: Ne,
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-Cwm_oMws.js";
2
- import { B as d, C as f, D as e } from "./index-DKAMCXFf.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./YPM2AS64-bUkej3Ae.js";
2
+ import { B as d, C as f, D as e } from "./index-CQlX16AU.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
- import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-Cwm_oMws.js";
2
- import { B as C, C as v, D as e } from "./index-DKAMCXFf.js";
1
+ import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./YPM2AS64-bUkej3Ae.js";
2
+ import { B as C, C as v, D as e } from "./index-CQlX16AU.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1,5 +1,5 @@
1
1
  import { jsxs as I, jsx as l } from "react/jsx-runtime";
2
- import { p as B, o as k, u as N, n as H, r as K, a as w, d as x, h as Q, H as j, s as G, L as M, A as z, t as P, v as S, V as W, f as Y, x as J, F as X, q as Z, W as ee, z as te } from "./index-DKAMCXFf.js";
2
+ import { p as B, o as k, u as N, n as H, r as K, a as w, d as x, h as Q, H as j, s as G, L as M, A as z, t as P, v as S, V as W, f as Y, x as J, F as X, q as Z, W as ee, z as te } from "./index-CQlX16AU.js";
3
3
  import { useRef as ae, useEffect as $, useMemo as E } from "react";
4
4
  const F = (t, d, n, u, o) => {
5
5
  const a = W(t, d), s = a.value, r = Y(s);
@@ -1,4 +1,4 @@
1
- import { E as we, I as z, J as xt, M as B, C as q, D as y, N as Ro, O as ye, S as R, Q as _, R as k, U as N, X as A, _ as bs, a0 as ir, a1 as $e, a2 as U, a3 as Hn, a4 as Vn, a5 as dt, a6 as D, a7 as xs, a8 as cn, a9 as Be, aa as ws, ab as qt, ac as zt, ad as $s, ae as Cs, af as $n, ag as Ss, ah as Nr, ai as Bt, aj as zo, ak as ks, al as Es, am as j, an as Ur, ao as Ms, ap as Ds, aq as sr, ar as As, as as Ts, at as zn, au as Fs, av as Is, aw as Z, ax as Ps, ay as Os } from "./index-DKAMCXFf.js";
1
+ import { E as we, I as z, J as xt, M as B, C as q, D as y, N as Ro, O as ye, S as R, Q as _, R as k, U as N, X as A, _ as bs, a0 as ir, a1 as $e, a2 as U, a3 as Hn, a4 as Vn, a5 as dt, a6 as D, a7 as xs, a8 as cn, a9 as Be, aa as ws, ab as qt, ac as zt, ad as $s, ae as Cs, af as $n, ag as Ss, ah as Nr, ai as Bt, aj as zo, ak as ks, al as Es, am as j, an as Ur, ao as Ms, ap as Ds, aq as sr, ar as As, as as Ts, at as zn, au as Fs, av as Is, aw as Z, ax as Ps, ay as Os } from "./index-CQlX16AU.js";
2
2
  var Ls = (e) => e != null, qs = (e) => e.filter(Ls);
3
3
  function _s(e) {
4
4
  return (...t) => {
@@ -158711,9 +158711,11 @@ async function ytt(n) {
158711
158711
  );
158712
158712
  return !e.results || e.results.length === 0 ? null : e.results[0];
158713
158713
  }
158714
- const Vtt = (n) => `${n1}/Observation?encounter=${n}`;
158714
+ const Vtt = (n) => `${n1}/Observation/$fetch-all?encounter=${n}`;
158715
158715
  async function pat(n) {
158716
- return await St(Vtt(n));
158716
+ return await St(
158717
+ Vtt(n)
158718
+ );
158717
158719
  }
158718
158720
  const ys = (n, e) => n?.length === 0 ? !1 : e?.length === 0, Htt = async () => {
158719
158721
  try {
@@ -158725,6 +158727,8 @@ const ys = (n, e) => n?.length === 0 ? !1 : e?.length === 0, Htt = async () => {
158725
158727
  }, The = (n, e) => {
158726
158728
  if (!n || n.length === 0)
158727
158729
  return !1;
158730
+ if (!e || e.length === 0)
158731
+ return !0;
158728
158732
  const r = Array.isArray(e) ? e : [e];
158729
158733
  return n.some(
158730
158734
  (a) => r.includes(a.name)
@@ -165259,7 +165263,7 @@ const Lot = [
165259
165263
  },
165260
165264
  {
165261
165265
  type: "patientDocuments",
165262
- component: lazy$1(() => import("./DocumentsTable-KDoVzKKR-rtawFUnv.js"))
165266
+ component: lazy$1(() => import("./DocumentsTable-DtSlp2um-DkARCnRy.js"))
165263
165267
  },
165264
165268
  {
165265
165269
  type: "flowSheet",
@@ -165267,7 +165271,7 @@ const Lot = [
165267
165271
  },
165268
165272
  {
165269
165273
  type: "forms",
165270
- component: lazy$1(() => import("./FormsTable-B874VYbf-CdEnBYC1.js"))
165274
+ component: lazy$1(() => import("./FormsTable-DxlCBCp5-Cr2v-kyz.js"))
165271
165275
  },
165272
165276
  {
165273
165277
  type: "labOrders",
@@ -165275,7 +165279,7 @@ const Lot = [
165275
165279
  },
165276
165280
  {
165277
165281
  type: "observations",
165278
- component: lazy$1(() => import("./Observations-BNdO8uec-ZZdDNr94.js"))
165282
+ component: lazy$1(() => import("./Observations-C0mQ2tV0-B_UG2eCN.js"))
165279
165283
  },
165280
165284
  {
165281
165285
  type: "ordersControl",
@@ -167176,7 +167180,7 @@ var displayValue = (n, e = !1) => {
167176
167180
  const e = render(() => {
167177
167181
  const r = this, [a] = this.#o, [l] = this.#d, [c] = this.#f, [f] = this.#u, [p] = this.#h, [m] = this.#t;
167178
167182
  let A;
167179
- return this.#s ? A = this.#s : (A = lazy(() => import("./LNWAZHJI-CbDbb0E7.js")), this.#s = A), setupStyleSheet(this.#i, this.#l), createComponent(A, mergeProps({
167183
+ return this.#s ? A = this.#s : (A = lazy(() => import("./LNWAZHJI-CYc7sS8z.js")), this.#s = A), setupStyleSheet(this.#i, this.#l), createComponent(A, mergeProps({
167180
167184
  get queryFlavor() {
167181
167185
  return r.#n;
167182
167186
  },
@@ -167274,7 +167278,7 @@ var displayValue = (n, e = !1) => {
167274
167278
  const e = render(() => {
167275
167279
  const r = this, [a] = this.#o, [l] = this.#d, [c] = this.#f, [f] = this.#u, [p] = this.#h, [m] = this.#t, [A] = this.#s;
167276
167280
  let g;
167277
- return this.#c ? g = this.#c : (g = lazy(() => import("./MWZ6AO7Z-URa-Dp6R.js")), this.#c = g), setupStyleSheet(this.#i, this.#l), createComponent(g, mergeProps({
167281
+ return this.#c ? g = this.#c : (g = lazy(() => import("./MWZ6AO7Z-dngalUEB.js")), this.#c = g), setupStyleSheet(this.#i, this.#l), createComponent(g, mergeProps({
167278
167282
  get queryFlavor() {
167279
167283
  return r.#n;
167280
167284
  },
@@ -214293,7 +214297,7 @@ const emptyState = "_emptyState_1vrno_1", emptyStateTitle = "_emptyStateTitle_1v
214293
214297
  return c && e.length > 0 ? /* @__PURE__ */ jsx(Uh2, { description: r("LOADING_CLINICAL_DATA"), role: "status" }) : f ? /* @__PURE__ */ jsx("div", { className: "alert alert-danger", children: r("ERROR_FETCHING_CLINICAL_DATA") }) : /* @__PURE__ */ jsx(ClinicalAppContext.Provider, { value: p, children: n });
214294
214298
  };
214295
214299
  ClinicalAppProvider.displayName = "clinical apps provider";
214296
- const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/${n}`, EPISODE_UUID_SEARCH_PARAMS_KEY = "episodeUuid", CURRENT_DASHBOARD_SEARCH_PARAMS_KEY = "currentDashboard", PROGRAM_UUID_SEARCH_PARAMS_KEY = "programUuid", $schema = "http://json-schema.org/draft-07/schema#", title = "Clinical Dashboard Configuration Schema", description = "Schema for dashboards in clinical app which contains sections and associated controls", type = "object", additionalProperties = !1, required = ["sections"], properties = { sections: { type: "array", description: "Section in a dashboard", items: { type: "object", additionalProperties: !1, required: ["name", "icon", "controls"], properties: { name: { type: "string", description: "Display name of the section" }, translationKey: { type: "string", description: "Translation key for the section name" }, icon: { type: "string", description: "Fontawesome Icon name for the section" }, controls: { type: "array", description: "List of controls in the section", items: [{ type: "object", additionalProperties: !1, required: ["type"], properties: { type: { type: "string", description: "Type of the control" }, config: { type: "object", description: "Configuration for the control" } } }] } } } } }, dashboardConfigSchema = {
214300
+ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/${n}`, EPISODE_UUID_SEARCH_PARAMS_KEY = "episodeUuid", CURRENT_DASHBOARD_SEARCH_PARAMS_KEY = "currentDashboard", PROGRAM_UUID_SEARCH_PARAMS_KEY = "programUuid", $schema = "http://json-schema.org/draft-07/schema#", title = "Clinical Dashboard Configuration Schema", description = "Schema for dashboards in clinical app which contains sections and associated controls", type = "object", additionalProperties = !1, required = ["sections"], properties = { sections: { type: "array", description: "Section in a dashboard", items: { type: "object", additionalProperties: !1, required: ["name", "icon", "controls"], properties: { name: { type: "string", description: "Display name of the section" }, translationKey: { type: "string", description: "Translation key for the section name" }, icon: { type: "string", description: "Fontawesome Icon name for the section" }, controls: { type: "array", description: "List of controls in the section", items: [{ type: "object", additionalProperties: !1, required: ["type"], properties: { type: { type: "string", description: "Type of the control" }, requiredPrivileges: { type: "array", description: "List of required privileges for the control", items: { type: "string" } }, config: { type: "object", description: "Configuration for the control" } } }] } } } } }, dashboardConfigSchema = {
214297
214301
  $schema,
214298
214302
  title,
214299
214303
  description,
@@ -214310,7 +214314,12 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214310
214314
  (r) => r.default === !0
214311
214315
  );
214312
214316
  return e || n[0];
214313
- }, getSidebarItems = (n, e) => n.sections.map((r) => ({
214317
+ }, filterControlsByPrivileges = (n) => n.filter(
214318
+ (e) => Nat(e.requiredPrivileges)
214319
+ ), filterSectionsByPrivileges = (n) => n.map((e) => ({
214320
+ ...e,
214321
+ controls: filterControlsByPrivileges(e.controls)
214322
+ })).filter((e) => e.controls.length > 0), getSidebarItems = (n, e) => n.sections.map((r) => ({
214314
214323
  id: r.id,
214315
214324
  icon: r.icon,
214316
214325
  label: e(r.translationKey ?? r.name)
@@ -214342,7 +214351,7 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214342
214351
  }
214343
214352
  }
214344
214353
  ], ConsultationPage = () => {
214345
- const { t: n } = useTranslation(), { clinicalConfig: e, isLoading: r } = useClinicalConfig(), { userPrivileges: a } = l5e(), { addNotification: l } = o1(), [c, f] = useState(!1), [p] = useSearchParams(), m = useObservationFormsStore(($) => $.viewingForm), A = [
214354
+ const { t: n } = useTranslation(), { clinicalConfig: e, isLoading: r } = useClinicalConfig(), { userPrivileges: a } = l5e(), { addNotification: l } = o1(), [c, f] = useState(!1), [p] = useSearchParams(), m = useObservationFormsStore((B) => B.viewingForm), A = [
214346
214355
  { id: "home", label: "Home", href: Oy$1 },
214347
214356
  {
214348
214357
  id: "clinical",
@@ -214351,12 +214360,12 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214351
214360
  },
214352
214361
  { id: "current", label: n("CURRENT_PATIENT"), isCurrentPage: !0 }
214353
214362
  ], g = useMemo(() => {
214354
- const $ = p.get(EPISODE_UUID_SEARCH_PARAMS_KEY);
214355
- return $ ? $.split(",").map((B) => B.trim()).filter(Boolean) : [];
214363
+ const B = p.get(EPISODE_UUID_SEARCH_PARAMS_KEY);
214364
+ return B ? B.split(",").map((O) => O.trim()).filter(Boolean) : [];
214356
214365
  }, [p]), w = p.get(
214357
214366
  CURRENT_DASHBOARD_SEARCH_PARAMS_KEY
214358
214367
  ), v = useMemo(() => e ? w ? e.dashboards?.find(
214359
- ($) => $.name === w
214368
+ (B) => B.name === w
214360
214369
  ) : getDefaultDashboard(e.dashboards || []) : null, [e, w]), C = v?.url ?? null, {
214361
214370
  data: x,
214362
214371
  isLoading: _,
@@ -214377,7 +214386,10 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214377
214386
  type: "error"
214378
214387
  });
214379
214388
  }, [y]);
214380
- const V = useMemo(() => x ? getSidebarItems(x, n) : [], [x, n]), { activeItemId: E, handleItemClick: M } = jh2(V);
214389
+ const V = useMemo(() => !x || !a ? null : {
214390
+ ...x,
214391
+ sections: filterSectionsByPrivileges(x.sections)
214392
+ }, [x, a]), E = useMemo(() => V ? getSidebarItems(V, n) : [], [V, n]), { activeItemId: M, handleItemClick: L } = jh2(E);
214381
214393
  if (r)
214382
214394
  return /* @__PURE__ */ jsx(
214383
214395
  Uh2,
@@ -214390,12 +214402,12 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214390
214402
  if (!a)
214391
214403
  return /* @__PURE__ */ jsx(Uh2, { description: n("LOADING_USER_PRIVILEGES"), role: "status" });
214392
214404
  if (!v) {
214393
- const $ = w ? n("ERROR_DASHBOARD_NOT_CONFIGURED", {
214405
+ const B = w ? n("ERROR_DASHBOARD_NOT_CONFIGURED", {
214394
214406
  dashboardName: w
214395
214407
  }) : n("ERROR_NO_DEFAULT_DASHBOARD");
214396
214408
  return l({
214397
214409
  title: n("ERROR_DEFAULT_TITLE"),
214398
- message: $,
214410
+ message: B,
214399
214411
  type: "error"
214400
214412
  }), /* @__PURE__ */ jsx(
214401
214413
  "div",
@@ -214415,12 +214427,12 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214415
214427
  role: "status"
214416
214428
  }
214417
214429
  );
214418
- const L = () => {
214419
- const $ = p.get(PROGRAM_UUID_SEARCH_PARAMS_KEY);
214420
- return $ && e.contextInformation?.program ? /* @__PURE__ */ jsx(
214430
+ const $ = () => {
214431
+ const B = p.get(PROGRAM_UUID_SEARCH_PARAMS_KEY);
214432
+ return B && e.contextInformation?.program ? /* @__PURE__ */ jsx(
214421
214433
  xat,
214422
214434
  {
214423
- programUUID: $,
214435
+ programUUID: B,
214424
214436
  config: {
214425
214437
  fields: e.contextInformation?.program?.fields ?? []
214426
214438
  }
@@ -214435,9 +214447,9 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214435
214447
  {
214436
214448
  breadcrumbItems: A,
214437
214449
  globalActions,
214438
- sideNavItems: V,
214439
- activeSideNavItemId: E,
214440
- onSideNavItemClick: M,
214450
+ sideNavItems: E,
214451
+ activeSideNavItemId: M,
214452
+ onSideNavItemClick: L,
214441
214453
  isRail: c
214442
214454
  }
214443
214455
  ),
@@ -214460,7 +214472,8 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214460
214472
  {
214461
214473
  id: "section-sticky-header",
214462
214474
  "data-testid": "section-sticky-header-test-id",
214463
- "aria-label": "section-sticky-header-aria-label",
214475
+ role: "region",
214476
+ "aria-label": n("PATIENT_HEADER_SECTION"),
214464
214477
  className: styles.stickySection,
214465
214478
  children: [
214466
214479
  /* @__PURE__ */ jsx(
@@ -214470,15 +214483,15 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214470
214483
  setIsActionAreaVisible: f
214471
214484
  }
214472
214485
  ),
214473
- L()
214486
+ $()
214474
214487
  ]
214475
214488
  }
214476
214489
  ),
214477
214490
  /* @__PURE__ */ jsx(
214478
214491
  DashboardContainer,
214479
214492
  {
214480
- sections: x.sections,
214481
- activeItemId: E
214493
+ sections: V.sections,
214494
+ activeItemId: M
214482
214495
  }
214483
214496
  )
214484
214497
  ]
@@ -214489,7 +214502,7 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214489
214502
  actionArea: /* @__PURE__ */ jsx(
214490
214503
  ConsultationPad,
214491
214504
  {
214492
- onClose: () => f(($) => !$)
214505
+ onClose: () => f((B) => !B)
214493
214506
  }
214494
214507
  )
214495
214508
  }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { az as i } from "./index-DKAMCXFf.js";
1
+ import { az as i } from "./index-CQlX16AU.js";
2
2
  export {
3
3
  i as ClinicalApp
4
4
  };
@@ -295,6 +295,7 @@
295
295
  "OBSERVATIONS_RECORDED_BY": "Recorded By {{provider}}",
296
296
  "PARTICIPANT": "Participant(s)",
297
297
  "PATIENT_HEADER_LABEL": "Patient Header",
298
+ "PATIENT_HEADER_SECTION": "Patient Information Section",
298
299
  "PINNED_FORMS_INVALID_DATA": "Invalid pinned Forms data",
299
300
  "PINNED_FORMS_USER_NOT_FOUND": "User not found",
300
301
  "PROGRAM_DETAILS_ERROR_UPDATING_STATE": "Error updating Program state",
@@ -295,6 +295,7 @@
295
295
  "OBSERVATIONS_RECORDED_BY": "Grabado Por {{provider}} ",
296
296
  "PARTICIPANT": "Partícipe(es)",
297
297
  "PATIENT_HEADER_LABEL": "Cabecera del Paciente",
298
+ "PATIENT_HEADER_SECTION": "Sección de Información del Paciente",
298
299
  "PINNED_FORMS_INVALID_DATA": "Datos de formularios anclados no válidos",
299
300
  "PINNED_FORMS_USER_NOT_FOUND": "Usuario no encontrado",
300
301
  "PROGRAM_DETAILS_STATE_CHANGE_ERROR_TITLE": "Error",
@@ -1 +1 @@
1
- {"version":3,"file":"ConsultationPage.d.ts","sourceRoot":"","sources":["../../src/pages/ConsultationPage.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAqDtE;;;;;;;;GAQG;AACH,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EA6L7B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"ConsultationPage.d.ts","sourceRoot":"","sources":["../../src/pages/ConsultationPage.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAyDtE;;;;;;;;GAQG;AACH,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAsM7B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -10,6 +10,7 @@ export interface ControlConfig {
10
10
  name: string;
11
11
  translationKey?: string;
12
12
  conceptNames?: string[];
13
+ requiredPrivileges?: string[];
13
14
  config?: Record<string, unknown>;
14
15
  }
15
16
  export interface DashboardConfig {
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/pages/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;CACzC"}
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/pages/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;CACzC"}
@@ -39,6 +39,13 @@ declare const _default: {
39
39
  "type": "string",
40
40
  "description": "Type of the control"
41
41
  },
42
+ "requiredPrivileges": {
43
+ "type": "array",
44
+ "description": "List of required privileges for the control",
45
+ "items": {
46
+ "type": "string"
47
+ }
48
+ },
42
49
  "config": {
43
50
  "type": "object",
44
51
  "description": "Configuration for the control"
@@ -1,16 +1,8 @@
1
1
  import { HeaderSideNavItem } from '@bahmni/design-system';
2
2
  import { Dashboard } from '../providers/clinicalConfig/models';
3
- import { DashboardConfig } from './models';
4
- /**
5
- * Gets the default dashboard from an array of dashboards
6
- * @param dashboards Array of dashboard configurations
7
- * @returns The default dashboard or null if none is found
8
- */
3
+ import { DashboardConfig, DashboardSectionConfig, ControlConfig } from './models';
9
4
  export declare const getDefaultDashboard: (dashboards: Dashboard[]) => Dashboard | null;
10
- /**
11
- * Converts dashboard sections to sidebar items
12
- * @param dashboardConfig The dashboard configuration containing sections
13
- * @returns Array of sidebar items
14
- */
5
+ export declare const filterControlsByPrivileges: (controls: ControlConfig[]) => ControlConfig[];
6
+ export declare const filterSectionsByPrivileges: (sections: DashboardSectionConfig[]) => DashboardSectionConfig[];
15
7
  export declare const getSidebarItems: (dashboardConfig: DashboardConfig, t: (key: string) => string) => HeaderSideNavItem[];
16
8
  //# sourceMappingURL=util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/pages/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,YAAY,SAAS,EAAE,KACtB,SAAS,GAAG,IAcd,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,iBAAiB,eAAe,EAChC,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,KACzB,iBAAiB,EAMnB,CAAC"}
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/pages/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,mBAAmB,GAC9B,YAAY,SAAS,EAAE,KACtB,SAAS,GAAG,IAcd,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,UAAU,aAAa,EAAE,KACxB,aAAa,EAIf,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,UAAU,sBAAsB,EAAE,KACjC,sBAAsB,EAOxB,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,iBAAiB,eAAe,EAChC,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,KACzB,iBAAiB,EAMnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/clinical-app",
3
- "version": "0.0.1-dev.188",
3
+ "version": "0.0.1-dev.190",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",