@ampath/esm-dha-workflow-app 4.0.0-next.53 → 4.0.0-next.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/264.js +1 -1
- package/dist/264.js.map +1 -1
- package/dist/294.js +1 -1
- package/dist/294.js.map +1 -1
- package/dist/826.js +1 -1
- package/dist/826.js.map +1 -1
- package/dist/esm-dha-workflow-app.js.buildmanifest.json +9 -9
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/bookings/daily/daily-bookings.resource.ts +2 -1
- package/src/registry/modal/send-to-triage/send-to-triage.modal.tsx +62 -17
|
@@ -382,9 +382,9 @@
|
|
|
382
382
|
"initial": false,
|
|
383
383
|
"entry": false,
|
|
384
384
|
"recorded": false,
|
|
385
|
-
"size":
|
|
385
|
+
"size": 54378,
|
|
386
386
|
"sizes": {
|
|
387
|
-
"javascript":
|
|
387
|
+
"javascript": 54378
|
|
388
388
|
},
|
|
389
389
|
"names": [],
|
|
390
390
|
"idHints": [],
|
|
@@ -398,7 +398,7 @@
|
|
|
398
398
|
"auxiliaryFiles": [
|
|
399
399
|
"264.js.map"
|
|
400
400
|
],
|
|
401
|
-
"hash": "
|
|
401
|
+
"hash": "afe713bc3cf61c8e",
|
|
402
402
|
"childrenByOrder": {}
|
|
403
403
|
},
|
|
404
404
|
{
|
|
@@ -434,9 +434,9 @@
|
|
|
434
434
|
"entry": false,
|
|
435
435
|
"recorded": false,
|
|
436
436
|
"reason": "split chunk (cache group: default)",
|
|
437
|
-
"size":
|
|
437
|
+
"size": 194476,
|
|
438
438
|
"sizes": {
|
|
439
|
-
"javascript":
|
|
439
|
+
"javascript": 194476
|
|
440
440
|
},
|
|
441
441
|
"names": [],
|
|
442
442
|
"idHints": [],
|
|
@@ -450,7 +450,7 @@
|
|
|
450
450
|
"auxiliaryFiles": [
|
|
451
451
|
"294.js.map"
|
|
452
452
|
],
|
|
453
|
-
"hash": "
|
|
453
|
+
"hash": "9f2076ca1de85824",
|
|
454
454
|
"childrenByOrder": {}
|
|
455
455
|
},
|
|
456
456
|
{
|
|
@@ -866,9 +866,9 @@
|
|
|
866
866
|
"initial": false,
|
|
867
867
|
"entry": false,
|
|
868
868
|
"recorded": false,
|
|
869
|
-
"size":
|
|
869
|
+
"size": 124782,
|
|
870
870
|
"sizes": {
|
|
871
|
-
"javascript":
|
|
871
|
+
"javascript": 124782
|
|
872
872
|
},
|
|
873
873
|
"names": [],
|
|
874
874
|
"idHints": [],
|
|
@@ -882,7 +882,7 @@
|
|
|
882
882
|
"auxiliaryFiles": [
|
|
883
883
|
"826.js.map"
|
|
884
884
|
],
|
|
885
|
-
"hash": "
|
|
885
|
+
"hash": "283e5ddfb9c5fd09",
|
|
886
886
|
"childrenByOrder": {}
|
|
887
887
|
},
|
|
888
888
|
{
|
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{},"pages":[{"component":"root","route":"dha-workflow","online":true,"offline":true}],"extensions":[{"component":"workflowRegistryLink","name":"workflow-registry-link","slot":"app-menu-slot","online":true,"offline":true},{"component":"navLinks","name":"side-nav-workflow-links","slot":"dha-workflow-slot","online":true,"offline":true},{"name":"dha-workflow-dashboard-link","component":"dhaWorkflowDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"dashboard","slot":"dha-workflow-dashboard-slot","title":"Dashboard"},"online":true,"offline":true,"order":0},{"component":"dhaWorkflowDashboard","name":"dashboardExt","slot":"dha-workflow-dashboard-slot"},{"name":"registry-dashboard-link","component":"registryDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"registry","slot":"client-registry-dashboard-slot","title":"Registry"},"online":true,"offline":true,"order":1},{"component":"registryExtension","name":"registry","slot":"client-registry-dashboard-slot"},{"name":"triage-dashboard-link","component":"triageDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"triage","slot":"triage-queue-dashboard-slot","title":"Triage"},"online":true,"offline":false},{"component":"triageQueueExtension","name":"triage","slot":"triage-queue-dashboard-slot"},{"name":"consultation-dashboard-link","component":"consultationDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"consultation","slot":"consultation-dashboard-slot","title":"Consultation"},"online":true,"offline":false},{"component":"consultationQueue","name":"consultation","slot":"consultation-dashboard-slot"},{"name":"mnch-dashboard-link","component":"mnchQueueDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"mnch","slot":"mnch-dashboard-slot","title":"MNCH"},"online":true,"offline":true},{"component":"mnchQueueDashboard","name":"mnch","slot":"mnch-dashboard-slot"},{"name":"pharmacy-dashboard-link","component":"pharmacyDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"dispensing","slot":"dispensing-dashboard-slot","title":"Pharmacy"},"online":true,"offline":true},{"name":"accounting-dashboard-link","component":"accountingDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"accounting","slot":"accounting-dashboard-slot","title":"Accounting"},"online":true,"offline":false},{"component":"accountingDashboard","name":"accounting","slot":"accounting-dashboard-slot"},{"name":"registers-dashboard-link","component":"registersDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"registers","slot":"registers-dashboard-slot","title":"Registers"},"online":true,"offline":false},{"component":"registers","name":"registers","slot":"registers-dashboard-slot"},{"name":"reports-dashboard-link","component":"reportsDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"reports","slot":"reports-dashboard-slot","title":"Reports"},"online":true,"offline":false},{"component":"reports","name":"Reports","slot":"reports-dashboard-slot"},{"name":"bookings-dashboard-link","component":"bookingsDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"bookings","slot":"bookings-dashboard-slot","title":"Bookings"},"online":true,"offline":true},{"component":"bookings","name":"bookings","slot":"bookings-dashboard-slot"}],"modals":[{"name":"sign-off-queue-entry-modal","component":"signOffModal"}],"version":"4.0.0-next.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{},"pages":[{"component":"root","route":"dha-workflow","online":true,"offline":true}],"extensions":[{"component":"workflowRegistryLink","name":"workflow-registry-link","slot":"app-menu-slot","online":true,"offline":true},{"component":"navLinks","name":"side-nav-workflow-links","slot":"dha-workflow-slot","online":true,"offline":true},{"name":"dha-workflow-dashboard-link","component":"dhaWorkflowDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"dashboard","slot":"dha-workflow-dashboard-slot","title":"Dashboard"},"online":true,"offline":true,"order":0},{"component":"dhaWorkflowDashboard","name":"dashboardExt","slot":"dha-workflow-dashboard-slot"},{"name":"registry-dashboard-link","component":"registryDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"registry","slot":"client-registry-dashboard-slot","title":"Registry"},"online":true,"offline":true,"order":1},{"component":"registryExtension","name":"registry","slot":"client-registry-dashboard-slot"},{"name":"triage-dashboard-link","component":"triageDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"triage","slot":"triage-queue-dashboard-slot","title":"Triage"},"online":true,"offline":false},{"component":"triageQueueExtension","name":"triage","slot":"triage-queue-dashboard-slot"},{"name":"consultation-dashboard-link","component":"consultationDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"consultation","slot":"consultation-dashboard-slot","title":"Consultation"},"online":true,"offline":false},{"component":"consultationQueue","name":"consultation","slot":"consultation-dashboard-slot"},{"name":"mnch-dashboard-link","component":"mnchQueueDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"mnch","slot":"mnch-dashboard-slot","title":"MNCH"},"online":true,"offline":true},{"component":"mnchQueueDashboard","name":"mnch","slot":"mnch-dashboard-slot"},{"name":"pharmacy-dashboard-link","component":"pharmacyDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"dispensing","slot":"dispensing-dashboard-slot","title":"Pharmacy"},"online":true,"offline":true},{"name":"accounting-dashboard-link","component":"accountingDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"accounting","slot":"accounting-dashboard-slot","title":"Accounting"},"online":true,"offline":false},{"component":"accountingDashboard","name":"accounting","slot":"accounting-dashboard-slot"},{"name":"registers-dashboard-link","component":"registersDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"registers","slot":"registers-dashboard-slot","title":"Registers"},"online":true,"offline":false},{"component":"registers","name":"registers","slot":"registers-dashboard-slot"},{"name":"reports-dashboard-link","component":"reportsDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"reports","slot":"reports-dashboard-slot","title":"Reports"},"online":true,"offline":false},{"component":"reports","name":"Reports","slot":"reports-dashboard-slot"},{"name":"bookings-dashboard-link","component":"bookingsDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"bookings","slot":"bookings-dashboard-slot","title":"Bookings"},"online":true,"offline":true},{"component":"bookings","name":"bookings","slot":"bookings-dashboard-slot"}],"modals":[{"name":"sign-off-queue-entry-modal","component":"signOffModal"}],"version":"4.0.0-next.55"}
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { openmrsFetch } from '@openmrs/esm-framework';
|
|
1
2
|
import { getEtlBaseUrl } from '../../shared/utils/get-base-url';
|
|
2
3
|
import {
|
|
3
4
|
type BookingFilter,
|
|
@@ -21,7 +22,7 @@ export async function getDailyBookings(
|
|
|
21
22
|
};
|
|
22
23
|
const queryString = new URLSearchParams(params).toString();
|
|
23
24
|
const dailyAppUrl = `${etlBaseUrl}/${bookingType}/${bookingFilter.startDate}?&${queryString}`;
|
|
24
|
-
const resp = await
|
|
25
|
+
const resp = await openmrsFetch(dailyAppUrl);
|
|
25
26
|
const data: DailyBookingsReponse = await resp.json();
|
|
26
27
|
return data.result ?? [];
|
|
27
28
|
}
|
|
@@ -108,8 +108,23 @@ const SendToTriageModal: React.FC<SendToTriageModalProps> = ({
|
|
|
108
108
|
window.open('https://afyayangu.go.ke/', '_blank');
|
|
109
109
|
};
|
|
110
110
|
const sendToTriage = async () => {
|
|
111
|
+
if (!validateVisitQueueBill()) return;
|
|
111
112
|
setLoading(true);
|
|
112
113
|
try {
|
|
114
|
+
// add bill if it was a paying client
|
|
115
|
+
let createBillResp = null;
|
|
116
|
+
if (selectedPaymentDetail === PaymentDetail.Paying) {
|
|
117
|
+
const createBillDto = generateCreateBillDto();
|
|
118
|
+
if (isValidCreateBillDto(createBillDto)) {
|
|
119
|
+
createBillResp = await createBill(createBillDto);
|
|
120
|
+
if (createBillResp) {
|
|
121
|
+
showAlert('success', 'Bill succesfully created', '');
|
|
122
|
+
}
|
|
123
|
+
} else {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
113
128
|
const newVisit = await createPatientVisit();
|
|
114
129
|
if (newVisit) {
|
|
115
130
|
const addToTriageQueueDto: QueueEntryDto = generateAddToTriageDto(newVisit.uuid);
|
|
@@ -119,21 +134,7 @@ const SendToTriageModal: React.FC<SendToTriageModalProps> = ({
|
|
|
119
134
|
showAlert('success', 'Patient has succesfully been moved to the Triage queue', '');
|
|
120
135
|
}
|
|
121
136
|
|
|
122
|
-
|
|
123
|
-
let createBillResp = null;
|
|
124
|
-
if (selectedPaymentDetail === PaymentDetail.Paying && selectedBillableService) {
|
|
125
|
-
const createBillDto = generateCreateBillDto();
|
|
126
|
-
if (isValidCreateBillDto(createBillDto)) {
|
|
127
|
-
createBillResp = await createBill(createBillDto);
|
|
128
|
-
if (createBillResp) {
|
|
129
|
-
showAlert('success', 'Bill succesfully created', '');
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
} else {
|
|
133
|
-
createBillResp = true;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (queueEntryResp && createBillResp) {
|
|
137
|
+
if ((queueEntryResp && PaymentDetail.Paying && createBillResp) || (queueEntryResp && PaymentDetail.NonPaying)) {
|
|
137
138
|
onModalClose({ success: true });
|
|
138
139
|
}
|
|
139
140
|
}
|
|
@@ -143,6 +144,50 @@ const SendToTriageModal: React.FC<SendToTriageModalProps> = ({
|
|
|
143
144
|
setLoading(false);
|
|
144
145
|
}
|
|
145
146
|
};
|
|
147
|
+
function validateVisitQueueBill(): boolean {
|
|
148
|
+
if (!selectedPatient) {
|
|
149
|
+
showAlert('error', 'Please select a patient', '');
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
if (!selectedPaymentDetail) {
|
|
153
|
+
showAlert('error', 'Please select a paying or non paying option', '');
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (selectedPaymentDetail === PaymentDetail.Paying) {
|
|
158
|
+
if (!selectedPaymentMode) {
|
|
159
|
+
showAlert('error', 'Please select a payment method', '');
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
if (!selectedBillableService) {
|
|
163
|
+
showAlert('error', 'Please select a billable service', '');
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
if (!selectedCashPoint) {
|
|
167
|
+
showAlert('error', 'Please select a cashpoint', '');
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (selectedPaymentDetail === PaymentDetail.NonPaying) {
|
|
172
|
+
if (!selectedPatientCategory) {
|
|
173
|
+
showAlert('error', 'Please select a patient category', '');
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (!selectedVisitType) {
|
|
178
|
+
showAlert('error', 'Please select a visit type', '');
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
if (!selectedServiceQueue) {
|
|
182
|
+
showAlert('error', 'Please select a service queue', '');
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
if (!selectedPriority) {
|
|
186
|
+
showAlert('error', 'Please select a service queue priority', '');
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
146
191
|
const generateAddToTriageDto = (newVisitUuid: string): QueueEntryDto => {
|
|
147
192
|
const payload: QueueEntryDto = {
|
|
148
193
|
visit: {
|
|
@@ -391,11 +436,11 @@ const SendToTriageModal: React.FC<SendToTriageModalProps> = ({
|
|
|
391
436
|
return false;
|
|
392
437
|
}
|
|
393
438
|
if (!createBillDto.cashPoint) {
|
|
394
|
-
showAlert('error', 'Please select a cashpoint', '');
|
|
439
|
+
showAlert('error', 'Please select a valid cashpoint', '');
|
|
395
440
|
return false;
|
|
396
441
|
}
|
|
397
442
|
if (!createBillDto.lineItems || createBillDto.lineItems.length === 0) {
|
|
398
|
-
showAlert('error', 'Please select a valid
|
|
443
|
+
showAlert('error', 'Please select a valid billable service', '');
|
|
399
444
|
return false;
|
|
400
445
|
}
|
|
401
446
|
return true;
|