@uxland/primary-shell 7.26.4 → 7.27.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.
@@ -14,7 +14,13 @@ export type MenuItemConfig = {
14
14
  actionMenuItems: {
15
15
  icon: string;
16
16
  label: string;
17
- callbackFn: () => void | Promise<void>;
17
+ callbackFn?: () => void | Promise<void>;
18
+ hasNestedMenu?: boolean;
19
+ nestedMenuItems?: {
20
+ icon: string;
21
+ label: string;
22
+ callbackFn: () => void | Promise<void>;
23
+ }[];
18
24
  }[];
19
25
  };
20
26
  export declare const commonNavMenuItems: {
@@ -3,10 +3,12 @@ interface MenuItem {
3
3
  label: string;
4
4
  }
5
5
  export interface PrimariaNavItemConfig extends MenuItem {
6
- callbackFn: () => void;
6
+ callbackFn?: () => void;
7
7
  showArrow?: boolean;
8
8
  fill?: boolean;
9
9
  rotateIcon?: boolean;
10
+ hasNestedMenu?: boolean;
11
+ nestedMenuItems?: PrimariaNavItemConfig[];
10
12
  }
11
13
  export interface PrimariaNavTreeMenuConfig {
12
14
  icon: string;
@@ -0,0 +1 @@
1
+ export declare const navigateToEcap: (eventName: string, closeAction?: string, additionalParams?: Record<string, string>, includeCip?: boolean) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxland/primary-shell",
3
- "version": "7.26.4",
3
+ "version": "7.27.0",
4
4
  "description": "Primaria Shell",
5
5
  "author": "UXLand <dev@uxland.es>",
6
6
  "homepage": "https://github.com/uxland/harmonix/tree/app#readme",
@@ -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
 
@@ -1,14 +1,10 @@
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";
6
6
  import { ClinicalPathwaysActionMenu } from "../components/clinical-pathways-action-menu/clinical-pathways-action-menu";
7
- import {
8
- MenuItemConfig,
9
- registerNavMenuViews,
10
- registerCommunicationNavMenu,
11
- } from "./common-nav-menu";
7
+ import { MenuItemConfig, registerNavMenuViews, registerCommunicationNavMenu } from "./common-nav-menu";
12
8
 
13
9
  const doctorNavMenuItems: MenuItemConfig[] = [
14
10
  {
@@ -17,7 +13,7 @@ const doctorNavMenuItems: MenuItemConfig[] = [
17
13
  label: "Monitoratge dinàmic",
18
14
  type: "item",
19
15
  sortHint: "0030",
20
- callbackFn: () => navigateToEcapWithoutClosingWithCip("IA_DEV"),
16
+ callbackFn: () => navigateToEcap("IA_DEV"),
21
17
  },
22
18
  {
23
19
  id: "unique-petition",
@@ -29,22 +25,22 @@ const doctorNavMenuItems: MenuItemConfig[] = [
29
25
  {
30
26
  icon: "open_in_new",
31
27
  label: "Analítiques",
32
- callbackFn: () => navigateToEcapWithoutClosingWithCip("LABORATORI"),
28
+ callbackFn: () => navigateToEcap("LABORATORI"),
33
29
  },
34
30
  {
35
31
  icon: "open_in_new",
36
32
  label: "Ordres Clíniques",
37
- callbackFn: () => navigateToEcapWithoutClosingWithCip("RESULT_OC"),
33
+ callbackFn: () => navigateToEcap("RESULT_OC"),
38
34
  },
39
35
  {
40
36
  icon: "open_in_new",
41
37
  label: "OC Exprés",
42
- callbackFn: () => navigateToEcapWithoutClosingWithCip("OC_EXPRES"),
38
+ callbackFn: () => navigateToEcap("OC_EXPRES"),
43
39
  },
44
40
  {
45
41
  icon: "open_in_new",
46
42
  label: "Sol·licitud de trasllat",
47
- callbackFn: () => navigateToEcapWithoutClosingWithCip("TRANSPORT"),
43
+ callbackFn: () => navigateToEcap("TRANSPORT"),
48
44
  },
49
45
  ],
50
46
  },
@@ -54,7 +50,7 @@ const doctorNavMenuItems: MenuItemConfig[] = [
54
50
  label: "Seguiment analític",
55
51
  type: "item",
56
52
  sortHint: "0060",
57
- callbackFn: () => navigateToEcapWithoutClosingWithCip("SEGUIMENT_ANALITIC"),
53
+ callbackFn: () => navigateToEcap("SEGUIMENT_ANALITIC"),
58
54
  },
59
55
  {
60
56
  id: "results-reports",
@@ -66,21 +62,21 @@ const doctorNavMenuItems: MenuItemConfig[] = [
66
62
  {
67
63
  icon: "open_in_new",
68
64
  label: "Resultats i informes",
69
- callbackFn: () => navigateToEcapWithoutClosingWithCip("RESULTAT_INFORMES"),
65
+ callbackFn: () => navigateToEcap("RESULTAT_INFORMES"),
70
66
  },
71
67
  {
72
68
  icon: "open_in_new",
73
69
  label: "Documents usuari",
74
70
  callbackFn: () => {
75
71
  setTimeout(() => {
76
- navigateToEcapWithoutClosingWithCip("CRIDA_DOCS_USU");
72
+ navigateToEcap("CRIDA_DOCS_USU");
77
73
  }, 0);
78
74
  },
79
75
  },
80
76
  {
81
77
  icon: "open_in_new",
82
78
  label: "Informes clínics",
83
- callbackFn: () => navigateToEcapWithoutClosingWithCip("INFORME_CLINIC_NET"),
79
+ callbackFn: () => navigateToEcap("INFORME_CLINIC_NET"),
84
80
  },
85
81
  ],
86
82
  },
@@ -90,7 +86,7 @@ const doctorNavMenuItems: MenuItemConfig[] = [
90
86
  label: "Gabinets de proves",
91
87
  type: "item",
92
88
  sortHint: "0080",
93
- callbackFn: () => navigateToEcapWithoutClosingWithCip("GABINETS_PROVES"),
89
+ callbackFn: () => navigateToEcap("GABINETS_PROVES"),
94
90
  },
95
91
  {
96
92
  id: "prescriptions",
@@ -102,22 +98,22 @@ const doctorNavMenuItems: MenuItemConfig[] = [
102
98
  {
103
99
  icon: "open_in_new",
104
100
  label: "Prescripció",
105
- callbackFn: () => navigateToEcapWithoutClosingWithCip("PRESCRIPCIO_ACTIVA"),
101
+ callbackFn: () => navigateToEcap("PRESCRIPCIO_ACTIVA"),
106
102
  },
107
103
  {
108
104
  icon: "open_in_new",
109
105
  label: "Ordres de tractament",
110
- callbackFn: () => navigateToEcapWithoutClosingWithCip("ORDRE_TRACTAMENT"),
106
+ callbackFn: () => navigateToEcap("ORDRE_TRACTAMENT"),
111
107
  },
112
108
  {
113
109
  icon: "open_in_new",
114
110
  label: "Dispensació material sanitari",
115
- callbackFn: () => navigateToEcapWithoutClosingWithCip("DISPENSACIO_MATERIAL_PACIENT"),
111
+ callbackFn: () => navigateToEcap("DISPENSACIO_MATERIAL_PACIENT"),
116
112
  },
117
113
  {
118
114
  icon: "open_in_new",
119
115
  label: "Prescripció social",
120
- callbackFn: () => navigateToEcapWithoutClosingWithCip("PRESCRIPCIO_SOCIAL"),
116
+ callbackFn: () => navigateToEcap("PRESCRIPCIO_SOCIAL"),
121
117
  },
122
118
  ],
123
119
  },
@@ -127,7 +123,7 @@ const doctorNavMenuItems: MenuItemConfig[] = [
127
123
  label: "Immunitzacions",
128
124
  type: "item",
129
125
  sortHint: "0100",
130
- callbackFn: () => navigateToEcapWithoutClosingWithCip("IMMUNITZACIONS"),
126
+ callbackFn: () => navigateToEcap("IMMUNITZACIONS"),
131
127
  },
132
128
  {
133
129
  id: "it",
@@ -135,7 +131,7 @@ const doctorNavMenuItems: MenuItemConfig[] = [
135
131
  label: "Incapacitat temporal",
136
132
  type: "item",
137
133
  sortHint: "0100",
138
- callbackFn: () => navigateToEcapWithoutClosingWithCip("REV_IT"),
134
+ callbackFn: () => navigateToEcap("REV_IT"),
139
135
  },
140
136
  {
141
137
  id: "visits",
@@ -143,7 +139,7 @@ const doctorNavMenuItems: MenuItemConfig[] = [
143
139
  label: "Visites",
144
140
  type: "item",
145
141
  sortHint: "0130",
146
- callbackFn: () => navigateToEcapWithoutClosingWithCip("CONSULTA_VISITES"),
142
+ callbackFn: () => navigateToEcap("CONSULTA_VISITES"),
147
143
  },
148
144
  ];
149
145
 
@@ -206,7 +202,7 @@ export const registerDoctorCommunicationMenuActions = () => {
206
202
  sortHint: "0030",
207
203
  icon: "open_in_new",
208
204
  label: "Veu IP",
209
- callbackFn: () => navigateToEcapWithoutClosingWithCip("VOIP"),
205
+ callbackFn: () => navigateToEcap("VOIP"),
210
206
  },
211
207
  // { id: "5", sortHint: "0040", icon: "open_in_new", label: "Videoconsulta", callbackFn: () => {} },
212
208
  ];
@@ -229,42 +225,42 @@ export const registerDoctorClinicalPathwaysMenuActions = () => {
229
225
  sortHint: "0010",
230
226
  icon: "open_in_new",
231
227
  label: "Proces d'atenció - ARES",
232
- callbackFn: () => navigateToEcapWithoutClosingWithCip("PROCES_ATENCIO"),
228
+ callbackFn: () => navigateToEcap("PROCES_ATENCIO"),
233
229
  },
234
230
  {
235
231
  id: "3",
236
232
  sortHint: "0030",
237
233
  icon: "open_in_new",
238
234
  label: "Nen sa",
239
- callbackFn: () => navigateToEcapWithoutClosingWithCip("NEN_SA"),
235
+ callbackFn: () => navigateToEcap("NEN_SA"),
240
236
  },
241
237
  {
242
238
  id: "4",
243
239
  sortHint: "0040",
244
240
  icon: "open_in_new",
245
241
  label: "ASSIR",
246
- callbackFn: () => navigateToEcapWithoutClosingWithCip("NAVEGACIO_ASSIR"),
242
+ callbackFn: () => navigateToEcap("NAVEGACIO_ASSIR"),
247
243
  },
248
244
  {
249
245
  id: "5",
250
246
  sortHint: "0050",
251
247
  icon: "open_in_new",
252
248
  label: "Odontologia",
253
- callbackFn: () => navigateToEcapWithoutClosingWithCip("ODONTOLOGO"),
249
+ callbackFn: () => navigateToEcap("ODONTOLOGO"),
254
250
  },
255
251
  {
256
252
  id: "6",
257
253
  sortHint: "0060",
258
254
  icon: "open_in_new",
259
255
  label: "Situació d'especial cura",
260
- callbackFn: () => navigateToEcapWithoutClosingWithCip("SIT_ESPEC_CURA_DEV"),
256
+ callbackFn: () => navigateToEcap("SIT_ESPEC_CURA_DEV"),
261
257
  },
262
258
  {
263
259
  id: "7",
264
260
  sortHint: "0070",
265
261
  icon: "open_in_new",
266
262
  label: "Valoració social",
267
- callbackFn: () => navigateToEcapWithoutClosingWithCip("VALORACIO_SOCIAL"),
263
+ callbackFn: () => navigateToEcap("VALORACIO_SOCIAL"),
268
264
  },
269
265
  ];
270
266
  for (const item of clinicalPathwaysItems) {
@@ -1,6 +1,6 @@
1
1
  import { shellApi } from "../../api/api";
2
2
  import { QuickActionItem } from "../shared-components/quick-action-item/quick-action-item";
3
- import { navigateToEcapWithoutClosingWithCip } from "../../features/navigate-to-ecap/navigate-without-closing-and-with-cip";
3
+ import { navigateToEcap } from "../../features/navigate-to-ecap/navigate-to-ecap";
4
4
 
5
5
  export const registerDoctorQuickActionViews = () => {
6
6
  shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.quickActions, {
@@ -8,7 +8,7 @@ export const registerDoctorQuickActionViews = () => {
8
8
  sortHint: "0011",
9
9
  factory: () => {
10
10
  const quickActionItem = new QuickActionItem("", "Cita", () => {
11
- navigateToEcapWithoutClosingWithCip("CREAR_VISITA");
11
+ navigateToEcap("CREAR_VISITA");
12
12
  });
13
13
  return Promise.resolve(quickActionItem);
14
14
  },
@@ -14,13 +14,33 @@ export const template = (props: PrimariaNavTreeMenu) => html`
14
14
  ? html`
15
15
  <dss-action-menu @onCloseActionMenu=${props.handleCloseMenu}>
16
16
  ${props.config.actionMenuItems?.map(
17
- (item) => html`
18
- <dss-action-menu-item
19
- righticon=${item.icon}
20
- .label=${item.label}
21
- @click=${item.callbackFn}
22
- ></dss-action-menu-item>
23
- `,
17
+ (item) => item.hasNestedMenu
18
+ ? html`
19
+ <dss-action-menu-item
20
+ righticon=${item.icon}
21
+ .label=${item.label}
22
+ hasnestedmenu
23
+ >
24
+ <dss-action-menu>
25
+ ${item.nestedMenuItems?.map(
26
+ (nestedItem) => html`
27
+ <dss-action-menu-item
28
+ righticon=${nestedItem.icon}
29
+ .label=${nestedItem.label}
30
+ @click=${nestedItem.callbackFn}
31
+ ></dss-action-menu-item>
32
+ `,
33
+ )}
34
+ </dss-action-menu>
35
+ </dss-action-menu-item>
36
+ `
37
+ : html`
38
+ <dss-action-menu-item
39
+ righticon=${item.icon}
40
+ .label=${item.label}
41
+ @click=${item.callbackFn}
42
+ ></dss-action-menu-item>
43
+ `,
24
44
  )}
25
45
  </dss-action-menu>
26
46
  `
@@ -4,10 +4,12 @@ interface MenuItem {
4
4
  }
5
5
 
6
6
  export interface PrimariaNavItemConfig extends MenuItem {
7
- callbackFn: () => void;
7
+ callbackFn?: () => void;
8
8
  showArrow?: boolean;
9
9
  fill?: boolean;
10
10
  rotateIcon?: boolean;
11
+ hasNestedMenu?: boolean;
12
+ nestedMenuItems?: PrimariaNavItemConfig[];
11
13
  }
12
14
 
13
15
  export interface PrimariaNavTreeMenuConfig {
@@ -0,0 +1,18 @@
1
+ import { shellApi } from "../../api/api";
2
+ import { getPatientCip } from "../get-patient-cip/action";
3
+
4
+ export const navigateToEcap = async (
5
+ eventName: string,
6
+ closeAction = "NO_TANCAR",
7
+ additionalParams: Record<string, string> = {},
8
+ includeCip = true,
9
+ ) => {
10
+ const params = { ...additionalParams };
11
+
12
+ if (includeCip) {
13
+ const CIP = await getPatientCip(shellApi);
14
+ params.CIP = CIP;
15
+ }
16
+
17
+ shellApi.ecapEventManager.publish(eventName, closeAction, params);
18
+ };