@kenyaemr/esm-admin-app 5.4.4-pre.34 → 5.4.4-pre.340
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/.turbo/turbo-build.log +5 -12
- package/dist/100.js +1 -0
- package/dist/100.js.map +1 -0
- package/dist/1074.js +1 -0
- package/dist/1074.js.map +1 -0
- package/dist/1242.js +1 -0
- package/dist/1242.js.map +1 -0
- package/dist/1311.js +1 -0
- package/dist/1311.js.map +1 -0
- package/dist/1442.js +1 -0
- package/dist/1442.js.map +1 -0
- package/dist/1462.js +1 -0
- package/dist/1462.js.map +1 -0
- package/dist/1469.js +1 -0
- package/dist/1469.js.map +1 -0
- package/dist/1506.js +13 -0
- package/dist/1506.js.map +1 -0
- package/dist/1718.js +1 -0
- package/dist/1718.js.map +1 -0
- package/dist/1722.js +1 -0
- package/dist/1722.js.map +1 -0
- package/dist/1772.js +1 -0
- package/dist/1772.js.map +1 -0
- package/dist/1889.js +1 -0
- package/dist/1889.js.map +1 -0
- package/dist/1972.js +1 -0
- package/dist/1972.js.map +1 -0
- package/dist/1990.js +1 -0
- package/dist/1990.js.map +1 -0
- package/dist/2016.js +1 -0
- package/dist/2016.js.map +1 -0
- package/dist/2080.js +1 -0
- package/dist/2080.js.map +1 -0
- package/dist/2096.js +1 -0
- package/dist/2096.js.map +1 -0
- package/dist/2153.js +1 -0
- package/dist/2153.js.map +1 -0
- package/dist/216.js +1 -0
- package/dist/216.js.map +1 -0
- package/dist/2270.js +1 -0
- package/dist/2270.js.map +1 -0
- package/dist/2294.js +1 -0
- package/dist/2294.js.map +1 -0
- package/dist/2345.js +1 -0
- package/dist/2345.js.map +1 -0
- package/dist/2467.js +1 -0
- package/dist/2467.js.map +1 -0
- package/dist/2500.js +1 -0
- package/dist/2500.js.map +1 -0
- package/dist/251.js +1 -0
- package/dist/251.js.map +1 -0
- package/dist/257.js +1 -0
- package/dist/257.js.map +1 -0
- package/dist/2586.js +1 -0
- package/dist/2586.js.map +1 -0
- package/dist/2625.js +1 -0
- package/dist/2625.js.map +1 -0
- package/dist/2652.js +1 -0
- package/dist/2652.js.map +1 -0
- package/dist/2685.js +1 -0
- package/dist/2685.js.map +1 -0
- package/dist/2948.js +1 -0
- package/dist/2948.js.map +1 -0
- package/dist/3089.js +1 -0
- package/dist/3089.js.map +1 -0
- package/dist/3190.js +1 -0
- package/dist/3190.js.map +1 -0
- package/dist/3224.js +1 -0
- package/dist/3224.js.map +1 -0
- package/dist/3380.js +1 -0
- package/dist/3380.js.map +1 -0
- package/dist/3548.js +1 -0
- package/dist/3548.js.map +1 -0
- package/dist/3571.js +1 -0
- package/dist/3571.js.map +1 -0
- package/dist/3691.js +1 -0
- package/dist/3691.js.map +1 -0
- package/dist/3775.js +1 -0
- package/dist/3775.js.map +1 -0
- package/dist/3816.js +1 -0
- package/dist/3816.js.map +1 -0
- package/dist/3906.js +1 -0
- package/dist/3906.js.map +1 -0
- package/dist/3963.js +1 -0
- package/dist/3963.js.map +1 -0
- package/dist/405.js +1 -0
- package/dist/405.js.map +1 -0
- package/dist/4296.js +1 -0
- package/dist/4296.js.map +1 -0
- package/dist/4337.js +1 -0
- package/dist/4337.js.map +1 -0
- package/dist/4584.js +1 -0
- package/dist/4584.js.map +1 -0
- package/dist/4687.js +1 -0
- package/dist/4687.js.map +1 -0
- package/dist/4735.js +1 -0
- package/dist/4735.js.map +1 -0
- package/dist/4744.js +1 -0
- package/dist/4744.js.map +1 -0
- package/dist/4813.js +2 -0
- package/dist/4813.js.map +1 -0
- package/dist/4858.js +1 -0
- package/dist/4858.js.map +1 -0
- package/dist/487.js +1 -0
- package/dist/487.js.map +1 -0
- package/dist/4970.js +1 -0
- package/dist/4970.js.map +1 -0
- package/dist/5202.js +1 -0
- package/dist/5202.js.map +1 -0
- package/dist/5294.js +1 -0
- package/dist/5294.js.map +1 -0
- package/dist/5297.js +1 -0
- package/dist/5297.js.map +1 -0
- package/dist/545.js +1 -0
- package/dist/545.js.map +1 -0
- package/dist/5592.js +1 -0
- package/dist/5592.js.map +1 -0
- package/dist/5669.js +1 -0
- package/dist/5669.js.map +1 -0
- package/dist/5884.js +1 -0
- package/dist/5884.js.map +1 -0
- package/dist/5910.js +1 -0
- package/dist/5910.js.map +1 -0
- package/dist/5940.js +1 -0
- package/dist/5940.js.map +1 -0
- package/dist/6155.js +1 -0
- package/dist/6155.js.map +1 -0
- package/dist/6178.js +1 -0
- package/dist/6178.js.map +1 -0
- package/dist/6253.js +1 -0
- package/dist/6253.js.map +1 -0
- package/dist/6455.js +1 -0
- package/dist/6455.js.map +1 -0
- package/dist/6456.js +1 -0
- package/dist/6466.js +3 -0
- package/dist/6466.js.map +1 -0
- package/dist/6492.js +1 -0
- package/dist/6492.js.map +1 -0
- package/dist/6800.js +1 -0
- package/dist/6800.js.map +1 -0
- package/dist/6925.js +1 -0
- package/dist/6925.js.map +1 -0
- package/dist/7005.js +1 -0
- package/dist/7005.js.map +1 -0
- package/dist/7201.js +1 -0
- package/dist/7201.js.map +1 -0
- package/dist/7210.js +1 -0
- package/dist/7210.js.map +1 -0
- package/dist/7234.js +1 -0
- package/dist/7234.js.map +1 -0
- package/dist/7261.js +1 -0
- package/dist/7261.js.map +1 -0
- package/dist/7326.js +1 -0
- package/dist/7463.js +1 -0
- package/dist/7463.js.map +1 -0
- package/dist/7528.js +1 -0
- package/dist/7528.js.map +1 -0
- package/dist/7607.js +1 -0
- package/dist/7717.js +1 -0
- package/dist/7717.js.map +1 -0
- package/dist/7737.js +1 -0
- package/dist/7737.js.map +1 -0
- package/dist/7739.js +1 -0
- package/dist/7739.js.map +1 -0
- package/dist/7765.js +1 -0
- package/dist/7765.js.map +1 -0
- package/dist/7820.js +1 -0
- package/dist/7820.js.map +1 -0
- package/dist/7844.js +1 -0
- package/dist/7844.js.map +1 -0
- package/dist/7866.js +1 -0
- package/dist/7866.js.map +1 -0
- package/dist/7971.js +1 -0
- package/dist/7971.js.map +1 -0
- package/dist/8159.js +7 -0
- package/dist/8159.js.map +1 -0
- package/dist/8206.js +1 -0
- package/dist/8206.js.map +1 -0
- package/dist/8244.js +1 -0
- package/dist/8244.js.map +1 -0
- package/dist/8262.js +1 -0
- package/dist/8262.js.map +1 -0
- package/dist/8376.js +1 -0
- package/dist/8376.js.map +1 -0
- package/dist/845.js +1 -0
- package/dist/845.js.map +1 -0
- package/dist/846.js +17 -0
- package/dist/846.js.map +1 -0
- package/dist/8487.js +1 -0
- package/dist/8487.js.map +1 -0
- package/dist/8528.js +1 -0
- package/dist/8528.js.map +1 -0
- package/dist/8570.js +1 -0
- package/dist/8570.js.map +1 -0
- package/dist/87.js +1 -0
- package/dist/87.js.map +1 -0
- package/dist/8727.js +1 -0
- package/dist/8828.js +1 -0
- package/dist/8828.js.map +1 -0
- package/dist/8860.js +1 -0
- package/dist/8860.js.map +1 -0
- package/dist/9036.js +1 -0
- package/dist/9036.js.map +1 -0
- package/dist/9124.js +1 -0
- package/dist/9124.js.map +1 -0
- package/dist/9182.js +1 -0
- package/dist/921.js +1 -0
- package/dist/921.js.map +1 -0
- package/dist/9404.js +1 -0
- package/dist/9404.js.map +1 -0
- package/dist/9446.js +1 -0
- package/dist/9446.js.map +1 -0
- package/dist/9449.js +1 -0
- package/dist/9449.js.map +1 -0
- package/dist/9566.js +5 -0
- package/dist/9566.js.map +1 -0
- package/dist/9585.js +1 -0
- package/dist/9585.js.map +1 -0
- package/dist/9641.js +1 -0
- package/dist/9641.js.map +1 -0
- package/dist/9647.js +1 -0
- package/dist/9647.js.map +1 -0
- package/dist/9801.js +1 -0
- package/dist/9801.js.map +1 -0
- package/dist/9835.js +11 -0
- package/dist/9835.js.map +1 -0
- package/dist/kenyaemr-esm-admin-app.js +5 -5
- package/dist/kenyaemr-esm-admin-app.js.buildmanifest.json +2672 -154
- package/dist/kenyaemr-esm-admin-app.js.map +1 -1
- package/dist/main.js +5 -31
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +5 -7
- package/rspack.config.js +1 -1
- package/src/components/confirm-modal/confirmation-operation.test.tsx +8 -19
- package/src/components/dashboard/dashboard.component.tsx +4 -1
- package/src/components/empty-state/empty-state-log.test.tsx +3 -4
- package/src/components/facility-setup/constant/index.ts +3 -0
- package/src/components/facility-setup/facility-info.component.tsx +247 -108
- package/src/components/facility-setup/facility-info.scss +136 -55
- package/src/components/facility-setup/facility-setup.component.tsx +2 -2
- package/src/components/facility-setup/header/header.component.tsx +4 -10
- package/src/components/facility-setup/header/header.scss +3 -9
- package/src/components/facility-setup/shared/custom-info.component.tsx +9 -0
- package/src/components/facility-setup/shared/custom-section-card.component.tsx +10 -0
- package/src/components/facility-setup/shared/custom-status-tag.component.tsx +22 -0
- package/src/components/facility-setup/type/index.ts +61 -0
- package/src/components/facility-setup/useFacilityRegistry.ts +29 -0
- package/src/components/global-property/dashboard/global-property-dashboard.component.tsx +23 -0
- package/src/components/global-property/dashboard/global-property-dashboard.scss +6 -0
- package/src/components/global-property/hooks/useGlobalProperty.ts +64 -0
- package/src/components/global-property/index.ts +14 -0
- package/src/components/global-property/modal/delete-global-property-modal.component.tsx +71 -0
- package/src/components/global-property/modal/delete-global-property-modal.test.tsx +131 -0
- package/src/components/global-property/table/global-property-table.component.tsx +249 -0
- package/src/components/global-property/table/global-property-table.scss +34 -0
- package/src/components/global-property/table/global-property-table.test.tsx +198 -0
- package/src/components/global-property/workspace/global-property-form-schema.ts +32 -0
- package/src/components/global-property/workspace/global-property.workspace.scss +40 -0
- package/src/components/global-property/workspace/global-property.workspace.test.tsx +172 -0
- package/src/components/global-property/workspace/global-property.workspace.tsx +260 -0
- package/src/components/hook/healthWorkerRegistry.ts +78 -0
- package/src/components/hook/useProfessionalRegistryEnums.ts +59 -0
- package/src/components/locations/forms/add-location/add-location.workspace.tsx +96 -95
- package/src/components/locations/forms/search-location/search-location.workspace.tsx +90 -85
- package/src/components/locations/tables/locations-table.component.tsx +117 -121
- package/src/components/logs-table/operation-log-table.component.tsx +87 -75
- package/src/components/logs-table/operation-log.test.tsx +134 -28
- package/src/components/modal/hwr-confirmation.modal.scss +80 -4
- package/src/components/modal/hwr-confirmation.modal.tsx +118 -128
- package/src/components/modal/hwr-sync.modal.tsx +194 -106
- package/src/components/users/manage-users/manage-user-role-scope/user-role-scope-workspace/user-role-scope.workspace.tsx +13 -13
- package/src/components/users/manage-users/user-details/user-detail.scss +167 -39
- package/src/components/users/manage-users/user-details/user-details.component.tsx +130 -122
- package/src/components/users/manage-users/user-list/user-list.component.tsx +22 -9
- package/src/components/users/manage-users/user-management.workspace.scss +233 -95
- package/src/components/users/manage-users/user-management.workspace.tsx +800 -687
- package/src/components/users/userManagementFormSchema.tsx +17 -8
- package/src/config-schema.ts +48 -68
- package/src/index.ts +64 -31
- package/src/left-pannel-link.component.tsx +5 -3
- package/src/root.component.tsx +13 -13
- package/src/routes.json +57 -38
- package/src/types/index.ts +40 -3
- package/translations/am.json +196 -13
- package/translations/en.json +207 -24
- package/translations/fr.json +243 -58
- package/translations/sw.json +312 -129
- package/tsconfig.json +1 -1
- package/dist/127.js +0 -1
- package/dist/267.js +0 -1
- package/dist/267.js.map +0 -1
- package/dist/281.js +0 -15
- package/dist/281.js.map +0 -1
- package/dist/329.js +0 -1
- package/dist/329.js.map +0 -1
- package/dist/40.js +0 -1
- package/dist/466.js +0 -1
- package/dist/466.js.map +0 -1
- package/dist/472.js +0 -1
- package/dist/472.js.map +0 -1
- package/dist/478.js +0 -1
- package/dist/478.js.map +0 -1
- package/dist/585.js +0 -1
- package/dist/585.js.map +0 -1
- package/dist/630.js +0 -1
- package/dist/630.js.map +0 -1
- package/dist/675.js +0 -1
- package/dist/675.js.map +0 -1
- package/dist/689.js +0 -1
- package/dist/689.js.map +0 -1
- package/dist/706.js +0 -27
- package/dist/706.js.map +0 -1
- package/dist/729.js +0 -17
- package/dist/729.js.map +0 -1
- package/dist/774.js +0 -1
- package/dist/774.js.map +0 -1
- package/dist/847.js +0 -1
- package/dist/847.js.map +0 -1
- package/dist/85.js +0 -1
- package/dist/85.js.map +0 -1
- package/dist/882.js +0 -1
- package/dist/91.js +0 -1
- package/dist/91.js.map +0 -1
- package/dist/916.js +0 -1
- package/dist/998.js +0 -1
- package/dist/998.js.map +0 -1
- package/jest.config.js +0 -8
- package/src/components/facility-setup/card.component.tsx +0 -16
- package/src/components/facility-setup/facility-setup.resource.tsx +0 -7
- package/src/components/hook/healthWorkerAdapter.ts +0 -213
- package/src/components/hook/useFacilityInfo.tsx +0 -37
|
@@ -1,75 +1,203 @@
|
|
|
1
|
+
@use '@carbon/colors';
|
|
1
2
|
@use '@carbon/layout';
|
|
2
3
|
@use '@carbon/type';
|
|
3
|
-
@use '@carbon/colors';
|
|
4
4
|
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
5
5
|
|
|
6
|
-
.
|
|
7
|
-
|
|
8
|
-
color: colors.$gray-
|
|
9
|
-
|
|
10
|
-
margin-left: layout.$spacing-04;
|
|
11
|
-
margin-right: layout.$spacing-01;
|
|
12
|
-
}
|
|
13
|
-
.middot {
|
|
14
|
-
margin: 0 layout.$spacing-01;
|
|
15
|
-
}
|
|
16
|
-
.spanField {
|
|
17
|
-
margin-left: layout.$spacing-04;
|
|
18
|
-
margin-right: layout.$spacing-01;
|
|
6
|
+
.providerDetailsContainer {
|
|
7
|
+
width: 100%;
|
|
8
|
+
background-color: colors.$gray-10;
|
|
9
|
+
padding: layout.$spacing-04;
|
|
19
10
|
}
|
|
20
11
|
|
|
21
|
-
.
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
color: colors.$gray-70;
|
|
25
|
-
gap: layout.$spacing-01;
|
|
26
|
-
margin-left: layout.$spacing-02;
|
|
27
|
-
}
|
|
28
|
-
.statusTag {
|
|
12
|
+
.patientBanner {
|
|
29
13
|
display: flex;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
gap: layout.$spacing-05;
|
|
15
|
+
padding: layout.$spacing-05 layout.$spacing-06;
|
|
16
|
+
background-color: colors.$white;
|
|
17
|
+
border-radius: 6px;
|
|
18
|
+
border: 1px solid colors.$gray-20;
|
|
34
19
|
}
|
|
35
|
-
|
|
20
|
+
|
|
21
|
+
.patientAvatar {
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
width: 4rem;
|
|
24
|
+
height: 4rem;
|
|
36
25
|
display: flex;
|
|
37
26
|
align-items: center;
|
|
38
|
-
|
|
39
|
-
color:
|
|
40
|
-
|
|
27
|
+
justify-content: center;
|
|
28
|
+
background-color: colors.$gray-10;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
|
|
31
|
+
:global(img) {
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: 100%;
|
|
34
|
+
object-fit: cover;
|
|
35
|
+
}
|
|
41
36
|
}
|
|
42
37
|
|
|
43
|
-
.
|
|
38
|
+
.patientInfo {
|
|
44
39
|
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
flex: 1;
|
|
42
|
+
min-width: 0;
|
|
43
|
+
gap: layout.$spacing-04;
|
|
45
44
|
}
|
|
46
45
|
|
|
47
|
-
.
|
|
46
|
+
.row {
|
|
48
47
|
display: flex;
|
|
49
48
|
flex-direction: column;
|
|
50
|
-
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.patientNameRow {
|
|
52
|
+
align-items: flex-start;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
.flexRow {
|
|
54
56
|
display: flex;
|
|
55
57
|
flex-flow: row wrap;
|
|
56
58
|
align-items: center;
|
|
57
|
-
|
|
59
|
+
gap: layout.$spacing-03;
|
|
60
|
+
row-gap: layout.$spacing-02;
|
|
58
61
|
}
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
|
|
63
|
+
.tagRow {
|
|
64
|
+
display: inline-flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
flex-wrap: wrap;
|
|
67
|
+
gap: layout.$spacing-02;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.patientName {
|
|
71
|
+
@include type.type-style('heading-03');
|
|
72
|
+
color: colors.$gray-100;
|
|
73
|
+
font-weight: 600;
|
|
74
|
+
margin: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.gender {
|
|
78
|
+
@include type.type-style('body-01');
|
|
79
|
+
color: colors.$gray-70;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.statusTag {
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.puidBadge {
|
|
88
|
+
@include type.type-style('label-02');
|
|
89
|
+
display: inline-block;
|
|
90
|
+
background-color: colors.$gray-10;
|
|
91
|
+
color: colors.$gray-90;
|
|
92
|
+
padding: layout.$spacing-02 layout.$spacing-03;
|
|
93
|
+
border-radius: 4px;
|
|
94
|
+
border: 1px solid colors.$gray-20;
|
|
95
|
+
align-self: flex-start;
|
|
96
|
+
|
|
97
|
+
strong {
|
|
98
|
+
color: colors.$gray-100;
|
|
99
|
+
font-weight: 600;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.spanField {
|
|
104
|
+
@include type.type-style('body-01');
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
gap: layout.$spacing-01;
|
|
108
|
+
color: colors.$gray-90;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.fieldLabel {
|
|
112
|
+
color: colors.$gray-70;
|
|
113
|
+
font-weight: 400;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.fieldValue {
|
|
117
|
+
color: colors.$gray-100;
|
|
118
|
+
font-weight: 500;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.middot {
|
|
122
|
+
color: colors.$gray-50;
|
|
123
|
+
user-select: none;
|
|
61
124
|
}
|
|
125
|
+
|
|
126
|
+
.demographics {
|
|
127
|
+
display: flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
margin-bottom: layout.$spacing-02;
|
|
130
|
+
color: $text-02;
|
|
131
|
+
text-transform: uppercase;
|
|
132
|
+
}
|
|
133
|
+
|
|
62
134
|
.viewRoles {
|
|
63
|
-
margin-top: layout.$spacing-
|
|
135
|
+
margin-top: layout.$spacing-04;
|
|
136
|
+
padding-top: layout.$spacing-04;
|
|
137
|
+
border-top: 1px solid colors.$gray-20;
|
|
138
|
+
|
|
139
|
+
:global(.cds--accordion) {
|
|
140
|
+
border-top: none;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:global(.cds--accordion__heading) {
|
|
144
|
+
@include type.type-style('label-02');
|
|
145
|
+
padding: layout.$spacing-03 0;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:global(.cds--accordion__title) {
|
|
149
|
+
color: colors.$gray-100;
|
|
150
|
+
font-weight: 600;
|
|
151
|
+
}
|
|
64
152
|
}
|
|
153
|
+
|
|
65
154
|
.roleContainer {
|
|
66
155
|
display: flex;
|
|
67
156
|
flex-direction: column;
|
|
68
|
-
gap:
|
|
157
|
+
gap: layout.$spacing-02;
|
|
158
|
+
padding: layout.$spacing-03 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.roleName {
|
|
162
|
+
color: colors.$gray-100;
|
|
163
|
+
font-weight: 600;
|
|
69
164
|
}
|
|
70
165
|
|
|
71
166
|
.roleDescription {
|
|
167
|
+
@include type.type-style('body-01');
|
|
72
168
|
margin: 0;
|
|
73
169
|
color: colors.$gray-70;
|
|
74
|
-
font-size:
|
|
170
|
+
font-size: 0.875rem;
|
|
171
|
+
line-height: 1.4;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@media (max-width: 768px) {
|
|
175
|
+
.patientBanner {
|
|
176
|
+
flex-direction: column;
|
|
177
|
+
gap: layout.$spacing-04;
|
|
178
|
+
padding: layout.$spacing-04;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.patientAvatar {
|
|
182
|
+
width: 3rem;
|
|
183
|
+
height: 3rem;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.patientName {
|
|
187
|
+
@include type.type-style('heading-02');
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.flexRow {
|
|
191
|
+
flex-direction: column;
|
|
192
|
+
align-items: flex-start;
|
|
193
|
+
gap: layout.$spacing-02;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.middot {
|
|
197
|
+
display: none;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.spanField {
|
|
201
|
+
width: 100%;
|
|
202
|
+
}
|
|
75
203
|
}
|
|
@@ -1,176 +1,184 @@
|
|
|
1
|
-
import React, { useRef } from 'react';
|
|
2
|
-
import styles from './user-detail.scss';
|
|
1
|
+
import React, { useMemo, useRef } from 'react';
|
|
3
2
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { Tag, Accordion, AccordionItem,
|
|
5
|
-
import { PatientPhoto } from '@openmrs/esm-framework';
|
|
3
|
+
import { Tag, Accordion, AccordionItem, ContainedListItem } from '@carbon/react';
|
|
4
|
+
import { PatientPhoto, useConfig } from '@openmrs/esm-framework';
|
|
6
5
|
import dayjs from 'dayjs';
|
|
7
6
|
import classNames from 'classnames';
|
|
8
7
|
import capitalize from 'lodash/capitalize';
|
|
8
|
+
|
|
9
|
+
import styles from './user-detail.scss';
|
|
9
10
|
import { type ProviderResponse, type UserResponse } from '../../../../types';
|
|
11
|
+
import { type ConfigObject } from '../../../../config-schema';
|
|
10
12
|
|
|
11
13
|
interface UserDetailsProps {
|
|
12
14
|
provider: ProviderResponse;
|
|
13
15
|
user: UserResponse;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
|
-
interface ProviderAttribute {
|
|
17
|
-
value: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface ProviderAttributes {
|
|
21
|
-
licenseAttr?: ProviderAttribute;
|
|
22
|
-
nationalID?: ProviderAttribute;
|
|
23
|
-
dateAttr?: ProviderAttribute;
|
|
24
|
-
phoneNumber?: ProviderAttribute;
|
|
25
|
-
qualification?: ProviderAttribute;
|
|
26
|
-
registrationNumber?: ProviderAttribute;
|
|
27
|
-
emailAddress?: ProviderAttribute;
|
|
28
|
-
passportNumber: ProviderAttribute;
|
|
29
|
-
providerUniqueIdentifier: ProviderAttribute;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
18
|
const UserDetails: React.FC<UserDetailsProps> = ({ provider, user }) => {
|
|
33
19
|
const { t } = useTranslation();
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
const attributeMap = {
|
|
37
|
-
licenseAttr: 'Practising License Number',
|
|
38
|
-
nationalID: 'Provider National Id Number',
|
|
39
|
-
dateAttr: 'License Expiry Date',
|
|
40
|
-
phoneNumber: 'Provider Telephone',
|
|
41
|
-
qualification: 'Provider Qualification',
|
|
42
|
-
registrationNumber: 'License Body',
|
|
43
|
-
emailAddress: 'Provider Address',
|
|
44
|
-
passportNumber: 'Provider passport number',
|
|
45
|
-
providerUniqueIdentifier: 'Provider unique identifier',
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const attributes: ProviderAttributes = Object.entries(attributeMap).reduce((acc, [key, display]) => {
|
|
49
|
-
const attr = provider?.attributes?.find((attr) => attr.attributeType.display === display);
|
|
50
|
-
if (attr) {
|
|
51
|
-
acc[key as keyof ProviderAttributes] = { value: attr.value };
|
|
52
|
-
}
|
|
53
|
-
return acc;
|
|
54
|
-
}, {} as ProviderAttributes);
|
|
20
|
+
const bannerRef = useRef<HTMLElement>(null);
|
|
55
21
|
|
|
56
22
|
const {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
23
|
+
licenseNumberUuid,
|
|
24
|
+
licenseExpiryDateUuid,
|
|
25
|
+
licenseBodyUuid,
|
|
26
|
+
qualificationUuid,
|
|
27
|
+
specialtyUuid,
|
|
28
|
+
providerCadreUuid,
|
|
29
|
+
practiceTypeUuid,
|
|
30
|
+
providerNationalIdUuid,
|
|
31
|
+
passportNumberUuid,
|
|
32
|
+
providerUniqueIdentifierAttributeTypeUuid,
|
|
33
|
+
externalProviderIdentifierUuid,
|
|
34
|
+
phoneNumberUuid,
|
|
35
|
+
providerAddressUuid,
|
|
36
|
+
} = useConfig<ConfigObject>();
|
|
37
|
+
|
|
38
|
+
const attrByUuid = useMemo(() => {
|
|
39
|
+
const map: Record<string, string> = {};
|
|
40
|
+
provider?.attributes?.forEach((a) => {
|
|
41
|
+
const uuid = a?.attributeType?.uuid;
|
|
42
|
+
if (uuid && a.value != null) {
|
|
43
|
+
map[uuid] = typeof a.value === 'string' ? a.value : String(a.value);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return map;
|
|
47
|
+
}, [provider]);
|
|
48
|
+
|
|
49
|
+
const licenseNumber = attrByUuid[licenseNumberUuid];
|
|
50
|
+
const licenseExpiryRaw = attrByUuid[licenseExpiryDateUuid];
|
|
51
|
+
const licenseBody = attrByUuid[licenseBodyUuid];
|
|
52
|
+
const qualification = attrByUuid[qualificationUuid];
|
|
53
|
+
const specialty = attrByUuid[specialtyUuid];
|
|
54
|
+
const providerCadre = attrByUuid[providerCadreUuid];
|
|
55
|
+
const practiceType = attrByUuid[practiceTypeUuid];
|
|
56
|
+
const nationalId = attrByUuid[providerNationalIdUuid];
|
|
57
|
+
const passportNumber = attrByUuid[passportNumberUuid];
|
|
58
|
+
const providerUniqueIdentifier = attrByUuid[providerUniqueIdentifierAttributeTypeUuid];
|
|
59
|
+
const externalProviderIdentifier = attrByUuid[externalProviderIdentifierUuid];
|
|
60
|
+
const phoneNumber = attrByUuid[phoneNumberUuid];
|
|
61
|
+
const emailAddress = attrByUuid[providerAddressUuid];
|
|
62
|
+
|
|
69
63
|
const today = dayjs();
|
|
70
|
-
const expiryDate =
|
|
64
|
+
const expiryDate = licenseExpiryRaw ? dayjs(licenseExpiryRaw) : null;
|
|
71
65
|
const daysUntilExpiry = expiryDate ? expiryDate.diff(today, 'day') : null;
|
|
66
|
+
const formattedExpiryDate = expiryDate?.isValid() ? expiryDate.format('YYYY-MM-DD') : null;
|
|
72
67
|
|
|
73
68
|
const getLicenseStatusTag = () => {
|
|
74
|
-
if (!
|
|
69
|
+
if (!licenseNumber) {
|
|
75
70
|
return <Tag type="red">{t('unlicensed', 'Unlicensed')}</Tag>;
|
|
76
71
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<>
|
|
83
|
-
<Tag type="cyan">{t('licenseExpiringSoon', 'License is expiring soon')}</Tag>
|
|
84
|
-
</>
|
|
85
|
-
);
|
|
86
|
-
} else {
|
|
87
|
-
return <Tag type="green">{t('active', 'Active')}</Tag>;
|
|
72
|
+
if (daysUntilExpiry !== null && daysUntilExpiry < 0) {
|
|
73
|
+
return <Tag type="red">{t('licenseExpired', 'License expired')}</Tag>;
|
|
74
|
+
}
|
|
75
|
+
if (daysUntilExpiry !== null && daysUntilExpiry <= 3) {
|
|
76
|
+
return <Tag type="warm-gray">{t('licenseExpiringSoon', 'License expiring soon')}</Tag>;
|
|
88
77
|
}
|
|
78
|
+
return <Tag type="green">{t('active', 'Active')}</Tag>;
|
|
89
79
|
};
|
|
90
80
|
|
|
81
|
+
const genderLabel =
|
|
82
|
+
provider?.person?.gender === 'M'
|
|
83
|
+
? t('male', 'Male')
|
|
84
|
+
: provider?.person?.gender === 'F'
|
|
85
|
+
? t('female', 'Female')
|
|
86
|
+
: '';
|
|
87
|
+
|
|
88
|
+
const Field = ({ label, value }: { label: string; value?: string | null }) => (
|
|
89
|
+
<span className={styles.spanField}>
|
|
90
|
+
<span className={styles.fieldLabel}>{label}:</span> <span className={styles.fieldValue}>{value || '--'}</span>
|
|
91
|
+
</span>
|
|
92
|
+
);
|
|
93
|
+
|
|
91
94
|
return (
|
|
92
95
|
<div className={styles.providerDetailsContainer}>
|
|
93
|
-
<header aria-label=
|
|
96
|
+
<header aria-label={t('providerBanner', 'Provider banner')} role="banner" ref={bannerRef}>
|
|
94
97
|
<div className={styles.patientBanner}>
|
|
95
98
|
<div className={styles.patientAvatar} role="img">
|
|
96
99
|
<PatientPhoto patientUuid={provider?.uuid} patientName={provider?.person?.display} />
|
|
97
100
|
</div>
|
|
101
|
+
|
|
98
102
|
<div className={styles.patientInfo}>
|
|
99
103
|
<div className={classNames(styles.row, styles.patientNameRow)}>
|
|
100
104
|
<div className={styles.flexRow}>
|
|
101
|
-
<span className={styles.patientName}>{provider?.person?.display}
|
|
102
|
-
<span className={styles.gender}>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
{
|
|
109
|
-
</span>
|
|
110
|
-
<span className={styles.statusTag}>
|
|
111
|
-
{providerUniqueIdentifier?.value && (
|
|
112
|
-
<Tag type="cyan">{capitalize(providerUniqueIdentifier?.value)}</Tag>
|
|
113
|
-
)}
|
|
105
|
+
<span className={styles.patientName}>{provider?.person?.display}</span>
|
|
106
|
+
{genderLabel && <span className={styles.gender}>{genderLabel}</span>}
|
|
107
|
+
|
|
108
|
+
<span className={styles.tagRow}>
|
|
109
|
+
{getLicenseStatusTag()}
|
|
110
|
+
{qualification && <Tag type="cyan">{capitalize(qualification)}</Tag>}
|
|
111
|
+
{specialty && <Tag type="purple">{capitalize(specialty)}</Tag>}
|
|
112
|
+
{providerCadre && <Tag type="teal">{capitalize(providerCadre)}</Tag>}
|
|
114
113
|
</span>
|
|
115
114
|
</div>
|
|
116
115
|
</div>
|
|
117
|
-
|
|
118
|
-
<div className={classNames(styles.row, styles.patientNameRow)}>
|
|
116
|
+
<div className={styles.row}>
|
|
119
117
|
<div className={styles.flexRow}>
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
<span className={styles.middot}>· </span>
|
|
124
|
-
|
|
125
|
-
<span className={styles.spanField}>
|
|
126
|
-
{t('emailAddress', 'Email address')}: {emailAddress?.value ? emailAddress.value : '--'}
|
|
127
|
-
</span>
|
|
118
|
+
<Field label={t('phoneNumber', 'Phone')} value={phoneNumber} />
|
|
119
|
+
<span className={styles.middot}>·</span>
|
|
120
|
+
<Field label={t('emailAddress', 'Email')} value={emailAddress} />
|
|
128
121
|
</div>
|
|
129
122
|
</div>
|
|
130
|
-
<div className={classNames(styles.row, styles.patientNameRow)}>
|
|
131
|
-
<div className={styles.flexRow}>
|
|
132
|
-
<span className={styles.spanField}>
|
|
133
|
-
{t('nationalId', 'National ID')}: {nationalID?.value ? nationalID.value : '--'}
|
|
134
|
-
</span>
|
|
135
|
-
<span className={styles.middot}>· </span>
|
|
136
123
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
<span className={styles.middot}
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
<
|
|
146
|
-
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
<span className={styles.middot}>· </span>
|
|
124
|
+
<div className={styles.row}>
|
|
125
|
+
<div className={styles.flexRow}>
|
|
126
|
+
<Field label={t('nationalId', 'National ID')} value={nationalId} />
|
|
127
|
+
<span className={styles.middot}>·</span>
|
|
128
|
+
<Field label={t('passportNumber', 'Passport')} value={passportNumber} />
|
|
129
|
+
<span className={styles.middot}>·</span>
|
|
130
|
+
<Field label={t('licenseNumber', 'License #')} value={licenseNumber} />
|
|
131
|
+
<span className={styles.middot}>·</span>
|
|
132
|
+
<Field label={t('licenseBody', 'License body')} value={licenseBody} />
|
|
133
|
+
<span className={styles.middot}>·</span>
|
|
134
|
+
<Field label={t('licenseExpiryDate', 'License expiry')} value={formattedExpiryDate} />
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
151
137
|
|
|
152
|
-
|
|
153
|
-
|
|
138
|
+
{/* Practice row */}
|
|
139
|
+
{practiceType && (
|
|
140
|
+
<div className={styles.row}>
|
|
141
|
+
<div className={styles.flexRow}>
|
|
142
|
+
<Field label={t('practiceType', 'Practice')} value={practiceType} />
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
)}
|
|
146
|
+
{providerUniqueIdentifier && (
|
|
147
|
+
<div className={styles.row}>
|
|
148
|
+
<span className={styles.puidBadge}>
|
|
149
|
+
{t('puid', 'PUID')}: <strong>{providerUniqueIdentifier}</strong>
|
|
150
|
+
{externalProviderIdentifier && (
|
|
151
|
+
<>
|
|
152
|
+
<span className={styles.middot}>·</span>
|
|
153
|
+
<span className={styles.fieldLabel}>{t('externalRef', 'External ref')}:</span>{' '}
|
|
154
|
+
<strong>{externalProviderIdentifier}</strong>
|
|
155
|
+
</>
|
|
156
|
+
)}
|
|
154
157
|
</span>
|
|
155
158
|
</div>
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
)}
|
|
160
|
+
|
|
161
|
+
{/* Roles */}
|
|
162
|
+
<div className={classNames(styles.row, styles.viewRoles)}>
|
|
163
|
+
<Accordion>
|
|
164
|
+
<AccordionItem title={t('viewRoles', 'View roles ({{count}})', { count: user?.roles?.length ?? 0 })}>
|
|
165
|
+
{user?.roles?.length ? (
|
|
166
|
+
user.roles.map((role, i) => (
|
|
160
167
|
<ContainedListItem key={i}>
|
|
161
168
|
<div className={styles.roleContainer}>
|
|
162
|
-
<strong>{role.display}</strong>
|
|
169
|
+
<strong className={styles.roleName}>{role.display}</strong>
|
|
163
170
|
<p className={styles.roleDescription}>
|
|
164
171
|
{role.description || t('noDescriptionAvailable', 'No description available')}
|
|
165
172
|
</p>
|
|
166
173
|
</div>
|
|
167
174
|
</ContainedListItem>
|
|
168
|
-
))
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
175
|
+
))
|
|
176
|
+
) : (
|
|
177
|
+
<p className={styles.roleDescription}>{t('noRolesAssigned', 'No roles assigned')}</p>
|
|
178
|
+
)}
|
|
179
|
+
</AccordionItem>
|
|
180
|
+
</Accordion>
|
|
172
181
|
</div>
|
|
173
|
-
<br />
|
|
174
182
|
</div>
|
|
175
183
|
</div>
|
|
176
184
|
</header>
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
isDesktop,
|
|
30
30
|
usePagination,
|
|
31
31
|
showModal,
|
|
32
|
+
launchWorkspace2,
|
|
32
33
|
} from '@openmrs/esm-framework';
|
|
33
34
|
import { CardHeader, usePaginationInfo } from '@openmrs/esm-patient-common-lib';
|
|
34
35
|
import capitalize from 'lodash-es/capitalize';
|
|
@@ -261,10 +262,15 @@ const UserList: React.FC = () => {
|
|
|
261
262
|
onClick={() => {
|
|
262
263
|
const selectedUser = users.find((u) => u.uuid === user.uuid);
|
|
263
264
|
if (selectedUser) {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
265
|
+
launchWorkspace2(
|
|
266
|
+
'manage-user-workspace',
|
|
267
|
+
{
|
|
268
|
+
workspaceTitle: t('editUser', 'Edit User'),
|
|
269
|
+
initialUserValue: user,
|
|
270
|
+
},
|
|
271
|
+
{},
|
|
272
|
+
{},
|
|
273
|
+
);
|
|
268
274
|
} else {
|
|
269
275
|
console.error('User not found:', user.uuid);
|
|
270
276
|
}
|
|
@@ -280,10 +286,15 @@ const UserList: React.FC = () => {
|
|
|
280
286
|
hasDivider
|
|
281
287
|
disabled={!userHasInventoryRole}
|
|
282
288
|
onClick={() => {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
289
|
+
launchWorkspace2(
|
|
290
|
+
'user-role-scope-workspace',
|
|
291
|
+
{
|
|
292
|
+
workspaceTitle: t('manageUserRoleScope', 'Manage user role scope'),
|
|
293
|
+
user: user,
|
|
294
|
+
},
|
|
295
|
+
{},
|
|
296
|
+
{},
|
|
297
|
+
);
|
|
287
298
|
}}
|
|
288
299
|
itemText={t('manageUserRoleScope', 'Manage user role scope')}
|
|
289
300
|
/>
|
|
@@ -317,7 +328,9 @@ const UserList: React.FC = () => {
|
|
|
317
328
|
size={isDesktop(layout) ? 'lg' : 'sm'}
|
|
318
329
|
/>
|
|
319
330
|
<Button
|
|
320
|
-
onClick={() =>
|
|
331
|
+
onClick={() =>
|
|
332
|
+
launchWorkspace2('manage-user-workspace', { workspaceTitle: t('addUser', 'Add user') }, {}, {})
|
|
333
|
+
}
|
|
321
334
|
className={styles.userManagementModeButton}
|
|
322
335
|
renderIcon={UserFollow}
|
|
323
336
|
size={isDesktop(layout) ? 'lg' : 'sm'}
|