@bahmni/clinical-app 0.0.1-dev.189 → 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-hzibnTqr.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-hzibnTqr.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-DXoAiWaQ.js";
2
- import { B as d, C as f, D as e } from "./index-hzibnTqr.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-DXoAiWaQ.js";
2
- import { B as C, C as v, D as e } from "./index-hzibnTqr.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-hzibnTqr.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-hzibnTqr.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) => {
@@ -158727,6 +158727,8 @@ const ys = (n, e) => n?.length === 0 ? !1 : e?.length === 0, Htt = async () => {
158727
158727
  }, The = (n, e) => {
158728
158728
  if (!n || n.length === 0)
158729
158729
  return !1;
158730
+ if (!e || e.length === 0)
158731
+ return !0;
158730
158732
  const r = Array.isArray(e) ? e : [e];
158731
158733
  return n.some(
158732
158734
  (a) => r.includes(a.name)
@@ -165261,7 +165263,7 @@ const Lot = [
165261
165263
  },
165262
165264
  {
165263
165265
  type: "patientDocuments",
165264
- component: lazy$1(() => import("./DocumentsTable-BQYdm5FO-CI7RHjMr.js"))
165266
+ component: lazy$1(() => import("./DocumentsTable-DtSlp2um-DkARCnRy.js"))
165265
165267
  },
165266
165268
  {
165267
165269
  type: "flowSheet",
@@ -165269,7 +165271,7 @@ const Lot = [
165269
165271
  },
165270
165272
  {
165271
165273
  type: "forms",
165272
- component: lazy$1(() => import("./FormsTable-BUw2KCew-FuIdsUF_.js"))
165274
+ component: lazy$1(() => import("./FormsTable-DxlCBCp5-Cr2v-kyz.js"))
165273
165275
  },
165274
165276
  {
165275
165277
  type: "labOrders",
@@ -165277,7 +165279,7 @@ const Lot = [
165277
165279
  },
165278
165280
  {
165279
165281
  type: "observations",
165280
- component: lazy$1(() => import("./Observations-D9XzsEPN-Um0M38rj.js"))
165282
+ component: lazy$1(() => import("./Observations-C0mQ2tV0-B_UG2eCN.js"))
165281
165283
  },
165282
165284
  {
165283
165285
  type: "ordersControl",
@@ -167178,7 +167180,7 @@ var displayValue = (n, e = !1) => {
167178
167180
  const e = render(() => {
167179
167181
  const r = this, [a] = this.#o, [l] = this.#d, [c] = this.#f, [f] = this.#u, [p] = this.#h, [m] = this.#t;
167180
167182
  let A;
167181
- return this.#s ? A = this.#s : (A = lazy(() => import("./LNWAZHJI-DgiLh6aa.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({
167182
167184
  get queryFlavor() {
167183
167185
  return r.#n;
167184
167186
  },
@@ -167276,7 +167278,7 @@ var displayValue = (n, e = !1) => {
167276
167278
  const e = render(() => {
167277
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;
167278
167280
  let g;
167279
- return this.#c ? g = this.#c : (g = lazy(() => import("./MWZ6AO7Z-Tw697iV9.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({
167280
167282
  get queryFlavor() {
167281
167283
  return r.#n;
167282
167284
  },
@@ -214295,7 +214297,7 @@ const emptyState = "_emptyState_1vrno_1", emptyStateTitle = "_emptyStateTitle_1v
214295
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 });
214296
214298
  };
214297
214299
  ClinicalAppProvider.displayName = "clinical apps provider";
214298
- 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 = {
214299
214301
  $schema,
214300
214302
  title,
214301
214303
  description,
@@ -214312,7 +214314,12 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214312
214314
  (r) => r.default === !0
214313
214315
  );
214314
214316
  return e || n[0];
214315
- }, 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) => ({
214316
214323
  id: r.id,
214317
214324
  icon: r.icon,
214318
214325
  label: e(r.translationKey ?? r.name)
@@ -214344,7 +214351,7 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214344
214351
  }
214345
214352
  }
214346
214353
  ], ConsultationPage = () => {
214347
- 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 = [
214348
214355
  { id: "home", label: "Home", href: Oy$1 },
214349
214356
  {
214350
214357
  id: "clinical",
@@ -214353,12 +214360,12 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214353
214360
  },
214354
214361
  { id: "current", label: n("CURRENT_PATIENT"), isCurrentPage: !0 }
214355
214362
  ], g = useMemo(() => {
214356
- const $ = p.get(EPISODE_UUID_SEARCH_PARAMS_KEY);
214357
- 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) : [];
214358
214365
  }, [p]), w = p.get(
214359
214366
  CURRENT_DASHBOARD_SEARCH_PARAMS_KEY
214360
214367
  ), v = useMemo(() => e ? w ? e.dashboards?.find(
214361
- ($) => $.name === w
214368
+ (B) => B.name === w
214362
214369
  ) : getDefaultDashboard(e.dashboards || []) : null, [e, w]), C = v?.url ?? null, {
214363
214370
  data: x,
214364
214371
  isLoading: _,
@@ -214379,7 +214386,10 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214379
214386
  type: "error"
214380
214387
  });
214381
214388
  }, [y]);
214382
- 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);
214383
214393
  if (r)
214384
214394
  return /* @__PURE__ */ jsx(
214385
214395
  Uh2,
@@ -214392,12 +214402,12 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214392
214402
  if (!a)
214393
214403
  return /* @__PURE__ */ jsx(Uh2, { description: n("LOADING_USER_PRIVILEGES"), role: "status" });
214394
214404
  if (!v) {
214395
- const $ = w ? n("ERROR_DASHBOARD_NOT_CONFIGURED", {
214405
+ const B = w ? n("ERROR_DASHBOARD_NOT_CONFIGURED", {
214396
214406
  dashboardName: w
214397
214407
  }) : n("ERROR_NO_DEFAULT_DASHBOARD");
214398
214408
  return l({
214399
214409
  title: n("ERROR_DEFAULT_TITLE"),
214400
- message: $,
214410
+ message: B,
214401
214411
  type: "error"
214402
214412
  }), /* @__PURE__ */ jsx(
214403
214413
  "div",
@@ -214417,12 +214427,12 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214417
214427
  role: "status"
214418
214428
  }
214419
214429
  );
214420
- const L = () => {
214421
- const $ = p.get(PROGRAM_UUID_SEARCH_PARAMS_KEY);
214422
- 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(
214423
214433
  xat,
214424
214434
  {
214425
- programUUID: $,
214435
+ programUUID: B,
214426
214436
  config: {
214427
214437
  fields: e.contextInformation?.program?.fields ?? []
214428
214438
  }
@@ -214437,9 +214447,9 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214437
214447
  {
214438
214448
  breadcrumbItems: A,
214439
214449
  globalActions,
214440
- sideNavItems: V,
214441
- activeSideNavItemId: E,
214442
- onSideNavItemClick: M,
214450
+ sideNavItems: E,
214451
+ activeSideNavItemId: M,
214452
+ onSideNavItemClick: L,
214443
214453
  isRail: c
214444
214454
  }
214445
214455
  ),
@@ -214462,7 +214472,8 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214462
214472
  {
214463
214473
  id: "section-sticky-header",
214464
214474
  "data-testid": "section-sticky-header-test-id",
214465
- "aria-label": "section-sticky-header-aria-label",
214475
+ role: "region",
214476
+ "aria-label": n("PATIENT_HEADER_SECTION"),
214466
214477
  className: styles.stickySection,
214467
214478
  children: [
214468
214479
  /* @__PURE__ */ jsx(
@@ -214472,15 +214483,15 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214472
214483
  setIsActionAreaVisible: f
214473
214484
  }
214474
214485
  ),
214475
- L()
214486
+ $()
214476
214487
  ]
214477
214488
  }
214478
214489
  ),
214479
214490
  /* @__PURE__ */ jsx(
214480
214491
  DashboardContainer,
214481
214492
  {
214482
- sections: x.sections,
214483
- activeItemId: E
214493
+ sections: V.sections,
214494
+ activeItemId: M
214484
214495
  }
214485
214496
  )
214486
214497
  ]
@@ -214491,7 +214502,7 @@ const DASHBOARD_CONFIG_URL = (n) => `${CLINICAL_V2_CONFIG_BASE_URL}/dashboards/$
214491
214502
  actionArea: /* @__PURE__ */ jsx(
214492
214503
  ConsultationPad,
214493
214504
  {
214494
- onClose: () => f(($) => !$)
214505
+ onClose: () => f((B) => !B)
214495
214506
  }
214496
214507
  )
214497
214508
  }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { az as i } from "./index-hzibnTqr.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.189",
3
+ "version": "0.0.1-dev.190",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",