@ampath/esm-dha-workflow-app 4.0.0-next.11 → 4.0.0-next.12
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/16.js +1 -0
- package/dist/16.js.map +1 -0
- package/dist/198.js +1 -1
- package/dist/860.js +1 -1
- package/dist/860.js.map +1 -1
- package/dist/91.js +1 -1
- package/dist/91.js.map +1 -1
- package/dist/970.js +2 -0
- package/dist/970.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-home-app.js +1 -1
- package/dist/openmrs-esm-home-app.js.buildmanifest.json +43 -43
- package/dist/openmrs-esm-home-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/registry/modal/client-details-modal/client-details-modal.tsx +11 -5
- package/src/registry/modal/send-to-triage/send-to-triage.modal.scss +24 -0
- package/src/registry/modal/send-to-triage/send-to-triage.modal.tsx +258 -0
- package/src/registry/registry.component.tsx +37 -4
- package/src/registry/registry.resource.ts +1 -2
- package/src/registry/types/index.ts +63 -0
- package/src/registry/utils/error-handler.ts +4 -0
- package/src/resources/patient-search.resource.ts +22 -0
- package/src/resources/queue.resource.ts +37 -0
- package/src/resources/visit.resource.ts +20 -0
- package/src/root.component.tsx +1 -0
- package/src/shared/constants/concepts.ts +17 -0
- package/src/shared/constants/index.ts +2 -0
- package/dist/161.js +0 -1
- package/dist/161.js.map +0 -1
- package/dist/916.js +0 -2
- package/dist/916.js.map +0 -1
- package/src/resources/resources.component.tsx +0 -56
- package/src/resources/resources.scss +0 -68
- /package/dist/{916.js.LICENSE.txt → 970.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
Checkbox,
|
|
5
|
+
Dropdown,
|
|
6
|
+
InlineLoading,
|
|
7
|
+
Modal,
|
|
8
|
+
ModalBody,
|
|
9
|
+
Select,
|
|
10
|
+
SelectItem,
|
|
11
|
+
Table,
|
|
12
|
+
TableBody,
|
|
13
|
+
TableCell,
|
|
14
|
+
TableHead,
|
|
15
|
+
TableHeader,
|
|
16
|
+
TableRow,
|
|
17
|
+
} from '@carbon/react';
|
|
18
|
+
import styles from './send-to-triage.modal.scss';
|
|
19
|
+
import {
|
|
20
|
+
type VisitType,
|
|
21
|
+
type Patient,
|
|
22
|
+
useVisitTypes,
|
|
23
|
+
useSession,
|
|
24
|
+
showSnackbar,
|
|
25
|
+
type Visit,
|
|
26
|
+
} from '@openmrs/esm-framework';
|
|
27
|
+
import { type CreateVisitDto, type QueueEntryDto, type ServiceQueue } from '../../types';
|
|
28
|
+
import { createQueueEntry, fetchServiceQueuesByLocationUuid } from '../../../resources/queue.resource';
|
|
29
|
+
import { QUEUE_PRIORITIES_UUIDS, QUEUE_STATUS_UUIDS } from '../../../shared/constants/concepts';
|
|
30
|
+
import { createVisit } from '../../../resources/visit.resource';
|
|
31
|
+
|
|
32
|
+
interface SendToTriageModalProps {
|
|
33
|
+
patients: Patient[];
|
|
34
|
+
open: boolean;
|
|
35
|
+
onModalClose: (modalCloseResp?: { success: boolean }) => void;
|
|
36
|
+
onSubmit: () => void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const SendToTriageModal: React.FC<SendToTriageModalProps> = ({ patients, open, onModalClose, onSubmit }) => {
|
|
40
|
+
const [selectedPatient, setSelectedPatient] = useState<Patient>();
|
|
41
|
+
const [selectedVisitType, setSelectedVisitType] = useState<string>();
|
|
42
|
+
const [serviceQueues, setServiceQueues] = useState<ServiceQueue[]>();
|
|
43
|
+
const [selectedServiceQueue, setSelectedServiceQueue] = useState<string>();
|
|
44
|
+
const [selectedPriority, setSelectedPriority] = useState<string>('');
|
|
45
|
+
const [loading, setLoading] = useState<boolean>(false);
|
|
46
|
+
const visitTypes = useVisitTypes();
|
|
47
|
+
const session = useSession();
|
|
48
|
+
const locationUuid = session.sessionLocation.uuid;
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
getServiceQueues();
|
|
51
|
+
}, [patients]);
|
|
52
|
+
if (!patients) {
|
|
53
|
+
return <>No Client data</>;
|
|
54
|
+
}
|
|
55
|
+
const registerOnAfyaYangu = () => {
|
|
56
|
+
window.open('https://afyayangu.go.ke/', '_blank');
|
|
57
|
+
};
|
|
58
|
+
const sendToTriage = async () => {
|
|
59
|
+
setLoading(true);
|
|
60
|
+
try {
|
|
61
|
+
const newVisit = await createPatientVisit();
|
|
62
|
+
if (newVisit) {
|
|
63
|
+
const addToTriageQueueDto: QueueEntryDto = generateAddToTriageDto(newVisit.uuid);
|
|
64
|
+
const queueEntryResp = await createQueueEntry(addToTriageQueueDto);
|
|
65
|
+
if (queueEntryResp) {
|
|
66
|
+
showAlert('success', 'Patient has succesfully been moved to the Triage queue', '');
|
|
67
|
+
onModalClose({ success: true });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
} catch (error) {
|
|
71
|
+
showAlert('error', 'Error creating visit', '');
|
|
72
|
+
} finally {
|
|
73
|
+
setLoading(false);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const generateAddToTriageDto = (newVisitUuid: string): QueueEntryDto => {
|
|
77
|
+
const payload: QueueEntryDto = {
|
|
78
|
+
visit: {
|
|
79
|
+
uuid: newVisitUuid,
|
|
80
|
+
},
|
|
81
|
+
queueEntry: {
|
|
82
|
+
status: {
|
|
83
|
+
uuid: QUEUE_STATUS_UUIDS.WAITING_UUID,
|
|
84
|
+
},
|
|
85
|
+
priority: {
|
|
86
|
+
uuid: selectedPriority,
|
|
87
|
+
},
|
|
88
|
+
queue: {
|
|
89
|
+
uuid: selectedServiceQueue,
|
|
90
|
+
},
|
|
91
|
+
patient: {
|
|
92
|
+
uuid: selectedPatient.uuid,
|
|
93
|
+
},
|
|
94
|
+
startedAt: new Date().toISOString(),
|
|
95
|
+
sortWeight: 0,
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
return payload;
|
|
99
|
+
};
|
|
100
|
+
const onPatientSelect = (patient: Patient) => {
|
|
101
|
+
setSelectedPatient(patient);
|
|
102
|
+
};
|
|
103
|
+
const getServiceQueues = async () => {
|
|
104
|
+
const resp = await fetchServiceQueuesByLocationUuid(locationUuid);
|
|
105
|
+
if (resp && resp.results) {
|
|
106
|
+
setServiceQueues(resp.results);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const visitTypeChangeHandler = ($event: any) => {
|
|
110
|
+
const vt = $event.target.value as unknown as string;
|
|
111
|
+
setSelectedVisitType(vt);
|
|
112
|
+
};
|
|
113
|
+
const serviceChangeHandler = ($event: any) => {
|
|
114
|
+
const sq = $event.target.value as unknown as string;
|
|
115
|
+
setSelectedServiceQueue(sq);
|
|
116
|
+
};
|
|
117
|
+
const priorityChangeHandler = (priorityUuid: string) => {
|
|
118
|
+
setSelectedPriority(priorityUuid);
|
|
119
|
+
};
|
|
120
|
+
const createPatientVisit = async () => {
|
|
121
|
+
const visitDto = getCreateVisitDto();
|
|
122
|
+
if (!isValidCreateVisitDto(visitDto)) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const result = await createVisit(visitDto);
|
|
127
|
+
if (result) {
|
|
128
|
+
showAlert('success', 'Visit has been created succesfully', '');
|
|
129
|
+
return result;
|
|
130
|
+
} else {
|
|
131
|
+
showAlert('error', 'Error creating patient visit', '');
|
|
132
|
+
throw new Error('Error creating patient visit');
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
const isValidCreateVisitDto = (createVisitDto: CreateVisitDto): boolean => {
|
|
136
|
+
if (!createVisitDto.location) {
|
|
137
|
+
showAlert('error', 'Missing location in create visits', '');
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
if (!createVisitDto.patient) {
|
|
141
|
+
showAlert('error', 'Please select a patient', '');
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (!createVisitDto.visitType) {
|
|
146
|
+
showAlert('error', 'Please select a visit', '');
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
return true;
|
|
150
|
+
};
|
|
151
|
+
const getCreateVisitDto = (): CreateVisitDto => {
|
|
152
|
+
return {
|
|
153
|
+
visitType: selectedVisitType,
|
|
154
|
+
location: locationUuid,
|
|
155
|
+
startDatetime: null,
|
|
156
|
+
stopDatetime: null,
|
|
157
|
+
patient: selectedPatient?.uuid ?? '',
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
const showAlert = (alertType: 'error' | 'success', title: string, subtitle: string) => {
|
|
161
|
+
showSnackbar({
|
|
162
|
+
kind: alertType,
|
|
163
|
+
title: title,
|
|
164
|
+
subtitle: subtitle,
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
return (
|
|
168
|
+
<>
|
|
169
|
+
<Modal
|
|
170
|
+
open={open}
|
|
171
|
+
size="md"
|
|
172
|
+
onSecondarySubmit={() => onModalClose({ success: false })}
|
|
173
|
+
onRequestClose={() => onModalClose({ success: false })}
|
|
174
|
+
onRequestSubmit={registerOnAfyaYangu}
|
|
175
|
+
primaryButtonText="Register on Afya Yangu"
|
|
176
|
+
secondaryButtonText="Cancel"
|
|
177
|
+
>
|
|
178
|
+
<ModalBody>
|
|
179
|
+
<div className={styles.clientDetailsLayout}>
|
|
180
|
+
<div className={styles.sectionHeader}>
|
|
181
|
+
<h4 className={styles.sectionTitle}>Send To Triage</h4>
|
|
182
|
+
</div>
|
|
183
|
+
<div className={styles.sectionContent}>
|
|
184
|
+
<div className={styles.patientSelect}>
|
|
185
|
+
<Table>
|
|
186
|
+
<TableHead>
|
|
187
|
+
<TableRow>
|
|
188
|
+
<TableHeader>No</TableHeader>
|
|
189
|
+
<TableHeader>Name</TableHeader>
|
|
190
|
+
<TableHeader>DOB</TableHeader>
|
|
191
|
+
<TableHeader>Select Patient</TableHeader>
|
|
192
|
+
</TableRow>
|
|
193
|
+
</TableHead>
|
|
194
|
+
<TableBody>
|
|
195
|
+
{patients.map((p, index) => (
|
|
196
|
+
<TableRow key={p.uuid}>
|
|
197
|
+
<TableCell>{index + 1}</TableCell>
|
|
198
|
+
<TableCell>{p.person.preferredName.display}</TableCell>
|
|
199
|
+
<TableCell>{p.person.birthdate}</TableCell>
|
|
200
|
+
<TableCell>
|
|
201
|
+
<Checkbox id={p.uuid} labelText="" onChange={() => onPatientSelect(p)} />
|
|
202
|
+
</TableCell>
|
|
203
|
+
</TableRow>
|
|
204
|
+
))}
|
|
205
|
+
</TableBody>
|
|
206
|
+
</Table>
|
|
207
|
+
</div>
|
|
208
|
+
<div className={styles.formSection}>
|
|
209
|
+
<div className={styles.formRow}>
|
|
210
|
+
<div className={styles.formControl}>
|
|
211
|
+
<Select id="visit-type" labelText="Select a Visit Type" onChange={visitTypeChangeHandler}>
|
|
212
|
+
<SelectItem value="" text="Select" />;
|
|
213
|
+
{visitTypes &&
|
|
214
|
+
visitTypes.map((vt) => {
|
|
215
|
+
return <SelectItem value={vt.uuid} text={vt.display} />;
|
|
216
|
+
})}
|
|
217
|
+
</Select>
|
|
218
|
+
</div>
|
|
219
|
+
<div className={styles.formControl}>
|
|
220
|
+
<Select id="service" labelText="Select a Service" onChange={serviceChangeHandler}>
|
|
221
|
+
<SelectItem value="" text="Select" />;
|
|
222
|
+
{serviceQueues &&
|
|
223
|
+
serviceQueues.map((sq) => {
|
|
224
|
+
return <SelectItem value={sq.uuid} text={sq.display} />;
|
|
225
|
+
})}
|
|
226
|
+
</Select>
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
<div className={styles.formRow}>
|
|
230
|
+
<div className={styles.formControl}>
|
|
231
|
+
<Select
|
|
232
|
+
id="priority"
|
|
233
|
+
labelText="Select Priority"
|
|
234
|
+
onChange={($event) => priorityChangeHandler($event.target.value)}
|
|
235
|
+
>
|
|
236
|
+
<SelectItem value="" text="Select" />;
|
|
237
|
+
<SelectItem value={QUEUE_PRIORITIES_UUIDS.NORMAL_PRIORITY_UUID} text="NORMAL" />;
|
|
238
|
+
<SelectItem value={QUEUE_PRIORITIES_UUIDS.EMERGENCY_PRIORITY_UUID} text="EMERGENCY" />;
|
|
239
|
+
</Select>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
<div className={styles.actionSection}>
|
|
245
|
+
<div className={styles.btnContainer}>
|
|
246
|
+
<Button kind="primary" onClick={sendToTriage}>
|
|
247
|
+
{loading ? <InlineLoading description="Sending To Triage..." /> : 'Send To Triage'}
|
|
248
|
+
</Button>
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
</ModalBody>
|
|
253
|
+
</Modal>
|
|
254
|
+
</>
|
|
255
|
+
);
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
export default SendToTriageModal;
|
|
@@ -17,22 +17,29 @@ import React, { useState } from 'react';
|
|
|
17
17
|
import styles from './registry.component.scss';
|
|
18
18
|
import { type HieClient, IDENTIFIER_TYPES, type IdentifierType, type RequestCustomOtpDto } from './types';
|
|
19
19
|
import { fetchClientRegistryData } from './registry.resource';
|
|
20
|
-
import { showSnackbar, useSession } from '@openmrs/esm-framework';
|
|
20
|
+
import { type Patient, showSnackbar, useSession } from '@openmrs/esm-framework';
|
|
21
21
|
import OtpVerificationModal from './modal/otp-verification-modal/otp-verification-modal';
|
|
22
22
|
import { maskExceptFirstAndLast, maskValue } from './utils/mask-data';
|
|
23
23
|
import ClientDetailsModal from './modal/client-details-modal/client-details-modal';
|
|
24
|
+
import { searchPatientByCrNumber } from '../resources/patient-search.resource';
|
|
25
|
+
import SendToTriageModal from './modal/send-to-triage/send-to-triage.modal';
|
|
26
|
+
import { useNavigate } from 'react-router-dom';
|
|
27
|
+
|
|
24
28
|
interface RegistryComponentProps {}
|
|
25
29
|
const RegistryComponent: React.FC<RegistryComponentProps> = () => {
|
|
26
30
|
const [identifierType, setIdentifierType] = useState<IdentifierType>('National ID');
|
|
27
31
|
const [identifierValue, setIdentifierValue] = useState('');
|
|
28
32
|
const [loading, setLoading] = useState<boolean>(false);
|
|
29
33
|
const [client, setClient] = useState<HieClient>();
|
|
34
|
+
const [amrsPatients, setAmrsPatient] = useState<Patient[]>();
|
|
30
35
|
const [selectedPatient, setSelectedPatient] = useState<string>('principal');
|
|
31
36
|
const [displayOtpModal, setDisplayOtpModal] = useState<boolean>(false);
|
|
32
37
|
const [displayClientDetailsModal, setDisplayClientDetailsModal] = useState<boolean>(false);
|
|
38
|
+
const [displaytriageModal, setDisplaytriageModal] = useState<boolean>(false);
|
|
33
39
|
const [requestCustomOtpDto, setRequestCustomOtpDto] = useState<RequestCustomOtpDto>();
|
|
34
40
|
const session = useSession();
|
|
35
41
|
const locationUuid = session.sessionLocation.uuid;
|
|
42
|
+
const navigate = useNavigate();
|
|
36
43
|
|
|
37
44
|
const handleSearchPatient = async () => {
|
|
38
45
|
setLoading(true);
|
|
@@ -103,10 +110,22 @@ const RegistryComponent: React.FC<RegistryComponentProps> = () => {
|
|
|
103
110
|
const handleEmergencyRegistration = () => {
|
|
104
111
|
window.location.href = `${window.spaBase}/patient-registration`;
|
|
105
112
|
};
|
|
113
|
+
const handleSendClientToTriage = async (crId: string) => {
|
|
114
|
+
onClientDetailsModalClose();
|
|
115
|
+
const resp = await searchPatientByCrNumber(crId);
|
|
116
|
+
if (resp.totalCount > 0) {
|
|
117
|
+
setAmrsPatient(resp.results);
|
|
118
|
+
setDisplaytriageModal(true);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
const onSendToTriageModalClose = (modalCloseResp?: { success: boolean }) => {
|
|
122
|
+
setDisplaytriageModal(false);
|
|
123
|
+
if (modalCloseResp && modalCloseResp.success) {
|
|
124
|
+
navigate('/triage');
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const handleSendToTriageModalSubmit = () => {};
|
|
106
128
|
return (
|
|
107
|
-
/*
|
|
108
|
-
To be refactored ton use gloab-nav-slot
|
|
109
|
-
*/
|
|
110
129
|
<>
|
|
111
130
|
<div className={styles.registryLayout}>
|
|
112
131
|
<div className={styles.mainContent}>
|
|
@@ -268,11 +287,25 @@ const RegistryComponent: React.FC<RegistryComponentProps> = () => {
|
|
|
268
287
|
open={displayClientDetailsModal}
|
|
269
288
|
onModalClose={onClientDetailsModalClose}
|
|
270
289
|
onSubmit={handleClientDetailsSubmit}
|
|
290
|
+
onSendClientToTriage={handleSendClientToTriage}
|
|
271
291
|
/>{' '}
|
|
272
292
|
</>
|
|
273
293
|
) : (
|
|
274
294
|
<></>
|
|
275
295
|
)}
|
|
296
|
+
|
|
297
|
+
{client && displaytriageModal ? (
|
|
298
|
+
<>
|
|
299
|
+
<SendToTriageModal
|
|
300
|
+
patients={amrsPatients}
|
|
301
|
+
open={displaytriageModal}
|
|
302
|
+
onModalClose={onSendToTriageModalClose}
|
|
303
|
+
onSubmit={handleSendToTriageModalSubmit}
|
|
304
|
+
/>
|
|
305
|
+
</>
|
|
306
|
+
) : (
|
|
307
|
+
<></>
|
|
308
|
+
)}
|
|
276
309
|
</div>
|
|
277
310
|
</div>
|
|
278
311
|
) : (
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HIE_BASE_URL } from '../shared/constants';
|
|
1
2
|
import {
|
|
2
3
|
type ClientRegistrySearchRequest,
|
|
3
4
|
type RequestCustomOtpDto,
|
|
@@ -6,8 +7,6 @@ import {
|
|
|
6
7
|
type ValidateHieCustomOtpDto,
|
|
7
8
|
} from './types';
|
|
8
9
|
|
|
9
|
-
const HIE_BASE_URL = 'https://staging.ampath.or.ke/hie';
|
|
10
|
-
|
|
11
10
|
export type ClientRegistrySearchResponse = any[];
|
|
12
11
|
|
|
13
12
|
async function postJson<T>(url: string, payload: unknown): Promise<T> {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Location, type Patient } from '@openmrs/esm-framework';
|
|
2
|
+
|
|
1
3
|
export type IdentifierType = 'National ID' | 'Alien ID' | 'Passport' | 'Mandate Number' | 'Refugee ID';
|
|
2
4
|
|
|
3
5
|
export const IDENTIFIER_TYPES: IdentifierType[] = [
|
|
@@ -158,3 +160,64 @@ export interface HieClient {
|
|
|
158
160
|
is_agent: number;
|
|
159
161
|
agent_id: string;
|
|
160
162
|
}
|
|
163
|
+
|
|
164
|
+
export type PatientSearchResponse = {
|
|
165
|
+
results: Patient[];
|
|
166
|
+
totalCount: number;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export type QueuePriority = {
|
|
170
|
+
uuid: string;
|
|
171
|
+
display: string;
|
|
172
|
+
};
|
|
173
|
+
export type QueueStatus = {
|
|
174
|
+
uuid: string;
|
|
175
|
+
display: string;
|
|
176
|
+
};
|
|
177
|
+
export type ServiceQueue = {
|
|
178
|
+
uuid: string;
|
|
179
|
+
display: string;
|
|
180
|
+
name: string;
|
|
181
|
+
description: string;
|
|
182
|
+
service: {
|
|
183
|
+
uuid: string;
|
|
184
|
+
display: string;
|
|
185
|
+
};
|
|
186
|
+
allowedPriorities: QueuePriority[];
|
|
187
|
+
allowedStatuses: QueueStatus[];
|
|
188
|
+
location: Location;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export type ServiceQueueApiResponse = {
|
|
192
|
+
results: ServiceQueue[];
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export type QueueEntryDto = {
|
|
196
|
+
visit: {
|
|
197
|
+
uuid: string;
|
|
198
|
+
};
|
|
199
|
+
queueEntry: {
|
|
200
|
+
status: {
|
|
201
|
+
uuid: string;
|
|
202
|
+
};
|
|
203
|
+
priority: {
|
|
204
|
+
uuid: string;
|
|
205
|
+
};
|
|
206
|
+
queue: {
|
|
207
|
+
uuid: string;
|
|
208
|
+
};
|
|
209
|
+
patient: {
|
|
210
|
+
uuid: string;
|
|
211
|
+
};
|
|
212
|
+
startedAt: string;
|
|
213
|
+
sortWeight: number;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
export type CreateVisitDto = {
|
|
218
|
+
visitType: string;
|
|
219
|
+
location: string;
|
|
220
|
+
startDatetime: null | string;
|
|
221
|
+
stopDatetime: null | string;
|
|
222
|
+
patient: string;
|
|
223
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
|
2
|
+
import { type PatientSearchResponse } from '../registry/types';
|
|
3
|
+
|
|
4
|
+
export async function searchPatientByCrNumber<T>(cr_id: string): Promise<PatientSearchResponse> {
|
|
5
|
+
const url = `${restBaseUrl}/patient`;
|
|
6
|
+
const params = {
|
|
7
|
+
q: cr_id,
|
|
8
|
+
v: 'full',
|
|
9
|
+
includeDead: 'true',
|
|
10
|
+
limit: '10',
|
|
11
|
+
totalCount: 'true',
|
|
12
|
+
};
|
|
13
|
+
const queryString = new URLSearchParams(params).toString();
|
|
14
|
+
const response = await openmrsFetch(`${url}?${queryString}`);
|
|
15
|
+
|
|
16
|
+
if (!response.ok) {
|
|
17
|
+
const errorText = await response.text();
|
|
18
|
+
throw new Error(`Request failed with ${response.status}: ${errorText}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return response.json();
|
|
22
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
|
2
|
+
import { type QueueEntryDto, type ServiceQueueApiResponse } from '../registry/types';
|
|
3
|
+
|
|
4
|
+
export async function fetchServiceQueuesByLocationUuid<T>(locationUuid: string): Promise<ServiceQueueApiResponse> {
|
|
5
|
+
const url = `${restBaseUrl}/queue`;
|
|
6
|
+
const params = {
|
|
7
|
+
v: 'custom:(uuid,display,name,description,service:(uuid,display),allowedPriorities:(uuid,display),allowedStatuses:(uuid,display),location:(uuid,display))',
|
|
8
|
+
location: locationUuid,
|
|
9
|
+
};
|
|
10
|
+
const queryString = new URLSearchParams(params).toString();
|
|
11
|
+
const response = await openmrsFetch(`${url}?${queryString}`);
|
|
12
|
+
|
|
13
|
+
if (!response.ok) {
|
|
14
|
+
const errorText = await response.text();
|
|
15
|
+
throw new Error(`Request failed with ${response.status}: ${errorText}`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return response.json();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export async function createQueueEntry(createQueueEntryDto: QueueEntryDto) {
|
|
22
|
+
const url = `${restBaseUrl}/visit-queue-entry`;
|
|
23
|
+
const response = await openmrsFetch(url, {
|
|
24
|
+
method: 'POST',
|
|
25
|
+
headers: {
|
|
26
|
+
'content-type': 'application/json',
|
|
27
|
+
},
|
|
28
|
+
body: JSON.stringify(createQueueEntryDto),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
if (!response.ok) {
|
|
32
|
+
const errorText = await response.text();
|
|
33
|
+
throw new Error(`Request failed with ${response.status}: ${errorText}`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return response.json();
|
|
37
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
|
2
|
+
import { type CreateVisitDto } from '../registry/types';
|
|
3
|
+
|
|
4
|
+
export async function createVisit(createVisitDto: CreateVisitDto) {
|
|
5
|
+
const url = `${restBaseUrl}/visit`;
|
|
6
|
+
const response = await openmrsFetch(url, {
|
|
7
|
+
method: 'POST',
|
|
8
|
+
headers: {
|
|
9
|
+
'content-type': 'application/json',
|
|
10
|
+
},
|
|
11
|
+
body: JSON.stringify(createVisitDto),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
if (!response.ok) {
|
|
15
|
+
const errorText = await response.text();
|
|
16
|
+
throw new Error(`Request failed with ${response.status}: ${errorText}`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return response.json();
|
|
20
|
+
}
|
package/src/root.component.tsx
CHANGED
|
@@ -14,6 +14,7 @@ const Root: React.FC = () => {
|
|
|
14
14
|
<Routes>
|
|
15
15
|
<Route path="" element={<RegistryComponent />} />
|
|
16
16
|
<Route path="registry" element={<RegistryComponent />} />
|
|
17
|
+
<Route path="triage" element={<Consultation />} />
|
|
17
18
|
<Route path="consultation" element={<Consultation />} />
|
|
18
19
|
<Route path="*" element={<RegistryComponent />} />
|
|
19
20
|
</Routes>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const NORMAL_PRIORITY_UUID = 'bbd99c12-67e9-4381-8b4c-1f231e86f8e2';
|
|
2
|
+
const EMERGENCY_PRIORITY_UUID = '8e86ff12-ec83-41e8-a534-bb410739d880';
|
|
3
|
+
|
|
4
|
+
const WAITING_UUID = '89d01aa5-0ab0-4626-934b-37766b4cd779';
|
|
5
|
+
const IN_SERVICE_UUID = 'f9cf5768-508f-45de-8d40-eaf6ea3f3b02';
|
|
6
|
+
const COMPLETED_UUID = 'a89c1ef8-1350-11df-a1f1-0026b9348838';
|
|
7
|
+
|
|
8
|
+
export const QUEUE_PRIORITIES_UUIDS = {
|
|
9
|
+
NORMAL_PRIORITY_UUID,
|
|
10
|
+
EMERGENCY_PRIORITY_UUID,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const QUEUE_STATUS_UUIDS = {
|
|
14
|
+
WAITING_UUID,
|
|
15
|
+
IN_SERVICE_UUID,
|
|
16
|
+
COMPLETED_UUID,
|
|
17
|
+
};
|
package/dist/161.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_ampath_esm_dha_workflow_app=globalThis.webpackChunk_ampath_esm_dha_workflow_app||[]).push([[161],{6842:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__registry-component__registryLayout___PF4WP{display:flex;flex-direction:row;width:100%;row-gap:10px;padding:2% 2%}.-esm-dha-workflow__registry-component__mainContent___qOmrp{display:flex;flex-direction:column;width:100%}.-esm-dha-workflow__registry-component__registryHeader___YIQ62{display:flex;flex-direction:column;row-gap:10px;width:100%}.-esm-dha-workflow__registry-component__registryContent___W1b-9{display:flex;flex-direction:column;width:100%}.-esm-dha-workflow__registry-component__formRow___qlwjG{display:flex;flex-direction:row;width:100%;column-gap:5px;margin-top:10px}.-esm-dha-workflow__registry-component__formControl___R5c2A{width:30%}.-esm-dha-workflow__registry-component__hieData___jx5gt{margin-top:15px;display:flex;flex-direction:column;width:50%;row-gap:10px}.-esm-dha-workflow__registry-component__btnContainer___aXZfC{padding:5px 5px}.-esm-dha-workflow__registry-component__selectionHeader___-zRam{display:flex;flex-direction:column;width:100%;row-gap:5px}.-esm-dha-workflow__registry-component__patientSelect___wgPYw{display:flex;flex-direction:row;width:100%;column-gap:5px}.-esm-dha-workflow__registry-component__patientSelectRadio___3aGYW{width:70%}.-esm-dha-workflow__registry-component__patientConfirmSelection___Py9-y{display:flex;flex-direction:row;width:30%;column-gap:5px}.-esm-dha-workflow__registry-component__formBtn___ok0W6{display:flex;flex-direction:row;column-gap:5px}.-esm-dha-workflow__registry-component__registrySearchBtn___jHA2M{height:30px}","",{version:3,sources:["webpack://./src/registry/registry.component.scss"],names:[],mappings:"AAAA,+DACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,YAAA,CACA,aAAA,CAEJ,4DACE,YAAA,CACA,qBAAA,CACA,UAAA,CAEF,+DACI,YAAA,CACA,qBAAA,CACA,YAAA,CACA,UAAA,CAEJ,gEACI,YAAA,CACA,qBAAA,CACA,UAAA,CAEJ,wDACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,cAAA,CACA,eAAA,CAEJ,4DACI,SAAA,CAEJ,wDACI,eAAA,CACA,YAAA,CACA,qBAAA,CACA,SAAA,CACA,YAAA,CAEJ,6DACI,eAAA,CAEJ,gEACI,YAAA,CACA,qBAAA,CACA,UAAA,CACA,WAAA,CAEJ,8DACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,cAAA,CAEJ,mEACI,SAAA,CAEJ,wEACI,YAAA,CACA,kBAAA,CACA,SAAA,CACA,cAAA,CAEJ,wDACI,YAAA,CACA,kBAAA,CACA,cAAA,CAEJ,kEACI,WAAA",sourcesContent:[".registryLayout{\n display: flex;\n flex-direction: row;\n width: 100%;\n row-gap: 10px;\n padding: 2% 2%;\n}\n.mainContent{\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n.registryHeader{\n display: flex;\n flex-direction: column;\n row-gap: 10px;\n width: 100%;\n}\n.registryContent{\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n.formRow{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 5px;\n margin-top: 10px;\n}\n.formControl{\n width: 30%;\n}\n.hieData{\n margin-top: 15px;\n display: flex;\n flex-direction: column;\n width: 50%;\n row-gap: 10px;\n}\n.btnContainer{\n padding: 5px 5px;\n}\n.selectionHeader{\n display: flex;\n flex-direction: column;\n width: 100%;\n row-gap: 5px;\n}\n.patientSelect{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 5px;\n}\n.patientSelectRadio{\n width: 70%;\n}\n.patientConfirmSelection{\n display: flex;\n flex-direction: row;\n width: 30%;\n column-gap: 5px;\n}\n.formBtn{\n display: flex;\n flex-direction: row;\n column-gap: 5px;\n}\n.registrySearchBtn{\n height: 30px;\n}"],sourceRoot:""}]),i.locals={registryLayout:"-esm-dha-workflow__registry-component__registryLayout___PF4WP",mainContent:"-esm-dha-workflow__registry-component__mainContent___qOmrp",registryHeader:"-esm-dha-workflow__registry-component__registryHeader___YIQ62",registryContent:"-esm-dha-workflow__registry-component__registryContent___W1b-9",formRow:"-esm-dha-workflow__registry-component__formRow___qlwjG",formControl:"-esm-dha-workflow__registry-component__formControl___R5c2A",hieData:"-esm-dha-workflow__registry-component__hieData___jx5gt",btnContainer:"-esm-dha-workflow__registry-component__btnContainer___aXZfC",selectionHeader:"-esm-dha-workflow__registry-component__selectionHeader___-zRam",patientSelect:"-esm-dha-workflow__registry-component__patientSelect___wgPYw",patientSelectRadio:"-esm-dha-workflow__registry-component__patientSelectRadio___3aGYW",patientConfirmSelection:"-esm-dha-workflow__registry-component__patientConfirmSelection___Py9-y",formBtn:"-esm-dha-workflow__registry-component__formBtn___ok0W6",registrySearchBtn:"-esm-dha-workflow__registry-component__registrySearchBtn___jHA2M"};const l=i},78161:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Q});var r=n(69150),a=n(16072),o=n.n(a),i=n(85072),l=n.n(i),c=n(97825),s=n.n(c),u=n(77659),m=n.n(u),d=n(55056),A=n.n(d),f=n(10540),p=n.n(f),_=n(41113),y=n.n(_),h=n(6842),w={};w.styleTagTransform=y(),w.setAttributes=A(),w.insert=m().bind(null,"head"),w.domAPI=s(),w.insertStyleElement=p(),l()(h.A,w);const g=h.A&&h.A.locals?h.A.locals:void 0;var C=["National ID","Alien ID","Passport","Mandate Number","Refugee ID"];function E(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function b(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){E(o,r,a,i,l,"next",e)}function l(e){E(o,r,a,i,l,"throw",e)}i(void 0)}))}}function v(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}var x="https://staging.ampath.or.ke/hie";function k(e,t){return b((function(){var n,r;return v(this,(function(a){switch(a.label){case 0:return[4,fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})];case 1:return(n=a.sent()).ok?[3,3]:[4,n.text()];case 2:throw r=a.sent(),new Error("Request failed with ".concat(n.status,": ").concat(r));case 3:return[2,n.json()]}}))}))()}function S(e){return b((function(){var t,n;return v(this,(function(r){return t="".concat(x,"/client/search"),n={identificationNumber:e.identificationNumber,identificationType:e.identificationType,locationUuid:e.locationUuid},[2,k(t,n)]}))}))()}var T=n(25987),N=n(84497),P={};P.styleTagTransform=y(),P.setAttributes=A(),P.insert=m().bind(null,"head"),P.domAPI=s(),P.insertStyleElement=p(),l()(N.A,P);const I=N.A&&N.A.locals?N.A.locals:void 0;var F=function(e){for(var t=e.split(""),n=0;n<e.length;n++)n%2==0&&(t[n]="*");return t.join("")},O=function(e){for(var t=e.split(""),n=0;n<e.length;n++)0!=n&&n!==e.length-1&&(t[n]="*");return t.join("")};function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function R(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function B(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){R(o,r,a,i,l,"next",e)}function l(e){R(o,r,a,i,l,"throw",e)}i(void 0)}))}}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}const Y=function(e){var t=e.requestCustomOtpDto,n=e.phoneNumber,i=e.open,l=e.onModalClose,c=j((0,a.useState)(""),2),s=c[0],u=c[1],m=j((0,a.useState)("DRAFT"),2),d=m[0],A=m[1],f=j((0,a.useState)(!1),2),p=f[0],_=f[1],y=j((0,a.useState)(""),2),h=y[0],w=y[1],g=function(e,t,n){(0,T.showSnackbar)({kind:e,title:t,subtitle:n})};return o().createElement(o().Fragment,null,o().createElement(r.aFV,{open:i,size:"md",onSecondarySubmit:l,onRequestClose:l,onRequestSubmit:function(){window.open("https://afyayangu.go.ke/","_blank")},primaryButtonText:"Register on Afya Yangu",secondaryButtonText:"Cancel"},o().createElement(r.cwr,null,o().createElement("div",{className:I.modalVerificationLayout},o().createElement("div",{className:I.sectionHeader},o().createElement("h4",{className:I.sectionTitle},"One Time Password (OTP)"),o().createElement("h6",null,"Enter one time password to proceed")),o().createElement("div",{className:I.sectionContent},o().createElement("div",{className:I.contentHeader},"DRAFT"===d?o().createElement(o().Fragment,null,o().createElement("h6",null,"Send Code to Phone ",F(n))):o().createElement(o().Fragment,null),"OTP_SENT"===d?o().createElement(o().Fragment,null,o().createElement(r.ksK,{id:"otp-input",labelText:"Enter OTP",value:s,onChange:function(e){return u(e.target.value)},placeholder:"Enter the code sent to your phone"})):o().createElement(o().Fragment,null),"OTP_VERIFIED"===d?o().createElement(o().Fragment,null,o().createElement("h6",null,"OTP Verification Successfull!")):o().createElement(o().Fragment,null))),o().createElement("div",{className:I.sectionAction},"DRAFT"===d?o().createElement(o().Fragment,null,o().createElement(r.$nd,{kind:"primary",onClick:function(){return B((function(){var e,n,r;return H(this,(function(a){switch(a.label){case 0:if(!t.identificationNumber)return g("error","Invalid Identification Value","Please enter a valid ID value"),[2];_(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,(o=t,b((function(){var e,t;return v(this,(function(n){return e="".concat(x,"/client/send-custom-otp"),t={identificationNumber:o.identificationNumber,identificationType:o.identificationType,locationUuid:o.locationUuid},[2,k(e,t)]}))}))())];case 2:return e=a.sent(),w(e.sessionId),A("OTP_SENT"),g("success","OTP sent successfully","A code was sent to ".concat(e.maskedPhone)),[3,5];case 3:return n=a.sent(),r=n.message||"Failed to send OTP",g("error","Error sending OTP",r),[3,5];case 4:return _(!1),[7];case 5:return[2]}var o}))}))()}},p?o().createElement(r.OuH,{description:"Sending OTP..."}):"Send OTP")):o().createElement(o().Fragment,null),"OTP_SENT"===d?o().createElement(o().Fragment,null,o().createElement(r.$nd,{kind:"primary",onClick:function(){return B((function(){var e,n;return H(this,(function(r){switch(r.label){case 0:if(!s.trim())return g("error","Please enter the OTP code",""),[2];_(!0),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,(a={sessionId:h,otp:s,locationUuid:t.locationUuid},b((function(){var e,t;return v(this,(function(n){return e="".concat(x,"/client/validate-custom-otp"),t={sessionId:a.sessionId,otp:a.otp,locationUuid:a.locationUuid},[2,k(e,t)]}))}))())];case 2:return r.sent(),A("OTP_VERIFIED"),(0,T.showSnackbar)({kind:"success",title:"OTP Verified",subtitle:"You can now fetch data from Client Registry."}),[3,5];case 3:return e=r.sent(),n=e.message||"OTP verification failed",(0,T.showSnackbar)({kind:"error",title:"OTP Verification Failed",subtitle:n}),[3,5];case 4:return _(!1),[7];case 5:return[2]}var a}))}))()}},p?o().createElement(r.OuH,{description:"Verifying OTP..."}):"Verify")):o().createElement(o().Fragment,null),"OTP_VERIFIED"===d?o().createElement(o().Fragment,null,o().createElement(r.$nd,{kind:"primary",onClick:l},"Continue")):o().createElement(o().Fragment,null))))))};var U=n(86575),q={};q.styleTagTransform=y(),q.setAttributes=A(),q.insert=m().bind(null,"head"),q.domAPI=s(),q.insertStyleElement=p(),l()(U.A,q);const L=U.A&&U.A.locals?U.A.locals:void 0;function V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var W=["id","other_identifications","first_name","middle_name","last_name","gender","date_of_birth","is_alive","deceased_datetime","phone","email","civil_status","place_of_birth","citizenship","country","county","sub_county","ward","village_estate","longitude","latitude","identification_type"];const J=function(e){var t=e.client,n=(0,a.useMemo)((function(){return e=t,n={},Object.keys(e).filter((function(e){return W.includes(e)})).forEach((function(t){if("other_identifications"===t){var r=(o=e[t],i={},o.forEach((function(e){i[e.identification_type]=e.identification_number})),i);n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){V(e,t,n[t])}))}return e}({},n,r)}else if("identification_type"===t)n[e.identification_type]=e.identification_number;else{var a=e[t];n[t]=a}var o,i})),n;var e,n}),[t]);return t&&n?o().createElement(o().Fragment,null,o().createElement(r.XIK,null,o().createElement(r.ndF,null,o().createElement(r.Hjg,null,o().createElement(r.A0N,null,"Field"),o().createElement(r.A0N,null,"Value"))),o().createElement(r.BFY,null,Object.keys(n).map((function(e){return o().createElement(r.Hjg,null,o().createElement(r.nA6,null,e),o().createElement(r.nA6,null,n[e]))}))))):o().createElement(o().Fragment,null,o().createElement("h4",null,"No patient Data to Display"))},M=function(){return o().createElement(o().Fragment,null,o().createElement(r.zWQ,{defaultSelected:"sha",legendText:"Patient",onChange:function(e){},name:"payment-options-radio-group"},o().createElement(r.aaP,{id:"sha",labelText:"Social Health Authority",value:"sha"}),o().createElement(r.aaP,{id:"insurance",labelText:"Other Insurance",value:"other"}),o().createElement(r.aaP,{id:"cash",labelText:"Cash",value:"cash"})))},$=function(e){var t=e.client,n=e.open,a=e.onModalClose;return e.onSubmit,t?o().createElement(o().Fragment,null,o().createElement(r.aFV,{open:n,size:"md",onSecondarySubmit:a,onRequestClose:a,onRequestSubmit:function(){window.open("https://afyayangu.go.ke/","_blank")},primaryButtonText:"Register on Afya Yangu",secondaryButtonText:"Cancel"},o().createElement(r.cwr,null,o().createElement("div",{className:L.clientDetailsLayout},o().createElement("div",{className:L.sectionHeader},o().createElement("h4",{className:L.sectionTitle},"Patient/Payment Details")),o().createElement("div",{className:L.sectionContent},o().createElement(r.tUM,null,o().createElement(r.wbY,{contained:!0},o().createElement(r.ozo,null,"Patient Details"),o().createElement(r.ozo,null,"Payment Details")),o().createElement(r.T2N,null,o().createElement(r.KpK,null,o().createElement(J,{client:t})),o().createElement(r.KpK,null,o().createElement(M,null))))),o().createElement("div",{className:L.actionSection},o().createElement("div",{className:L.btnContainer},o().createElement(r.$nd,{kind:"primary"},"Book Appointment")),o().createElement("div",{className:L.btnContainer},o().createElement(r.$nd,{kind:"secondary"},"Walk In Orders")),o().createElement("div",{className:L.btnContainer},o().createElement(r.$nd,{kind:"tertiary"},"Send To Triage")),o().createElement("div",{className:L.btnContainer},o().createElement(r.$nd,{kind:"primary"},"Send To Consultation"))))))):o().createElement(o().Fragment,null,"No Client data")};function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function K(e,t,n,r,a,o,i){try{var l=e[o](i),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,a)}function G(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const Q=function(){var e=G((0,a.useState)("National ID"),2),t=e[0],n=e[1],i=G((0,a.useState)(""),2),l=i[0],c=i[1],s=G((0,a.useState)(!1),2),u=s[0],m=s[1],d=G((0,a.useState)(),2),A=d[0],f=d[1],p=G((0,a.useState)("principal"),2),_=p[0],y=p[1],h=G((0,a.useState)(!1),2),w=h[0],E=h[1],b=G((0,a.useState)(!1),2),v=b[0],x=b[1],k=G((0,a.useState)(),2),N=k[0],P=k[1],I=(0,T.useSession)().sessionLocation.uuid,D=function(e,t,n){(0,T.showSnackbar)({kind:e,title:t,subtitle:n})};return o().createElement(o().Fragment,null,o().createElement("div",{className:g.registryLayout},o().createElement("div",{className:g.mainContent},o().createElement("div",{className:g.registryHeader},o().createElement("h4",null,"Client Registry"),o().createElement("p",null,"Please enter identification number to begin")),o().createElement("div",{className:g.registryContent},o().createElement("div",{className:g.formRow},o().createElement("div",{className:g.formControl},o().createElement(r.msM,{id:"identifier-type-dropdown",label:"Identifier Type",titleText:"Select Identifier Type",items:C,selectedItem:t,onChange:function(e){var t=e.selectedItem;return n(t)}})),o().createElement("div",{className:g.formControl},o().createElement(r.ksK,{id:"identifier-value",labelText:"".concat(t," Value"),value:l,onChange:function(e){return c(e.target.value)},placeholder:"Enter ".concat(t.toLowerCase()," value")}))),o().createElement("div",{className:g.formRow},o().createElement("div",{className:g.formControl},o().createElement("div",{className:g.formBtn},o().createElement(r.$nd,{className:g.registrySearchBtn,kind:"primary",onClick:function(){return(e=function(){var e,n,r,a,o,i;return function(e,t){var n,r,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=l(0),i.throw=l(1),i.return=l(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(l){return function(c){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(6===l[0]&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}(this,(function(c){switch(c.label){case 0:m(!0),c.label=1;case 1:return c.trys.push([1,3,4,5]),function(e){return e.identificationNumber?e.identificationType?!!e.locationUuid||(D("error","No default location selected",""),!1):(D("error","Please enter a valid identification type",""),!1):(D("error","Please enter a valid identification number",""),!1)}(e={identificationNumber:l,identificationType:t,locationUuid:I})?(P(e),[4,S(e)]):[2,!1];case 2:if(n=c.sent(),0===(r=Array.isArray(n)?n:[]).length)throw new Error("No matching patient found in Client Registry.");return a=r[0],f(a),D("success","Client Data Loaded","Patient fetched successfully"),[3,5];case 3:return o=c.sent(),i=o.message||"Failed to fetch client data",D("error","Fetch Failed",i),[3,5];case 4:return m(!1),[7];case 5:return[2]}}))},function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){K(o,r,a,i,l,"next",e)}function l(e){K(o,r,a,i,l,"throw",e)}i(void 0)}))})();var e},disabled:u},u?o().createElement(r.OuH,{description:"Searching..."}):"Search"),o().createElement(r.$nd,{className:g.registrySearchBtn,kind:"secondary",onClick:function(){window.location.href="".concat(window.spaBase,"/patient-registration")},disabled:u},"Emergency Registration")))),A?o().createElement("div",{className:g.formRow},o().createElement("div",{className:g.hieData},o().createElement("div",{className:g.selectionHeader},o().createElement("h5",null,"Please select one patient and request patient to share the OTP sent")),o().createElement("div",{className:g.patientSelect},o().createElement("div",{className:g.patientSelectRadio},o().createElement(r.zWQ,{defaultSelected:"principal",legendText:"Patient",onChange:function(e){y(e)},name:"radio-button-default-group"},o().createElement(r.aaP,{id:"principal",labelText:"Principal",value:"principal"}),o().createElement(r.aaP,{id:"dependants",labelText:"Dependants",value:"dependants"}))),o().createElement("div",{className:g.patientConfirmSelection},o().createElement("div",{className:g.btnContainer},o().createElement(r.$nd,{kind:"primary",onClick:function(){E(!0)}}," ","Confirm")),o().createElement("div",{className:g.btnContainer},o().createElement(r.$nd,{kind:"secondary"},"Cancel")))),"principal"===_?o().createElement(o().Fragment,null,o().createElement(r.XIK,null,o().createElement(r.ndF,null,o().createElement(r.Hjg,null,o().createElement(r.A0N,null,"Name"),o().createElement(r.A0N,null,"CR"),o().createElement(r.A0N,null,"Phone No"),o().createElement(r.A0N,null,"ID No"))),o().createElement(r.BFY,null,o().createElement(r.Hjg,null,o().createElement(r.nA6,null,A.first_name," ",O(A.middle_name)," ",O(A.last_name)),o().createElement(r.nA6,null,F(A.id)),o().createElement(r.nA6,null,F(A.phone)),o().createElement(r.nA6,null,F(A.identification_number)))))):o().createElement(o().Fragment,null),"dependants"===_?o().createElement(o().Fragment,null,o().createElement(r.XIK,null,o().createElement(r.ndF,null,o().createElement(r.Hjg,null,o().createElement(r.A0N,null,"Name"),o().createElement(r.A0N,null,"CR"),o().createElement(r.A0N,null,"Relationship"))),o().createElement(r.BFY,null,A.dependants.map((function(e){var t=e.result[0],n=e.relationship;return o().createElement(o().Fragment,null,o().createElement(r.Hjg,null,o().createElement(r.nA6,null,t.first_name," ",O(t.middle_name)," ",O(t.last_name)),o().createElement(r.nA6,null,F(t.id)),o().createElement(r.nA6,null,n)))}))))):o().createElement(o().Fragment,null),w?o().createElement(Y,{requestCustomOtpDto:N,phoneNumber:A.phone,open:w,onModalClose:function(){E(!1),x(!0)}}):o().createElement(o().Fragment,null),A&&v?o().createElement(o().Fragment,null,o().createElement($,{client:A,open:v,onModalClose:function(){x(!1)},onSubmit:function(){}})," "):o().createElement(o().Fragment,null))):o().createElement(o().Fragment,null)))))}},84497:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__otp-verification-modal__modalVerificationLayout___MST8n{display:flex;flex-direction:column;row-gap:10px;width:100%}.-esm-dha-workflow__otp-verification-modal__sectionHeader___g62oo{display:flex;flex-direction:column;column-gap:5px;margin-top:5px;margin-bottom:5px}","",{version:3,sources:["webpack://./src/registry/modal/otp-verification-modal/otp-verification-modal.scss"],names:[],mappings:"AAAA,4EACE,YAAA,CACA,qBAAA,CACA,YAAA,CACA,UAAA,CAEF,kEACE,YAAA,CACA,qBAAA,CACA,cAAA,CACA,cAAA,CACA,iBAAA",sourcesContent:[".modalVerificationLayout {\n display: flex;\n flex-direction: column;\n row-gap: 10px;\n width: 100%;\n}\n.sectionHeader{\n display: flex;\n flex-direction: column;\n column-gap: 5px;\n margin-top: 5px;\n margin-bottom: 5px;\n}"],sourceRoot:""}]),i.locals={modalVerificationLayout:"-esm-dha-workflow__otp-verification-modal__modalVerificationLayout___MST8n",sectionHeader:"-esm-dha-workflow__otp-verification-modal__sectionHeader___g62oo"};const l=i},86575:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(72996),a=n.n(r),o=n(70159),i=n.n(o)()(a());i.push([e.id,".-esm-dha-workflow__client-details-modal__clientDetailsLayout___r5WF\\+{display:flex;flex-direction:column;width:100%;row-gap:5px}.-esm-dha-workflow__client-details-modal__sectionHeader___lH-gL{display:flex;flex-direction:column;row-gap:5px;margin-top:5px;margin-bottom:10px}.-esm-dha-workflow__client-details-modal__sectionContent___QDFT7{display:flex;flex-direction:column;row-gap:5px}.-esm-dha-workflow__client-details-modal__actionSection___okVDp{display:flex;flex-direction:row;width:100%;column-gap:5px}.-esm-dha-workflow__client-details-modal__btnContainer___ETNEk{margin-top:2px;margin-bottom:2px}","",{version:3,sources:["webpack://./src/registry/modal/client-details-modal/client-details-modal.scss"],names:[],mappings:"AAAA,uEACI,YAAA,CACA,qBAAA,CACA,UAAA,CACA,WAAA,CAEJ,gEACI,YAAA,CACA,qBAAA,CACA,WAAA,CACA,cAAA,CACA,kBAAA,CAEJ,iEACI,YAAA,CACA,qBAAA,CACA,WAAA,CAEJ,gEACI,YAAA,CACA,kBAAA,CACA,UAAA,CACA,cAAA,CAEJ,+DACI,cAAA,CACA,iBAAA",sourcesContent:[".clientDetailsLayout{\n display: flex;\n flex-direction: column;\n width: 100%;\n row-gap: 5px;\n}\n.sectionHeader{\n display: flex;\n flex-direction: column;\n row-gap: 5px;\n margin-top: 5px;\n margin-bottom: 10px;\n}\n.sectionContent{\n display: flex;\n flex-direction: column;\n row-gap: 5px;\n}\n.actionSection{\n display: flex;\n flex-direction: row;\n width: 100%;\n column-gap: 5px;\n}\n.btnContainer{\n margin-top: 2px;\n margin-bottom: 2px;\n}"],sourceRoot:""}]),i.locals={clientDetailsLayout:"-esm-dha-workflow__client-details-modal__clientDetailsLayout___r5WF+",sectionHeader:"-esm-dha-workflow__client-details-modal__sectionHeader___lH-gL",sectionContent:"-esm-dha-workflow__client-details-modal__sectionContent___QDFT7",actionSection:"-esm-dha-workflow__client-details-modal__actionSection___okVDp",btnContainer:"-esm-dha-workflow__client-details-modal__btnContainer___ETNEk"};const l=i}}]);
|
package/dist/161.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"161.js","mappings":"2MAGIA,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,s+CA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,EAAAA,IAAQA,KACP,kBAACI,EAAAA,IAASA,KACPuE,EAAUN,WAAW,IAAE/I,EAAuBqJ,EAAUL,aAAc,IACtEhJ,EAAuBqJ,EAAUJ,YAEpC,kBAACnE,EAAAA,IAASA,KAAErF,EAAU4J,EAAU5L,KAChC,kBAACqH,EAAAA,IAASA,KAAEwE,IAIpB,OAKN,qCAGD9C,EACC,kBAAC+C,EAAoBA,CACnBtJ,oBAAqBA,EACrBC,YAAasD,EAAO0F,MACpB/I,KAAMqG,EACNpG,aArKK,WACvBqG,GAAmB,GACnBE,GAA6B,EAC/B,IAqKkB,qCAGDnD,GAAUkD,EACT,oCACE,kBAAC8C,EAAkBA,CACjBhG,OAAQA,EACRrD,KAAMuG,EACNtG,aA5KY,WAChCuG,GAA6B,EAC/B,EA2KsBtB,SA1KY,WAElC,IAyKuB,KAGL,uCAKN,wCAOd,C,sEC1RI/H,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,+RAAgS,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,qFAAqF,MAAQ,GAAG,SAAW,2GAA2G,eAAiB,CAAC,gPAAgP,WAAa,MAEz0BH,EAAwBI,OAAS,CAChC,wBAA2B,6EAC3B,cAAiB,oEAElB,S,sECRIJ,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,gmBAAimB,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,iFAAiF,MAAQ,GAAG,SAAW,0NAA0N,eAAiB,CAAC,+fAA+f,WAAa,MAEpgDH,EAAwBI,OAAS,CAChC,oBAAuB,uEACvB,cAAiB,iEACjB,eAAkB,kEAClB,cAAiB,iEACjB,aAAgB,iEAEjB,S","sources":["webpack://@ampath/esm-dha-workflow-app/./src/registry/registry.component.scss","webpack://@ampath/esm-dha-workflow-app/./src/registry/registry.component.scss?85af","webpack://@ampath/esm-dha-workflow-app/./src/registry/types/index.ts","webpack://@ampath/esm-dha-workflow-app/./src/registry/registry.resource.ts","webpack://@ampath/esm-dha-workflow-app/./src/registry/modal/otp-verification-modal/otp-verification-modal.scss?a063","webpack://@ampath/esm-dha-workflow-app/./src/registry/utils/mask-data.ts","webpack://@ampath/esm-dha-workflow-app/./src/registry/modal/otp-verification-modal/otp-verification-modal.tsx","webpack://@ampath/esm-dha-workflow-app/./src/registry/modal/client-details-modal/client-details-modal.scss?6725","webpack://@ampath/esm-dha-workflow-app/./src/registry/utils/hie-adapter.ts","webpack://@ampath/esm-dha-workflow-app/./src/registry/client-details/client-details.tsx","webpack://@ampath/esm-dha-workflow-app/./src/registry/payment-details/payment-options/payment-options.tsx","webpack://@ampath/esm-dha-workflow-app/./src/registry/modal/client-details-modal/client-details-modal.tsx","webpack://@ampath/esm-dha-workflow-app/./src/registry/registry.component.tsx","webpack://@ampath/esm-dha-workflow-app/./src/registry/modal/otp-verification-modal/otp-verification-modal.scss","webpack://@ampath/esm-dha-workflow-app/./src/registry/modal/client-details-modal/client-details-modal.scss"],"names":["___CSS_LOADER_EXPORT___","push","module","id","locals","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","undefined","IDENTIFIER_TYPES","HIE_BASE_URL","postJson","url","payload","response","errorText","fetch","method","headers","body","JSON","stringify","ok","text","Error","status","json","fetchClientRegistryData","formattedPayload","identificationNumber","identificationType","locationUuid","maskValue","value","arrValue","split","i","length","join","maskExceptFirstAndLast","requestCustomOtpDto","phoneNumber","open","onModalClose","useState","otp","setOtp","otpStatus","setOtpStatus","loading","setLoading","sessionId","setSessionId","showAlert","alertType","title","subtitle","showSnackbar","kind","Modal","size","onSecondarySubmit","onRequestClose","onRequestSubmit","window","primaryButtonText","secondaryButtonText","ModalBody","div","className","styles","modalVerificationLayout","sectionHeader","h4","sectionTitle","h6","sectionContent","contentHeader","TextInput","labelText","onChange","e","target","placeholder","sectionAction","Button","onClick","err","errorMessage","maskedPhone","message","InlineLoading","description","trim","clientDatailsFields","client","clientDetails","useMemo","hieClient","data","Object","keys","filter","key","includes","forEach","otherIds","hieIdentifications","other","identification_type","identification_number","Table","TableHead","TableRow","TableHeader","TableBody","map","TableCell","RadioButtonGroup","defaultSelected","legendText","v","name","RadioButton","onSubmit","clientDetailsLayout","Tabs","TabList","contained","Tab","TabPanels","TabPanel","ClientDetails","PaymentOptionsComponent","actionSection","btnContainer","identifierType","setIdentifierType","identifierValue","setIdentifierValue","setClient","selectedPatient","setSelectedPatient","displayOtpModal","setDisplayOtpModal","displayClientDetailsModal","setDisplayClientDetailsModal","setRequestCustomOtpDto","useSession","sessionLocation","uuid","registryLayout","mainContent","registryHeader","p","registryContent","formRow","formControl","Dropdown","label","titleText","items","selectedItem","toLowerCase","formBtn","registrySearchBtn","result","patients","patient","isValidCustomSmsPayload","Array","isArray","disabled","location","href","spaBase","hieData","selectionHeader","h5","patientSelect","patientSelectRadio","patientConfirmSelection","first_name","middle_name","last_name","phone","dependants","d","dependant","relationship","OtpVerificationModal","ClientDetailsModal"],"sourceRoot":""}
|