@uxland/primary-shell 5.3.7 → 5.3.8
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.
- package/dist/index.js +3260 -3463
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +121 -85
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/events.d.ts +1 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/add/add-async-history-items/request.d.ts +3 -2
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/add/handle-error/actions.d.ts +1 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/add/handle-error/handle-history-items-add-error/bootstrapper.d.ts +4 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/add/handle-error/handle-history-items-add-error/handler.d.ts +7 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/add/handle-error/handle-history-items-add-error/request.d.ts +6 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/add/handle-error/history-full-data-error/component.d.ts +10 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/add/handle-error/history-full-data-error/template.d.ts +3 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/add/handle-error/history-partial-data-error/component.d.ts +11 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/add/handle-error/history-partial-data-error/template.d.ts +3 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/{list → add}/handle-error/reducers.d.ts +2 -4
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/add/handle-error/selectors.d.ts +5 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/domain/model.d.ts +2 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/domain/specs/diagnostics-filter-spec.d.ts +8 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/domain/specs/diagnostics-filter-spec.test.d.ts +1 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/UI/active-filters-badges/active-filters-badges.d.ts +4 -2
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/UI/active-filters-header/active-filters-header.d.ts +1 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/UI/activity-history-filters/activity-history-filters.d.ts +4 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/common-filters/selectors.d.ts +42 -42
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/add-custom-filters/actions.d.ts +1 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/add-custom-filters/reducer.d.ts +2 -2
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/add-custom-filters/request.d.ts +3 -3
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/selectors.d.ts +29 -29
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/add/actions.d.ts +1 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/add/bootstrapper.d.ts +4 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/add/handler.d.ts +6 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/add/reducer.d.ts +4 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/add/reducer.test.d.ts +1 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/add/request.d.ts +6 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/handle-add-diagnostics-options-from-item.d.ts +5 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/handle-add-diagnostics-options-from-item.test.d.ts +1 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/selectors.d.ts +185 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/set/actions.d.ts +1 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/set/bootstrapper.d.ts +4 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/set/handler.d.ts +6 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/set/reducer.d.ts +3 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/set/request.d.ts +4 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/model.d.ts +18 -3
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/selectors.d.ts +1 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/filter/slice.d.ts +7 -3
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/selectors.d.ts +86 -27
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/slice.d.ts +2 -2
- package/dist/primary/shell/src/internal-plugins/activity-history/infrastructure/state/store.d.ts +4 -4
- package/dist/primary/shell/src/internal-plugins/activity-history/localization.d.ts +16 -0
- package/package.json +1 -2
- package/src/UI/images/feedback-error.svg +9 -0
- package/src/UI/internal-views/upper-nav-views.ts +90 -17
- package/src/UI/shared-components/primaria-character-limit-badge/primaria-character-limit-badge.ts +5 -7
- package/src/UI/shared-components/primaria-character-limit-badge/styles.css +1 -1
- package/src/api/interaction-service/modal-styles.css +1 -1
- package/src/events.ts +1 -0
- package/src/features/clinical-monitoring/component/template.ts +5 -5
- package/src/internal-plugins/activity-history/activity-history-item/add/add-async-history-items/handler.ts +4 -3
- package/src/internal-plugins/activity-history/activity-history-item/add/add-async-history-items/request.ts +3 -2
- package/src/internal-plugins/activity-history/activity-history-item/add/add-history-item/handler.ts +2 -0
- package/src/internal-plugins/activity-history/activity-history-item/add/add-history-items/handler.ts +2 -0
- package/src/internal-plugins/activity-history/activity-history-item/add/handle-error/handle-history-items-add-error/bootstrapper.ts +18 -0
- package/src/internal-plugins/activity-history/activity-history-item/add/handle-error/handle-history-items-add-error/handler.ts +26 -0
- package/src/internal-plugins/activity-history/activity-history-item/add/handle-error/handle-history-items-add-error/request.ts +5 -0
- package/src/internal-plugins/activity-history/activity-history-item/add/handle-error/history-full-data-error/component.ts +32 -0
- package/src/internal-plugins/activity-history/activity-history-item/add/handle-error/history-full-data-error/styles.css +11 -0
- package/src/internal-plugins/activity-history/activity-history-item/add/handle-error/history-full-data-error/template.ts +23 -0
- package/src/internal-plugins/activity-history/activity-history-item/add/handle-error/history-partial-data-error/component.ts +42 -0
- package/src/internal-plugins/activity-history/activity-history-item/add/handle-error/history-partial-data-error/styles.css +11 -0
- package/src/internal-plugins/activity-history/activity-history-item/add/handle-error/history-partial-data-error/template.ts +19 -0
- package/src/internal-plugins/activity-history/activity-history-item/{list → add}/handle-error/reducers.ts +3 -2
- package/src/internal-plugins/activity-history/activity-history-item/add/handle-error/selectors.ts +19 -0
- package/src/internal-plugins/activity-history/activity-history-item/bootstrapper.ts +4 -1
- package/src/internal-plugins/activity-history/activity-history-item/domain/model.ts +2 -1
- package/src/internal-plugins/activity-history/activity-history-item/domain/specs/diagnostics-filter-spec.test.ts +59 -0
- package/src/internal-plugins/activity-history/activity-history-item/domain/specs/diagnostics-filter-spec.ts +18 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/UI/active-filters-badges/active-filters-badges.ts +19 -2
- package/src/internal-plugins/activity-history/activity-history-item/filter/UI/active-filters-badges/template.ts +49 -1
- package/src/internal-plugins/activity-history/activity-history-item/filter/UI/active-filters-header/active-filters-header.ts +4 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/UI/active-filters-header/template.ts +1 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/UI/activity-history-filters/activity-history-filters.ts +21 -1
- package/src/internal-plugins/activity-history/activity-history-item/filter/UI/activity-history-filters/template.ts +11 -2
- package/src/internal-plugins/activity-history/activity-history-item/filter/bootstrapper.ts +12 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/common-filters/common-filters.ts +8 -3
- package/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/add-custom-filters/reducer.ts +2 -2
- package/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/add-custom-filters/request.ts +2 -2
- package/src/internal-plugins/activity-history/activity-history-item/filter/custom-filters/selectors.ts +4 -5
- package/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/add/actions.ts +3 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/add/bootstrapper.ts +14 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/add/handler.ts +14 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/add/reducer.test.ts +93 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/add/reducer.ts +25 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/add/request.ts +5 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/handle-add-diagnostics-options-from-item.test.ts +80 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/handle-add-diagnostics-options-from-item.ts +30 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/selectors.ts +22 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/set/actions.ts +3 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/set/bootstrapper.ts +14 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/set/handler.ts +13 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/set/reducer.ts +11 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/diagnostic-filters/set/request.ts +3 -0
- package/src/internal-plugins/activity-history/activity-history-item/filter/model.ts +21 -4
- package/src/internal-plugins/activity-history/activity-history-item/filter/slice.ts +6 -2
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/activity-history-timeline.ts +1 -4
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/template.ts +3 -1
- package/src/internal-plugins/activity-history/activity-history-item/list/bootstrapper.ts +4 -1
- package/src/internal-plugins/activity-history/activity-history-item/selectors.ts +5 -0
- package/src/internal-plugins/activity-history/activity-history-item/slice.ts +2 -8
- package/src/internal-plugins/activity-history/localization.ts +16 -0
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/list/handle-error/actions.d.ts +0 -4
- /package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/{list → add}/handle-busy/actions.d.ts +0 -0
- /package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/{list → add}/handle-busy/bootstrapper.d.ts +0 -0
- /package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/{list → add}/handle-busy/busy-component/component.d.ts +0 -0
- /package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/{list → add}/handle-busy/busy-component/template.d.ts +0 -0
- /package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/{list → add}/handle-busy/reducers.d.ts +0 -0
- /package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/{list → add}/handle-busy/selectors.d.ts +0 -0
- /package/src/internal-plugins/activity-history/activity-history-item/{list → add}/handle-busy/actions.ts +0 -0
- /package/src/internal-plugins/activity-history/activity-history-item/{list → add}/handle-busy/bootstrapper.ts +0 -0
- /package/src/internal-plugins/activity-history/activity-history-item/{list → add}/handle-busy/busy-component/component.ts +0 -0
- /package/src/internal-plugins/activity-history/activity-history-item/{list → add}/handle-busy/busy-component/styles.css +0 -0
- /package/src/internal-plugins/activity-history/activity-history-item/{list → add}/handle-busy/busy-component/template.ts +0 -0
- /package/src/internal-plugins/activity-history/activity-history-item/{list → add}/handle-busy/reducers.ts +0 -0
- /package/src/internal-plugins/activity-history/activity-history-item/{list → add}/handle-busy/selectors.ts +0 -0
- /package/src/internal-plugins/activity-history/activity-history-item/{list → add}/handle-error/actions.ts +0 -0
|
@@ -37,6 +37,14 @@ const upperNavMenuItems: MenuItemConfig[] = [
|
|
|
37
37
|
sortHint: "0010",
|
|
38
38
|
callbackFn: () => shellApi.broker.send(new ExitShell("OBRIR_PI")),
|
|
39
39
|
},
|
|
40
|
+
{
|
|
41
|
+
id: "dinamic-monitoring",
|
|
42
|
+
icon: "poll",
|
|
43
|
+
label: "Monitoratge dinàmic",
|
|
44
|
+
type: "item",
|
|
45
|
+
sortHint: "0030",
|
|
46
|
+
callbackFn: () => navigateToEcapWithoutClosingWithCip("SIA_DEV"),
|
|
47
|
+
},
|
|
40
48
|
{
|
|
41
49
|
id: "processes",
|
|
42
50
|
icon: "account_tree",
|
|
@@ -51,13 +59,13 @@ const upperNavMenuItems: MenuItemConfig[] = [
|
|
|
51
59
|
},
|
|
52
60
|
{
|
|
53
61
|
icon: "open_in_new",
|
|
54
|
-
label: "
|
|
55
|
-
callbackFn: () =>
|
|
62
|
+
label: "Nen sa",
|
|
63
|
+
callbackFn: () => navigateToEcapWithoutClosingWithCip("NEN_SA"),
|
|
56
64
|
},
|
|
57
65
|
{
|
|
58
66
|
icon: "open_in_new",
|
|
59
|
-
label: "
|
|
60
|
-
callbackFn: () =>
|
|
67
|
+
label: "ASSIR",
|
|
68
|
+
callbackFn: () => {},
|
|
61
69
|
},
|
|
62
70
|
{
|
|
63
71
|
icon: "open_in_new",
|
|
@@ -69,6 +77,11 @@ const upperNavMenuItems: MenuItemConfig[] = [
|
|
|
69
77
|
label: "Situació d'especial cura",
|
|
70
78
|
callbackFn: () => navigateToEcapWithoutClosingWithCip("SIT_ESPEC_CURA_DEV"),
|
|
71
79
|
},
|
|
80
|
+
{
|
|
81
|
+
icon: "open_in_new",
|
|
82
|
+
label: "Valoració social",
|
|
83
|
+
callbackFn: () => {},
|
|
84
|
+
},
|
|
72
85
|
],
|
|
73
86
|
},
|
|
74
87
|
{
|
|
@@ -100,6 +113,14 @@ const upperNavMenuItems: MenuItemConfig[] = [
|
|
|
100
113
|
},
|
|
101
114
|
],
|
|
102
115
|
},
|
|
116
|
+
{
|
|
117
|
+
id: "analytics-monitoring", // id correcta?
|
|
118
|
+
icon: "science",
|
|
119
|
+
label: "Seguiment analític",
|
|
120
|
+
type: "item",
|
|
121
|
+
sortHint: "0060",
|
|
122
|
+
callbackFn: () => {},
|
|
123
|
+
},
|
|
103
124
|
{
|
|
104
125
|
id: "results-reports",
|
|
105
126
|
icon: "folder_shared",
|
|
@@ -109,7 +130,7 @@ const upperNavMenuItems: MenuItemConfig[] = [
|
|
|
109
130
|
actionMenuItems: [
|
|
110
131
|
{
|
|
111
132
|
icon: "open_in_new",
|
|
112
|
-
label: "Resultats i informes
|
|
133
|
+
label: "Resultats i informes",
|
|
113
134
|
callbackFn: () => {},
|
|
114
135
|
},
|
|
115
136
|
{
|
|
@@ -120,8 +141,66 @@ const upperNavMenuItems: MenuItemConfig[] = [
|
|
|
120
141
|
navigateToEcapWithoutClosingWithCip("CRIDA_DOCS_USU");
|
|
121
142
|
}, 0),
|
|
122
143
|
},
|
|
144
|
+
{
|
|
145
|
+
icon: "open_in_new",
|
|
146
|
+
label: "Informes clínics",
|
|
147
|
+
callbackFn: () => {},
|
|
148
|
+
},
|
|
123
149
|
],
|
|
124
150
|
},
|
|
151
|
+
{
|
|
152
|
+
id: "test-cabinets",
|
|
153
|
+
icon: "list_alt",
|
|
154
|
+
label: "Gabinets de proves",
|
|
155
|
+
type: "item",
|
|
156
|
+
sortHint: "0080",
|
|
157
|
+
callbackFn: () => {},
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: "prescriptions",
|
|
161
|
+
icon: "pill",
|
|
162
|
+
label: "Prescripció",
|
|
163
|
+
type: "tree",
|
|
164
|
+
sortHint: "0090",
|
|
165
|
+
actionMenuItems: [
|
|
166
|
+
{
|
|
167
|
+
icon: "open_in_new",
|
|
168
|
+
label: "Prescripció",
|
|
169
|
+
callbackFn: () => {},
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
icon: "open_in_new",
|
|
173
|
+
label: "Ordres de tractament",
|
|
174
|
+
callbackFn: () => {},
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
icon: "open_in_new",
|
|
178
|
+
label: "Dispensació material sanitari",
|
|
179
|
+
callbackFn: () => {},
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
icon: "open_in_new",
|
|
183
|
+
label: "Prescripció social",
|
|
184
|
+
callbackFn: () => {},
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
id: "vaccines",
|
|
190
|
+
icon: "vaccines",
|
|
191
|
+
label: "Immunitzacions",
|
|
192
|
+
type: "item",
|
|
193
|
+
sortHint: "0100",
|
|
194
|
+
callbackFn: () => {},
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
id: "it",
|
|
198
|
+
icon: "history_toggle_off",
|
|
199
|
+
label: "Incapacitat temporal",
|
|
200
|
+
type: "item",
|
|
201
|
+
sortHint: "0100",
|
|
202
|
+
callbackFn: () => navigateToEcapWithoutClosingWithCip("REV_IT"),
|
|
203
|
+
},
|
|
125
204
|
{
|
|
126
205
|
id: "communication",
|
|
127
206
|
icon: "3p",
|
|
@@ -140,7 +219,7 @@ const upperNavMenuItems: MenuItemConfig[] = [
|
|
|
140
219
|
});
|
|
141
220
|
},
|
|
142
221
|
},
|
|
143
|
-
{ icon: "open_in_new", label: "
|
|
222
|
+
{ icon: "open_in_new", label: "eConsulta", callbackFn: () => {} },
|
|
144
223
|
{ icon: "open_in_new", label: "Mail", callbackFn: () => {} },
|
|
145
224
|
{
|
|
146
225
|
icon: "open_in_new",
|
|
@@ -159,18 +238,12 @@ const upperNavMenuItems: MenuItemConfig[] = [
|
|
|
159
238
|
callbackFn: () => navigateToEcapWithoutClosingWithCip("CONSULTA_VISITES"),
|
|
160
239
|
},
|
|
161
240
|
{
|
|
162
|
-
id: "
|
|
163
|
-
icon: "
|
|
164
|
-
label: "
|
|
241
|
+
id: "visor",
|
|
242
|
+
icon: "window",
|
|
243
|
+
label: "Visor",
|
|
165
244
|
type: "item",
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
{
|
|
169
|
-
id: "variable activities",
|
|
170
|
-
icon: "add_box",
|
|
171
|
-
label: "Activitats variables",
|
|
172
|
-
type: "item",
|
|
173
|
-
callbackFn: () => navigateToEcapWithoutClosingWithCip("SIA_DEV"),
|
|
245
|
+
sortHint: "0140",
|
|
246
|
+
callbackFn: () => {},
|
|
174
247
|
},
|
|
175
248
|
];
|
|
176
249
|
|
package/src/UI/shared-components/primaria-character-limit-badge/primaria-character-limit-badge.ts
CHANGED
|
@@ -14,14 +14,12 @@ export class PrimariaCharacterLimitBadge extends LitElement {
|
|
|
14
14
|
render() {
|
|
15
15
|
if (this.characterCount > this.characterLimit) {
|
|
16
16
|
return html`
|
|
17
|
-
<dss-
|
|
18
|
-
class="limit-
|
|
19
|
-
|
|
17
|
+
<dss-alert
|
|
18
|
+
class="limit-alert"
|
|
19
|
+
state="warning"
|
|
20
20
|
size="md"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
outlined
|
|
24
|
-
></dss-badge>
|
|
21
|
+
message="${this.label} ${this.characterCount}/${this.characterLimit}"
|
|
22
|
+
></dss-alert>
|
|
25
23
|
`;
|
|
26
24
|
}
|
|
27
25
|
return nothing;
|
package/src/events.ts
CHANGED
|
@@ -3,10 +3,10 @@ import { ClinicalMonitoring } from "./clinical-monitoring";
|
|
|
3
3
|
|
|
4
4
|
export const template = (props: ClinicalMonitoring) => html`
|
|
5
5
|
<div class="wrapper">
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
<div class="content">
|
|
7
|
+
<div id="header-widgets-region"></div>
|
|
8
|
+
<div id="content-widgets-region"></div>
|
|
9
|
+
</div>
|
|
10
|
+
<div id="widgets-sidebar-region"></div>
|
|
11
11
|
</div>
|
|
12
12
|
`;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseHandler } from "../../../infrastructure/base-handlers";
|
|
2
2
|
import { AddCustomFiltersCommand } from "../../filter/custom-filters/add-custom-filters/request";
|
|
3
|
-
import { addBusyHistoryItem, removeBusyHistoryItem } from "../../list/handle-busy/actions";
|
|
4
|
-
import { addErrorHistoryItem } from "../../list/handle-error/actions";
|
|
5
3
|
import { addHistoryItemsCommand } from "../add-history-items/request";
|
|
4
|
+
import { addBusyHistoryItem, removeBusyHistoryItem } from "../handle-busy/actions";
|
|
5
|
+
import { addErrorHistoryItem } from "../handle-error/actions";
|
|
6
6
|
import { InjectAsyncHistoryItemsPayload } from "./request";
|
|
7
7
|
import { validateAddAsyncCommand } from "./validate-add-async-items-command";
|
|
8
8
|
|
|
@@ -14,6 +14,7 @@ export class InjectAsyncHistoryItemsHandler extends BaseHandler {
|
|
|
14
14
|
validateAddAsyncCommand(payload, items);
|
|
15
15
|
this.api.broker.send(addHistoryItemsCommand, {
|
|
16
16
|
entityId: payload.entityId,
|
|
17
|
+
entityDescription: payload.entityDescription,
|
|
17
18
|
items,
|
|
18
19
|
componentFactory: payload.componentFactory,
|
|
19
20
|
searchPredicate: payload.searchPredicate,
|
|
@@ -21,7 +22,7 @@ export class InjectAsyncHistoryItemsHandler extends BaseHandler {
|
|
|
21
22
|
payload.filters ? this.api.broker.send(new AddCustomFiltersCommand(payload.filters)) : null;
|
|
22
23
|
} catch (e) {
|
|
23
24
|
this.store.dispatch(
|
|
24
|
-
addErrorHistoryItem({
|
|
25
|
+
addErrorHistoryItem({ entityId: payload.entityId, message: payload.errorMessage || e.message, entityDescription: payload.entityDescription }),
|
|
25
26
|
);
|
|
26
27
|
} finally {
|
|
27
28
|
this.store.dispatch(removeBusyHistoryItem(payload.entityId));
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { IActivityHistoryItem } from "../../domain/model";
|
|
2
|
-
import {
|
|
2
|
+
import { IActivityHistoryCustomFilter } from "../../filter";
|
|
3
3
|
|
|
4
4
|
export interface InjectAsyncHistoryItemsPayload {
|
|
5
5
|
entityId: string;
|
|
6
|
+
entityDescription: string;
|
|
6
7
|
asyncDataProvider: () => Promise<IActivityHistoryItem[]>;
|
|
7
8
|
componentFactory: (item: IActivityHistoryItem) => HTMLElement;
|
|
8
9
|
searchPredicate?: (searchString: string, item: IActivityHistoryItem) => boolean;
|
|
9
10
|
errorMessage: string;
|
|
10
|
-
filters:
|
|
11
|
+
filters: IActivityHistoryCustomFilter;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export const addAsyncHistoryItemsCommand = "inject_async_history_items_request";
|
package/src/internal-plugins/activity-history/activity-history-item/add/add-history-item/handler.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StoreBaseHandler } from "../../../infrastructure/base-handlers";
|
|
2
2
|
import { ensureAreValidActivityHistoryItems } from "../../domain/is-valid-history-item/is-valid-history-item";
|
|
3
|
+
import { handleAddDiagnosticsFilter } from "../../filter/diagnostic-filters/handle-add-diagnostics-options-from-item";
|
|
3
4
|
import { addActivityHistoryItem } from "./action";
|
|
4
5
|
import { AddHistoryItemPayload } from "./request";
|
|
5
6
|
|
|
@@ -13,6 +14,7 @@ export class AddHistoryItemHandler extends StoreBaseHandler {
|
|
|
13
14
|
item: payload.item,
|
|
14
15
|
}),
|
|
15
16
|
);
|
|
17
|
+
handleAddDiagnosticsFilter([payload.item], this.store);
|
|
16
18
|
} catch (e) {
|
|
17
19
|
console.log(e.message);
|
|
18
20
|
}
|
package/src/internal-plugins/activity-history/activity-history-item/add/add-history-items/handler.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StoreBaseHandler } from "../../../infrastructure/base-handlers";
|
|
2
2
|
import { validateAndFilterItems } from "../../domain/is-valid-history-item/is-valid-history-item";
|
|
3
|
+
import { handleAddDiagnosticsFilter } from "../../filter/diagnostic-filters/handle-add-diagnostics-options-from-item";
|
|
3
4
|
import { addActivityHistoryItems } from "./action";
|
|
4
5
|
import { AddHistoryItemsPayload } from "./request";
|
|
5
6
|
|
|
@@ -15,6 +16,7 @@ export class AddHistoryItemsHandler extends StoreBaseHandler {
|
|
|
15
16
|
searchPredicate: payload.searchPredicate,
|
|
16
17
|
}),
|
|
17
18
|
);
|
|
19
|
+
handleAddDiagnosticsFilter(validItems, this.store);
|
|
18
20
|
} catch (e) {
|
|
19
21
|
console.log(e.message);
|
|
20
22
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PrimariaApi } from "../../../../../../api/api";
|
|
2
|
+
import { registerRequest } from "../../../../../../features/utils";
|
|
3
|
+
import { BrokerDisposableHandler } from "../../../../../../api/broker/primaria-broker";
|
|
4
|
+
import { HandleHistoryItemsAddError } from "./request";
|
|
5
|
+
import { HandleHistoryItemsAddErrorHandler } from "./handler";
|
|
6
|
+
import { container } from "../../../../infrastructure/ioc/container";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
let request: BrokerDisposableHandler;
|
|
10
|
+
|
|
11
|
+
export const bootstrapHandleHistoryItemsAddError = (api: PrimariaApi) => {
|
|
12
|
+
teardownHandleHistoryItemsAddError();
|
|
13
|
+
request = registerRequest(api, container)(HandleHistoryItemsAddError, HandleHistoryItemsAddErrorHandler);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const teardownHandleHistoryItemsAddError = () => {
|
|
17
|
+
request?.dispose();
|
|
18
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseHandler } from "../../../../infrastructure/base-handlers";
|
|
2
|
+
import { HandleHistoryItemsAddError } from "./request";
|
|
3
|
+
import { shellEvents } from "../../../../../../events";
|
|
4
|
+
import { removeErrorHistoryItem } from "../actions";
|
|
5
|
+
import { translate } from "../../../../localization";
|
|
6
|
+
|
|
7
|
+
export class HandleHistoryItemsAddErrorHandler extends BaseHandler {
|
|
8
|
+
async handle(payload: HandleHistoryItemsAddError) {
|
|
9
|
+
try {
|
|
10
|
+
const entityIdsWithError = payload.entities.map(error => error.entityId);
|
|
11
|
+
|
|
12
|
+
await this.dispatchRemoveErrorItems(entityIdsWithError);
|
|
13
|
+
|
|
14
|
+
this.api.broker.publish(shellEvents.refresh_history_data_requested, entityIdsWithError);
|
|
15
|
+
|
|
16
|
+
} catch (e) {
|
|
17
|
+
this.api.notificationService.error(translate("error.errorToRefresh"));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
private async dispatchRemoveErrorItems(entityIds: string[]) {
|
|
22
|
+
for (const entityId of entityIds) {
|
|
23
|
+
this.store.dispatch(removeErrorHistoryItem(entityId));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LitElement, css, html, unsafeCSS } from "lit";
|
|
2
|
+
import { customElement } from "lit/decorators.js";
|
|
3
|
+
import styles from "./styles.css?inline";
|
|
4
|
+
import { template } from "./template";
|
|
5
|
+
import { connectedProperty } from "../../../../infrastructure/state/connected-property";
|
|
6
|
+
import { isAllDataFailedToLoad, selectErrorMessages } from "../selectors";
|
|
7
|
+
import { shellApi } from "../../../../../../api/api";
|
|
8
|
+
import { shellEvents } from "../../../../../../events";
|
|
9
|
+
import { IErrorHistoryItem } from "../../../domain/model";
|
|
10
|
+
import { HandleHistoryItemsAddError } from "../handle-history-items-add-error/request";
|
|
11
|
+
|
|
12
|
+
//@ts-ignore
|
|
13
|
+
@customElement("activity-history-full-data-error")
|
|
14
|
+
export class ActivityHistoryFullDataError extends LitElement {
|
|
15
|
+
render() {
|
|
16
|
+
return html`${template(this)}`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static styles = css`
|
|
20
|
+
${unsafeCSS(styles)}
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
@connectedProperty(isAllDataFailedToLoad)
|
|
24
|
+
isAllDataFailedToLoad: boolean;
|
|
25
|
+
|
|
26
|
+
@connectedProperty(selectErrorMessages)
|
|
27
|
+
errorMessages: Array<IErrorHistoryItem> = [];
|
|
28
|
+
|
|
29
|
+
handleClickFeedback() {
|
|
30
|
+
shellApi.broker.send(new HandleHistoryItemsAddError(this.errorMessages));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { html, nothing } from "lit";
|
|
2
|
+
import { ActivityHistoryFullDataError } from "./component";
|
|
3
|
+
import { translate } from "../../../../localization";
|
|
4
|
+
import showError from "../../../../../../UI/images/feedback-error.svg";
|
|
5
|
+
|
|
6
|
+
export const template = (props: ActivityHistoryFullDataError) => {
|
|
7
|
+
return html`
|
|
8
|
+
${props.isAllDataFailedToLoad ? renderErrorFeedback(props) : nothing}
|
|
9
|
+
`;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const renderErrorFeedback = (props: ActivityHistoryFullDataError) => {
|
|
13
|
+
return html`
|
|
14
|
+
<div class="container">
|
|
15
|
+
<dss-user-feedback imagealt=${translate("error.imageAlt")} variant="default" size="lg" imagesrc=${showError} title=${translate("error.title")} description=${translate("error.general.title")} hasdetails="" detailslabel=${translate("error.viewDetails")}>
|
|
16
|
+
<div slot="details">
|
|
17
|
+
${props.errorMessages.length > 0 ? html`<div>${props.errorMessages.map(error => html`<div>${error.message}</div>`)}</div>` : translate("error.general.noInfo")}
|
|
18
|
+
</div>
|
|
19
|
+
<dss-button @onClick=${props.handleClickFeedback} label=${translate("error.general.refresh")} size="lg"></dss-button>
|
|
20
|
+
</dss-user-feedback>
|
|
21
|
+
</div>
|
|
22
|
+
`;
|
|
23
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { LitElement, css, html, unsafeCSS } from "lit";
|
|
2
|
+
import { customElement } from "lit/decorators.js";
|
|
3
|
+
import styles from "./styles.css?inline";
|
|
4
|
+
import { template } from "./template";
|
|
5
|
+
import { connectedProperty } from "../../../../infrastructure/state/connected-property";
|
|
6
|
+
import { isErrorOccurred, selectErrorMessages } from "../selectors";
|
|
7
|
+
import { shellApi } from "../../../../../../api/api";
|
|
8
|
+
import { translate } from "../../../../localization";
|
|
9
|
+
import { IErrorHistoryItem } from "../../../domain/model";
|
|
10
|
+
import { HandleHistoryItemsAddError } from "../handle-history-items-add-error/request";
|
|
11
|
+
|
|
12
|
+
//@ts-ignore
|
|
13
|
+
@customElement("activity-history-partial-data-error")
|
|
14
|
+
export class ActivityHistoryPartialDataError extends LitElement {
|
|
15
|
+
render() {
|
|
16
|
+
return html`${template(this)}`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static styles = css`
|
|
20
|
+
${unsafeCSS(styles)}
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
@connectedProperty(isErrorOccurred)
|
|
24
|
+
isErrorOccurred: boolean;
|
|
25
|
+
|
|
26
|
+
@connectedProperty(selectErrorMessages)
|
|
27
|
+
errorMessages: Array<IErrorHistoryItem> = [];
|
|
28
|
+
|
|
29
|
+
handleClickAlert() {
|
|
30
|
+
shellApi.broker.send(new HandleHistoryItemsAddError(this.errorMessages));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
getCombinedMessage() {
|
|
34
|
+
const titleMessage = translate("error.partial.title");
|
|
35
|
+
|
|
36
|
+
const errorMessages = this.errorMessages.length > 0 ? this.errorMessages.map(error => error.entityDescription) : [];
|
|
37
|
+
|
|
38
|
+
return errorMessages.length > 0
|
|
39
|
+
? `${titleMessage} ${errorMessages[0]}${errorMessages.length > 1 ? ` i ${errorMessages.slice(1).join(' i ')}` : ''}`
|
|
40
|
+
: titleMessage;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { html, nothing } from "lit";
|
|
2
|
+
import { translate } from "../../../../localization";
|
|
3
|
+
import { ActivityHistoryPartialDataError } from "./component";
|
|
4
|
+
|
|
5
|
+
export const template = (props: ActivityHistoryPartialDataError) => {
|
|
6
|
+
const combinedMessage = props.getCombinedMessage();
|
|
7
|
+
|
|
8
|
+
return html`
|
|
9
|
+
${props.isErrorOccurred ? renderPartialErrorAlert(props, combinedMessage) : nothing}
|
|
10
|
+
`;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const renderPartialErrorAlert = (props: ActivityHistoryPartialDataError, combinedMessage: string) => {
|
|
14
|
+
return html`
|
|
15
|
+
<div class="container">
|
|
16
|
+
<dss-alert @onButtonClick=${props.handleClickAlert} state="warning" size="lg" message="${combinedMessage}" buttonLabel=${translate("error.partial.refresh")} hasbutton></dss-alert>
|
|
17
|
+
</div>
|
|
18
|
+
`;
|
|
19
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { PayloadAction } from "@reduxjs/toolkit";
|
|
2
|
+
import { IErrorHistoryItem } from "../../domain/model";
|
|
2
3
|
|
|
3
4
|
export function addErrorHistoryItemReducer(
|
|
4
5
|
state,
|
|
5
|
-
action: PayloadAction<
|
|
6
|
+
action: PayloadAction<IErrorHistoryItem>,
|
|
6
7
|
) {
|
|
7
8
|
state.error.push(action.payload);
|
|
8
9
|
}
|
|
9
10
|
export function removeErrorHistoryItemReducer(state, action: PayloadAction<string>) {
|
|
10
|
-
state.error = state.error.filter((
|
|
11
|
+
state.error = state.error.filter((item) => item.entityId !== action.payload);
|
|
11
12
|
}
|
package/src/internal-plugins/activity-history/activity-history-item/add/handle-error/selectors.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RootState } from "../../../infrastructure/state/store";
|
|
2
|
+
import { isAnyCollectionLoadingWithoutAnyLoaded, isSomeCollectionLoadedAndOtherLoading } from "../handle-busy/selectors";
|
|
3
|
+
|
|
4
|
+
export const isErrorOccurred = (state: RootState) => state.activityHistoryCollections.error.length > 0;
|
|
5
|
+
|
|
6
|
+
const areCollectionsEmpty = (state: RootState) => {
|
|
7
|
+
const collections = state.activityHistoryCollections.collections;
|
|
8
|
+
|
|
9
|
+
return Object.values(collections).every(collection => {
|
|
10
|
+
return !collection.items || collection.items.length === 0;
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
export const isAllDataFailedToLoad = (state: RootState) => {
|
|
14
|
+
return !isAnyCollectionLoadingWithoutAnyLoaded(state) &&
|
|
15
|
+
!isSomeCollectionLoadedAndOtherLoading(state) &&
|
|
16
|
+
isErrorOccurred(state) && areCollectionsEmpty(state);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const selectErrorMessages = (state: RootState) => state.activityHistoryCollections.error;
|
|
@@ -18,7 +18,8 @@ import { bootstrapUpdateHistoryItem, teardownUpdateHistoryItem } from "./update/
|
|
|
18
18
|
import { bootstrapListActivityHistoryItems } from "./list/bootstrapper";
|
|
19
19
|
import { bootstrapFilters, teardownFilters } from "./filter/bootstrapper";
|
|
20
20
|
import { bootstrapSearchItems, teardownSearchItems } from "./search/bootstrapper";
|
|
21
|
-
import {
|
|
21
|
+
import { bootstrapHandleHistoryItemsAddError, teardownHandleHistoryItemsAddError } from "./add/handle-error/handle-history-items-add-error/bootstrapper";
|
|
22
|
+
import { bootstrapActivityHistoryItemHandleBusy } from "./add/handle-busy/bootstrapper";
|
|
22
23
|
|
|
23
24
|
let broker: BrokerExtensions;
|
|
24
25
|
|
|
@@ -29,6 +30,7 @@ export const bootstrapActivityHistoryItem = (api: PrimariaApi) => {
|
|
|
29
30
|
bootstrapInjectAsyncHistoryItems(broker);
|
|
30
31
|
bootstrapAddHistoryItem(broker);
|
|
31
32
|
bootstrapAddHistoryItems(broker);
|
|
33
|
+
bootstrapHandleHistoryItemsAddError(api);
|
|
32
34
|
bootstrapUpdateHistoryItem(broker);
|
|
33
35
|
bootstrapExportPdf(broker);
|
|
34
36
|
bootstrapFilters(broker);
|
|
@@ -39,6 +41,7 @@ export const teardownActivityHistoryItem = () => {
|
|
|
39
41
|
teardownInjectAsyncHistoryItems();
|
|
40
42
|
teardownAddHistoryItem();
|
|
41
43
|
teardownAddHistoryItems();
|
|
44
|
+
teardownHandleHistoryItemsAddError();
|
|
42
45
|
teardownUpdateHistoryItem();
|
|
43
46
|
teardownExportPdf();
|
|
44
47
|
teardownFilters();
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { DiagnosticCodeSpec } from "./diagnostics-filter-spec";
|
|
3
|
+
import { IActivityHistoryItem } from "../model";
|
|
4
|
+
|
|
5
|
+
describe("DiagnosticCodeSpec", () => {
|
|
6
|
+
it("should return true if allowedCodes is empty", () => {
|
|
7
|
+
const spec = new DiagnosticCodeSpec([]);
|
|
8
|
+
const item: IActivityHistoryItem = {
|
|
9
|
+
diagnostics: [{ codi: "E11", descripcio: "Diabetes" }],
|
|
10
|
+
};
|
|
11
|
+
expect(spec.isSatisfiedBy(item)).toBe(true);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("should return true if item has at least one matching diagnostic code", () => {
|
|
15
|
+
const spec = new DiagnosticCodeSpec(["I10", "E11"]);
|
|
16
|
+
const item: IActivityHistoryItem = {
|
|
17
|
+
diagnostics: [
|
|
18
|
+
{ codi: "Z99", descripcio: "No relevante" },
|
|
19
|
+
{ codi: "E11", descripcio: "Diabetes" },
|
|
20
|
+
],
|
|
21
|
+
};
|
|
22
|
+
expect(spec.isSatisfiedBy(item)).toBe(true);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("should return false if item has diagnostics but none match", () => {
|
|
26
|
+
const spec = new DiagnosticCodeSpec(["J00", "K52"]);
|
|
27
|
+
const item: IActivityHistoryItem = {
|
|
28
|
+
diagnostics: [
|
|
29
|
+
{ codi: "E11", descripcio: "Diabetes" },
|
|
30
|
+
{ codi: "I10", descripcio: "Hipertensió" },
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
expect(spec.isSatisfiedBy(item)).toBe(false);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("should return false if item has no diagnostics", () => {
|
|
37
|
+
const spec = new DiagnosticCodeSpec(["E11"]);
|
|
38
|
+
const item: IActivityHistoryItem = {
|
|
39
|
+
diagnostics: undefined,
|
|
40
|
+
};
|
|
41
|
+
expect(spec.isSatisfiedBy(item)).toBe(false);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("should return false if item.diagnostics is an empty array", () => {
|
|
45
|
+
const spec = new DiagnosticCodeSpec(["E11"]);
|
|
46
|
+
const item: IActivityHistoryItem = {
|
|
47
|
+
diagnostics: [],
|
|
48
|
+
};
|
|
49
|
+
expect(spec.isSatisfiedBy(item)).toBe(false);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("should be case-sensitive by default (E11 !== e11)", () => {
|
|
53
|
+
const spec = new DiagnosticCodeSpec(["e11"]);
|
|
54
|
+
const item: IActivityHistoryItem = {
|
|
55
|
+
diagnostics: [{ codi: "E11", descripcio: "Diabetes" }],
|
|
56
|
+
};
|
|
57
|
+
expect(spec.isSatisfiedBy(item)).toBe(false);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IActivityHistoryItem } from "../model";
|
|
2
|
+
import { Spec } from "./spec";
|
|
3
|
+
|
|
4
|
+
export class DiagnosticCodeSpec extends Spec<IActivityHistoryItem> {
|
|
5
|
+
constructor(private diagnosticCodes: string[]) {
|
|
6
|
+
super();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
isSatisfiedBy(item: IActivityHistoryItem): boolean {
|
|
10
|
+
if (!this.diagnosticCodes?.length) {
|
|
11
|
+
return true; // No se filtra si no se proporcionan códigos
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const itemDiagnostics = item.diagnostics ?? [];
|
|
15
|
+
|
|
16
|
+
return itemDiagnostics.some((d) => this.diagnosticCodes.includes(d.codi));
|
|
17
|
+
}
|
|
18
|
+
}
|