@kenyaemr/esm-admin-app 5.4.4-pre.26 → 5.4.4-pre.265
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/1074.js +1 -0
- package/dist/1074.js.map +1 -0
- package/dist/12.js +17 -0
- package/dist/12.js.map +1 -0
- package/dist/1201.js +1 -0
- package/dist/1201.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/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/2402.js +1 -0
- package/dist/2402.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/3366.js +1 -0
- package/dist/3366.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/3852.js +1 -0
- package/dist/3852.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/4047.js +1 -0
- package/dist/4047.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/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/545.js +1 -0
- package/dist/545.js.map +1 -0
- package/dist/552.js +1 -0
- package/dist/552.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/5940.js +1 -0
- package/dist/5940.js.map +1 -0
- package/dist/6092.js +1 -0
- package/dist/6092.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/6399.js +1 -0
- package/dist/6399.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/6676.js +1 -0
- package/dist/6676.js.map +1 -0
- package/dist/6800.js +1 -0
- package/dist/6800.js.map +1 -0
- package/dist/6976.js +1 -0
- package/dist/6976.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/7916.js +1 -0
- package/dist/7916.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/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/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/9406.js +1 -0
- package/dist/9406.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/9641.js +1 -0
- package/dist/9641.js.map +1 -0
- package/dist/9711.js +1 -0
- package/dist/9711.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 +2649 -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/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/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/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 +168 -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 +55 -30
- package/src/left-pannel-link.component.tsx +5 -3
- package/src/root.component.tsx +11 -13
- package/src/routes.json +40 -40
- package/src/types/index.ts +29 -1
- package/translations/am.json +158 -13
- package/translations/en.json +158 -13
- package/translations/fr.json +193 -47
- package/translations/sw.json +158 -13
- 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
|
@@ -2,86 +2,167 @@
|
|
|
2
2
|
@use '@carbon/type';
|
|
3
3
|
@use '@carbon/colors';
|
|
4
4
|
|
|
5
|
-
.
|
|
6
|
-
|
|
5
|
+
.root {
|
|
6
|
+
padding: layout.$spacing-05;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.
|
|
9
|
+
.pageHeader {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: space-between;
|
|
10
13
|
margin-bottom: layout.$spacing-05;
|
|
14
|
+
margin-right: layout.$spacing-08;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pageTitle {
|
|
18
|
+
@include type.type-style('heading-03');
|
|
19
|
+
color: colors.$gray-100;
|
|
20
|
+
margin: 0;
|
|
11
21
|
}
|
|
12
22
|
|
|
13
|
-
.
|
|
23
|
+
.pageActions {
|
|
14
24
|
display: flex;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
margin-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: layout.$spacing-03;
|
|
27
|
+
margin-left: auto;
|
|
28
|
+
margin-right: layout.$spacing-12;
|
|
29
|
+
}
|
|
30
|
+
.grid {
|
|
31
|
+
margin-top: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.sectionCard {
|
|
35
|
+
padding: layout.$spacing-05 !important;
|
|
36
|
+
background: white !important;
|
|
37
|
+
border: 1px solid colors.$gray-20 !important;
|
|
38
|
+
border-radius: 8px !important;
|
|
39
|
+
margin-bottom: layout.$spacing-05;
|
|
40
|
+
box-shadow: none !important;
|
|
23
41
|
}
|
|
24
42
|
|
|
25
|
-
.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
43
|
+
.sectionTitle {
|
|
44
|
+
@include type.type-style('label-01');
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
color: colors.$gray-60;
|
|
47
|
+
text-transform: uppercase;
|
|
48
|
+
letter-spacing: 0.06em;
|
|
49
|
+
margin: 0 0 layout.$spacing-04;
|
|
50
|
+
padding-bottom: layout.$spacing-03;
|
|
51
|
+
border-bottom: 1px solid colors.$gray-20;
|
|
30
52
|
}
|
|
31
53
|
|
|
32
|
-
.
|
|
54
|
+
.sectionBody {
|
|
33
55
|
display: flex;
|
|
34
|
-
|
|
35
|
-
padding-right: layout.$spacing-05;
|
|
36
|
-
padding-bottom: layout.$spacing-05;
|
|
37
|
-
margin-top: layout.$spacing-05;
|
|
38
|
-
flex-direction: row;
|
|
39
|
-
justify-content: flex-end;
|
|
40
|
-
background-color: white;
|
|
41
|
-
width: 100%;
|
|
56
|
+
flex-direction: column;
|
|
42
57
|
}
|
|
43
58
|
|
|
44
|
-
|
|
45
|
-
|
|
59
|
+
/* ── Info rows ── */
|
|
60
|
+
.infoRow {
|
|
61
|
+
display: flex;
|
|
62
|
+
justify-content: space-between;
|
|
63
|
+
align-items: baseline;
|
|
64
|
+
padding: layout.$spacing-02 0;
|
|
65
|
+
border-bottom: 1px solid colors.$gray-10;
|
|
66
|
+
|
|
67
|
+
&:last-child {
|
|
68
|
+
border-bottom: none;
|
|
69
|
+
}
|
|
46
70
|
}
|
|
47
71
|
|
|
48
|
-
.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
72
|
+
.infoLabel {
|
|
73
|
+
@include type.type-style('body-01');
|
|
74
|
+
color: colors.$gray-60;
|
|
75
|
+
flex-shrink: 0;
|
|
76
|
+
margin-right: layout.$spacing-05;
|
|
54
77
|
}
|
|
55
78
|
|
|
56
|
-
.
|
|
57
|
-
|
|
58
|
-
font-
|
|
59
|
-
|
|
79
|
+
.infoValue {
|
|
80
|
+
@include type.type-style('body-01');
|
|
81
|
+
font-weight: 500;
|
|
82
|
+
color: colors.$gray-100;
|
|
83
|
+
text-align: right;
|
|
84
|
+
word-break: break-word;
|
|
60
85
|
}
|
|
61
86
|
|
|
62
|
-
.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
margin: 0.5rem 0;
|
|
87
|
+
.emptyValue {
|
|
88
|
+
color: colors.$gray-40;
|
|
89
|
+
font-weight: 400;
|
|
66
90
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
91
|
+
|
|
92
|
+
.contactValue {
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
gap: layout.$spacing-02;
|
|
70
96
|
}
|
|
71
97
|
|
|
72
|
-
.
|
|
98
|
+
.adminCard {
|
|
73
99
|
display: flex;
|
|
74
|
-
|
|
75
|
-
|
|
100
|
+
align-items: flex-start;
|
|
101
|
+
gap: layout.$spacing-04;
|
|
102
|
+
margin-top: layout.$spacing-04;
|
|
103
|
+
padding-top: layout.$spacing-04;
|
|
104
|
+
border-top: 1px solid colors.$gray-10;
|
|
76
105
|
}
|
|
77
|
-
.
|
|
106
|
+
.adminName {
|
|
107
|
+
@include type.type-style('body-01');
|
|
108
|
+
font-weight: 500;
|
|
109
|
+
color: colors.$gray-100;
|
|
110
|
+
margin: 0 0 layout.$spacing-01;
|
|
111
|
+
text-transform: capitalize;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.adminDetail {
|
|
115
|
+
@include type.type-style('label-01');
|
|
116
|
+
color: colors.$gray-60;
|
|
117
|
+
margin: 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.serviceList {
|
|
78
121
|
display: flex;
|
|
79
|
-
|
|
80
|
-
|
|
122
|
+
flex-wrap: wrap;
|
|
123
|
+
gap: layout.$spacing-02;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.emptyState {
|
|
127
|
+
@include type.type-style('body-01');
|
|
128
|
+
color: colors.$gray-40;
|
|
129
|
+
font-style: italic;
|
|
130
|
+
margin: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.pageMeta {
|
|
134
|
+
display: flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
gap: 0.5rem;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.lastSynced {
|
|
140
|
+
font-size: 0.875rem;
|
|
141
|
+
color: var(--cds-text-secondary, #525252);
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: end;
|
|
81
144
|
}
|
|
82
145
|
|
|
83
|
-
.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
146
|
+
.bedGrid {
|
|
147
|
+
display: grid;
|
|
148
|
+
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
|
|
149
|
+
gap: layout.$spacing-04;
|
|
150
|
+
|
|
151
|
+
.infoRow {
|
|
152
|
+
display: flex;
|
|
153
|
+
justify-content: flex-start;
|
|
154
|
+
gap: layout.$spacing-03;
|
|
155
|
+
padding: layout.$spacing-02 layout.$spacing-03;
|
|
156
|
+
background: colors.$gray-10;
|
|
157
|
+
border-radius: 4px;
|
|
158
|
+
border-bottom: none;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.infoLabel {
|
|
162
|
+
margin-right: 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.infoValue {
|
|
166
|
+
text-align: left;
|
|
167
|
+
}
|
|
87
168
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Layer } from '@carbon/react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import FacilityInfo from './facility-info.component';
|
|
5
4
|
import styles from './facility-setup.scss';
|
|
6
5
|
import Header from './header/header.component';
|
|
6
|
+
import FacilityRegistryView from './facility-info.component';
|
|
7
7
|
|
|
8
8
|
const FacilitySetup: React.FC = () => {
|
|
9
9
|
const { t } = useTranslation();
|
|
@@ -12,7 +12,7 @@ const FacilitySetup: React.FC = () => {
|
|
|
12
12
|
<Header title={t('facilityDetails', 'Facility Details')} />
|
|
13
13
|
|
|
14
14
|
<Layer className={styles.tableLayer}>
|
|
15
|
-
<
|
|
15
|
+
<FacilityRegistryView />
|
|
16
16
|
</Layer>
|
|
17
17
|
</div>
|
|
18
18
|
);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { Development } from '@carbon/react/icons';
|
|
4
|
-
import { useSession, PageHeader } from '@openmrs/esm-framework';
|
|
2
|
+
import { PageHeader, PageHeaderContent, HomePictogram } from '@openmrs/esm-framework';
|
|
5
3
|
import styles from './header.scss';
|
|
6
4
|
|
|
7
5
|
interface HeaderProps {
|
|
@@ -9,14 +7,10 @@ interface HeaderProps {
|
|
|
9
7
|
}
|
|
10
8
|
|
|
11
9
|
const Header: React.FC<HeaderProps> = ({ title }) => {
|
|
12
|
-
const { t } = useTranslation();
|
|
13
|
-
const session = useSession();
|
|
14
|
-
const location = session?.sessionLocation?.display;
|
|
15
|
-
|
|
16
10
|
return (
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
</
|
|
11
|
+
<PageHeader className={styles.pageHeader}>
|
|
12
|
+
<PageHeaderContent title={title} illustration={<HomePictogram />} />
|
|
13
|
+
</PageHeader>
|
|
20
14
|
);
|
|
21
15
|
};
|
|
22
16
|
|
|
@@ -2,18 +2,12 @@
|
|
|
2
2
|
@use '@carbon/type';
|
|
3
3
|
@use '@carbon/colors';
|
|
4
4
|
|
|
5
|
-
.
|
|
5
|
+
.pageHeader {
|
|
6
6
|
@include type.type-style('body-compact-02');
|
|
7
7
|
height: layout.$spacing-12;
|
|
8
8
|
display: flex;
|
|
9
9
|
justify-content: space-between;
|
|
10
10
|
padding: layout.$spacing-05;
|
|
11
|
-
background: white;
|
|
12
|
-
border: 1px solid colors.$gray-20;
|
|
13
|
-
}
|
|
14
|
-
.svgContainer svg {
|
|
15
|
-
width: layout.$spacing-10;
|
|
16
|
-
height: layout.$spacing-10;
|
|
17
|
-
margin-right: layout.$spacing-06;
|
|
18
|
-
fill: var(--brand-03);
|
|
11
|
+
background: colors.$white-0;
|
|
12
|
+
border-bottom: 1px solid colors.$gray-20;
|
|
19
13
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styles from '../facility-info.scss';
|
|
3
|
+
|
|
4
|
+
export const InfoRow: React.FC<{ label: string; value?: React.ReactNode }> = ({ label, value }) => (
|
|
5
|
+
<div className={styles.infoRow}>
|
|
6
|
+
<span className={styles.infoLabel}>{label}</span>
|
|
7
|
+
<span className={styles.infoValue}>{value ?? <span className={styles.emptyValue}>—</span>}</span>
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tile } from '@carbon/react';
|
|
3
|
+
import styles from '../facility-info.scss';
|
|
4
|
+
|
|
5
|
+
export const SectionCard: React.FC<{ title: string; children: React.ReactNode }> = ({ title, children }) => (
|
|
6
|
+
<Tile className={styles.sectionCard}>
|
|
7
|
+
<p className={styles.sectionTitle}>{title}</p>
|
|
8
|
+
<div className={styles.sectionBody}>{children}</div>
|
|
9
|
+
</Tile>
|
|
10
|
+
);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tag } from '@carbon/react';
|
|
3
|
+
import styles from '../facility-info.scss';
|
|
4
|
+
|
|
5
|
+
export const StatusTag: React.FC<{ value?: string }> = ({ value }) => {
|
|
6
|
+
if (!value || value === '--' || value.trim() === '') {
|
|
7
|
+
return <span className={styles.emptyValue}>—</span>;
|
|
8
|
+
}
|
|
9
|
+
const upper = value.toUpperCase();
|
|
10
|
+
const type =
|
|
11
|
+
upper === 'ACTIVE' || upper === 'LICENSED'
|
|
12
|
+
? 'green'
|
|
13
|
+
: upper === 'INACTIVE' || upper === 'SUSPENDED'
|
|
14
|
+
? 'red'
|
|
15
|
+
: 'gray';
|
|
16
|
+
const label = `${value.charAt(0).toUpperCase()}${value.slice(1).toLowerCase()}`;
|
|
17
|
+
return (
|
|
18
|
+
<Tag type={type} size="sm">
|
|
19
|
+
{label}
|
|
20
|
+
</Tag>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type FacilityRegistryAddress = {
|
|
2
|
+
country?: string;
|
|
3
|
+
county_code?: string;
|
|
4
|
+
county?: string;
|
|
5
|
+
sub_county_code?: string;
|
|
6
|
+
sub_county?: string;
|
|
7
|
+
postal_address?: string;
|
|
8
|
+
physical_location?: string;
|
|
9
|
+
town?: string;
|
|
10
|
+
latitude?: number | null;
|
|
11
|
+
longitude?: number | null;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type FacilityRegistryBedOccupancy = {
|
|
15
|
+
totalBeds?: number;
|
|
16
|
+
normalBeds?: number;
|
|
17
|
+
icuBeds?: number;
|
|
18
|
+
hduBeds?: number;
|
|
19
|
+
dialysisBeds?: number;
|
|
20
|
+
numberOfCots?: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type FacilityRegistryRecord = {
|
|
24
|
+
fr_code: string;
|
|
25
|
+
fid_code?: string;
|
|
26
|
+
registration_number?: string;
|
|
27
|
+
official_name?: string;
|
|
28
|
+
keph_level?: string;
|
|
29
|
+
facility_type?: string;
|
|
30
|
+
facility_ownership?: string;
|
|
31
|
+
license_status?: string;
|
|
32
|
+
license_number?: string;
|
|
33
|
+
license_start_date?: string | null;
|
|
34
|
+
license_end_date?: string | null;
|
|
35
|
+
regulatory_body?: string;
|
|
36
|
+
sha_contract_status?: string;
|
|
37
|
+
sha_contract_start_date?: string | null;
|
|
38
|
+
sha_contract_end_date?: string | null;
|
|
39
|
+
is_hub?: boolean;
|
|
40
|
+
facility_phone_number?: string;
|
|
41
|
+
facility_email?: string;
|
|
42
|
+
facility_administrator_name?: string;
|
|
43
|
+
facility_administrator_email?: string;
|
|
44
|
+
facility_administrator_phone?: string;
|
|
45
|
+
facility_administrator_identifier?: string;
|
|
46
|
+
address?: FacilityRegistryAddress;
|
|
47
|
+
regulatory_operational_status?: string;
|
|
48
|
+
sha_operational_status?: string;
|
|
49
|
+
bed_occupancy?: FacilityRegistryBedOccupancy;
|
|
50
|
+
sha_contracted_services?: Array<{ name?: string } | string>;
|
|
51
|
+
last_synced_at?: string;
|
|
52
|
+
last_sync_status?: 'SUCCESS' | 'FAILURE';
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type FacilityRegistrySyncResult = {
|
|
56
|
+
success: boolean;
|
|
57
|
+
fr_code: string;
|
|
58
|
+
official_name: string;
|
|
59
|
+
last_synced_at: string;
|
|
60
|
+
last_sync_status: 'SUCCESS' | 'FAILURE';
|
|
61
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import useSWR from 'swr';
|
|
2
|
+
import { openmrsFetch, restBaseUrl, type FetchResponse } from '@openmrs/esm-framework';
|
|
3
|
+
import { FacilityRegistryRecord, FacilityRegistrySyncResult } from './type';
|
|
4
|
+
import { facilityRegistryUrl } from './constant';
|
|
5
|
+
|
|
6
|
+
export const useFacilityRegistry = () => {
|
|
7
|
+
const { data, error, isLoading, mutate } = useSWR<FetchResponse<FacilityRegistryRecord>>(
|
|
8
|
+
facilityRegistryUrl,
|
|
9
|
+
openmrsFetch,
|
|
10
|
+
{
|
|
11
|
+
revalidateOnFocus: false,
|
|
12
|
+
},
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const notYetSynced = error?.response?.status === 404;
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
facility: data?.data,
|
|
19
|
+
isLoading,
|
|
20
|
+
error: notYetSynced ? null : error,
|
|
21
|
+
notYetSynced,
|
|
22
|
+
mutate,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const syncFacilityRegistry = async (): Promise<FacilityRegistrySyncResult> => {
|
|
27
|
+
const response = await openmrsFetch<FacilityRegistrySyncResult>(facilityRegistryUrl + '/sync', { method: 'POST' });
|
|
28
|
+
return response.data;
|
|
29
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { FetchResponse, openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
|
2
|
+
import useSWR from 'swr';
|
|
3
|
+
import { HWR_API_NO_CREDENTIALS, PROVIDER_NOT_FOUND, RESOURCE_NOT_FOUND, UNKNOWN } from '../../constants';
|
|
4
|
+
|
|
5
|
+
export interface ProfessionalRegistryResponse {
|
|
6
|
+
success: boolean;
|
|
7
|
+
regulator: string;
|
|
8
|
+
identification_type: string;
|
|
9
|
+
identification_number: string;
|
|
10
|
+
professional: {
|
|
11
|
+
membership: {
|
|
12
|
+
id: string;
|
|
13
|
+
full_name: string;
|
|
14
|
+
gender: string;
|
|
15
|
+
first_name: string;
|
|
16
|
+
middle_name: string;
|
|
17
|
+
last_name: string;
|
|
18
|
+
registration_id: string;
|
|
19
|
+
external_reference_id: string;
|
|
20
|
+
licensing_body: string;
|
|
21
|
+
specialty: string;
|
|
22
|
+
is_active: number;
|
|
23
|
+
};
|
|
24
|
+
licenses?: Array<{
|
|
25
|
+
id: string;
|
|
26
|
+
external_reference_id: string;
|
|
27
|
+
license_type: string;
|
|
28
|
+
license_start: string;
|
|
29
|
+
license_end: string;
|
|
30
|
+
}>;
|
|
31
|
+
professional_details?: {
|
|
32
|
+
professional_cadre?: string;
|
|
33
|
+
practice_type?: string;
|
|
34
|
+
educational_qualifications?: string;
|
|
35
|
+
};
|
|
36
|
+
contacts?: {
|
|
37
|
+
phone?: string;
|
|
38
|
+
email?: string;
|
|
39
|
+
postal_address?: string;
|
|
40
|
+
};
|
|
41
|
+
identifiers?: {
|
|
42
|
+
identification_type?: string;
|
|
43
|
+
identification_number?: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const searchHealthCareWork = async (
|
|
49
|
+
identifierType: string,
|
|
50
|
+
identifierNumber: string,
|
|
51
|
+
regulator: string,
|
|
52
|
+
): Promise<ProfessionalRegistryResponse> => {
|
|
53
|
+
const url = `${restBaseUrl}/virtualclaims/professional-registry?${new URLSearchParams({
|
|
54
|
+
identification_number: identifierNumber,
|
|
55
|
+
identification_type: identifierType,
|
|
56
|
+
regulator,
|
|
57
|
+
}).toString()}`;
|
|
58
|
+
|
|
59
|
+
try {
|
|
60
|
+
const response = await openmrsFetch<ProfessionalRegistryResponse>(url);
|
|
61
|
+
if (!response.data?.success || !response.data?.professional) {
|
|
62
|
+
throw new Error(PROVIDER_NOT_FOUND);
|
|
63
|
+
}
|
|
64
|
+
return response.data;
|
|
65
|
+
} catch (err: any) {
|
|
66
|
+
if (err?.message === PROVIDER_NOT_FOUND) {
|
|
67
|
+
throw err;
|
|
68
|
+
}
|
|
69
|
+
const status = err?.response?.status;
|
|
70
|
+
if (status === 401) {
|
|
71
|
+
throw new Error(HWR_API_NO_CREDENTIALS);
|
|
72
|
+
}
|
|
73
|
+
if (status === 404) {
|
|
74
|
+
throw new Error(RESOURCE_NOT_FOUND);
|
|
75
|
+
}
|
|
76
|
+
throw new Error(UNKNOWN);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { FetchResponse, openmrsFetch, restBaseUrl, useSession } from '@openmrs/esm-framework';
|
|
2
|
+
import useSWR from 'swr';
|
|
3
|
+
|
|
4
|
+
export type EnumEntry = {
|
|
5
|
+
code: string;
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type RegulatorsResponse = {
|
|
10
|
+
count: number;
|
|
11
|
+
regulators: Array<EnumEntry>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type IdentificationTypesResponse = {
|
|
15
|
+
count: number;
|
|
16
|
+
identification_types: Array<EnumEntry>;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const ONE_DAY_MS = 24 * 60 * 60 * 1000;
|
|
20
|
+
|
|
21
|
+
export const useProfessionalRegistryRegulators = () => {
|
|
22
|
+
const { authenticated } = useSession();
|
|
23
|
+
const url = `${restBaseUrl}/virtualclaims/professional-registry/regulators`;
|
|
24
|
+
|
|
25
|
+
const { data, error, isLoading } = useSWR<FetchResponse<RegulatorsResponse>>(
|
|
26
|
+
authenticated ? url : null,
|
|
27
|
+
openmrsFetch,
|
|
28
|
+
{
|
|
29
|
+
revalidateOnFocus: false,
|
|
30
|
+
dedupingInterval: ONE_DAY_MS,
|
|
31
|
+
},
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
regulators: data?.data?.regulators ?? [],
|
|
36
|
+
isLoading,
|
|
37
|
+
error,
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const useProfessionalRegistryIdentificationTypes = () => {
|
|
42
|
+
const { authenticated } = useSession();
|
|
43
|
+
const url = `${restBaseUrl}/virtualclaims/professional-registry/identification-types`;
|
|
44
|
+
|
|
45
|
+
const { data, error, isLoading } = useSWR<FetchResponse<IdentificationTypesResponse>>(
|
|
46
|
+
authenticated ? url : null,
|
|
47
|
+
openmrsFetch,
|
|
48
|
+
{
|
|
49
|
+
revalidateOnFocus: false,
|
|
50
|
+
dedupingInterval: ONE_DAY_MS,
|
|
51
|
+
},
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
identificationTypes: data?.data?.identification_types ?? [],
|
|
56
|
+
isLoading,
|
|
57
|
+
error,
|
|
58
|
+
};
|
|
59
|
+
};
|