@kenyaemr/esm-service-queues-app 7.0.3-pre.89 → 7.0.3-pre.94
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 +18 -17
- package/dist/130.js +1 -1
- package/dist/130.js.map +1 -1
- package/dist/199.js +1 -1
- package/dist/236.js +1 -0
- package/dist/236.js.map +1 -0
- package/dist/265.js +1 -0
- package/dist/265.js.map +1 -0
- package/dist/271.js +1 -1
- package/dist/282.js +1 -0
- package/dist/282.js.map +1 -0
- package/dist/319.js +1 -1
- package/dist/366.js +1 -0
- package/dist/366.js.map +1 -0
- package/dist/392.js +1 -0
- package/dist/392.js.map +1 -0
- package/dist/460.js +1 -1
- package/dist/484.js +2 -0
- package/dist/484.js.map +1 -0
- package/dist/574.js +1 -1
- package/dist/6.js +1 -1
- package/dist/604.js +1 -0
- package/dist/604.js.map +1 -0
- package/dist/644.js +1 -1
- package/dist/670.js +1 -0
- package/dist/670.js.map +1 -0
- package/dist/727.js +1 -0
- package/dist/727.js.map +1 -0
- package/dist/752.js +1 -1
- package/dist/757.js +1 -1
- package/dist/760.js +1 -0
- package/dist/760.js.map +1 -0
- package/dist/788.js +1 -1
- package/dist/800.js +1 -1
- package/dist/807.js +1 -1
- package/dist/818.js +1 -0
- package/dist/818.js.map +1 -0
- package/dist/828.js +1 -1
- package/dist/833.js +1 -1
- package/dist/911.js +1 -0
- package/dist/911.js.map +1 -0
- package/dist/kenyaemr-esm-service-queues-app.js +1 -1
- package/dist/kenyaemr-esm-service-queues-app.js.buildmanifest.json +160 -160
- package/dist/kenyaemr-esm-service-queues-app.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/active-visits/active-visits-table.resource.ts +1 -1
- package/src/active-visits/change-status-dialog.scss +11 -11
- package/src/active-visits/change-status-dialog.test.tsx +36 -31
- package/src/add-patient-toqueue/add-patient-toqueue-dialog.scss +10 -10
- package/src/add-provider-queue-room/add-provider-queue-room.component.tsx +4 -4
- package/src/add-provider-queue-room/add-provider-queue-room.resource.ts +2 -2
- package/src/add-provider-queue-room/add-provider-queue-room.scss +6 -6
- package/src/add-provider-queue-room/add-provider-queue-room.test.tsx +44 -38
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.component.tsx +1 -1
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.scss +2 -3
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.test.tsx +15 -15
- package/src/config-schema.ts +84 -84
- package/src/current-visit/current-visit-summary.component.tsx +1 -1
- package/src/current-visit/current-visit-summary.test.tsx +12 -11
- package/src/current-visit/current-visit.resource.ts +1 -1
- package/src/current-visit/current-visit.scss +4 -4
- package/src/current-visit/hooks/useVitalsConceptMetadata.tsx +1 -1
- package/src/current-visit/visit-details/triage-note.scss +11 -11
- package/src/helpers/helpers.test.ts +24 -0
- package/src/helpers/helpers.ts +41 -14
- package/src/home.test.tsx +10 -12
- package/src/hooks/useQueueService.ts +16 -10
- package/src/past-visit/past-visit-details/past-visit-summary.scss +8 -8
- package/src/past-visit/past-visit.component.tsx +1 -1
- package/src/past-visit/past-visit.resource.ts +1 -1
- package/src/past-visit/past-visit.scss +17 -17
- package/src/past-visit/past-visit.test.tsx +8 -13
- package/src/patient-info/appointment-details.scss +7 -7
- package/src/patient-info/appointment-details.test.tsx +11 -6
- package/src/patient-info/appointments.resource.ts +1 -1
- package/src/patient-info/patient-info.scss +9 -9
- package/src/patient-info/patient-info.test.tsx +3 -14
- package/src/patient-queue-header/patient-queue-header.component.tsx +4 -1
- package/src/patient-queue-header/patient-queue-header.scss +11 -11
- package/src/patient-queue-metrics/clinic-metrics.component.tsx +1 -1
- package/src/patient-queue-metrics/clinic-metrics.resource.ts +2 -2
- package/src/patient-queue-metrics/clinic-metrics.scss +4 -4
- package/src/patient-queue-metrics/clinic-metrics.test.tsx +40 -45
- package/src/patient-queue-metrics/metrics-card.scss +11 -11
- package/src/patient-queue-metrics/metrics-header.scss +2 -2
- package/src/patient-search/advanced-search.scss +27 -27
- package/src/patient-search/advanced-search.test.tsx +6 -9
- package/src/patient-search/basic-search.scss +14 -14
- package/src/patient-search/basic-search.test.tsx +2 -7
- package/src/patient-search/hooks/useDefaultLocation.ts +1 -1
- package/src/patient-search/hooks/useQueueLocations.tsx +1 -0
- package/src/patient-search/hooks/useScheduledVisits.ts +1 -1
- package/src/patient-search/patient-scheduled-visits.component.tsx +4 -4
- package/src/patient-search/patient-scheduled-visits.scss +17 -17
- package/src/patient-search/patient-scheduled-visits.test.tsx +18 -23
- package/src/patient-search/patient-search.scss +7 -7
- package/src/patient-search/patient-search.workspace.tsx +4 -4
- package/src/patient-search/search-results.scss +11 -11
- package/src/patient-search/search-results.test.tsx +2 -10
- package/src/patient-search/visit-form/visit-form.scss +12 -13
- package/src/patient-search/visit-form/visit-type-selector.component.tsx +9 -11
- package/src/patient-search/visit-form/visit-type-selector.scss +13 -13
- package/src/patient-search/visit-form/visit-type-selector.test.tsx +4 -3
- package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.scss +1 -3
- package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.test.tsx +15 -9
- package/src/queue-entry-table-components/edit-entry.scss +1 -1
- package/src/queue-entry-table-components/queue-priority.scss +3 -4
- package/src/queue-entry-table-components/transition-entry.scss +1 -1
- package/src/queue-patient-linelists/queue-linelist-base-table.scss +16 -17
- package/src/queue-patient-linelists/queue-linelist-base-table.test.tsx +7 -8
- package/src/queue-patient-linelists/queue-linelist-filter.scss +13 -13
- package/src/queue-patient-linelists/queue-linelist-filter.test.tsx +9 -6
- package/src/queue-patient-linelists/queue-linelist.resource.ts +4 -4
- package/src/queue-patient-linelists/scheduled-appointments-table.test.tsx +10 -7
- package/src/queue-rooms/queue-room-form.scss +13 -13
- package/src/queue-rooms/queue-room-form.test.tsx +10 -8
- package/src/queue-screen/queue-screen.scss +6 -4
- package/src/queue-screen/queue-screen.test.tsx +6 -6
- package/src/queue-services/queue-service-form.scss +13 -13
- package/src/queue-services/queue-service-form.test.tsx +15 -8
- package/src/queue-table/cells/queue-table-action-cell.component.tsx +2 -2
- package/src/queue-table/cells/queue-table-coming-from-cell.component.tsx +1 -1
- package/src/queue-table/default-queue-table.component.tsx +63 -61
- package/src/queue-table/default-queue-table.test.tsx +61 -61
- package/src/queue-table/queue-entry-actions/queue-entry-actions-modal.scss +36 -0
- package/src/queue-table/queue-entry-actions/queue-entry-actions.modal.tsx +30 -10
- package/src/queue-table/queue-entry-actions/queue-entry-actions.test.tsx +34 -103
- package/src/queue-table/queue-entry-actions/queue-entry-confirm-action.test.tsx +42 -25
- package/src/queue-table/queue-entry-actions/queue-entry-undo-actions.test.tsx +19 -14
- package/src/queue-table/queue-table-by-status-skeleton.component.tsx +1 -5
- package/src/queue-table/queue-table-expanded-row.component.tsx +1 -2
- package/src/queue-table/queue-table-metrics-card.scss +7 -7
- package/src/queue-table/queue-table-metrics.scss +3 -3
- package/src/queue-table/queue-table.component.tsx +8 -11
- package/src/queue-table/queue-table.scss +32 -26
- package/src/queue-table/queue-table.test.tsx +46 -21
- package/src/remove-queue-entry-dialog/remove-queue-entry.resource.ts +1 -1
- package/src/remove-queue-entry-dialog/remove-queue-entry.scss +2 -2
- package/src/remove-queue-entry-dialog/remove-queue-entry.test.tsx +13 -12
- package/src/side-menu/side-menu.test.tsx +0 -1
- package/src/transition-queue-entry/transition-queue-entry-dialog.component.tsx +1 -1
- package/src/transition-queue-entry/transition-queue-entry-dialog.scss +5 -5
- package/src/transition-queue-entry/transition-queue-entry-dialog.test.tsx +33 -44
- package/src/views/queue-tables-for-all-statuses.component.tsx +14 -14
- package/src/visits-missing-inqueue/visits-missing-inqueue.component.tsx +1 -1
- package/src/visits-missing-inqueue/visits-missing-inqueue.resource.ts +1 -1
- package/src/visits-missing-inqueue/visits-missing-inqueue.scss +17 -14
- package/translations/am.json +4 -2
- package/translations/ar.json +4 -2
- package/translations/en.json +1 -0
- package/translations/es.json +4 -2
- package/translations/fr.json +39 -37
- package/translations/he.json +4 -2
- package/translations/km.json +4 -2
- package/translations/zh.json +4 -2
- package/translations/zh_CN.json +4 -2
- package/dist/276.js +0 -1
- package/dist/276.js.map +0 -1
- package/dist/384.js +0 -2
- package/dist/384.js.map +0 -1
- package/dist/401.js +0 -1
- package/dist/401.js.map +0 -1
- package/dist/430.js +0 -1
- package/dist/430.js.map +0 -1
- package/dist/60.js +0 -1
- package/dist/60.js.map +0 -1
- package/dist/600.js +0 -1
- package/dist/600.js.map +0 -1
- package/dist/647.js +0 -1
- package/dist/647.js.map +0 -1
- package/dist/650.js +0 -1
- package/dist/650.js.map +0 -1
- package/dist/669.js +0 -1
- package/dist/669.js.map +0 -1
- package/dist/764.js +0 -1
- package/dist/764.js.map +0 -1
- package/dist/877.js +0 -1
- package/dist/877.js.map +0 -1
- package/dist/917.js +0 -1
- package/dist/917.js.map +0 -1
- package/src/queue-table/queue-entry-actions/queue-entry-actons-modal.scss +0 -36
- package/src/root.scss +0 -15
- /package/dist/{384.js.LICENSE.txt → 484.js.LICENSE.txt} +0 -0
package/src/config-schema.ts
CHANGED
|
@@ -60,33 +60,18 @@ export const defaultQueueTable: TableDefinitions = {
|
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
export const configSchema = {
|
|
63
|
-
|
|
64
|
-
_type: Type.
|
|
65
|
-
_description: '
|
|
66
|
-
|
|
67
|
-
_type: Type.String,
|
|
68
|
-
_description: 'The translation key of the title to be displayed on the service queues dashboard',
|
|
69
|
-
},
|
|
70
|
-
value: {
|
|
71
|
-
_type: Type.String,
|
|
72
|
-
_description: 'The translation value of the title to be displayed on the service queues dashboard',
|
|
73
|
-
},
|
|
74
|
-
_default: {
|
|
75
|
-
key: 'serviceQueues',
|
|
76
|
-
value: 'Service queues',
|
|
77
|
-
},
|
|
63
|
+
appointmentStatuses: {
|
|
64
|
+
_type: Type.Array,
|
|
65
|
+
_description: 'Configurable appointment status (status of appointments)',
|
|
66
|
+
_default: ['Requested', 'Scheduled', 'CheckedIn', 'Completed', 'Cancelled', 'Missed'],
|
|
78
67
|
},
|
|
68
|
+
biometrics: biometricsConfigSchema,
|
|
79
69
|
concepts: {
|
|
80
70
|
defaultPriorityConceptUuid: {
|
|
81
71
|
_type: Type.ConceptUuid,
|
|
82
72
|
_description: 'The UUID of the default priority for the queues eg Not urgent.',
|
|
83
73
|
_default: 'f4620bfa-3625-4883-bd3f-84c2cce14470',
|
|
84
74
|
},
|
|
85
|
-
emergencyPriorityConceptUuid: {
|
|
86
|
-
_type: Type.ConceptUuid,
|
|
87
|
-
_description: 'The UUID of the priority with the highest sort weight for the queues eg Emergency.',
|
|
88
|
-
_default: '04f6f7e0-e3cb-4e13-a133-4479f759574e',
|
|
89
|
-
},
|
|
90
75
|
defaultStatusConceptUuid: {
|
|
91
76
|
_type: Type.ConceptUuid,
|
|
92
77
|
_description: 'The UUID of the default status for the queues eg Waiting.',
|
|
@@ -97,42 +82,47 @@ export const configSchema = {
|
|
|
97
82
|
_description: 'The UUID of the default status for attending a service in the queues eg In Service.',
|
|
98
83
|
_default: 'ca7494ae-437f-4fd0-8aae-b88b9a2ba47d',
|
|
99
84
|
},
|
|
100
|
-
systolicBloodPressureUuid: {
|
|
101
|
-
_type: Type.ConceptUuid,
|
|
102
|
-
_default: '5085AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
103
|
-
},
|
|
104
85
|
diastolicBloodPressureUuid: {
|
|
105
86
|
_type: Type.ConceptUuid,
|
|
106
87
|
_default: '5086AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
107
88
|
},
|
|
108
|
-
|
|
89
|
+
emergencyPriorityConceptUuid: {
|
|
109
90
|
_type: Type.ConceptUuid,
|
|
110
|
-
|
|
91
|
+
_description: 'The UUID of the priority with the highest sort weight for the queues eg Emergency.',
|
|
92
|
+
_default: '04f6f7e0-e3cb-4e13-a133-4479f759574e',
|
|
111
93
|
},
|
|
112
|
-
|
|
94
|
+
heightUuid: {
|
|
113
95
|
_type: Type.ConceptUuid,
|
|
114
|
-
_default: '
|
|
96
|
+
_default: '5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
97
|
+
},
|
|
98
|
+
historicalObsConceptUuid: {
|
|
99
|
+
_type: Type.Array,
|
|
100
|
+
_description: 'The Uuids of the obs that are displayed on the previous visit modal',
|
|
101
|
+
_default: ['161643AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'],
|
|
115
102
|
},
|
|
116
103
|
oxygenSaturationUuid: {
|
|
117
104
|
_type: Type.ConceptUuid,
|
|
118
105
|
_default: '5092AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
119
106
|
},
|
|
120
|
-
|
|
121
|
-
_type: Type.ConceptUuid,
|
|
122
|
-
_default: '5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
123
|
-
},
|
|
124
|
-
weightUuid: {
|
|
107
|
+
pulseUuid: {
|
|
125
108
|
_type: Type.ConceptUuid,
|
|
126
|
-
_default: '
|
|
109
|
+
_default: '5087AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
127
110
|
},
|
|
128
111
|
respiratoryRateUuid: {
|
|
129
112
|
_type: Type.ConceptUuid,
|
|
130
113
|
_default: '5242AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
131
114
|
},
|
|
132
|
-
|
|
133
|
-
_type: Type.
|
|
134
|
-
|
|
135
|
-
|
|
115
|
+
systolicBloodPressureUuid: {
|
|
116
|
+
_type: Type.ConceptUuid,
|
|
117
|
+
_default: '5085AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
118
|
+
},
|
|
119
|
+
temperatureUuid: {
|
|
120
|
+
_type: Type.ConceptUuid,
|
|
121
|
+
_default: '5088AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
122
|
+
},
|
|
123
|
+
weightUuid: {
|
|
124
|
+
_type: Type.ConceptUuid,
|
|
125
|
+
_default: '5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
|
136
126
|
},
|
|
137
127
|
},
|
|
138
128
|
contactAttributeType: {
|
|
@@ -141,31 +131,6 @@ export const configSchema = {
|
|
|
141
131
|
'The UUID of the person attribute type that captures contact information such as `Next of kin contact details`',
|
|
142
132
|
_default: '',
|
|
143
133
|
},
|
|
144
|
-
vitals: vitalsConfigSchema,
|
|
145
|
-
biometrics: biometricsConfigSchema,
|
|
146
|
-
appointmentStatuses: {
|
|
147
|
-
_type: Type.Array,
|
|
148
|
-
_description: 'Configurable appointment status (status of appointments)',
|
|
149
|
-
_default: ['Requested', 'Scheduled', 'CheckedIn', 'Completed', 'Cancelled', 'Missed'],
|
|
150
|
-
},
|
|
151
|
-
defaultIdentifierTypes: {
|
|
152
|
-
_type: Type.Array,
|
|
153
|
-
_element: {
|
|
154
|
-
_type: Type.String,
|
|
155
|
-
},
|
|
156
|
-
_description: 'The identifier types to be display on all patient search result page',
|
|
157
|
-
_default: ['05ee9cf4-7242-4a17-b4d4-00f707265c8a', 'f85081e2-b4be-4e48-b3a4-7994b69bb101'],
|
|
158
|
-
},
|
|
159
|
-
showRecommendedVisitTypeTab: {
|
|
160
|
-
_type: Type.Boolean,
|
|
161
|
-
_description: 'Whether start visit form should display recommended visit type tab. Requires `visitTypeResourceUrl`',
|
|
162
|
-
_default: false,
|
|
163
|
-
},
|
|
164
|
-
visitTypeResourceUrl: {
|
|
165
|
-
_type: Type.String,
|
|
166
|
-
_description: 'The `visitTypeResourceUrl`',
|
|
167
|
-
_default: null,
|
|
168
|
-
},
|
|
169
134
|
customPatientChartUrl: {
|
|
170
135
|
_type: Type.String,
|
|
171
136
|
_default: '${openmrsSpaBase}/patient/${patientUuid}/chart',
|
|
@@ -174,15 +139,34 @@ export const configSchema = {
|
|
|
174
139
|
(openmrsSpaBase and openBase are available to any <ConfigurableLink>)`,
|
|
175
140
|
_validators: [validators.isUrlWithTemplateParameters(['patientUuid'])],
|
|
176
141
|
},
|
|
142
|
+
dashboardTitle: {
|
|
143
|
+
_type: Type.Object,
|
|
144
|
+
_description: 'The title to be displayed on the service queues dashboard',
|
|
145
|
+
key: {
|
|
146
|
+
_type: Type.String,
|
|
147
|
+
_description: 'The translation key of the title to be displayed on the service queues dashboard',
|
|
148
|
+
},
|
|
149
|
+
value: {
|
|
150
|
+
_type: Type.String,
|
|
151
|
+
_description: 'The translation value of the title to be displayed on the service queues dashboard',
|
|
152
|
+
},
|
|
153
|
+
_default: {
|
|
154
|
+
key: 'serviceQueues',
|
|
155
|
+
value: 'Service queues',
|
|
156
|
+
},
|
|
157
|
+
},
|
|
177
158
|
defaultFacilityUrl: {
|
|
178
159
|
_type: Type.String,
|
|
179
160
|
_default: '',
|
|
180
161
|
_description: 'Custom URL to load default facility if it is not in the session',
|
|
181
162
|
},
|
|
182
|
-
|
|
183
|
-
_type: Type.
|
|
184
|
-
|
|
185
|
-
|
|
163
|
+
defaultIdentifierTypes: {
|
|
164
|
+
_type: Type.Array,
|
|
165
|
+
_element: {
|
|
166
|
+
_type: Type.String,
|
|
167
|
+
},
|
|
168
|
+
_description: 'The identifier types to be display on all patient search result page',
|
|
169
|
+
_default: ['05ee9cf4-7242-4a17-b4d4-00f707265c8a', 'f85081e2-b4be-4e48-b3a4-7994b69bb101'],
|
|
186
170
|
},
|
|
187
171
|
queueTables: {
|
|
188
172
|
columnDefinitions: {
|
|
@@ -368,6 +352,22 @@ export const configSchema = {
|
|
|
368
352
|
),
|
|
369
353
|
],
|
|
370
354
|
},
|
|
355
|
+
showRecommendedVisitTypeTab: {
|
|
356
|
+
_type: Type.Boolean,
|
|
357
|
+
_description: 'Whether start visit form should display recommended visit type tab. Requires `visitTypeResourceUrl`',
|
|
358
|
+
_default: false,
|
|
359
|
+
},
|
|
360
|
+
visitQueueNumberAttributeUuid: {
|
|
361
|
+
_type: Type.String,
|
|
362
|
+
_description: 'The UUID of the visit attribute that contains the visit queue number.',
|
|
363
|
+
_default: null,
|
|
364
|
+
},
|
|
365
|
+
visitTypeResourceUrl: {
|
|
366
|
+
_type: Type.String,
|
|
367
|
+
_description: 'The `visitTypeResourceUrl`',
|
|
368
|
+
_default: null,
|
|
369
|
+
},
|
|
370
|
+
vitals: vitalsConfigSchema,
|
|
371
371
|
_validators: [
|
|
372
372
|
validator((config: ConfigObject) => {
|
|
373
373
|
const queueNumberColumnDefs = [
|
|
@@ -393,35 +393,35 @@ function columnHasType(columnDef: ColumnDefinition, type: ColumnType): boolean {
|
|
|
393
393
|
}
|
|
394
394
|
|
|
395
395
|
export interface ConfigObject {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
value: string;
|
|
399
|
-
};
|
|
396
|
+
appointmentStatuses: Array<string>;
|
|
397
|
+
biometrics: BiometricsConfigObject;
|
|
400
398
|
concepts: {
|
|
401
399
|
defaultPriorityConceptUuid: string;
|
|
402
400
|
defaultStatusConceptUuid: string;
|
|
403
401
|
defaultTransitionStatus: string;
|
|
404
|
-
systolicBloodPressureUuid: string;
|
|
405
402
|
diastolicBloodPressureUuid: string;
|
|
403
|
+
emergencyPriorityConceptUuid: string;
|
|
404
|
+
heightUuid: string;
|
|
405
|
+
historicalObsConceptUuid: Array<string>;
|
|
406
|
+
oxygenSaturationUuid: string;
|
|
406
407
|
pulseUuid: string;
|
|
408
|
+
respiratoryRateUuid: string;
|
|
409
|
+
systolicBloodPressureUuid: string;
|
|
407
410
|
temperatureUuid: string;
|
|
408
|
-
oxygenSaturationUuid: string;
|
|
409
|
-
heightUuid: string;
|
|
410
411
|
weightUuid: string;
|
|
411
|
-
respiratoryRateUuid: string;
|
|
412
|
-
emergencyPriorityConceptUuid: string;
|
|
413
|
-
historicalObsConceptUuid: Array<string>;
|
|
414
412
|
};
|
|
415
413
|
contactAttributeType: Array<string>;
|
|
416
|
-
|
|
417
|
-
biometrics: BiometricsConfigObject;
|
|
418
|
-
appointmentStatuses: Array<string>;
|
|
414
|
+
customPatientChartUrl: string;
|
|
419
415
|
defaultIdentifierTypes: Array<string>;
|
|
416
|
+
dashboardTitle: {
|
|
417
|
+
key: string;
|
|
418
|
+
value: string;
|
|
419
|
+
};
|
|
420
|
+
queueTables: TablesConfig;
|
|
420
421
|
showRecommendedVisitTypeTab: boolean;
|
|
421
|
-
customPatientChartUrl: string;
|
|
422
|
-
visitTypeResourceUrl: string;
|
|
423
422
|
visitQueueNumberAttributeUuid: string | null;
|
|
424
|
-
|
|
423
|
+
visitTypeResourceUrl: string;
|
|
424
|
+
vitals: VitalsConfigObject;
|
|
425
425
|
}
|
|
426
426
|
|
|
427
427
|
interface TablesConfig {
|
|
@@ -431,7 +431,7 @@ interface TablesConfig {
|
|
|
431
431
|
A list of table definitions. A queue table (whether it is displaying entries from a
|
|
432
432
|
particular queue+status combination, from a particular queue, or from multiple queues)
|
|
433
433
|
will determine what columns to show based on these definitions. If multiple TableDefinitions
|
|
434
|
-
have matching appliedTo criteria, the first one will be used.
|
|
434
|
+
have matching appliedTo criteria, the first one will be used.
|
|
435
435
|
*/
|
|
436
436
|
tableDefinitions: TableDefinitions[];
|
|
437
437
|
}
|
|
@@ -12,7 +12,7 @@ interface CurrentVisitProps {
|
|
|
12
12
|
|
|
13
13
|
const CurrentVisit: React.FC<CurrentVisitProps> = ({ patientUuid, visitUuid }) => {
|
|
14
14
|
const { t } = useTranslation();
|
|
15
|
-
const { visit,
|
|
15
|
+
const { visit, isLoading } = useVisit(visitUuid);
|
|
16
16
|
|
|
17
17
|
if (isLoading) {
|
|
18
18
|
return <DataTableSkeleton role="progressbar" />;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import { useVisit } from './current-visit.resource';
|
|
4
3
|
import { mockPastVisit } from '__mocks__';
|
|
4
|
+
import { useVisit } from './current-visit.resource';
|
|
5
5
|
import CurrentVisit from './current-visit-summary.component';
|
|
6
6
|
|
|
7
|
-
const useVisitMock =
|
|
7
|
+
const useVisitMock = jest.mocked(useVisit);
|
|
8
8
|
|
|
9
9
|
jest.mock('./current-visit.resource', () => ({
|
|
10
|
-
useVisit: jest.fn(
|
|
10
|
+
useVisit: jest.fn().mockReturnValue({
|
|
11
11
|
visit: {
|
|
12
12
|
visitType: { display: 'Visit Type' },
|
|
13
13
|
encounters: [],
|
|
14
14
|
},
|
|
15
|
-
|
|
15
|
+
error: null,
|
|
16
16
|
isLoading: false,
|
|
17
|
-
})
|
|
17
|
+
}),
|
|
18
18
|
}));
|
|
19
19
|
|
|
20
20
|
const patientUuid = mockPastVisit.data.results[0].patient.uuid;
|
|
@@ -24,17 +24,18 @@ describe('CurrentVisit', () => {
|
|
|
24
24
|
it('renders visit details correctly', async () => {
|
|
25
25
|
render(<CurrentVisit patientUuid={patientUuid} visitUuid={visitUuid} />);
|
|
26
26
|
|
|
27
|
-
expect(screen.queryByRole('progressbar')).
|
|
27
|
+
expect(screen.queryByRole('progressbar')).not.toBeInTheDocument();
|
|
28
28
|
expect(screen.getByText('Visit Type')).toBeInTheDocument();
|
|
29
29
|
expect(screen.getByText('Scheduled for today')).toBeInTheDocument();
|
|
30
30
|
expect(screen.getByText('On time')).toBeInTheDocument();
|
|
31
31
|
});
|
|
32
|
-
it('
|
|
33
|
-
useVisitMock.
|
|
34
|
-
visit:
|
|
35
|
-
|
|
32
|
+
it('renders a loading skeleton when fetching data', async () => {
|
|
33
|
+
useVisitMock.mockReturnValue({
|
|
34
|
+
visit: null,
|
|
35
|
+
error: null,
|
|
36
36
|
isLoading: true,
|
|
37
|
-
|
|
37
|
+
isValidating: false,
|
|
38
|
+
});
|
|
38
39
|
|
|
39
40
|
render(<CurrentVisit patientUuid={patientUuid} visitUuid={visitUuid} />);
|
|
40
41
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
4
4
|
|
|
5
5
|
.visitContainer {
|
|
6
6
|
background-color: $ui-background;
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.wrapper {
|
|
33
|
-
margin:
|
|
33
|
+
margin: layout.$spacing-03;
|
|
34
34
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
@use '@carbon/
|
|
3
|
-
@
|
|
1
|
+
@use '@carbon/layout';
|
|
2
|
+
@use '@carbon/type';
|
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
|
4
4
|
|
|
5
5
|
.subHeading {
|
|
6
6
|
@include type.type-style('label-01');
|
|
@@ -8,20 +8,20 @@
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.emptyText {
|
|
11
|
-
padding:
|
|
11
|
+
padding: layout.$spacing-05;
|
|
12
12
|
@include type.type-style('body-02');
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.unit {
|
|
16
16
|
@include type.type-style('body-compact-01');
|
|
17
17
|
color: var(--text-02);
|
|
18
|
-
margin-left:
|
|
18
|
+
margin-left: layout.$spacing-02;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.vitalValues {
|
|
22
22
|
@include type.type-style('body-compact-02');
|
|
23
23
|
color: $ui-05;
|
|
24
|
-
margin-left:
|
|
24
|
+
margin-left: layout.$spacing-02;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.grid {
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
|
|
40
40
|
.danger-icon {
|
|
41
41
|
color: $danger;
|
|
42
|
-
height:
|
|
43
|
-
width:
|
|
44
|
-
margin-left:
|
|
42
|
+
height: layout.$spacing-02;
|
|
43
|
+
width: layout.$spacing-02;
|
|
44
|
+
margin-left: layout.$spacing-02;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.iconWrapper {
|
|
48
|
-
margin-left:
|
|
48
|
+
margin-left: layout.$spacing-02;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.critically-low,
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
display: flex;
|
|
82
82
|
justify-content: space-between;
|
|
83
83
|
align-items: center;
|
|
84
|
-
margin:
|
|
84
|
+
margin: layout.$spacing-02 layout.$spacing-03;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
.tile {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { updateValueInSessionStorage } from './helpers';
|
|
2
|
+
|
|
3
|
+
describe('Testing updateValueInSessionStorage', () => {
|
|
4
|
+
beforeEach(() => {
|
|
5
|
+
sessionStorage.clear();
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
it('should save value in the session storage if valid value is passed', () => {
|
|
9
|
+
updateValueInSessionStorage('key', 'value');
|
|
10
|
+
expect(sessionStorage.getItem('key')).toBe('value');
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should delete the key of the value passed is null or undefined', () => {
|
|
14
|
+
updateValueInSessionStorage('key1', 'v1');
|
|
15
|
+
expect(sessionStorage.getItem('key1')).toBe('v1');
|
|
16
|
+
updateValueInSessionStorage('key1', null);
|
|
17
|
+
expect(sessionStorage.getItem('key1')).toBe(null);
|
|
18
|
+
|
|
19
|
+
updateValueInSessionStorage('key2', 'v2');
|
|
20
|
+
expect(sessionStorage.getItem('key2')).toBe('v2');
|
|
21
|
+
updateValueInSessionStorage('key2', undefined);
|
|
22
|
+
expect(sessionStorage.getItem('key2')).toBe(null);
|
|
23
|
+
});
|
|
24
|
+
});
|
package/src/helpers/helpers.ts
CHANGED
|
@@ -14,17 +14,42 @@ export const getServiceCountByAppointmentType = (
|
|
|
14
14
|
.reduce((count, val) => count + val, 0);
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* This function is mainly useful for not writing null/ undefined in the session storage
|
|
19
|
+
*/
|
|
20
|
+
export function updateValueInSessionStorage(key: string, value: string) {
|
|
21
|
+
if (value === undefined || value === null) {
|
|
22
|
+
sessionStorage.removeItem(key);
|
|
23
|
+
} else {
|
|
24
|
+
sessionStorage.setItem(key, value);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* This function fetches the value for the passed key from session storage
|
|
30
|
+
*/
|
|
31
|
+
export function getValueFromSessionStorage(key: string): string | null {
|
|
32
|
+
return sessionStorage.getItem(key);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const initialQueueLocationNameState = {
|
|
36
|
+
queueLocationName: getValueFromSessionStorage('queueLocationName'),
|
|
37
|
+
};
|
|
38
|
+
const initialQueueLocationUuidState = {
|
|
39
|
+
queueLocationUuid: getValueFromSessionStorage('queueLocationUuid'),
|
|
40
|
+
};
|
|
19
41
|
const initialServiceUuidState = {
|
|
20
|
-
serviceUuid:
|
|
21
|
-
serviceDisplay:
|
|
42
|
+
serviceUuid: getValueFromSessionStorage('queueServiceUuid'),
|
|
43
|
+
serviceDisplay: getValueFromSessionStorage('queueServiceDisplay'),
|
|
44
|
+
};
|
|
45
|
+
const intialAppointmentStatusNameState = { status: '' };
|
|
46
|
+
const initialQueueStatusState = {
|
|
47
|
+
statusUuid: getValueFromSessionStorage('queueStatusUuid'),
|
|
48
|
+
statusDisplay: getValueFromSessionStorage('queueStatusDisplay'),
|
|
22
49
|
};
|
|
23
|
-
const intialStatusNameState = { status: '' };
|
|
24
|
-
const initialQueueStatusState = { statusUuid: null, statusDisplay: null };
|
|
25
50
|
const initialSelectedQueueRoomTimestamp = { providerQueueRoomTimestamp: new Date() };
|
|
26
51
|
const initialPermanentProviderQueueRoomState = {
|
|
27
|
-
isPermanentProviderQueueRoom:
|
|
52
|
+
isPermanentProviderQueueRoom: getValueFromSessionStorage('isPermanentProviderQueueRoom'),
|
|
28
53
|
};
|
|
29
54
|
|
|
30
55
|
export function getSelectedService() {
|
|
@@ -35,7 +60,7 @@ export function getSelectedService() {
|
|
|
35
60
|
}
|
|
36
61
|
|
|
37
62
|
export function getSelectedAppointmentStatus() {
|
|
38
|
-
return getGlobalStore<{ status: string }>('appointmentSelectedStatus',
|
|
63
|
+
return getGlobalStore<{ status: string }>('appointmentSelectedStatus', intialAppointmentStatusNameState);
|
|
39
64
|
}
|
|
40
65
|
|
|
41
66
|
export function getSelectedQueueLocationName() {
|
|
@@ -69,8 +94,8 @@ export function getIsPermanentProviderQueueRoom() {
|
|
|
69
94
|
|
|
70
95
|
export const updateSelectedService = (currentServiceUuid: string, currentServiceDisplay: string) => {
|
|
71
96
|
const store = getSelectedService();
|
|
72
|
-
|
|
73
|
-
|
|
97
|
+
updateValueInSessionStorage('queueServiceDisplay', currentServiceDisplay);
|
|
98
|
+
updateValueInSessionStorage('queueServiceUuid', currentServiceUuid);
|
|
74
99
|
store.setState({ serviceUuid: currentServiceUuid, serviceDisplay: currentServiceDisplay });
|
|
75
100
|
};
|
|
76
101
|
|
|
@@ -81,13 +106,13 @@ export const updateSelectedAppointmentStatus = (currentAppointmentStatus: string
|
|
|
81
106
|
|
|
82
107
|
export const updateSelectedQueueLocationName = (currentLocationName: string) => {
|
|
83
108
|
const store = getSelectedQueueLocationName();
|
|
84
|
-
|
|
109
|
+
updateValueInSessionStorage('queueLocationName', currentLocationName);
|
|
85
110
|
store.setState({ queueLocationName: currentLocationName });
|
|
86
111
|
};
|
|
87
112
|
|
|
88
113
|
export const updateSelectedQueueLocationUuid = (currentLocationUuid: string) => {
|
|
89
114
|
const store = getSelectedQueueLocationUuid();
|
|
90
|
-
|
|
115
|
+
updateValueInSessionStorage('queueLocationUuid', currentLocationUuid);
|
|
91
116
|
store.setState({ queueLocationUuid: currentLocationUuid });
|
|
92
117
|
};
|
|
93
118
|
|
|
@@ -98,12 +123,14 @@ export const updatedSelectedQueueRoomTimestamp = (currentProviderRoomTimestamp:
|
|
|
98
123
|
|
|
99
124
|
export const updateIsPermanentProviderQueueRoom = (currentIsPermanentProviderQueueRoom) => {
|
|
100
125
|
const store = getIsPermanentProviderQueueRoom();
|
|
101
|
-
|
|
126
|
+
updateValueInSessionStorage('isPermanentProviderQueueRoom', currentIsPermanentProviderQueueRoom);
|
|
102
127
|
store.setState({ isPermanentProviderQueueRoom: currentIsPermanentProviderQueueRoom });
|
|
103
128
|
};
|
|
104
129
|
|
|
105
130
|
export const updateSelectedQueueStatus = (currentQueueStatusUuid: string, currentQueueStatusDisplay: string) => {
|
|
106
131
|
const store = getSelectedQueueStatus();
|
|
132
|
+
updateValueInSessionStorage('queueStatusUuid', currentQueueStatusUuid);
|
|
133
|
+
updateValueInSessionStorage('queueStatusDisplay', currentQueueStatusDisplay);
|
|
107
134
|
store.setState({ statusUuid: currentQueueStatusUuid, statusDisplay: currentQueueStatusDisplay });
|
|
108
135
|
};
|
|
109
136
|
|
|
@@ -117,7 +144,7 @@ export const useSelectedService = () => {
|
|
|
117
144
|
};
|
|
118
145
|
|
|
119
146
|
export const useSelectedAppointmentStatus = () => {
|
|
120
|
-
const [currentAppointmentStatus, setCurrentAppointmentStatus] = useState(
|
|
147
|
+
const [currentAppointmentStatus, setCurrentAppointmentStatus] = useState(intialAppointmentStatusNameState.status);
|
|
121
148
|
|
|
122
149
|
useEffect(() => {
|
|
123
150
|
getSelectedAppointmentStatus().subscribe(({ status }) => setCurrentAppointmentStatus(status));
|
package/src/home.test.tsx
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import Home from './home.component';
|
|
4
3
|
import { getDefaultsFromConfigSchema, useConfig } from '@openmrs/esm-framework';
|
|
5
|
-
import { configSchema } from './config-schema';
|
|
6
|
-
|
|
7
|
-
const mockedUseConfig = useConfig as jest.Mock;
|
|
4
|
+
import { type ConfigObject, configSchema } from './config-schema';
|
|
5
|
+
import Home from './home.component';
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
...getDefaultsFromConfigSchema(configSchema),
|
|
11
|
-
concepts: {
|
|
12
|
-
visitQueueNumberAttributeUuid: 'c61ce16f-272a-41e7-9924-4c555d0932c5',
|
|
13
|
-
},
|
|
14
|
-
});
|
|
7
|
+
const mockUseConfig = jest.mocked(useConfig<ConfigObject>);
|
|
15
8
|
|
|
16
9
|
jest.mock('./helpers/helpers', () => ({
|
|
17
10
|
...jest.requireActual('./helpers/helpers'),
|
|
18
11
|
useSelectedQueueLocationName: jest.fn(() => 'Test Location'),
|
|
19
12
|
}));
|
|
20
13
|
|
|
14
|
+
mockUseConfig.mockReturnValue({
|
|
15
|
+
...getDefaultsFromConfigSchema(configSchema),
|
|
16
|
+
visitQueueNumberAttributeUuid: 'c61ce16f-272a-41e7-9924-4c555d0932c5',
|
|
17
|
+
});
|
|
18
|
+
|
|
21
19
|
describe('Home Component', () => {
|
|
22
20
|
it('renders PatientQueueHeader, ClinicMetrics when activeTicketScreen is not "screen"', () => {
|
|
23
21
|
// Mock window.location.pathname
|
|
24
22
|
const originalLocation = window.location;
|
|
25
23
|
delete window.location;
|
|
26
|
-
window.location = { pathname: '/some-path' };
|
|
24
|
+
window.location = { pathname: '/some-path' } as Location;
|
|
27
25
|
|
|
28
26
|
render(<Home />);
|
|
29
27
|
|
|
@@ -38,7 +36,7 @@ describe('Home Component', () => {
|
|
|
38
36
|
it('renders QueueScreen when activeTicketScreen is "screen"', () => {
|
|
39
37
|
const originalLocation = window.location;
|
|
40
38
|
delete window.location;
|
|
41
|
-
window.location = { pathname: '/some-path/screen' };
|
|
39
|
+
window.location = { pathname: '/some-path/screen' } as Location;
|
|
42
40
|
|
|
43
41
|
render(<Home />);
|
|
44
42
|
expect(screen.getByText(/patients currently in queue/i)).toBeInTheDocument();
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import { getLocale } from '@openmrs/esm-framework';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { useQueues } from './useQueues';
|
|
4
|
+
import uniqBy from 'lodash-es/uniqBy';
|
|
5
|
+
import { useSelectedQueueLocationUuid } from '../helpers/helpers';
|
|
4
6
|
|
|
5
|
-
function useQueueServices(
|
|
6
|
-
const
|
|
7
|
+
function useQueueServices() {
|
|
8
|
+
const currentQueueLocation = useSelectedQueueLocationUuid();
|
|
9
|
+
const { queues, isLoading } = useQueues(currentQueueLocation);
|
|
7
10
|
|
|
8
|
-
const results = useMemo(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const results = useMemo(() => {
|
|
12
|
+
const uniqueServices = uniqBy(
|
|
13
|
+
queues.flatMap((queue) => queue.service),
|
|
14
|
+
(service) => service?.uuid,
|
|
15
|
+
);
|
|
16
|
+
const sortedServices = uniqueServices.sort((a, b) => a.display.localeCompare(b.display, getLocale()));
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
services: sortedServices,
|
|
13
20
|
isLoadingQueueServices: isLoading,
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
);
|
|
21
|
+
};
|
|
22
|
+
}, [queues, isLoading]);
|
|
17
23
|
|
|
18
24
|
return results;
|
|
19
25
|
}
|