@ampath/esm-patient-registration-app 9.2.0-next.18 → 9.2.0-next.20

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.
Files changed (63) hide show
  1. package/dist/1453.js +1 -0
  2. package/dist/1453.js.map +1 -0
  3. package/dist/4300.js +1 -1
  4. package/dist/5365.js +2 -0
  5. package/dist/5365.js.map +1 -0
  6. package/dist/6168.js +1 -0
  7. package/dist/6168.js.map +1 -0
  8. package/dist/6583.js +1 -0
  9. package/dist/6583.js.map +1 -0
  10. package/dist/7821.js +1 -1
  11. package/dist/8414.js +1 -1
  12. package/dist/8414.js.map +1 -1
  13. package/dist/8487.js +1 -0
  14. package/dist/8487.js.map +1 -0
  15. package/dist/main.js +1 -1
  16. package/dist/openmrs-esm-patient-registration-app.js +1 -1
  17. package/dist/openmrs-esm-patient-registration-app.js.buildmanifest.json +129 -129
  18. package/dist/routes.json +1 -1
  19. package/package.json +1 -1
  20. package/src/index.ts +1 -1
  21. package/src/patient-registration/client-registry/client-registry-search.component.tsx +9 -48
  22. package/src/patient-registration/client-registry/client-registry.resource.ts +8 -29
  23. package/src/patient-registration/client-registry/constants/civil-status.ts +29 -0
  24. package/src/patient-registration/client-registry/constants/person-attribute-types.ts +21 -0
  25. package/src/patient-registration/client-registry/existing-client/client-dependants-comparison/client-dependants-comparison.component.tsx +26 -0
  26. package/src/patient-registration/client-registry/existing-client/client-dependants-comparison/dependant-comparison-rows.component.tsx +153 -0
  27. package/src/patient-registration/client-registry/existing-client/client-details-comparison/client-details-comparison.component.tsx +181 -0
  28. package/src/patient-registration/client-registry/existing-client/client-details-comparison/comparison-table-row.component.tsx +42 -0
  29. package/src/patient-registration/client-registry/existing-client/client-registry-verification-tag.component.tsx +54 -0
  30. package/src/patient-registration/client-registry/existing-client/existing-client-tab.component.tsx +85 -0
  31. package/src/patient-registration/client-registry/existing-client/existing-client.resource.ts +78 -0
  32. package/src/patient-registration/client-registry/existing-client/mapper-utils.ts +419 -0
  33. package/src/patient-registration/{client-registry-search/client-registry.types.ts → client-registry/existing-client/types/index.ts} +91 -149
  34. package/src/patient-registration/client-registry/hie-client-adapter.ts +289 -1
  35. package/src/patient-registration/client-registry/mock-client.ts +627 -0
  36. package/src/patient-registration/client-registry/{client-dependants → new-client/client-dependants}/list/client-depandants.component.tsx +1 -1
  37. package/src/patient-registration/client-registry/{client-details → new-client/client-details}/client-details.tsx +2 -2
  38. package/src/patient-registration/client-registry/new-client/new-client-registration/new-client-registration.scss +25 -0
  39. package/src/patient-registration/client-registry/new-client/new-client-registration/new-client-registration.tsx +272 -0
  40. package/src/patient-registration/client-registry/new-client/new-client-tab.component.tsx +32 -0
  41. package/src/patient-registration/client-registry/new-client/registration-form-data.ts +251 -0
  42. package/src/patient-registration/client-registry/types/index.ts +324 -6
  43. package/src/patient-registration/client-registry-search/client-registry-dependant-details.component.tsx +1 -1
  44. package/src/patient-registration/client-registry-search/client-registry-details.component.tsx +1 -1
  45. package/src/patient-registration/client-registry-search/client-registry-patient-details.component.tsx +1 -1
  46. package/src/patient-registration/client-registry-search/client-registry-search.component.tsx +1 -1
  47. package/src/patient-registration/client-registry-search/client-registry-verification-tag.component.tsx +1 -1
  48. package/src/patient-registration/client-registry-search/client-registry.resource.ts +16 -3
  49. package/src/patient-registration/client-registry-search/map-client-registry-to-form-utils.ts +1 -1
  50. package/src/patient-registration/patient-registration.component.tsx +1 -0
  51. package/src/widgets/client-registry-verification.modal.tsx +13 -0
  52. package/translations/en.json +1 -0
  53. package/dist/4395.js +0 -1
  54. package/dist/4395.js.map +0 -1
  55. package/dist/5239.js +0 -2
  56. package/dist/5239.js.map +0 -1
  57. package/dist/6741.js +0 -1
  58. package/dist/6741.js.map +0 -1
  59. package/dist/8882.js +0 -1
  60. package/dist/8882.js.map +0 -1
  61. package/dist/9898.js +0 -1
  62. package/dist/9898.js.map +0 -1
  63. /package/dist/{5239.js.LICENSE.txt → 5365.js.LICENSE.txt} +0 -0
@@ -0,0 +1,419 @@
1
+ import dayjs from 'dayjs';
2
+ import { HieAttributeType, type HieClient, HieIdentificationType } from '../types';
3
+ import {
4
+ type AmrsClient,
5
+ type CustomRelationship,
6
+ IdentifierTypesUuids,
7
+ PersonAttributeTypeUuids,
8
+ RelationshipTypeUuids,
9
+ } from './types';
10
+
11
+ export const nameFields = ['givenName', 'middleName', 'familyName'];
12
+
13
+ export const addressFields = [
14
+ 'country',
15
+ 'countyDistrict',
16
+ 'address2',
17
+ 'address7',
18
+ 'cityVillage',
19
+ 'longitude',
20
+ 'latitude',
21
+ ];
22
+
23
+ export const personSyncFields = [...nameFields, 'gender', 'birthdate', ...addressFields];
24
+
25
+ export const identifiersSyncFields = () => Object.keys(HieIdentificationType);
26
+
27
+ export const attributesSyncFields = () => Object.keys(HieAttributeType);
28
+
29
+ export const getIdentifierUuid = (identifier: string) => {
30
+ let val = '';
31
+ switch (identifier) {
32
+ case HieIdentificationType.AlienID:
33
+ val = IdentifierTypesUuids.ALIEN_ID_UUID;
34
+ break;
35
+ case HieIdentificationType.HouseholdNumber:
36
+ val = IdentifierTypesUuids.HOUSE_HOLD_NUMBER_UUID;
37
+ break;
38
+ case HieIdentificationType.MandateNumber:
39
+ val = IdentifierTypesUuids.MANDATE_NUMBER_UUID;
40
+ break;
41
+ case HieIdentificationType.Cr:
42
+ val = IdentifierTypesUuids.CLIENT_REGISTRY_NO_UUID;
43
+ break;
44
+ case HieIdentificationType.NationalID:
45
+ val = IdentifierTypesUuids.NATIONAL_ID_UUID;
46
+ break;
47
+ case HieIdentificationType.RefugeeID:
48
+ val = IdentifierTypesUuids.REFUGEE_ID_UUID;
49
+ break;
50
+ case HieIdentificationType.SHANumber:
51
+ val = IdentifierTypesUuids.SHA_UUID;
52
+ break;
53
+ case HieIdentificationType.TemporaryDependantID:
54
+ val = IdentifierTypesUuids.TEMPORARY_DEPENDANT_ID_UUID;
55
+ break;
56
+ default:
57
+ val = '';
58
+ }
59
+ return val;
60
+ };
61
+
62
+ export const getAttributeUuid = (attribute: string) => {
63
+ let val = '';
64
+ switch (attribute) {
65
+ case HieAttributeType.Citizenship:
66
+ val = PersonAttributeTypeUuids.CITIZENSHIP_UUID;
67
+ break;
68
+ case HieAttributeType.CivilStatus:
69
+ val = PersonAttributeTypeUuids.CIVIL_STATUS_UUID;
70
+ break;
71
+ case HieAttributeType.Email:
72
+ val = PersonAttributeTypeUuids.CONTACT_EMAIL_ADDRESS_UUID;
73
+ break;
74
+ case HieAttributeType.KRAPin:
75
+ val = PersonAttributeTypeUuids.KRA_PIN_UUID;
76
+ break;
77
+ case HieAttributeType.Phone:
78
+ val = PersonAttributeTypeUuids.CONTACT_PHONE_NUMBER_UUID;
79
+ break;
80
+ case HieAttributeType.PlaceOfBirth:
81
+ val = PersonAttributeTypeUuids.PLACE_OF_BIRTH_UUID;
82
+ break;
83
+ case HieAttributeType.Cr:
84
+ val = PersonAttributeTypeUuids.CLIENT_REGISTRY_ID_UUID;
85
+ break;
86
+ default:
87
+ val = '';
88
+ }
89
+ return val;
90
+ };
91
+
92
+ export const getAmrsRelationshipTypeUuid = (relationshipType: string) => {
93
+ let relationShipTypeUuid = '';
94
+ switch (relationshipType) {
95
+ case 'Spouse':
96
+ relationShipTypeUuid = RelationshipTypeUuids.SPOUSE_UUID;
97
+ break;
98
+ case 'Child':
99
+ relationShipTypeUuid = RelationshipTypeUuids.PARENT_CHILD_UUID;
100
+ break;
101
+ default:
102
+ relationShipTypeUuid = RelationshipTypeUuids.OTHER_NON_CODED_UUID;
103
+ }
104
+
105
+ return relationShipTypeUuid;
106
+ };
107
+
108
+ export const patientObjFields = [...personSyncFields, ...identifiersSyncFields()];
109
+
110
+ const sanitizeValue = (value: unknown) => {
111
+ if (value === null || value === undefined) {
112
+ return '';
113
+ }
114
+ return value;
115
+ };
116
+
117
+ export const mapFieldValue = (field: string, hieData: HieClient, amrsPerson: AmrsClient): Array<string> => {
118
+ let arr = [];
119
+ switch (field) {
120
+ case 'givenName':
121
+ arr = [sanitizeValue(amrsPerson?.person?.preferredName?.givenName), sanitizeValue(hieData?.first_name)];
122
+ break;
123
+ case 'middleName':
124
+ arr = [sanitizeValue(amrsPerson?.person?.preferredName?.middleName), sanitizeValue(hieData?.middle_name)];
125
+ break;
126
+ case 'familyName':
127
+ arr = [sanitizeValue(amrsPerson?.person?.preferredName?.familyName), sanitizeValue(hieData?.last_name)];
128
+ break;
129
+ case 'gender':
130
+ arr = [sanitizeValue(amrsPerson?.person?.gender), sanitizeValue(hieData?.gender)];
131
+ break;
132
+ case 'birthdate':
133
+ arr = [
134
+ dayjs(sanitizeValue(amrsPerson?.person?.birthdate) + '', 'YYYY-MM-DD', true).isValid()
135
+ ? dayjs(sanitizeValue(amrsPerson?.person?.birthdate) + '').format('YYYY-MM-DD')
136
+ : sanitizeValue(amrsPerson?.person?.birthdate),
137
+ sanitizeValue(hieData?.date_of_birth),
138
+ ];
139
+ break;
140
+ case 'country':
141
+ arr = [sanitizeValue(amrsPerson?.person?.preferredAddress?.country), sanitizeValue(hieData?.country)];
142
+ break;
143
+ case 'countyDistrict':
144
+ arr = [sanitizeValue(amrsPerson?.person?.preferredAddress?.countyDistrict), sanitizeValue(hieData?.county)];
145
+ break;
146
+ case 'address2':
147
+ arr = [sanitizeValue(amrsPerson?.person?.preferredAddress?.address2), sanitizeValue(hieData?.sub_county)];
148
+ break;
149
+ case 'address7':
150
+ arr = [sanitizeValue(amrsPerson?.person?.preferredAddress?.address7), sanitizeValue(hieData?.ward)];
151
+ break;
152
+ case 'cityVillage':
153
+ arr = [sanitizeValue(amrsPerson?.person?.preferredAddress?.cityVillage), sanitizeValue(hieData?.village_estate)];
154
+ break;
155
+ case 'longitude':
156
+ arr = [sanitizeValue(amrsPerson?.person?.preferredAddress?.longitude), sanitizeValue(hieData?.longitude)];
157
+ break;
158
+ case 'latitude':
159
+ arr = [sanitizeValue(amrsPerson?.person?.preferredAddress?.latitude), sanitizeValue(hieData?.latitude)];
160
+ break;
161
+ case 'NationalID':
162
+ arr = [
163
+ sanitizeValue(
164
+ amrsPerson?.person?.identifiers?.find(
165
+ (v) => v.identifierType.uuid === getIdentifierUuid(HieIdentificationType.NationalID),
166
+ )?.identifier,
167
+ ),
168
+ sanitizeValue(
169
+ hieData?.other_identifications.find((v) => v.identification_type === HieIdentificationType.NationalID)
170
+ ?.identification_number,
171
+ ),
172
+ ];
173
+ break;
174
+ case 'SHANumber':
175
+ arr = [
176
+ sanitizeValue(
177
+ amrsPerson?.person?.identifiers?.find(
178
+ (v) => v.identifierType.uuid === getIdentifierUuid(HieIdentificationType.SHANumber),
179
+ )?.identifier,
180
+ ),
181
+ sanitizeValue(
182
+ hieData?.other_identifications.find((v) => v.identification_type === HieIdentificationType.SHANumber)
183
+ ?.identification_number,
184
+ ),
185
+ ];
186
+ break;
187
+ case 'HouseholdNumber':
188
+ arr = [
189
+ sanitizeValue(
190
+ amrsPerson?.person?.identifiers?.find(
191
+ (v) => v.identifierType.uuid === getIdentifierUuid(HieIdentificationType.HouseholdNumber),
192
+ )?.identifier,
193
+ ),
194
+ sanitizeValue(
195
+ hieData?.other_identifications?.find((v) => v.identification_type === HieIdentificationType.HouseholdNumber)
196
+ ?.identification_number,
197
+ ),
198
+ ];
199
+ break;
200
+ case 'RefugeeID':
201
+ arr = [
202
+ sanitizeValue(
203
+ amrsPerson?.person?.identifiers?.find(
204
+ (v) => v.identifierType.uuid === getIdentifierUuid(HieIdentificationType.RefugeeID),
205
+ )?.identifier,
206
+ ),
207
+ sanitizeValue(
208
+ hieData?.other_identifications.find((v) => v.identification_type === HieIdentificationType.RefugeeID)
209
+ ?.identification_number,
210
+ ),
211
+ ];
212
+ break;
213
+ case 'AlienID':
214
+ arr = [
215
+ sanitizeValue(
216
+ amrsPerson?.person?.identifiers?.find(
217
+ (v) => v.identifierType.uuid === getIdentifierUuid(HieIdentificationType.AlienID),
218
+ )?.identifier,
219
+ ),
220
+ sanitizeValue(
221
+ hieData?.other_identifications.find((v) => v.identification_type === HieIdentificationType.AlienID)
222
+ ?.identification_number,
223
+ ),
224
+ ];
225
+ break;
226
+ case 'MandateNumber':
227
+ arr = [
228
+ sanitizeValue(
229
+ amrsPerson?.person?.identifiers?.find(
230
+ (v) => v.identifierType.uuid === getIdentifierUuid(HieIdentificationType.MandateNumber),
231
+ )?.identifier,
232
+ ),
233
+ sanitizeValue(
234
+ hieData?.other_identifications.find((v) => v.identification_type === HieIdentificationType.MandateNumber)
235
+ ?.identification_number,
236
+ ),
237
+ ];
238
+ break;
239
+ case 'Cr':
240
+ arr = [
241
+ sanitizeValue(
242
+ amrsPerson?.person?.identifiers?.find(
243
+ (v) => v.identifierType.uuid === getIdentifierUuid(HieIdentificationType.Cr),
244
+ )?.identifier,
245
+ ),
246
+ sanitizeValue(
247
+ hieData?.other_identifications.find((v) => v.identification_type === HieIdentificationType.Cr)
248
+ ?.identification_number,
249
+ ),
250
+ ];
251
+ break;
252
+ case 'TemporaryDependantID':
253
+ arr = [
254
+ sanitizeValue(
255
+ amrsPerson?.person?.identifiers?.find(
256
+ (v) => v.identifierType.uuid === getIdentifierUuid(HieIdentificationType.TemporaryDependantID),
257
+ )?.identifier,
258
+ ),
259
+ sanitizeValue(
260
+ hieData?.other_identifications.find(
261
+ (v) => v.identification_type === HieIdentificationType.TemporaryDependantID,
262
+ )?.identification_number,
263
+ ),
264
+ ];
265
+ break;
266
+ case 'PlaceOfBirth':
267
+ arr = [
268
+ sanitizeValue(
269
+ amrsPerson?.person?.attributes.find(
270
+ (v) => v.attributeType.uuid === getAttributeUuid(HieAttributeType.PlaceOfBirth),
271
+ )?.value,
272
+ ),
273
+ sanitizeValue(hieData?.place_of_birth),
274
+ ];
275
+ break;
276
+ case 'CivilStatus':
277
+ arr = [
278
+ sanitizeValue(
279
+ amrsPerson?.person?.attributes.find(
280
+ (v) => v.attributeType.uuid === getAttributeUuid(HieAttributeType.CivilStatus),
281
+ )?.value,
282
+ ),
283
+ sanitizeValue(hieData?.civil_status),
284
+ ];
285
+ break;
286
+ case 'Email':
287
+ arr = [
288
+ sanitizeValue(
289
+ amrsPerson?.person?.attributes.find((v) => v.attributeType.uuid === getAttributeUuid(HieAttributeType.Email))
290
+ ?.value,
291
+ ),
292
+ sanitizeValue(hieData?.email),
293
+ ];
294
+ break;
295
+ case 'Phone':
296
+ arr = [
297
+ sanitizeValue(
298
+ amrsPerson?.person?.attributes.find((v) => v.attributeType.uuid === getAttributeUuid(HieAttributeType.Phone))
299
+ ?.value,
300
+ ),
301
+ sanitizeValue(hieData?.phone),
302
+ ];
303
+ break;
304
+ case 'KRAPin':
305
+ arr = [
306
+ sanitizeValue(
307
+ amrsPerson?.person?.attributes.find((v) => v.attributeType.uuid === getAttributeUuid(HieAttributeType.KRAPin))
308
+ ?.value,
309
+ ),
310
+ sanitizeValue(hieData?.kra_pin),
311
+ ];
312
+ break;
313
+ case 'Citizenship':
314
+ arr = [
315
+ sanitizeValue(
316
+ amrsPerson?.person?.attributes.find(
317
+ (v) => v.attributeType.uuid === getAttributeUuid(HieAttributeType.Citizenship),
318
+ )?.value,
319
+ ),
320
+ sanitizeValue(hieData?.citizenship),
321
+ ];
322
+ break;
323
+ default:
324
+ arr = ['', ''];
325
+ }
326
+ return arr;
327
+ };
328
+
329
+ export function getPatientRelationshipPayload(amrsPerson: AmrsClient, relationshipType: string, dependantUuid: string) {
330
+ const startDate = dayjs().format('YYYY-MM-DDTHH:mm:ss.SSSZZ');
331
+ const patientRelationshipPayload = {
332
+ personA: amrsPerson.person.uuid,
333
+ relationshipType: getAmrsRelationshipTypeUuid(relationshipType),
334
+ personB: dependantUuid,
335
+ startDate: startDate,
336
+ };
337
+ return patientRelationshipPayload;
338
+ }
339
+
340
+ export function mapAmrsPatientRelationship(uuid: string, relationships: Array<any>) {
341
+ const relationshipsArr: Array<CustomRelationship> = [];
342
+ if (relationships) {
343
+ for (const relationship of relationships) {
344
+ if (uuid === relationship?.personA?.uuid) {
345
+ const relation = {
346
+ uuid: relationship?.uuid,
347
+ display: relationship?.personB?.display,
348
+ relative: relationship?.personB?.display,
349
+ relatedPersonUuid: relationship?.personB?.uuid,
350
+ relationshipType: relationship?.relationshipType?.bIsToA,
351
+ relationshipTypeUuId: relationship?.relationshipType?.uuid,
352
+ relationshipTypeName: relationship?.relationshipType?.display,
353
+ relatedPerson: relationship?.personB,
354
+ };
355
+ relationshipsArr.push(relation);
356
+ } else {
357
+ const relation = {
358
+ uuid: relationship?.uuid,
359
+ display: relationship?.personA?.display,
360
+ relative: relationship?.personA?.display,
361
+ relatedPersonUuid: relationship?.personA?.uuid,
362
+ relationshipType: relationship?.relationshipType?.aIsToB,
363
+ relatedPerson: relationship?.personA,
364
+ relationshipTypeUuId: relationship?.relationshipType?.uuid,
365
+ relationshipTypeName: relationship?.relationshipType?.display,
366
+ };
367
+ relationshipsArr.push(relation);
368
+ }
369
+ }
370
+ }
371
+ return relationshipsArr;
372
+ }
373
+
374
+ export function getPatientAttributes(hieClient: HieClient) {
375
+ const attributes = [];
376
+ if (hieClient.place_of_birth.length > 0) {
377
+ attributes.push({
378
+ value: hieClient.place_of_birth,
379
+ attributeType: getAttributeUuid(HieAttributeType.PlaceOfBirth),
380
+ });
381
+ }
382
+ if (hieClient.phone.length > 0) {
383
+ attributes.push({
384
+ value: hieClient.phone,
385
+ attributeType: getAttributeUuid(HieAttributeType.Phone),
386
+ });
387
+ }
388
+ if (hieClient.email.length > 0) {
389
+ attributes.push({
390
+ value: hieClient.email,
391
+ attributeType: getAttributeUuid(HieAttributeType.Email),
392
+ });
393
+ }
394
+ if (hieClient.kra_pin.length > 0) {
395
+ attributes.push({
396
+ value: hieClient.kra_pin,
397
+ attributeType: getAttributeUuid(HieAttributeType.KRAPin),
398
+ });
399
+ }
400
+ if (hieClient.civil_status.length > 0) {
401
+ attributes.push({
402
+ value: this.getAmrsConceptUuidFromField(hieClient.civil_status),
403
+ attributeType: getAttributeUuid(HieAttributeType.CivilStatus),
404
+ });
405
+ }
406
+ if (hieClient.id) {
407
+ attributes.push({
408
+ value: hieClient.id,
409
+ attributeType: getAttributeUuid(HieAttributeType.Cr),
410
+ });
411
+ }
412
+ if (hieClient.citizenship) {
413
+ attributes.push({
414
+ value: hieClient.citizenship,
415
+ attributeType: getAttributeUuid(HieAttributeType.Citizenship),
416
+ });
417
+ }
418
+ return attributes;
419
+ }
@@ -1,79 +1,72 @@
1
- export type RequestCustomOtpDto = {
2
- identificationNumber: string | number;
3
- identificationType: string;
4
- locationUuid: string;
5
- };
1
+ import { type HieDependant, type HieClient } from '../../types';
6
2
 
7
- export interface RequestCustomOtpResponse {
8
- message: string;
9
- sessionId: string;
10
- maskedPhone: string;
11
- }
3
+ const HOUSE_HOLD_NUMBER_UUID = 'bb74b20e-dcee-4f59-bdf1-2dffc3abf106';
4
+ const SHA_UUID = 'cf5362b2-8049-4442-b3c6-36f870e320cb';
5
+ const CLIENT_REGISTRY_NO_UUID = 'e88dc246-3614-4ee3-8141-1f2a83054e72';
6
+ const NATIONAL_ID_UUID = '58a47054-1359-11df-a1f1-0026b9348838';
7
+ const PROVIDER_NATIONAL_ID_UUID = '4550df92-c684-4597-8ab8-d6b10eabdcfb';
8
+ const REFUGEE_ID_UUID = '465e81af-8d69-47e9-9127-53a94adc75fb';
9
+ const MANDATE_NUMBER_UUID = 'aae2d097-20ba-43ca-9b71-fd8296068f39';
10
+ const ALIEN_ID_UUID = '12f5b147-3403-4a73-913d-7ded9ffec094';
11
+ const TEMPORARY_DEPENDANT_ID_UUID = 'a3d34214-93e8-4faf-bf4d-0272eee079eb';
12
+ const AMRS_UNIVERSAL_ID_UUID = '58a4732e-1359-11df-a1f1-0026b9348838';
13
+ const UPI_NUMBER_UUID = 'cba702b9-4664-4b43-83f1-9ab473cbd64d';
12
14
 
13
- export interface ValidateHieCustomOtpDto {
14
- sessionId: string;
15
- otp: number | string;
16
- locationUuid: string;
17
- }
15
+ export const IdentifierTypesUuids = {
16
+ HOUSE_HOLD_NUMBER_UUID,
17
+ SHA_UUID,
18
+ CLIENT_REGISTRY_NO_UUID,
19
+ NATIONAL_ID_UUID,
20
+ PROVIDER_NATIONAL_ID_UUID,
21
+ REFUGEE_ID_UUID,
22
+ MANDATE_NUMBER_UUID,
23
+ ALIEN_ID_UUID,
24
+ TEMPORARY_DEPENDANT_ID_UUID,
25
+ AMRS_UNIVERSAL_ID_UUID,
26
+ UPI_NUMBER_UUID,
27
+ };
18
28
 
19
- export interface ValidateCustomOtpResponse {
20
- message: string;
21
- isValid?: boolean;
22
- }
29
+ const CONTACT_PHONE_NUMBER_UUID = '72a759a8-1359-11df-a1f1-0026b9348838';
30
+ const CITIZENSHIP_UUID = '72a759a8-1359-11df-a1f1-0026b9348838';
31
+ const CONTACT_EMAIL_ADDRESS_UUID = '2f65dbcb-3e58-45a3-8be7-fd1dc9aa0faa';
32
+ const ALTERNATIVE_CONTACT_PHONE_NUMBER_UUID = 'c725f524-c14a-4468-ac19-4a0e6661c930';
33
+ const KRA_PIN_UUID = 'ae683747-b3fc-4e5c-bad3-c3be743b248f';
34
+ const CIVIL_STATUS_UUID = '8d871f2a-c2cc-11de-8d13-0010c6dffd0f';
35
+ const CLIENT_REGISTRY_ID_UUID = 'e068e02b-faac-4baf-bd58-fe6e0c29a81f';
36
+ const PLACE_OF_BIRTH_UUID = '8d8718c2-c2cc-11de-8d13-0010c6dffd0f';
37
+ const EMAIL_UUID = '2f65dbcb-3e58-45a3-8be7-fd1dc9aa0faa';
23
38
 
24
- export type ClientRegistrySearchRequest = {
25
- identificationNumber: string | number;
26
- identificationType: string;
27
- locationUuid: string;
39
+ export const PersonAttributeTypeUuids = {
40
+ CONTACT_PHONE_NUMBER_UUID,
41
+ CITIZENSHIP_UUID,
42
+ CONTACT_EMAIL_ADDRESS_UUID,
43
+ ALTERNATIVE_CONTACT_PHONE_NUMBER_UUID,
44
+ KRA_PIN_UUID,
45
+ CIVIL_STATUS_UUID,
46
+ CLIENT_REGISTRY_ID_UUID,
47
+ PLACE_OF_BIRTH_UUID,
48
+ EMAIL_UUID,
28
49
  };
29
50
 
30
- export type ClientRegistryBody = {
31
- id: string;
32
- first_name: string;
33
- middle_name: string;
34
- last_name: string;
35
- gender: string;
36
- date_of_birth: string;
37
- other_identifications: Array<{
38
- identification_number: string;
39
- identification_type: string;
40
- }>;
41
- dependants: Array<ClientRegistryDependantBody>;
42
- citizenship: string;
43
- kra_pin: string;
44
- civil_status: string;
45
- email: string;
46
- phone: string;
47
- place_of_birth: string;
48
- country: string;
49
- county: string;
50
- sub_county: string;
51
- ward: string;
52
- village_estate: string;
53
- building_house_no: string;
54
- latitude: string;
55
- longitude: string;
56
- identification_number: string;
57
- };
51
+ const PARENT_CHILD_UUID = '7878d348-1359-11df-a1f1-0026b9348838';
52
+ const AUNT_UNCLE_NIECE_NEPHEW_UUID = '7878dd3e-1359-11df-a1f1-0026b9348838';
53
+ const SPOUSE_UUID = '7878df3c-1359-11df-a1f1-0026b9348838';
54
+ const GRANDCHILD_GRANDPARENT_UUID = '7878e144-1359-11df-a1f1-0026b9348838';
55
+ const GUARDIAN_CHILD_UUUD = '01bc0cf5-d428-427f-be13-305eb9cad7ba';
56
+ const FOSTER_CHILD_FOSTER_PARENT_UUID = '7878e52c-1359-11df-a1f1-0026b9348838';
57
+ const OTHER_NON_CODED_UUID = 'af78531e-98ab-41da-be3a-6a871ecbf8c0';
58
58
 
59
- export type ClientRegistryDependantBody = {
60
- relationship: string;
61
- total: number;
62
- result: Array<ClientRegistryBody>;
59
+ export const RelationshipTypeUuids = {
60
+ PARENT_CHILD_UUID,
61
+ AUNT_UNCLE_NIECE_NEPHEW_UUID,
62
+ SPOUSE_UUID,
63
+ GRANDCHILD_GRANDPARENT_UUID,
64
+ GUARDIAN_CHILD_UUUD,
65
+ FOSTER_CHILD_FOSTER_PARENT_UUID,
66
+ OTHER_NON_CODED_UUID,
63
67
  };
64
68
 
65
- export interface CustomRelationship {
66
- uuid: string;
67
- display: string;
68
- relative: string;
69
- relatedPersonUuid: string;
70
- relationshipType: string;
71
- relationshipTypeUuId: string;
72
- relationshipTypeName: string;
73
- relatedPerson: any;
74
- }
75
-
76
- export interface AmrsPerson {
69
+ export interface AmrsClient {
77
70
  uuid: string;
78
71
  identifiers: Identifier[];
79
72
  display: string;
@@ -153,91 +146,40 @@ export interface Attributes {
153
146
  };
154
147
  }
155
148
 
156
- export type ClientRegistrySearchResponse = Array<ClientRegistryBody>;
157
-
158
- export enum HieIdentificationType {
159
- NationalID = 'National ID',
160
- SHANumber = 'SHA Number',
161
- HouseholdNumber = 'Household Number',
162
- RefugeeID = 'Refugee ID',
163
- AlienID = 'Alien ID',
164
- MandateNumber = 'Mandate Number',
165
- Cr = 'id',
166
- TemporaryDependantID = 'Temporary Dependant ID',
149
+ export interface CustomRelationship {
150
+ uuid: string;
151
+ display: string;
152
+ relative: string;
153
+ relatedPersonUuid: string;
154
+ relationshipType: string;
155
+ relationshipTypeUuId: string;
156
+ relationshipTypeName: string;
157
+ relatedPerson: any;
167
158
  }
168
159
 
169
- const HOUSE_HOLD_NUMBER_UUID = 'bb74b20e-dcee-4f59-bdf1-2dffc3abf106';
170
- const SHA_UUID = 'cf5362b2-8049-4442-b3c6-36f870e320cb';
171
- const CLIENT_REGISTRY_NO_UUID = 'e88dc246-3614-4ee3-8141-1f2a83054e72';
172
- const NATIONAL_ID_UUID = '58a47054-1359-11df-a1f1-0026b9348838';
173
- const PROVIDER_NATIONAL_ID_UUID = '4550df92-c684-4597-8ab8-d6b10eabdcfb';
174
- const REFUGEE_ID_UUID = '465e81af-8d69-47e9-9127-53a94adc75fb';
175
- const MANDATE_NUMBER_UUID = 'aae2d097-20ba-43ca-9b71-fd8296068f39';
176
- const ALIEN_ID_UUID = '12f5b147-3403-4a73-913d-7ded9ffec094';
177
- const TEMPORARY_DEPENDANT_ID_UUID = 'a3d34214-93e8-4faf-bf4d-0272eee079eb';
178
- const AMRS_UNIVERSAL_ID_UUID = '58a4732e-1359-11df-a1f1-0026b9348838';
179
- const UPI_NUMBER_UUID = 'cba702b9-4664-4b43-83f1-9ab473cbd64d';
180
-
181
- export const IdentifierTypesUuids = {
182
- HOUSE_HOLD_NUMBER_UUID,
183
- SHA_UUID,
184
- CLIENT_REGISTRY_NO_UUID,
185
- NATIONAL_ID_UUID,
186
- PROVIDER_NATIONAL_ID_UUID,
187
- REFUGEE_ID_UUID,
188
- MANDATE_NUMBER_UUID,
189
- ALIEN_ID_UUID,
190
- TEMPORARY_DEPENDANT_ID_UUID,
191
- AMRS_UNIVERSAL_ID_UUID,
192
- UPI_NUMBER_UUID,
193
- };
194
-
195
- export enum HieAttributeType {
196
- KRAPin = 'kra_pin',
197
- CivilStatus = 'civil_status',
198
- Email = 'email',
199
- Phone = 'phone',
200
- PlaceOfBirth = 'place_of_birth',
201
- Citizenship = 'citizenship',
202
- Cr = 'id',
160
+ export interface ClientDetailsComparisonProps {
161
+ hieClient: HieClient;
162
+ amrsClient: AmrsClient;
163
+ fromDependant?: boolean;
203
164
  }
204
165
 
205
- const CONTACT_PHONE_NUMBER_UUID = '72a759a8-1359-11df-a1f1-0026b9348838';
206
- const CITIZENSHIP_UUID = '72a759a8-1359-11df-a1f1-0026b9348838';
207
- const CONTACT_EMAIL_ADDRESS_UUID = '2f65dbcb-3e58-45a3-8be7-fd1dc9aa0faa';
208
- const ALTERNATIVE_CONTACT_PHONE_NUMBER_UUID = 'c725f524-c14a-4468-ac19-4a0e6661c930';
209
- const KRA_PIN_UUID = 'ae683747-b3fc-4e5c-bad3-c3be743b248f';
210
- const CIVIL_STATUS_UUID = '8d871f2a-c2cc-11de-8d13-0010c6dffd0f';
211
- const CLIENT_REGISTRY_ID_UUID = 'e068e02b-faac-4baf-bd58-fe6e0c29a81f';
212
- const PLACE_OF_BIRTH_UUID = '8d8718c2-c2cc-11de-8d13-0010c6dffd0f';
213
- const EMAIL_UUID = '2f65dbcb-3e58-45a3-8be7-fd1dc9aa0faa';
214
-
215
- export const PersonAttributeTypeUuids = {
216
- CONTACT_PHONE_NUMBER_UUID,
217
- CITIZENSHIP_UUID,
218
- CONTACT_EMAIL_ADDRESS_UUID,
219
- ALTERNATIVE_CONTACT_PHONE_NUMBER_UUID,
220
- KRA_PIN_UUID,
221
- CIVIL_STATUS_UUID,
222
- CLIENT_REGISTRY_ID_UUID,
223
- PLACE_OF_BIRTH_UUID,
224
- EMAIL_UUID,
225
- };
166
+ export interface ComparisonTableRowProps {
167
+ field: string;
168
+ label: string;
169
+ amrsValue: string;
170
+ hieValue: string;
171
+ onChange?(e: boolean, field: string, value: string, multiple: boolean): void;
172
+ allChecked: boolean;
173
+ }
226
174
 
227
- const PARENT_CHILD_UUID = '7878d348-1359-11df-a1f1-0026b9348838';
228
- const AUNT_UNCLE_NIECE_NEPHEW_UUID = '7878dd3e-1359-11df-a1f1-0026b9348838';
229
- const SPOUSE_UUID = '7878df3c-1359-11df-a1f1-0026b9348838';
230
- const GRANDCHILD_GRANDPARENT_UUID = '7878e144-1359-11df-a1f1-0026b9348838';
231
- const GUARDIAN_CHILD_UUD = '01bc0cf5-d428-427f-be13-305eb9cad7ba';
232
- const FOSTER_CHILD_FOSTER_PARENT_UUID = '7878e52c-1359-11df-a1f1-0026b9348838';
233
- const OTHER_NON_CODED_UUID = 'af78531e-98ab-41da-be3a-6a871ecbf8c0';
175
+ export interface ClientDependantsComparisonProps {
176
+ hieDependants: Array<HieDependant>;
177
+ amrsClient: AmrsClient;
178
+ patientRelationships: Array<CustomRelationship>;
179
+ }
234
180
 
235
- export const RelationshipTypeUuids = {
236
- PARENT_CHILD_UUID,
237
- AUNT_UNCLE_NIECE_NEPHEW_UUID,
238
- SPOUSE_UUID,
239
- GRANDCHILD_GRANDPARENT_UUID,
240
- GUARDIAN_CHILD_UUD,
241
- FOSTER_CHILD_FOSTER_PARENT_UUID,
242
- OTHER_NON_CODED_UUID,
243
- };
181
+ export interface ClientDependantComparisonRowsProps {
182
+ hieDependant: HieDependant;
183
+ patientRelationships: Array<CustomRelationship>;
184
+ amrsClient: AmrsClient;
185
+ }