@uxland/primary-shell 5.3.12 → 5.4.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.
- package/dist/index.js +269 -163
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +86 -63
- package/dist/index.umd.cjs.map +1 -1
- package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/domain/model.d.ts +1 -1
- package/package.json +1 -1
- package/src/UI/internal-views/upper-nav-views.ts +8 -0
- package/src/features/visit/finalize-visit/handler.ts +2 -4
- package/src/internal-plugins/activity-history/activity-history-item/domain/model.ts +2 -5
- package/src/internal-plugins/activity-history/activity-history-item/domain/specs/diagnostics-filter-spec.test.ts +6 -6
- package/src/internal-plugins/activity-history/activity-history-item/domain/specs/search-string-spec.test.ts +15 -0
- package/src/internal-plugins/activity-history/activity-history-item/domain/specs/search-string-spec.ts +6 -14
- package/src/internal-plugins/activity-history/activity-history-item/domain/validation/diagnostics/has-valid-diagnostics.test.ts +8 -8
- package/src/internal-plugins/activity-history/activity-history-item/domain/validation/diagnostics/has-valid-diagnostics.ts +1 -1
- package/src/internal-plugins/activity-history/activity-history-item/domain/validation/is-valid-full-history-item.test.ts +7 -7
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/main-view/template.ts +1 -1
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/activity-history-timeline.ts +20 -9
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/styles.css +2 -2
- package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/template.ts +46 -52
- package/src/internal-plugins/activity-history/activity-history-item/list/bootstrapper.ts +1 -2
- package/src/internal-plugins/activity-history/activity-history-item/list/group-history-items/group-history-items.test.ts +3 -3
|
@@ -12,7 +12,7 @@ export type TSearchActivityHistoryItemPredicate = (searchString: string, item: I
|
|
|
12
12
|
export interface IActivityHistoryDiagnostic {
|
|
13
13
|
codi: string;
|
|
14
14
|
cataleg: string;
|
|
15
|
-
|
|
15
|
+
description: string;
|
|
16
16
|
idEcap: string;
|
|
17
17
|
idCipds: string;
|
|
18
18
|
idCdr: string;
|
package/package.json
CHANGED
|
@@ -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",
|
|
@@ -4,13 +4,11 @@ import { PrimariaApi } from "../../../api/api";
|
|
|
4
4
|
import { FinalizeVisit } from "./request";
|
|
5
5
|
|
|
6
6
|
export class FinalizeVisitHandler {
|
|
7
|
-
constructor(
|
|
8
|
-
@inject(TYPES.primaryApi) private api: PrimariaApi,
|
|
9
|
-
) {}
|
|
7
|
+
constructor(@inject(TYPES.primaryApi) private api: PrimariaApi) {}
|
|
10
8
|
async handle(data: FinalizeVisit) {
|
|
11
9
|
try {
|
|
12
10
|
const visitIdData = data.visitId;
|
|
13
|
-
this.api.ecapEventManager.publish("RESOL_VISITA", "", {
|
|
11
|
+
this.api.ecapEventManager.publish("RESOL_VISITA", "", { VisiID: visitIdData });
|
|
14
12
|
} catch (error) {
|
|
15
13
|
this.api.notificationService.error(error.message);
|
|
16
14
|
}
|
|
@@ -10,15 +10,12 @@ export interface IErrorHistoryItem {
|
|
|
10
10
|
entityDescription: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export type TSearchActivityHistoryItemPredicate = (
|
|
14
|
-
searchString: string,
|
|
15
|
-
item: IActivityHistoryItem,
|
|
16
|
-
) => boolean;
|
|
13
|
+
export type TSearchActivityHistoryItemPredicate = (searchString: string, item: IActivityHistoryItem) => boolean;
|
|
17
14
|
|
|
18
15
|
export interface IActivityHistoryDiagnostic {
|
|
19
16
|
codi: string;
|
|
20
17
|
cataleg: string;
|
|
21
|
-
|
|
18
|
+
description: string;
|
|
22
19
|
idEcap: string;
|
|
23
20
|
idCipds: string;
|
|
24
21
|
idCdr: string;
|
|
@@ -6,7 +6,7 @@ describe("DiagnosticCodeSpec", () => {
|
|
|
6
6
|
it("should return true if allowedCodes is empty", () => {
|
|
7
7
|
const spec = new DiagnosticCodeSpec([]);
|
|
8
8
|
const item: IActivityHistoryItem = {
|
|
9
|
-
diagnostics: [{ codi: "E11",
|
|
9
|
+
diagnostics: [{ codi: "E11", description: "Diabetes" }],
|
|
10
10
|
};
|
|
11
11
|
expect(spec.isSatisfiedBy(item)).toBe(true);
|
|
12
12
|
});
|
|
@@ -15,8 +15,8 @@ describe("DiagnosticCodeSpec", () => {
|
|
|
15
15
|
const spec = new DiagnosticCodeSpec(["I10", "E11"]);
|
|
16
16
|
const item: IActivityHistoryItem = {
|
|
17
17
|
diagnostics: [
|
|
18
|
-
{ codi: "Z99",
|
|
19
|
-
{ codi: "E11",
|
|
18
|
+
{ codi: "Z99", description: "No relevante" },
|
|
19
|
+
{ codi: "E11", description: "Diabetes" },
|
|
20
20
|
],
|
|
21
21
|
};
|
|
22
22
|
expect(spec.isSatisfiedBy(item)).toBe(true);
|
|
@@ -26,8 +26,8 @@ describe("DiagnosticCodeSpec", () => {
|
|
|
26
26
|
const spec = new DiagnosticCodeSpec(["J00", "K52"]);
|
|
27
27
|
const item: IActivityHistoryItem = {
|
|
28
28
|
diagnostics: [
|
|
29
|
-
{ codi: "E11",
|
|
30
|
-
{ codi: "I10",
|
|
29
|
+
{ codi: "E11", description: "Diabetes" },
|
|
30
|
+
{ codi: "I10", description: "Hipertensió" },
|
|
31
31
|
],
|
|
32
32
|
};
|
|
33
33
|
expect(spec.isSatisfiedBy(item)).toBe(false);
|
|
@@ -52,7 +52,7 @@ describe("DiagnosticCodeSpec", () => {
|
|
|
52
52
|
it("should be case-sensitive by default (E11 !== e11)", () => {
|
|
53
53
|
const spec = new DiagnosticCodeSpec(["e11"]);
|
|
54
54
|
const item: IActivityHistoryItem = {
|
|
55
|
-
diagnostics: [{ codi: "E11",
|
|
55
|
+
diagnostics: [{ codi: "E11", description: "Diabetes" }],
|
|
56
56
|
};
|
|
57
57
|
expect(spec.isSatisfiedBy(item)).toBe(false);
|
|
58
58
|
});
|
|
@@ -102,4 +102,19 @@ describe("SearchStringSpec", () => {
|
|
|
102
102
|
// Verify the searchPredicate is called with the correct arguments
|
|
103
103
|
expect(spySearchPredicate).toHaveBeenCalledWith(searchString.toLowerCase(), item);
|
|
104
104
|
});
|
|
105
|
+
it("should not throw if some nested properties are null or undefined", () => {
|
|
106
|
+
const partialItem = {
|
|
107
|
+
relevant: true,
|
|
108
|
+
professional: null,
|
|
109
|
+
center: null,
|
|
110
|
+
service: undefined,
|
|
111
|
+
diagnostics: null,
|
|
112
|
+
} as unknown as IActivityHistoryItem;
|
|
113
|
+
|
|
114
|
+
searchString = "test";
|
|
115
|
+
(propContainsString as vi.Mock).mockReturnValue(false);
|
|
116
|
+
const spec = new SearchStringSpec(searchString, searchPredicate);
|
|
117
|
+
|
|
118
|
+
expect(() => spec.isSatisfiedBy(partialItem)).not.toThrow();
|
|
119
|
+
});
|
|
105
120
|
});
|
|
@@ -5,20 +5,14 @@ import { propContainsString } from "../../../utils/prop-contains-string";
|
|
|
5
5
|
const commonFieldsSearchPredicate = (item: IActivityHistoryItem, searchString: string) => {
|
|
6
6
|
const professionalNameContainsSearchString =
|
|
7
7
|
item.professional?.name && propContainsString(item.professional?.name, searchString);
|
|
8
|
-
const centerNameContainsSearchString =
|
|
9
|
-
item.center.description && propContainsString(item.center.description, searchString);
|
|
8
|
+
const centerNameContainsSearchString = item.center?.description && propContainsString(item.center.description, searchString);
|
|
10
9
|
const specialityNameContainsSearchString =
|
|
11
|
-
item.professional?.speciality.description
|
|
12
|
-
propContainsString(item.professional?.speciality.description, searchString);
|
|
10
|
+
item.professional?.speciality?.description && propContainsString(item.professional?.speciality.description, searchString);
|
|
13
11
|
const roleNameContainsSearchString =
|
|
14
|
-
item.professional?.role.description
|
|
15
|
-
|
|
16
|
-
const serviceNameContainsSearchString =
|
|
17
|
-
item.service.description && propContainsString(item.service.description, searchString);
|
|
12
|
+
item.professional?.role?.description && propContainsString(item.professional?.role.description, searchString);
|
|
13
|
+
const serviceNameContainsSearchString = item.service?.description && propContainsString(item.service.description, searchString);
|
|
18
14
|
const diagnosticsMatch = item.diagnostics?.some(
|
|
19
|
-
(diagnostic) =>
|
|
20
|
-
propContainsString(diagnostic.id, searchString) ||
|
|
21
|
-
propContainsString(diagnostic.description, searchString),
|
|
15
|
+
(diagnostic) => propContainsString(diagnostic.id, searchString) || propContainsString(diagnostic.description, searchString),
|
|
22
16
|
);
|
|
23
17
|
return (
|
|
24
18
|
professionalNameContainsSearchString ||
|
|
@@ -48,9 +42,7 @@ export class SearchStringSpec extends Spec<IActivityHistoryItem> {
|
|
|
48
42
|
const matchesCommonFields = commonFieldsSearchPredicate(context, this.searchString);
|
|
49
43
|
|
|
50
44
|
// Verificamos coincidencias con el searchPredicate
|
|
51
|
-
const matchesSearchPredicate = this.searchPredicate
|
|
52
|
-
? this.searchPredicate(this.searchString.toLowerCase(), context)
|
|
53
|
-
: false;
|
|
45
|
+
const matchesSearchPredicate = this.searchPredicate ? this.searchPredicate(this.searchString.toLowerCase(), context) : false;
|
|
54
46
|
|
|
55
47
|
// Aseguramos que siempre se retorne un valor booleano
|
|
56
48
|
return !!(matchesCommonFields || matchesSearchPredicate);
|
|
@@ -4,7 +4,7 @@ import { hasValidDiagnostic, hasValidDiagnostics } from "./has-valid-diagnostics
|
|
|
4
4
|
interface IActivityHistoryDiagnostic {
|
|
5
5
|
codi?: any;
|
|
6
6
|
cataleg?: any;
|
|
7
|
-
|
|
7
|
+
description?: any;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
describe("hasValidDiagnostic", () => {
|
|
@@ -12,7 +12,7 @@ describe("hasValidDiagnostic", () => {
|
|
|
12
12
|
const diag: IActivityHistoryDiagnostic = {
|
|
13
13
|
codi: "A123",
|
|
14
14
|
cataleg: "ICD-10",
|
|
15
|
-
|
|
15
|
+
description: "Dolor lumbar",
|
|
16
16
|
};
|
|
17
17
|
expect(hasValidDiagnostic(diag)).toBe(true);
|
|
18
18
|
});
|
|
@@ -29,7 +29,7 @@ describe("hasValidDiagnostic", () => {
|
|
|
29
29
|
const diag: IActivityHistoryDiagnostic = {
|
|
30
30
|
codi: "B123",
|
|
31
31
|
cataleg: "CIM10",
|
|
32
|
-
//
|
|
32
|
+
// description missing
|
|
33
33
|
};
|
|
34
34
|
expect(hasValidDiagnostic(diag)).toBe(false);
|
|
35
35
|
});
|
|
@@ -38,7 +38,7 @@ describe("hasValidDiagnostic", () => {
|
|
|
38
38
|
const diag: IActivityHistoryDiagnostic = {
|
|
39
39
|
codi: 123,
|
|
40
40
|
cataleg: "ICD",
|
|
41
|
-
|
|
41
|
+
description: "Texto",
|
|
42
42
|
};
|
|
43
43
|
expect(hasValidDiagnostic(diag)).toBe(false);
|
|
44
44
|
});
|
|
@@ -47,8 +47,8 @@ describe("hasValidDiagnostic", () => {
|
|
|
47
47
|
describe("hasValidDiagnostics", () => {
|
|
48
48
|
it("returns true for a valid array of diagnostics", () => {
|
|
49
49
|
const diagnostics = [
|
|
50
|
-
{ codi: "A", cataleg: "X",
|
|
51
|
-
{ codi: "B", cataleg: "Y",
|
|
50
|
+
{ codi: "A", cataleg: "X", description: "D1" },
|
|
51
|
+
{ codi: "B", cataleg: "Y", description: "D2" },
|
|
52
52
|
];
|
|
53
53
|
expect(hasValidDiagnostics(diagnostics)).toBe(true);
|
|
54
54
|
});
|
|
@@ -63,8 +63,8 @@ describe("hasValidDiagnostics", () => {
|
|
|
63
63
|
|
|
64
64
|
it("returns false if not all diagnostics are valid", () => {
|
|
65
65
|
const diagnostics = [
|
|
66
|
-
{ codi: "A", cataleg: "X",
|
|
67
|
-
{ codi: "", cataleg: 42,
|
|
66
|
+
{ codi: "A", cataleg: "X", description: "D1" },
|
|
67
|
+
{ codi: "", cataleg: 42, description: null },
|
|
68
68
|
];
|
|
69
69
|
expect(hasValidDiagnostics(diagnostics)).toBe(false);
|
|
70
70
|
});
|
|
@@ -6,7 +6,7 @@ export const hasValidDiagnostic = (diagnostic: IActivityHistoryDiagnostic) => {
|
|
|
6
6
|
diagnostic !== undefined &&
|
|
7
7
|
typeof diagnostic.codi === "string" &&
|
|
8
8
|
typeof diagnostic.cataleg === "string" &&
|
|
9
|
-
typeof diagnostic.
|
|
9
|
+
typeof diagnostic.description === "string"
|
|
10
10
|
);
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -13,7 +13,7 @@ describe("isValidFullActivityHistoryItem", () => {
|
|
|
13
13
|
role: { id: "role-1", description: "Lead Doctor" },
|
|
14
14
|
},
|
|
15
15
|
relevant: true,
|
|
16
|
-
diagnostics: [{ codi: "diag-1", cataleg: "001",
|
|
16
|
+
diagnostics: [{ codi: "diag-1", cataleg: "001", description: "High Blood Pressure" }],
|
|
17
17
|
center: { id: "center-1", description: "Main Hospital" },
|
|
18
18
|
up: { id: "up-1", description: "Unit A" },
|
|
19
19
|
ep: { id: "ep-1", description: "Emergency Room" },
|
|
@@ -33,7 +33,7 @@ describe("isValidFullActivityHistoryItem", () => {
|
|
|
33
33
|
role: { id: "role-1", description: "Lead Doctor" },
|
|
34
34
|
},
|
|
35
35
|
relevant: true,
|
|
36
|
-
diagnostics: [{ codi: "diag-1", cataleg: "001",
|
|
36
|
+
diagnostics: [{ codi: "diag-1", cataleg: "001", description: "High Blood Pressure" }],
|
|
37
37
|
center: { id: "center-1", description: "Main Hospital" },
|
|
38
38
|
up: { id: "up-1", description: "Unit A" },
|
|
39
39
|
ep: { id: "ep-1", description: "Emergency Room" },
|
|
@@ -53,7 +53,7 @@ describe("isValidFullActivityHistoryItem", () => {
|
|
|
53
53
|
role: { id: "role-1", description: "Lead Doctor" },
|
|
54
54
|
},
|
|
55
55
|
relevant: true,
|
|
56
|
-
diagnostics: [{ codi: "diag-1", cataleg: "001",
|
|
56
|
+
diagnostics: [{ codi: "diag-1", cataleg: "001", description: "High Blood Pressure" }],
|
|
57
57
|
center: { id: "center-1", description: "Main Hospital" },
|
|
58
58
|
up: { id: "up-1", description: "Unit A" },
|
|
59
59
|
ep: { id: "ep-1", description: "Emergency Room" },
|
|
@@ -74,7 +74,7 @@ describe("isValidFullActivityHistoryItem", () => {
|
|
|
74
74
|
role: { id: "role-1", description: "Lead Doctor" },
|
|
75
75
|
},
|
|
76
76
|
relevant: true,
|
|
77
|
-
diagnostics: [{ codi: "diag-1", cataleg: "001",
|
|
77
|
+
diagnostics: [{ codi: "diag-1", cataleg: "001", description: "High Blood Pressure" }],
|
|
78
78
|
center: { id: "center-1", description: "Main Hospital" },
|
|
79
79
|
up: { id: "up-1", description: "Unit A" },
|
|
80
80
|
ep: { id: "ep-1", description: "Emergency Room" },
|
|
@@ -137,7 +137,7 @@ describe("isValidFullActivityHistoryItem", () => {
|
|
|
137
137
|
role: { id: "role-1", description: "Lead Doctor" },
|
|
138
138
|
},
|
|
139
139
|
relevant: true,
|
|
140
|
-
diagnostics: [{ codi: null, cataleg: "001",
|
|
140
|
+
diagnostics: [{ codi: null, cataleg: "001", description: "High Blood Pressure" }],
|
|
141
141
|
center: { id: "center-1", description: "Main Hospital" },
|
|
142
142
|
up: { id: "up-1", description: "Unit A" },
|
|
143
143
|
ep: { id: "ep-1", description: "Emergency Room" },
|
|
@@ -158,7 +158,7 @@ describe("isValidFullActivityHistoryItem", () => {
|
|
|
158
158
|
role: { id: "role-1", description: "Lead Doctor" },
|
|
159
159
|
},
|
|
160
160
|
relevant: "not a boolean", // Should be boolean
|
|
161
|
-
diagnostics: [{ codi: "diag-1", cataleg: "001",
|
|
161
|
+
diagnostics: [{ codi: "diag-1", cataleg: "001", description: "High Blood Pressure" }],
|
|
162
162
|
center: { id: "center-1", description: "Main Hospital" },
|
|
163
163
|
up: { id: "up-1", description: "Unit A" },
|
|
164
164
|
ep: { id: "ep-1", description: "Emergency Room" },
|
|
@@ -178,7 +178,7 @@ describe("isValidFullActivityHistoryItem", () => {
|
|
|
178
178
|
role: { id: "role-1", description: "Lead Doctor" },
|
|
179
179
|
},
|
|
180
180
|
relevant: true,
|
|
181
|
-
diagnostics: [{ codi: "diag-1", cataleg: "001",
|
|
181
|
+
diagnostics: [{ codi: "diag-1", cataleg: "001", description: "High Blood Pressure" }],
|
|
182
182
|
center: { id: "center-1", description: "Main Hospital" },
|
|
183
183
|
up: { id: "up-1", description: "Unit A" },
|
|
184
184
|
ep: { id: "ep-1", description: "Emergency Room" },
|
package/src/internal-plugins/activity-history/activity-history-item/list/UI/main-view/template.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { html } from "lit";
|
|
|
2
2
|
import { ActivityHistoryMain } from "./activity-history-main";
|
|
3
3
|
import { ExportPdf } from "../../../export-to-pdf/request";
|
|
4
4
|
import { translate } from "../../../../localization";
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
export const template = (props: ActivityHistoryMain) =>
|
|
7
7
|
html`<div class="container" ?maximized=${props.maximized}>
|
|
8
8
|
${
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement, PropertyValues, css, html, unsafeCSS } from "lit";
|
|
2
|
-
import { customElement } from "lit/decorators.js";
|
|
2
|
+
import { customElement, query } from "lit/decorators.js";
|
|
3
3
|
import { connectedProperty } from "../../../../infrastructure/state/connected-property";
|
|
4
4
|
import { IActivityHistoryGroup } from "../../../domain/model";
|
|
5
5
|
import { activityHistorySearchStringSelector } from "../../../search/selectors";
|
|
@@ -7,7 +7,12 @@ import { activityHistoryGroupedItems } from "../../../selectors";
|
|
|
7
7
|
import styles from "./styles.css?inline";
|
|
8
8
|
import { template } from "./template";
|
|
9
9
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
isAnyCollectionLoadingWithoutAnyLoaded,
|
|
12
|
+
isSomeCollectionLoadedAndOtherLoading,
|
|
13
|
+
} from "../../../add/handle-busy/selectors";
|
|
14
|
+
import { virtualizerRef } from "@lit-labs/virtualizer/virtualize.js";
|
|
15
|
+
import "@lit-labs/virtualizer";
|
|
11
16
|
|
|
12
17
|
const createZIndexStyles = (max: number) => {
|
|
13
18
|
let styles = "";
|
|
@@ -48,6 +53,8 @@ export class ActivityHistoryTimeline extends LitElement {
|
|
|
48
53
|
@connectedProperty(activityHistorySearchStringSelector)
|
|
49
54
|
searchString: string;
|
|
50
55
|
|
|
56
|
+
@query(".virtualizer") private _virtualizer!: HTMLElement;
|
|
57
|
+
|
|
51
58
|
_hasUpdatedOnce = false;
|
|
52
59
|
|
|
53
60
|
firstUpdated(_changeProps: PropertyValues) {
|
|
@@ -96,20 +103,24 @@ export class ActivityHistoryTimeline extends LitElement {
|
|
|
96
103
|
}
|
|
97
104
|
|
|
98
105
|
_scrollIntoDate(selectedDate: number) {
|
|
99
|
-
let
|
|
106
|
+
let closestIndex = -1;
|
|
100
107
|
let closestDifference = Number.POSITIVE_INFINITY;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const
|
|
108
|
+
|
|
109
|
+
(this.historyGroups ?? []).forEach((group, index) => {
|
|
110
|
+
const dateStr = group.items?.[0]?.date || group.subGroups?.[0]?.items?.[0]?.date;
|
|
111
|
+
if (!dateStr) return;
|
|
112
|
+
|
|
113
|
+
const groupDate = new Date(dateStr).getTime();
|
|
114
|
+
const difference = Math.abs(groupDate - selectedDate);
|
|
104
115
|
|
|
105
116
|
if (difference < closestDifference) {
|
|
106
117
|
closestDifference = difference;
|
|
107
|
-
|
|
118
|
+
closestIndex = index;
|
|
108
119
|
}
|
|
109
120
|
});
|
|
110
121
|
|
|
111
|
-
if (
|
|
112
|
-
|
|
122
|
+
if (closestIndex !== -1 && this._virtualizer) {
|
|
123
|
+
this._virtualizer[virtualizerRef].element(closestIndex).scrollIntoView();
|
|
113
124
|
}
|
|
114
125
|
}
|
|
115
126
|
}
|
package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/styles.css
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
width: calc(100% - var(--dss-spacing-md) - var(--dss-spacing-md));
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: column;
|
|
25
|
-
gap: var(--dss-spacing-
|
|
25
|
+
gap: var(--dss-spacing-sm);
|
|
26
26
|
background-color: white;
|
|
27
27
|
border-radius: var(--dss-radius-sm);
|
|
28
28
|
padding: var(--dss-spacing-sm);
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
.diagnostics {
|
|
71
71
|
display: flex;
|
|
72
72
|
flex-direction: column;
|
|
73
|
-
gap:
|
|
73
|
+
gap: var(--dss-spacing-sm);
|
|
74
74
|
border-bottom: var(--dss-border-width-sm) solid var(--color-neutral-200);
|
|
75
75
|
&:last-of-type {
|
|
76
76
|
border: none;
|
package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/template.ts
CHANGED
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
IActivityHistorySubGroup,
|
|
13
13
|
} from "../../../domain/model";
|
|
14
14
|
import { translate } from "../../../../localization";
|
|
15
|
-
import { virtualize } from "@lit-labs/virtualizer/virtualize.js";
|
|
16
15
|
import { hasItemDivider, shouldShowRole } from "../../../domain/business-rules";
|
|
17
16
|
import {
|
|
18
17
|
ActivityHistoryEntry,
|
|
@@ -24,17 +23,19 @@ export const template = (props: ActivityHistoryTimeline) => {
|
|
|
24
23
|
return html`<div class="container"></div>`;
|
|
25
24
|
}
|
|
26
25
|
return html`
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
<div class="container">
|
|
27
|
+
<activity-history-full-data-error></activity-history-full-data-error>
|
|
28
|
+
<activity-history-partial-data-error></activity-history-partial-data-error>
|
|
29
|
+
|
|
30
|
+
${
|
|
31
|
+
props.historyGroups?.length > 0
|
|
32
|
+
? html`
|
|
33
|
+
<lit-virtualizer class="virtualizer"
|
|
34
|
+
?scroller=${true}
|
|
35
|
+
.items=${props.historyGroups}
|
|
36
|
+
.renderItem=${(itemGroup: IActivityHistoryGroup, index: number) => html`
|
|
37
|
+
<div class="visit zIndex${props.historyGroups.length - index}"
|
|
38
|
+
data-date=${ifDefined(itemGroup?.items[0]?.date || itemGroup.subGroups[0]?.items[0]?.date)}>
|
|
38
39
|
${visitHeaderTemplate(props, itemGroup.items[0] || itemGroup.subGroups[0]?.items[0])}
|
|
39
40
|
<div class="visit__items">
|
|
40
41
|
${repeat(
|
|
@@ -54,48 +55,45 @@ export const template = (props: ActivityHistoryTimeline) => {
|
|
|
54
55
|
}
|
|
55
56
|
const subGroup = entry.subGroup;
|
|
56
57
|
return html`
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
`,
|
|
71
|
-
)}
|
|
72
|
-
</div>
|
|
58
|
+
<div class="diagnostics">
|
|
59
|
+
${diagnosticHeaderTemplate(subGroup.items[0])}
|
|
60
|
+
<div class="diagnostics__items">
|
|
61
|
+
${repeat(
|
|
62
|
+
subGroup.items,
|
|
63
|
+
(item) => item.id,
|
|
64
|
+
(item: IActivityHistoryItemWithComponent) => html`
|
|
65
|
+
<div class="item"
|
|
66
|
+
?has-divider=${hasItemDivider(item, subGroup.items as IActivityHistoryItemWithComponent[])}>
|
|
67
|
+
${item.component}
|
|
68
|
+
</div>
|
|
69
|
+
`,
|
|
70
|
+
)}
|
|
73
71
|
</div>
|
|
74
|
-
|
|
72
|
+
</div>
|
|
73
|
+
`;
|
|
75
74
|
},
|
|
76
75
|
)}
|
|
77
76
|
</div>
|
|
78
77
|
</div>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
78
|
+
`}
|
|
79
|
+
></lit-virtualizer>
|
|
80
|
+
`
|
|
81
|
+
: !props.isAnyCollectionLoadingWithoutAnyLoaded && !props.isSomeCollectionLoadedAndOtherLoading
|
|
82
|
+
? html`
|
|
83
|
+
<dss-user-feedback
|
|
84
|
+
class="feedback"
|
|
85
|
+
imagesrc=${notFound}
|
|
86
|
+
title=${translate("noResults")}>
|
|
87
|
+
</dss-user-feedback>
|
|
88
|
+
`
|
|
89
|
+
: nothing
|
|
90
|
+
}
|
|
91
|
+
</div>
|
|
92
|
+
`;
|
|
91
93
|
};
|
|
92
94
|
|
|
93
|
-
const visitHeaderTemplate = (
|
|
94
|
-
props: ActivityHistoryTimeline,
|
|
95
|
-
item: IActivityHistoryItem | undefined,
|
|
96
|
-
) => {
|
|
95
|
+
const visitHeaderTemplate = (props: ActivityHistoryTimeline, item: IActivityHistoryItem | undefined) => {
|
|
97
96
|
if (!item) return nothing;
|
|
98
|
-
|
|
99
97
|
return html`
|
|
100
98
|
<div class="visit__header">
|
|
101
99
|
<div class="title">
|
|
@@ -143,17 +141,13 @@ const diagnosticHeaderTemplate = (item: IActivityHistoryItem | undefined) =>
|
|
|
143
141
|
item &&
|
|
144
142
|
html`
|
|
145
143
|
<div class="diagnostics__header">
|
|
146
|
-
|
|
147
144
|
${item.diagnostics
|
|
148
145
|
.filter(
|
|
149
|
-
(diagnostic: IActivityHistoryDiagnostic) =>
|
|
150
|
-
diagnostic.descripcio != null && diagnostic.descripcio.trim() !== "",
|
|
146
|
+
(diagnostic: IActivityHistoryDiagnostic) => diagnostic.description != null && diagnostic.description.trim() !== "",
|
|
151
147
|
)
|
|
152
148
|
.map(
|
|
153
149
|
(diagnostic: IActivityHistoryDiagnostic) =>
|
|
154
|
-
html`<dss-badge text=${
|
|
155
|
-
diagnostic.descripcio?.toUpperCase() as string
|
|
156
|
-
} state="info" size="sm" outlined></dss-badge>`,
|
|
150
|
+
html`<dss-badge text=${diagnostic.description?.toUpperCase() as string} state="info" size="sm" outlined></dss-badge>`,
|
|
157
151
|
)}
|
|
158
152
|
</div>
|
|
159
153
|
`;
|
|
@@ -3,7 +3,6 @@ import "../filter/UI/active-filters-header/active-filters-header";
|
|
|
3
3
|
import "../add/handle-error/history-full-data-error/component";
|
|
4
4
|
import "../add/handle-error/history-partial-data-error/component";
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
export const bootstrapListActivityHistoryItems = () => {
|
|
8
7
|
() => null;
|
|
9
|
-
}
|
|
8
|
+
};
|
|
@@ -69,7 +69,7 @@ describe("groupActivityHistoryItems", () => {
|
|
|
69
69
|
{
|
|
70
70
|
codi: "A123",
|
|
71
71
|
cataleg: "ICD-10",
|
|
72
|
-
|
|
72
|
+
description: "Dolor lumbar",
|
|
73
73
|
},
|
|
74
74
|
];
|
|
75
75
|
const items = [
|
|
@@ -90,7 +90,7 @@ describe("groupActivityHistoryItems", () => {
|
|
|
90
90
|
{
|
|
91
91
|
codi: "A123",
|
|
92
92
|
cataleg: "ICD-10",
|
|
93
|
-
|
|
93
|
+
description: "Dolor lumbar",
|
|
94
94
|
},
|
|
95
95
|
];
|
|
96
96
|
const diagnostics2 = [
|
|
@@ -119,7 +119,7 @@ describe("groupActivityHistoryItems", () => {
|
|
|
119
119
|
{
|
|
120
120
|
codi: "A123",
|
|
121
121
|
cataleg: "ICD-10",
|
|
122
|
-
|
|
122
|
+
description: "Dolor lumbar",
|
|
123
123
|
},
|
|
124
124
|
],
|
|
125
125
|
}),
|