@uxland/primary-shell 7.9.1 → 7.10.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.
@@ -0,0 +1,2 @@
1
+ export declare const registerAdministrativeCommunicationMenuActions: () => void;
2
+ export declare const registerAdministrativeNavMenuViews: () => void;
@@ -0,0 +1,29 @@
1
+ export type MenuItemConfig = {
2
+ id: string;
3
+ sortHint?: string;
4
+ icon: string;
5
+ label: string;
6
+ type: "item";
7
+ callbackFn: () => void | Promise<void>;
8
+ } | {
9
+ id: string;
10
+ sortHint?: string;
11
+ icon: string;
12
+ label: string;
13
+ type: "tree";
14
+ actionMenuItems: {
15
+ icon: string;
16
+ label: string;
17
+ callbackFn: () => void | Promise<void>;
18
+ }[];
19
+ };
20
+ export declare const commonNavMenuItems: {
21
+ id: string;
22
+ icon: string;
23
+ label: string;
24
+ type: string;
25
+ sortHint: string;
26
+ callbackFn: () => Promise<unknown>;
27
+ }[];
28
+ export declare const registerNavMenuViews: (views: MenuItemConfig[]) => void;
29
+ export declare const registerCommunicationNavMenu: () => void;
@@ -0,0 +1,2 @@
1
+ export declare const registerDoctorCommunicationMenuActions: () => void;
2
+ export declare const registerDoctorNavMenuViews: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxland/primary-shell",
3
- "version": "7.9.1",
3
+ "version": "7.10.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,211 @@
1
+ import { getPatientCip } from "../../features/get-patient-cip/action";
2
+ import { navigateToEcapWithoutClosingWithCip } from "../../features/navigate-to-ecap/navigate-without-closing-and-with-cip";
3
+ import { GetVisitId } from "../../features/visit/get-visit-id/request";
4
+ import { shellApi } from "../../api/api";
5
+ import { QuickActionItem } from "../shared-components/quick-action-item/quick-action-item";
6
+ import { MenuItemConfig, registerNavMenuViews, registerCommunicationNavMenu } from "./common-nav-menu";
7
+
8
+ const administrativeNavMenuItems: MenuItemConfig[] = [
9
+ {
10
+ id: "create-visits",
11
+ icon: "today",
12
+ label: "Crear visites",
13
+ type: "tree",
14
+ sortHint: "0040",
15
+ actionMenuItems: [
16
+ {
17
+ icon: "open_in_new",
18
+ label: "",
19
+ callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
20
+ },
21
+ {
22
+ icon: "open_in_new",
23
+ label: "",
24
+ callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
25
+ },
26
+ ],
27
+ },
28
+ {
29
+ id: "register-visits",
30
+ icon: "event_note",
31
+ label: "Registre de visites",
32
+ type: "tree",
33
+ sortHint: "0050",
34
+ actionMenuItems: [
35
+ {
36
+ icon: "open_in_new",
37
+ label: "",
38
+ callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
39
+ },
40
+ {
41
+ icon: "open_in_new",
42
+ label: "",
43
+ callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
44
+ },
45
+ ],
46
+ },
47
+ {
48
+ id: "petitions",
49
+ icon: "alt_route",
50
+ label: "Peticions",
51
+ type: "tree",
52
+ sortHint: "0060",
53
+ actionMenuItems: [
54
+ {
55
+ icon: "open_in_new",
56
+ label: "",
57
+ callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
58
+ },
59
+ {
60
+ icon: "open_in_new",
61
+ label: "",
62
+ callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
63
+ },
64
+ ],
65
+ },
66
+ {
67
+ id: "administrative-procedures",
68
+ icon: "list_alt",
69
+ label: "Procediments administratius",
70
+ type: "tree",
71
+ sortHint: "0070",
72
+ actionMenuItems: [
73
+ {
74
+ icon: "open_in_new",
75
+ label: "",
76
+ callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
77
+ },
78
+ {
79
+ icon: "open_in_new",
80
+ label: "",
81
+ callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
82
+ },
83
+ ],
84
+ },
85
+ {
86
+ id: "billing",
87
+ icon: "receipt",
88
+ label: "Facturació",
89
+ type: "tree",
90
+ sortHint: "0080",
91
+ actionMenuItems: [
92
+ {
93
+ icon: "open_in_new",
94
+ label: "",
95
+ callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
96
+ },
97
+ {
98
+ icon: "open_in_new",
99
+ label: "",
100
+ callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
101
+ },
102
+ ],
103
+ },
104
+ {
105
+ id: "user-docs",
106
+ icon: "library_books",
107
+ label: "Documents de l'usuari",
108
+ type: "tree",
109
+ sortHint: "0090",
110
+ actionMenuItems: [
111
+ {
112
+ icon: "open_in_new",
113
+ label: "",
114
+ callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
115
+ },
116
+ {
117
+ icon: "open_in_new",
118
+ label: "",
119
+ callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
120
+ },
121
+ ],
122
+ },
123
+ {
124
+ id: "healthcare-procedures",
125
+ icon: "folder",
126
+ label: "Gestions sanitàries",
127
+ type: "tree",
128
+ sortHint: "0100",
129
+ actionMenuItems: [
130
+ {
131
+ icon: "open_in_new",
132
+ label: "",
133
+ callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
134
+ },
135
+ {
136
+ icon: "open_in_new",
137
+ label: "",
138
+ callbackFn: () => navigateToEcapWithoutClosingWithCip(""),
139
+ },
140
+ ],
141
+ },
142
+ ];
143
+
144
+ export const registerAdministrativeCommunicationMenuActions = () => {
145
+ const communicationItems = [
146
+ {
147
+ id: "1",
148
+ sortHint: "0010",
149
+ 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
+ },
173
+ },
174
+ {
175
+ id: "3",
176
+ 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
+ },
185
+ },
186
+ {
187
+ id: "4",
188
+ sortHint: "0030",
189
+ icon: "open_in_new",
190
+ label: "Veu IP",
191
+ callbackFn: () => navigateToEcapWithoutClosingWithCip("VOIP"),
192
+ },
193
+ // { id: "5", sortHint: "0040", icon: "open_in_new", label: "Videoconsulta", callbackFn: () => {} },
194
+ ];
195
+ for (const item of communicationItems) {
196
+ shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.communicationSidenav, {
197
+ id: item.id,
198
+ sortHint: item.sortHint,
199
+ factory: () => {
200
+ const menuTest = new QuickActionItem(item.icon, item.label, item.callbackFn);
201
+ return Promise.resolve(menuTest as any);
202
+ },
203
+ });
204
+ }
205
+ };
206
+
207
+ export const registerAdministrativeNavMenuViews = () => {
208
+ registerCommunicationNavMenu();
209
+ registerAdministrativeCommunicationMenuActions();
210
+ registerNavMenuViews(administrativeNavMenuItems);
211
+ };
@@ -0,0 +1,76 @@
1
+ import { shellApi } from "../../api/api";
2
+ import { ExitShell } from "../../features/exit/request";
3
+ import { CommunicationActionMenu } from "../components/communication-action-menu/communication-action-menu";
4
+ import { PrimariaNavItem } from "../shared-components/primaria-nav-item/primaria-nav-item";
5
+ import { PrimariaNavTreeMenu } from "../shared-components/primaria-nav-tree-menu/primaria-nav-tree-menu";
6
+
7
+ export type MenuItemConfig =
8
+ | {
9
+ id: string;
10
+ sortHint?: string;
11
+ icon: string;
12
+ label: string;
13
+ type: "item";
14
+ callbackFn: () => void | Promise<void>;
15
+ }
16
+ | {
17
+ id: string;
18
+ sortHint?: string;
19
+ icon: string;
20
+ label: string;
21
+ type: "tree";
22
+ actionMenuItems: {
23
+ icon: string;
24
+ label: string;
25
+ callbackFn: () => void | Promise<void>;
26
+ }[];
27
+ };
28
+
29
+ export const commonNavMenuItems = [
30
+ {
31
+ id: "landing",
32
+ icon: "home",
33
+ label: "Pàgina inici",
34
+ type: "item",
35
+ sortHint: "0010",
36
+ callbackFn: () => shellApi.broker.send(new ExitShell("OBRIR_PI")),
37
+ },
38
+ ];
39
+
40
+ export const registerNavMenuViews = (views: MenuItemConfig[]) => {
41
+ const finalViews = [...commonNavMenuItems, ...views] as MenuItemConfig[];
42
+ for (const item of finalViews) {
43
+ shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.navigationMenu, {
44
+ id: item.id,
45
+ sortHint: item.sortHint,
46
+ factory: () => {
47
+ const menuItem =
48
+ item.type === "item"
49
+ ? new PrimariaNavItem({
50
+ icon: item.icon,
51
+ label: item.label,
52
+ callbackFn: item.callbackFn,
53
+ })
54
+ : new PrimariaNavTreeMenu({
55
+ icon: item.icon,
56
+ label: item.label,
57
+ actionMenuItems: (item as any).actionMenuItems,
58
+ });
59
+
60
+ return Promise.resolve(menuItem as any);
61
+ },
62
+ });
63
+ }
64
+ };
65
+
66
+ export const registerCommunicationNavMenu = () => {
67
+ shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.navigationMenu, {
68
+ id: "communication",
69
+ sortHint: "0120",
70
+ factory: () => {
71
+ const menuItem = new CommunicationActionMenu("3p", "Comunicació");
72
+
73
+ return Promise.resolve(menuItem as any);
74
+ },
75
+ });
76
+ };
@@ -1,53 +1,11 @@
1
- import { shellApi } from "../../api/api";
2
- import { ExitShell } from "../../features/exit/request";
3
1
  import { getPatientCip } from "../../features/get-patient-cip/action";
4
2
  import { navigateToEcapWithoutClosingWithCip } from "../../features/navigate-to-ecap/navigate-without-closing-and-with-cip";
5
- import { CommunicationActionMenu } from "../components/communication-action-menu/communication-action-menu";
6
- import { QuickActionItem } from "../shared-components/quick-action-item/quick-action-item";
7
- import { PrimariaNavItem } from "../shared-components/primaria-nav-item/primaria-nav-item";
8
- import { PrimariaNavTreeMenu } from "../shared-components/primaria-nav-tree-menu/primaria-nav-tree-menu";
9
3
  import { GetVisitId } from "../../features/visit/get-visit-id/request";
10
-
11
- type MenuItemConfig =
12
- | {
13
- id: string;
14
- sortHint?: string;
15
- icon: string;
16
- label: string;
17
- type: "item";
18
- callbackFn: () => void | Promise<void>;
19
- }
20
- | {
21
- id: string;
22
- sortHint?: string;
23
- icon: string;
24
- label: string;
25
- type: "tree";
26
- actionMenuItems: {
27
- icon: string;
28
- label: string;
29
- callbackFn: () => void | Promise<void>;
30
- }[];
31
- };
32
-
33
- const commonNavMenuItems = [{
34
- id: "landing",
35
- icon: "home",
36
- label: "Pàgina inici",
37
- type: "item",
38
- sortHint: "0010",
39
- callbackFn: () => shellApi.broker.send(new ExitShell("OBRIR_PI")),
40
- }];
4
+ import { shellApi } from "../../api/api";
5
+ import { QuickActionItem } from "../shared-components/quick-action-item/quick-action-item";
6
+ import { MenuItemConfig, registerNavMenuViews, registerCommunicationNavMenu } from "./common-nav-menu";
41
7
 
42
8
  const doctorNavMenuItems: MenuItemConfig[] = [
43
- {
44
- id: "landing",
45
- icon: "home",
46
- label: "Pàgina inici",
47
- type: "item",
48
- sortHint: "0010",
49
- callbackFn: () => shellApi.broker.send(new ExitShell("OBRIR_PI")),
50
- },
51
9
  {
52
10
  id: "dinamic-monitoring",
53
11
  icon: "poll",
@@ -147,10 +105,11 @@ const doctorNavMenuItems: MenuItemConfig[] = [
147
105
  {
148
106
  icon: "open_in_new",
149
107
  label: "Documents usuari",
150
- callbackFn: () =>
108
+ callbackFn: () => {
151
109
  setTimeout(() => {
152
110
  navigateToEcapWithoutClosingWithCip("CRIDA_DOCS_USU");
153
- }, 0),
111
+ }, 0);
112
+ },
154
113
  },
155
114
  {
156
115
  icon: "open_in_new",
@@ -222,58 +181,7 @@ const doctorNavMenuItems: MenuItemConfig[] = [
222
181
  },
223
182
  ];
224
183
 
225
- const administrativeNavMenuItems = [] as any;
226
-
227
- export const registerDoctorNavMenuViews = () => {
228
- registerCommunicationNavMenu();
229
- registerNavMenuViews(doctorNavMenuItems);
230
- };
231
-
232
- export const registerAdministrativeNavMenuViews = () => {
233
- registerNavMenuViews(administrativeNavMenuItems);
234
- }
235
-
236
- const registerNavMenuViews = (views: MenuItemConfig[]) => {
237
- const finalViews = [...commonNavMenuItems, ...views];
238
- for (const item of finalViews) {
239
- shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.navigationMenu, {
240
- id: item.id,
241
- sortHint: item.sortHint,
242
- factory: () => {
243
- const menuItem =
244
- item.type === "item"
245
- ? new PrimariaNavItem({
246
- icon: item.icon,
247
- label: item.label,
248
- callbackFn: item.callbackFn,
249
- })
250
- : new PrimariaNavTreeMenu({
251
- icon: item.icon,
252
- label: item.label,
253
- actionMenuItems: item.actionMenuItems,
254
- });
255
-
256
- return Promise.resolve(menuItem);
257
- },
258
- });
259
- }
260
- }
261
-
262
- export const registerCommunicationNavMenu = () => {
263
- shellApi.regionManager.registerView(shellApi.regionManager.regions.shell.navigationMenu, {
264
- id: "communication",
265
- sortHint: "0120",
266
- factory: () => {
267
- const menuItem = new CommunicationActionMenu("3p", "Comunicació");
268
-
269
- return Promise.resolve(menuItem);
270
- },
271
- });
272
-
273
- registerCommunicationMenuActions();
274
- };
275
-
276
- export const registerCommunicationMenuActions = () => {
184
+ export const registerDoctorCommunicationMenuActions = () => {
277
185
  const communicationItems = [
278
186
  {
279
187
  id: "1",
@@ -329,15 +237,15 @@ export const registerCommunicationMenuActions = () => {
329
237
  id: item.id,
330
238
  sortHint: item.sortHint,
331
239
  factory: () => {
332
- const menuItem = new PrimariaNavItem({
333
- icon: item.icon,
334
- label: item.label,
335
- callbackFn: item.callbackFn,
336
- });
337
-
338
240
  const menuTest = new QuickActionItem(item.icon, item.label, item.callbackFn);
339
- return Promise.resolve(menuTest);
241
+ return Promise.resolve(menuTest as any);
340
242
  },
341
243
  });
342
244
  }
343
245
  };
246
+
247
+ export const registerDoctorNavMenuViews = () => {
248
+ registerCommunicationNavMenu();
249
+ registerDoctorCommunicationMenuActions();
250
+ registerNavMenuViews(doctorNavMenuItems);
251
+ };
@@ -1,6 +1,7 @@
1
1
  import { shellApi } from "../../api/api";
2
2
  import { registerPDFVisorMainView } from "../../api/pdf-viewer-manager/handle-views";
3
- import { registerAdministrativeNavMenuViews, registerDoctorNavMenuViews } from "./upper-nav-views";
3
+ import { registerAdministrativeNavMenuViews } from "./administrative-nav-menu";
4
+ import { registerDoctorNavMenuViews } from "./doctor-nav-menu";
4
5
 
5
6
  const registerMainViews = () => {
6
7
  registerPDFVisorMainView();