@uxland/primary-shell 7.26.4 → 7.28.0

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.
Files changed (38) hide show
  1. package/dist/{component-OjDyol8O.js → component-Dk1hmoTY.js} +2 -2
  2. package/dist/{component-OjDyol8O.js.map → component-Dk1hmoTY.js.map} +1 -1
  3. package/dist/{index-uA2lHdFS.js → index-DSoZpzbx.js} +1291 -1084
  4. package/dist/index-DSoZpzbx.js.map +1 -0
  5. package/dist/index.js +1 -1
  6. package/dist/index.umd.cjs +70 -54
  7. package/dist/index.umd.cjs.map +1 -1
  8. package/dist/primary/shell/src/UI/components/navigation-tooltip/index.d.ts +2 -0
  9. package/dist/primary/shell/src/UI/components/navigation-tooltip/navigation-tooltip.d.ts +8 -0
  10. package/dist/primary/shell/src/UI/components/navigation-tooltip/tooltip-manager.d.ts +1 -0
  11. package/dist/primary/shell/src/UI/components/primaria-shell/primaria-shell.d.ts +1 -0
  12. package/dist/primary/shell/src/UI/internal-views/common-nav-menu.d.ts +7 -1
  13. package/dist/primary/shell/src/UI/shared-components/typings.d.ts +3 -1
  14. package/dist/primary/shell/src/events.d.ts +2 -0
  15. package/dist/primary/shell/src/features/navigate-to-ecap/navigate-to-ecap.d.ts +1 -0
  16. package/dist/primary/shell/src/locales.d.ts +1 -0
  17. package/dist/styles.css +1 -1
  18. package/package.json +1 -1
  19. package/src/UI/components/navigation-tooltip/index.ts +2 -0
  20. package/src/UI/components/navigation-tooltip/navigation-tooltip.tsx +64 -0
  21. package/src/UI/components/navigation-tooltip/styles.css +63 -0
  22. package/src/UI/components/navigation-tooltip/tooltip-manager.ts +31 -0
  23. package/src/UI/components/primaria-shell/primaria-shell.ts +90 -0
  24. package/src/UI/internal-views/administrative-nav-menu.ts +157 -65
  25. package/src/UI/internal-views/common-nav-menu.ts +7 -1
  26. package/src/UI/internal-views/doctor-nav-menu.ts +26 -30
  27. package/src/UI/internal-views/doctor-quick-action-menu.ts +2 -2
  28. package/src/UI/shared-components/primaria-nav-tree-menu/template.ts +27 -7
  29. package/src/UI/shared-components/typings.ts +3 -1
  30. package/src/api/pdf-viewer-manager/handle-views.ts +8 -0
  31. package/src/api/pdf-viewer-manager/pdf-viewer-manager.test.ts +53 -0
  32. package/src/api/pdf-viewer-manager/pdf-viewer-manager.ts +11 -4
  33. package/src/events.ts +2 -0
  34. package/src/features/navigate-to-ecap/navigate-to-ecap.ts +18 -0
  35. package/src/locales.ts +5 -4
  36. package/dist/index-uA2lHdFS.js.map +0 -1
  37. package/dist/primary/shell/src/features/navigate-to-ecap/navigate-without-closing-and-with-cip.d.ts +0 -1
  38. package/src/features/navigate-to-ecap/navigate-without-closing-and-with-cip.ts +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxland/primary-shell",
3
- "version": "7.26.4",
3
+ "version": "7.28.0",
4
4
  "description": "Primaria Shell",
5
5
  "author": "UXLand <dev@uxland.es>",
6
6
  "homepage": "https://github.com/uxland/harmonix/tree/app#readme",
@@ -0,0 +1,2 @@
1
+ export { showNavItemTooltip } from "./tooltip-manager";
2
+ export { default as NavigationTooltip } from "./navigation-tooltip";
@@ -0,0 +1,64 @@
1
+ import React from "react";
2
+ import { createRoot, Root } from "react-dom/client";
3
+ import "./styles.css";
4
+
5
+ interface NavigationTooltipProps {
6
+ text: string;
7
+ itemAbsoluteY: number;
8
+ }
9
+
10
+ const NavigationTooltip: React.FC<NavigationTooltipProps> = ({ text, itemAbsoluteY }) => {
11
+ const itemHeight = 51;
12
+ const centerY = itemAbsoluteY + itemHeight / 2;
13
+
14
+ const style = {
15
+ left: "73px", // 60px (sidebar width) + 13px offset
16
+ top: `${centerY}px`,
17
+ };
18
+
19
+ return (
20
+ <div className="tooltip-overlay">
21
+ <div className="navigation-tooltip" style={style}>
22
+ <dss-icon icon="info" size="md" />
23
+ {text}
24
+ <div className="arrow" />
25
+ </div>
26
+ </div>
27
+ );
28
+ };
29
+
30
+ export default NavigationTooltip;
31
+
32
+ // Singleton root to manage the tooltip rendering
33
+ let tooltipRoot: Root | null = null;
34
+ let tooltipContainer: HTMLDivElement | null = null;
35
+
36
+ export const renderNavigationTooltip = (text: string, itemAbsoluteY: number) => {
37
+ // Clean up existing tooltip if any
38
+ if (tooltipRoot && tooltipContainer) {
39
+ tooltipRoot.unmount();
40
+ if (document.body.contains(tooltipContainer)) {
41
+ document.body.removeChild(tooltipContainer);
42
+ }
43
+ }
44
+
45
+ // Create new container
46
+ tooltipContainer = document.createElement("div");
47
+ document.body.appendChild(tooltipContainer);
48
+
49
+ // Create root and render
50
+ tooltipRoot = createRoot(tooltipContainer);
51
+ tooltipRoot.render(<NavigationTooltip text={text} itemAbsoluteY={itemAbsoluteY} />);
52
+
53
+ // Auto-remove after 5 seconds
54
+ setTimeout(() => {
55
+ if (tooltipRoot && tooltipContainer) {
56
+ tooltipRoot.unmount();
57
+ if (document.body.contains(tooltipContainer)) {
58
+ document.body.removeChild(tooltipContainer);
59
+ }
60
+ tooltipRoot = null;
61
+ tooltipContainer = null;
62
+ }
63
+ }, 5000);
64
+ };
@@ -0,0 +1,63 @@
1
+ .tooltip-overlay {
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ width: 100vw;
6
+ height: 100vh;
7
+ z-index: 9999;
8
+ pointer-events: none;
9
+ }
10
+
11
+ .navigation-tooltip {
12
+ position: absolute;
13
+ min-width: 250px;
14
+ transform: translateY(-50%);
15
+ background: #EAF7FD;
16
+ color: #0F4877;
17
+ border: 2px solid #0F4877;
18
+ padding: 12px 16px;
19
+ border-radius: 10px;
20
+ white-space: nowrap;
21
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
22
+ font-size: 13px;
23
+ font-family: var(--etc-font-family, inherit);
24
+ font-weight: 500;
25
+ animation: fadeInOut 5s ease-in-out forwards;
26
+ display: flex;
27
+ align-items: center;
28
+ gap: 8px;
29
+ }
30
+
31
+ .tooltip-icon {
32
+ font-size: 16px;
33
+ }
34
+
35
+ .arrow {
36
+ position: absolute;
37
+ right: 100%;
38
+ top: 50%;
39
+ transform: translateY(-50%);
40
+ width: 0;
41
+ height: 0;
42
+ border: 12px solid transparent;
43
+ border-right-color: #1e88e5;
44
+ }
45
+
46
+ @keyframes fadeInOut {
47
+ 0% {
48
+ opacity: 0;
49
+ transform: translateY(-50%) translateX(-10px);
50
+ }
51
+ 10% {
52
+ opacity: 1;
53
+ transform: translateY(-50%) translateX(0px);
54
+ }
55
+ 90% {
56
+ opacity: 1;
57
+ transform: translateY(-50%) translateX(0px);
58
+ }
59
+ 100% {
60
+ opacity: 0;
61
+ transform: translateY(-50%) translateX(-10px);
62
+ }
63
+ }
@@ -0,0 +1,31 @@
1
+ import { shellApi } from "../../../api/api";
2
+ import { shellEvents } from "../../../events";
3
+ import { renderNavigationTooltip } from "./navigation-tooltip";
4
+
5
+ const scrollToNavItem = (
6
+ navItemMenuKey: string,
7
+ ): Promise<{ scrollTop: number; containerTop: number; itemIndex: number; itemAbsoluteY: number }> => {
8
+ return new Promise((resolve) => {
9
+ const subscription = shellApi.broker.subscribe(
10
+ shellEvents.scrollToNavItemCompleted,
11
+ (data: { scrollTop: number; containerTop: number; itemIndex: number; itemAbsoluteY: number }) => {
12
+ subscription.dispose();
13
+ resolve(data);
14
+ },
15
+ );
16
+
17
+ shellApi.broker.publish(shellEvents.scrollToNavItemRequested, navItemMenuKey);
18
+
19
+ // Fallback timeout in case the event doesn't arrive
20
+ setTimeout(() => {
21
+ subscription.dispose();
22
+ resolve({ scrollTop: 0, containerTop: 0, itemIndex: -1, itemAbsoluteY: window.innerHeight / 2 });
23
+ }, 1000);
24
+ });
25
+ };
26
+
27
+ export const showNavItemTooltip = async (navItemMenuKey: string, text: string) => {
28
+ const scrollData = await scrollToNavItem(navItemMenuKey);
29
+
30
+ renderNavigationTooltip(text, scrollData.itemAbsoluteY);
31
+ };
@@ -89,6 +89,12 @@ export class PrimariaShell extends PrimariaRegionHost(LitElement) {
89
89
  this.quickActionBusy = detail.busy;
90
90
  }),
91
91
  );
92
+
93
+ this.subscriptions.push(
94
+ shellApi.broker.subscribe(shellEvents.scrollToNavItemRequested, (navItemMenuKey: string) => {
95
+ this._scrollToNavItem(navItemMenuKey);
96
+ }),
97
+ );
92
98
  }
93
99
 
94
100
  _handleError(error: { message: string }) {
@@ -100,4 +106,88 @@ export class PrimariaShell extends PrimariaRegionHost(LitElement) {
100
106
  _unsubscribeEvents() {
101
107
  this.subscriptions.forEach((s) => s.dispose());
102
108
  }
109
+
110
+ async _scrollToNavItem(navItemMenuKey: string) {
111
+ const region = await shellApi.regionManager.getRegion(shellApi.regionManager.regions.shell.navigationMenu);
112
+
113
+ const allViews = region.currentActiveViews;
114
+
115
+ // Extract the actual view id from the key (remove plugin prefix)
116
+ // navItemMenuKey comes as "primaria-shell::pdf-viewer", we need just "pdf-viewer"
117
+ const viewId = navItemMenuKey.includes("::") ? navItemMenuKey.split("::")[1] : navItemMenuKey;
118
+
119
+ const targetView = allViews.find((view: any) => view.id === viewId);
120
+
121
+ if (!targetView) {
122
+ shellApi.broker.publish(shellEvents.scrollToNavItemCompleted, {
123
+ scrollTop: 0,
124
+ containerTop: 0,
125
+ itemIndex: -1,
126
+ });
127
+ return;
128
+ }
129
+
130
+ // Sort views by sortHint to find the correct position
131
+ const sortedViews = [...allViews].sort((a: any, b: any) => {
132
+ const sortHintA = a.sortHint || "999";
133
+ const sortHintB = b.sortHint || "999";
134
+ return sortHintA.localeCompare(sortHintB);
135
+ });
136
+
137
+ const targetIndex = sortedViews.findIndex((view: any) => view.id === viewId);
138
+
139
+ if (targetIndex === -1) {
140
+ shellApi.broker.publish(shellEvents.scrollToNavItemCompleted, {
141
+ scrollTop: 0,
142
+ containerTop: 0,
143
+ itemIndex: -1,
144
+ });
145
+ return;
146
+ }
147
+
148
+ const menuContainer = this.shadowRoot?.querySelector("#menu-region-container") as HTMLElement;
149
+ if (!menuContainer) {
150
+ shellApi.broker.publish(shellEvents.scrollToNavItemCompleted, {
151
+ scrollTop: 0,
152
+ containerTop: 0,
153
+ itemIndex: targetIndex,
154
+ });
155
+ return;
156
+ }
157
+
158
+ const itemHeight = 51;
159
+ const targetPosition = itemHeight * targetIndex;
160
+ const containerHeight = menuContainer.clientHeight;
161
+
162
+ // Scroll to position the item in the middle of the container
163
+ const scrollPosition = targetPosition - containerHeight / 2 + itemHeight / 2;
164
+ menuContainer.scrollTo({
165
+ top: Math.max(0, scrollPosition),
166
+ behavior: "smooth",
167
+ });
168
+
169
+ // Wait for scroll to complete and then publish the completed event
170
+ setTimeout(() => {
171
+ const containerRect = menuContainer.getBoundingClientRect();
172
+
173
+ // Get all nav items from the container
174
+ const navItems = Array.from(menuContainer.children) as HTMLElement[];
175
+
176
+ // Find the actual DOM element for the target item
177
+ let itemAbsoluteY = window.innerHeight / 2; // default fallback
178
+
179
+ if (navItems[targetIndex]) {
180
+ const itemRect = navItems[targetIndex].getBoundingClientRect();
181
+ itemAbsoluteY = itemRect.top;
182
+ }
183
+
184
+ const data = {
185
+ scrollTop: menuContainer.scrollTop,
186
+ containerTop: containerRect.top,
187
+ itemIndex: targetIndex,
188
+ itemAbsoluteY: itemAbsoluteY,
189
+ };
190
+ shellApi.broker.publish(shellEvents.scrollToNavItemCompleted, data);
191
+ }, 300);
192
+ }
103
193
  }
@@ -1,5 +1,5 @@
1
1
  import { getPatientCip } from "../../features/get-patient-cip/action";
2
- import { navigateToEcapWithoutClosingWithCip } from "../../features/navigate-to-ecap/navigate-without-closing-and-with-cip";
2
+ import { navigateToEcap } from "../../features/navigate-to-ecap/navigate-to-ecap";
3
3
  import { GetVisitId } from "../../features/visit/get-visit-id/request";
4
4
  import { shellApi } from "../../api/api";
5
5
  import { QuickActionItem } from "../shared-components/quick-action-item/quick-action-item";
@@ -15,13 +15,33 @@ const administrativeNavMenuItems: MenuItemConfig[] = [
15
15
  actionMenuItems: [
16
16
  {
17
17
  icon: "open_in_new",
18
- label: "",
19
- callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
18
+ label: "Metge/essa",
19
+ callbackFn: () => navigateToEcap("CREAR_VISITA_ADM", "", { TipusCrida: "UAB" }),
20
20
  },
21
21
  {
22
22
  icon: "open_in_new",
23
- label: "",
24
- callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
23
+ label: "Infermeria",
24
+ callbackFn: () => navigateToEcap("CREAR_VISITA_ADM", "", { TipusCrida: "UI" }),
25
+ },
26
+ {
27
+ icon: "open_in_new",
28
+ label: "Administrativa",
29
+ callbackFn: () => navigateToEcap("CREAR_VISITA_ADM", "", { TipusCrida: "UAS" }),
30
+ },
31
+ {
32
+ icon: "open_in_new",
33
+ label: "Entre sectors",
34
+ callbackFn: () => navigateToEcap("CREAR_VISITA_SECTORS_ADM", ""),
35
+ },
36
+ {
37
+ icon: "open_in_new",
38
+ label: "Multiprogramació",
39
+ callbackFn: () => navigateToEcap("MULTIPROGRAMACIO_ADM", ""),
40
+ },
41
+ {
42
+ icon: "open_in_new",
43
+ label: "Vacunació internacional",
44
+ callbackFn: () => navigateToEcap("VACUNACIO_INTERNACIONAL_ADM", "", {}, false),
25
45
  },
26
46
  ],
27
47
  },
@@ -34,13 +54,18 @@ const administrativeNavMenuItems: MenuItemConfig[] = [
34
54
  actionMenuItems: [
35
55
  {
36
56
  icon: "open_in_new",
37
- label: "",
38
- callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
57
+ label: "Programades",
58
+ callbackFn: () => navigateToEcap("VISITES_PROGRAMADES_ADM", ""),
59
+ },
60
+ {
61
+ icon: "open_in_new",
62
+ label: "Passades",
63
+ callbackFn: () => navigateToEcap("VISITES_PASSADES_ADM", ""),
39
64
  },
40
65
  {
41
66
  icon: "open_in_new",
42
- label: "",
43
- callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
67
+ label: "Anul·lades",
68
+ callbackFn: () => navigateToEcap("VISITES_ANULADES_ADM", ""),
44
69
  },
45
70
  ],
46
71
  },
@@ -53,13 +78,65 @@ const administrativeNavMenuItems: MenuItemConfig[] = [
53
78
  actionMenuItems: [
54
79
  {
55
80
  icon: "open_in_new",
56
- label: "",
57
- callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
81
+ label: "Gestió de pendents",
82
+ callbackFn: () => navigateToEcap("GESTIO_PENDENTS_ADM", ""),
83
+ },
84
+ {
85
+ icon: "open_in_new",
86
+ label: "Gestió d'anul·lades",
87
+ callbackFn: () => navigateToEcap("GESTIO_ANULADES_ADM", ""),
88
+ },
89
+ {
90
+ icon: "open_in_new",
91
+ label: "Modificació/consulta derivacions",
92
+ callbackFn: () => navigateToEcap("MOD_CONS_DERIVACIONS_ADM", ""),
58
93
  },
59
94
  {
60
95
  icon: "open_in_new",
61
- label: "",
62
- callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
96
+ label: "Ordres clíniques",
97
+ callbackFn: () => navigateToEcap("ORDRES_CLINIQUES_ADM", ""),
98
+ },
99
+ {
100
+ icon: "open_in_new",
101
+ label: "Gestió IS3",
102
+ callbackFn: () => navigateToEcap("PETICIONS_PEND_PROG_ADM", "", {}, false),
103
+ },
104
+ {
105
+ icon: "",
106
+ label: "Altres accessos",
107
+ hasNestedMenu: true,
108
+ nestedMenuItems: [
109
+ {
110
+ icon: "open_in_new",
111
+ label: "Sol·licituds eliminades",
112
+ callbackFn: () => navigateToEcap("DERIVACIONS_BAIXA_ADM", ""),
113
+ },
114
+ {
115
+ icon: "open_in_new",
116
+ label: "Impressió recordatori",
117
+ callbackFn: () => navigateToEcap("DERIVACIONS_IMP_RECORD_ADM", ""),
118
+ },
119
+ {
120
+ icon: "open_in_new",
121
+ label: "Correcció de visita de laboratori",
122
+ callbackFn: () => navigateToEcap("CORRECCIO_VISITA_LAB_ADM", ""),
123
+ },
124
+ {
125
+ icon: "open_in_new",
126
+ label: "Sol·licitud de trasllat",
127
+ callbackFn: () => navigateToEcap("TRASLLAT_ADM", ""),
128
+ },
129
+ {
130
+ icon: "open_in_new",
131
+ label: "Informes d'autoritzacions",
132
+ callbackFn: () => navigateToEcap("INFORME_AUT_ADM", "", {}, false),
133
+ },
134
+ {
135
+ icon: "open_in_new",
136
+ label: "Informes d'analítiques",
137
+ callbackFn: () => navigateToEcap("INF_ANALITIQUES_ADM", ""),
138
+ },
139
+ ],
63
140
  },
64
141
  ],
65
142
  },
@@ -72,13 +149,13 @@ const administrativeNavMenuItems: MenuItemConfig[] = [
72
149
  actionMenuItems: [
73
150
  {
74
151
  icon: "open_in_new",
75
- label: "",
76
- callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
152
+ label: "Modificació",
153
+ callbackFn: () => navigateToEcap("PROCEDIMENTS_MOD_ADM", ""),
77
154
  },
78
155
  {
79
156
  icon: "open_in_new",
80
- label: "",
81
- callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
157
+ label: "SIUAC",
158
+ callbackFn: () => navigateToEcap("SIUAC_ADM", "", {}, false),
82
159
  },
83
160
  ],
84
161
  },
@@ -91,13 +168,23 @@ const administrativeNavMenuItems: MenuItemConfig[] = [
91
168
  actionMenuItems: [
92
169
  {
93
170
  icon: "open_in_new",
94
- label: "",
95
- callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
171
+ label: "Gestió de factures",
172
+ callbackFn: () => navigateToEcap("FACTURACIO_GESTIO_ADM", "", {}, false),
96
173
  },
97
174
  {
98
175
  icon: "open_in_new",
99
- label: "",
100
- callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
176
+ label: "Registres de factures",
177
+ callbackFn: () => navigateToEcap("FACTURACIO_REGISTRE_ADM", ""),
178
+ },
179
+ {
180
+ icon: "open_in_new",
181
+ label: "Registres de cobraments",
182
+ callbackFn: () => navigateToEcap("FACTURACIO_COBRAMENTS_ADM", "", {}, false),
183
+ },
184
+ {
185
+ icon: "open_in_new",
186
+ label: "Desvincular règim de finançament",
187
+ callbackFn: () => navigateToEcap("FACTURACIO_DESVINCULAR_ADM", ""),
101
188
  },
102
189
  ],
103
190
  },
@@ -110,13 +197,18 @@ const administrativeNavMenuItems: MenuItemConfig[] = [
110
197
  actionMenuItems: [
111
198
  {
112
199
  icon: "open_in_new",
113
- label: "",
114
- callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
200
+ label: "Carrega l'escàner",
201
+ callbackFn: () => navigateToEcap("ESCANER_ADM", "", {}, false),
202
+ },
203
+ {
204
+ icon: "open_in_new",
205
+ label: "Visualització documents usuari",
206
+ callbackFn: () => navigateToEcap("DOCUMENTS_USUARI_ADM", ""),
115
207
  },
116
208
  {
117
209
  icon: "open_in_new",
118
- label: "",
119
- callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
210
+ label: "Servei digitalització segura",
211
+ callbackFn: () => navigateToEcap("DIGITALITZACIO_ADM", ""),
120
212
  },
121
213
  ],
122
214
  },
@@ -129,13 +221,40 @@ const administrativeNavMenuItems: MenuItemConfig[] = [
129
221
  actionMenuItems: [
130
222
  {
131
223
  icon: "open_in_new",
132
- label: "",
133
- callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
224
+ label: "Manteniment IT",
225
+ callbackFn: () => navigateToEcap("IT_MANTENIMENT_CONSULTAR", ""),
134
226
  },
135
227
  {
136
228
  icon: "open_in_new",
137
- label: "",
138
- callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
229
+ label: "Pla de medicació",
230
+ callbackFn: () => navigateToEcap("PLA_MEDICACIO_ADM", ""),
231
+ },
232
+ {
233
+ icon: "",
234
+ label: "Materials diabètics",
235
+ hasNestedMenu: true,
236
+ nestedMenuItems: [
237
+ {
238
+ icon: "open_in_new",
239
+ label: "Lliurament de material",
240
+ callbackFn: () => navigateToEcap("LLIURAMENT_MATERIAL_ADM", ""),
241
+ },
242
+ {
243
+ icon: "open_in_new",
244
+ label: "Llistats",
245
+ callbackFn: () => navigateToEcap("DIABETICS_LLISTAT_ADM", "", {}, false),
246
+ },
247
+ ],
248
+ },
249
+ {
250
+ icon: "open_in_new",
251
+ label: "Full dosificació TAO",
252
+ callbackFn: () => navigateToEcap("TAO_ADM", ""),
253
+ },
254
+ {
255
+ icon: "open_in_new",
256
+ label: "Consultar pautes demandes a l'hospital",
257
+ callbackFn: () => navigateToEcap("CONSULTAR_PAUTES_ADM", "", {}, false),
139
258
  },
140
259
  ],
141
260
  },
@@ -147,50 +266,23 @@ export const registerAdministrativeCommunicationMenuActions = () => {
147
266
  id: "1",
148
267
  sortHint: "0010",
149
268
  icon: "open_in_new",
150
- label: "SMS",
151
- callbackFn: async () => {
152
- const CIP = await getPatientCip(shellApi);
153
- shellApi.ecapEventManager.publish("MISSATGES_DEV", "NO_TANCAR", {
154
- CIP: CIP || "",
155
- TipusMissatge: "SMS",
156
- });
157
- },
158
- },
159
- {
160
- id: "2",
161
- sortHint: "0020",
162
- icon: "open_in_new",
163
- label: "eConsulta",
164
- callbackFn: async () => {
165
- const CIP = await getPatientCip(shellApi);
166
- const visiId = (await shellApi.broker.send(new GetVisitId())) as string;
167
-
168
- shellApi.ecapEventManager.publish("NAVEGACIO_ECAP_ECONSULTA", "NO_TANCAR", {
169
- CIP: CIP || "",
170
- VisiID: visiId || "",
171
- });
172
- },
269
+ label: "Seguretat",
270
+ callbackFn: () => navigateToEcap("SEGURETAT_ADM", ""),
173
271
  },
174
272
  {
175
273
  id: "3",
274
+ sortHint: "0030",
176
275
  icon: "open_in_new",
177
- label: "Mail",
178
- callbackFn: async () => {
179
- const CIP = await getPatientCip(shellApi);
180
- shellApi.ecapEventManager.publish("COMUNICACIO_MISSATGES_CREAR", "NO_TANCAR", {
181
- CIP: CIP || "",
182
- TipusMissatge: "SMS",
183
- });
184
- },
276
+ label: "SMS",
277
+ callbackFn: () => navigateToEcap("COMUNICACIO_MISSATGES_ADM", "", { TipusMissatge: "SMS" }),
185
278
  },
186
279
  {
187
280
  id: "4",
188
- sortHint: "0030",
281
+ sortHint: "0040",
189
282
  icon: "open_in_new",
190
- label: "Veu IP",
191
- callbackFn: () => navigateToEcapWithoutClosingWithCip("VOIP"),
283
+ label: "Correu electrònic",
284
+ callbackFn: () => navigateToEcap("COMUNICACIO_MISSATGES_ADM", "", { TipusMissatge: "CORREU" }),
192
285
  },
193
- // { id: "5", sortHint: "0040", icon: "open_in_new", label: "Videoconsulta", callbackFn: () => {} },
194
286
  ];
195
287
  for (const item of communicationItems) {
196
288
  shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.communicationSidenav, {
@@ -208,4 +300,4 @@ export const registerAdministrativeNavMenuViews = () => {
208
300
  registerCommunicationNavMenu();
209
301
  registerAdministrativeCommunicationMenuActions();
210
302
  registerNavMenuViews(administrativeNavMenuItems);
211
- };
303
+ };
@@ -22,7 +22,13 @@ export type MenuItemConfig =
22
22
  actionMenuItems: {
23
23
  icon: string;
24
24
  label: string;
25
- callbackFn: () => void | Promise<void>;
25
+ callbackFn?: () => void | Promise<void>;
26
+ hasNestedMenu?: boolean;
27
+ nestedMenuItems?: {
28
+ icon: string;
29
+ label: string;
30
+ callbackFn: () => void | Promise<void>;
31
+ }[];
26
32
  }[];
27
33
  };
28
34