@ampath/esm-patient-registration-app 9.2.0-next.17 → 9.2.0-next.19

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 (53) hide show
  1. package/dist/2498.js +2 -0
  2. package/dist/2498.js.map +1 -0
  3. package/dist/2523.js +1 -0
  4. package/dist/2523.js.map +1 -0
  5. package/dist/5239.js +1 -1
  6. package/dist/5239.js.map +1 -1
  7. package/dist/6276.js +1 -1
  8. package/dist/6276.js.map +1 -1
  9. package/dist/6583.js +1 -0
  10. package/dist/6583.js.map +1 -0
  11. package/dist/7821.js +1 -1
  12. package/dist/7821.js.map +1 -1
  13. package/dist/8414.js +1 -1
  14. package/dist/8414.js.map +1 -1
  15. package/dist/8434.js +1 -1
  16. package/dist/8434.js.map +1 -1
  17. package/dist/9853.js +1 -0
  18. package/dist/9853.js.map +1 -0
  19. package/dist/main.js +1 -1
  20. package/dist/main.js.map +1 -1
  21. package/dist/openmrs-esm-patient-registration-app.js +1 -1
  22. package/dist/openmrs-esm-patient-registration-app.js.buildmanifest.json +109 -109
  23. package/dist/routes.json +1 -1
  24. package/package.json +1 -1
  25. package/src/index.ts +1 -1
  26. package/src/patient-registration/client-registry/client-registry-search.component.tsx +164 -68
  27. package/src/patient-registration/client-registry/client-registry-search.scss +26 -0
  28. package/src/patient-registration/client-registry/existing-client/client-dependants-comparison/client-dependants-comparison.component.tsx +26 -0
  29. package/src/patient-registration/client-registry/existing-client/client-dependants-comparison/dependant-comparison-rows.component.tsx +153 -0
  30. package/src/patient-registration/client-registry/existing-client/client-details-comparison/client-details-comparison.component.tsx +181 -0
  31. package/src/patient-registration/client-registry/existing-client/client-details-comparison/comparison-table-row.component.tsx +42 -0
  32. package/src/patient-registration/client-registry/existing-client/client-registry-verification-tag.component.tsx +54 -0
  33. package/src/patient-registration/client-registry/existing-client/existing-client-tab.component.tsx +85 -0
  34. package/src/patient-registration/client-registry/existing-client/existing-client.resource.ts +78 -0
  35. package/src/patient-registration/client-registry/existing-client/mapper-utils.ts +419 -0
  36. package/src/patient-registration/client-registry/existing-client/types/index.ts +185 -0
  37. package/src/patient-registration/client-registry/hie-client-adapter.ts +56 -0
  38. package/src/patient-registration/client-registry/new-client/client-dependants/list/client-depandants.component.tsx +55 -0
  39. package/src/patient-registration/client-registry/new-client/client-details/client-details.tsx +42 -0
  40. package/src/patient-registration/client-registry/new-client/new-client-tab.component.tsx +30 -0
  41. package/src/patient-registration/client-registry/types/index.ts +210 -0
  42. package/src/patient-registration/custom-patient-registration.scss +6 -0
  43. package/src/patient-registration/patient-registration.component.tsx +24 -12
  44. package/src/widgets/client-registry-verification.modal.tsx +13 -0
  45. package/dist/4395.js +0 -1
  46. package/dist/4395.js.map +0 -1
  47. package/dist/6996.js +0 -1
  48. package/dist/6996.js.map +0 -1
  49. package/dist/8882.js +0 -1
  50. package/dist/8882.js.map +0 -1
  51. package/dist/9933.js +0 -2
  52. package/dist/9933.js.map +0 -1
  53. /package/dist/{9933.js.LICENSE.txt → 2498.js.LICENSE.txt} +0 -0
@@ -0,0 +1,185 @@
1
+ import { type HieDependant, type HieClient } from '../../types';
2
+
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';
14
+
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
+ };
28
+
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';
38
+
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,
49
+ };
50
+
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
+
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,
67
+ };
68
+
69
+ export interface AmrsClient {
70
+ uuid: string;
71
+ identifiers: Identifier[];
72
+ display: string;
73
+ person: {
74
+ uuid: string;
75
+ display: string;
76
+ gender: string;
77
+ age: number;
78
+ birthdate: string;
79
+ birthdateEstimated: boolean;
80
+ dead: boolean;
81
+ deathDate?: any;
82
+ causeOfDeath?: any;
83
+ preferredAddress: {
84
+ address1: string;
85
+ address2: string;
86
+ address3: string;
87
+ address4: string;
88
+ address5: string;
89
+ address6: string;
90
+ address7: string;
91
+ cityVillage: string;
92
+ country: string;
93
+ postalCode: string;
94
+ stateProvince: string;
95
+ countyDistrict: string;
96
+ latitude: string;
97
+ longitude: string;
98
+ };
99
+ preferredName: {
100
+ display: string;
101
+ uuid: string;
102
+ givenName: string;
103
+ middleName: string;
104
+ familyName: string;
105
+ };
106
+ attributes: Array<Attributes>;
107
+ identifiers: Identifier[];
108
+ voided: boolean;
109
+ birthtime?: any;
110
+ deathdateEstimated: boolean;
111
+ resourceVersion: string;
112
+ };
113
+ attributes: { value: string; attributeType: { uuid: string; display: string } }[];
114
+ voided: boolean;
115
+ }
116
+
117
+ export interface Address {
118
+ preferred: boolean;
119
+ address1: string;
120
+ cityVillage: string;
121
+ country: string;
122
+ postalCode: string;
123
+ stateProvince: string;
124
+ }
125
+
126
+ export interface Identifier {
127
+ uuid: string;
128
+ display: string;
129
+ identifier: string;
130
+ identifierType: {
131
+ uuid: string;
132
+ display: string;
133
+ };
134
+ }
135
+
136
+ export interface Attributes {
137
+ uuid: string;
138
+ display: string;
139
+ value: {
140
+ uuid: string;
141
+ display: string;
142
+ };
143
+ attributeType: {
144
+ uuid: string;
145
+ display: string;
146
+ };
147
+ }
148
+
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;
158
+ }
159
+
160
+ export interface ClientDetailsComparisonProps {
161
+ hieClient: HieClient;
162
+ amrsClient: AmrsClient;
163
+ fromDependant?: boolean;
164
+ }
165
+
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
+ }
174
+
175
+ export interface ClientDependantsComparisonProps {
176
+ hieDependants: Array<HieDependant>;
177
+ amrsClient: AmrsClient;
178
+ patientRelationships: Array<CustomRelationship>;
179
+ }
180
+
181
+ export interface ClientDependantComparisonRowsProps {
182
+ hieDependant: HieDependant;
183
+ patientRelationships: Array<CustomRelationship>;
184
+ amrsClient: AmrsClient;
185
+ }
@@ -0,0 +1,56 @@
1
+ import { type HieIdentifications, type HieClient } from './types';
2
+
3
+ const clientDatailsFields = [
4
+ 'id',
5
+ 'other_identifications',
6
+ 'first_name',
7
+ 'middle_name',
8
+ 'last_name',
9
+ 'gender',
10
+ 'date_of_birth',
11
+ 'is_alive',
12
+ 'deceased_datetime',
13
+ 'phone',
14
+ 'email',
15
+ 'civil_status',
16
+ 'place_of_birth',
17
+ 'citizenship',
18
+ 'country',
19
+ 'county',
20
+ 'sub_county',
21
+ 'ward',
22
+ 'village_estate',
23
+ 'longitude',
24
+ 'latitude',
25
+ 'identification_type',
26
+ ];
27
+
28
+ export function generateHieClientDetails(hieClient: HieClient) {
29
+ let data = {};
30
+ Object.keys(hieClient)
31
+ .filter((key) => {
32
+ return clientDatailsFields.includes(key);
33
+ })
34
+ .forEach((key) => {
35
+ if (key === 'other_identifications') {
36
+ const otherIds = generateOtherIdentifications(hieClient[key]);
37
+ data = {
38
+ ...data,
39
+ ...otherIds,
40
+ };
41
+ } else if (key === 'identification_type') {
42
+ data[hieClient['identification_type']] = hieClient.identification_number;
43
+ } else {
44
+ const value = hieClient[key];
45
+ data[key] = value;
46
+ }
47
+ });
48
+ return data;
49
+ }
50
+ function generateOtherIdentifications(hieIdentifications: HieIdentifications[]) {
51
+ const other = {};
52
+ hieIdentifications.forEach((id) => {
53
+ other[id.identification_type] = id.identification_number;
54
+ });
55
+ return other;
56
+ }
@@ -0,0 +1,55 @@
1
+ import React, { useMemo } from 'react';
2
+ import { Table, TableHead, TableRow, TableHeader, TableBody, TableCell } from '@carbon/react';
3
+ import { type HieDependant } from '../../../types';
4
+
5
+ interface ClientDependantsListProps {
6
+ hieDependants: HieDependant[];
7
+ }
8
+
9
+ const ClientDependantList: React.FC<ClientDependantsListProps> = ({ hieDependants }) => {
10
+ const dependants = useMemo(() => generateDependantList(hieDependants), [hieDependants]);
11
+ if (!hieDependants) {
12
+ return <>No dependants</>;
13
+ }
14
+ function generateDependantList(hieDependants: HieDependant[]) {
15
+ const dependants = [];
16
+ hieDependants.forEach((dep) => {
17
+ dependants.push({
18
+ ...dep.result[0],
19
+ relationship: dep.relationship,
20
+ });
21
+ });
22
+ return dependants;
23
+ }
24
+
25
+ return (
26
+ <>
27
+ <Table>
28
+ <TableHead>
29
+ <TableRow>
30
+ <TableHeader>No</TableHeader>
31
+ <TableHeader>CR</TableHeader>
32
+ <TableHeader>Relationship</TableHeader>
33
+ <TableHeader>Full Name</TableHeader>
34
+ <TableHeader>Gender</TableHeader>
35
+ <TableHeader>Date of Birth</TableHeader>
36
+ </TableRow>
37
+ </TableHead>
38
+ <TableBody>
39
+ {dependants.map((dep, index) => (
40
+ <TableRow id={dep.id}>
41
+ <TableCell>{index + 1}</TableCell>
42
+ <TableCell>{dep.id}</TableCell>
43
+ <TableCell>{dep.relationship}</TableCell>
44
+ <TableCell>{`${dep.first_name} ${dep.middle_name} ${dep.last_name}`}</TableCell>
45
+ <TableCell>{dep.gender}</TableCell>
46
+ <TableCell>{dep.date_of_birth}</TableCell>
47
+ </TableRow>
48
+ ))}
49
+ </TableBody>
50
+ </Table>
51
+ </>
52
+ );
53
+ };
54
+
55
+ export default ClientDependantList;
@@ -0,0 +1,42 @@
1
+ import React, { useMemo } from 'react';
2
+ import { type HieClient } from '../../types';
3
+ import { DataTable, Table, TableHead, TableRow, TableHeader, TableBody, TableCell } from '@carbon/react';
4
+ import { generateHieClientDetails } from '../../hie-client-adapter';
5
+
6
+ interface ClientdetailsProps {
7
+ client: HieClient;
8
+ }
9
+
10
+ const ClientDetails: React.FC<ClientdetailsProps> = ({ client }) => {
11
+ const clientDetails = useMemo(() => generateHieClientDetails(client), [client]);
12
+
13
+ if (!client || !clientDetails) {
14
+ return (
15
+ <>
16
+ <h4>No patient Data to Display</h4>
17
+ </>
18
+ );
19
+ }
20
+ return (
21
+ <>
22
+ <Table>
23
+ <TableHead>
24
+ <TableRow>
25
+ <TableHeader>Field</TableHeader>
26
+ <TableHeader>Value</TableHeader>
27
+ </TableRow>
28
+ </TableHead>
29
+ <TableBody>
30
+ {Object.keys(clientDetails).map((key) => (
31
+ <TableRow>
32
+ <TableCell>{key}</TableCell>
33
+ <TableCell>{clientDetails[key]}</TableCell>
34
+ </TableRow>
35
+ ))}
36
+ </TableBody>
37
+ </Table>
38
+ </>
39
+ );
40
+ };
41
+
42
+ export default ClientDetails;
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { Tabs, TabList, Tab, TabPanels, TabPanel, Button } from '@carbon/react';
3
+ import { type HieClient } from '../types';
4
+ import ClientDependantList from './client-dependants/list/client-depandants.component';
5
+ import ClientDetails from './client-details/client-details';
6
+
7
+ interface NewClientTabProps {
8
+ client: HieClient;
9
+ useHieData: () => void;
10
+ }
11
+
12
+ const NewClientTab: React.FC<NewClientTabProps> = ({ client, useHieData }) => {
13
+ return (
14
+ <>
15
+ <Tabs>
16
+ <TabList contained>
17
+ <Tab>Patient</Tab>
18
+ <Tab>Dependants</Tab>
19
+ </TabList>
20
+ <TabPanels>
21
+ <TabPanel>{client ? <ClientDetails client={client} /> : <></>}</TabPanel>
22
+ <TabPanel>{client.dependants ? <ClientDependantList hieDependants={client.dependants} /> : <></>}</TabPanel>
23
+ </TabPanels>
24
+ </Tabs>
25
+ <Button onClick={useHieData}>Use Data</Button>
26
+ </>
27
+ );
28
+ };
29
+
30
+ export default NewClientTab;
@@ -0,0 +1,210 @@
1
+ export enum HieIdentificationType {
2
+ NationalID = 'National ID',
3
+ SHANumber = 'SHA Number',
4
+ HouseholdNumber = 'Household Number',
5
+ RefugeeID = 'Refugee ID',
6
+ AlienID = 'Alien ID',
7
+ MandateNumber = 'Mandate Number',
8
+ Cr = 'id',
9
+ TemporaryDependantID = 'Temporary Dependant ID',
10
+ }
11
+
12
+ export enum HieAttributeType {
13
+ KRAPin = 'kra_pin',
14
+ CivilStatus = 'civil_status',
15
+ Email = 'email',
16
+ Phone = 'phone',
17
+ PlaceOfBirth = 'place_of_birth',
18
+ Citizenship = 'citizenship',
19
+ Cr = 'id',
20
+ }
21
+
22
+ export interface HieIdentifications {
23
+ identification_number: string;
24
+ identification_type: HieIdentificationType;
25
+ }
26
+
27
+ export interface HieDependant {
28
+ date_added: string;
29
+ relationship: string;
30
+ total: number;
31
+ result: HieClient[];
32
+ }
33
+
34
+ export interface AlternateContact {
35
+ contact_type: string;
36
+ contact_id: string;
37
+ contact_name: string;
38
+ relationship: string;
39
+ remarks: string;
40
+ }
41
+
42
+ export interface HieClient {
43
+ resourceType: string;
44
+ id: string;
45
+ meta: {
46
+ versionId: string;
47
+ creationTime: string;
48
+ lastUpdated: string;
49
+ source: string;
50
+ };
51
+ originSystem: {
52
+ system: string;
53
+ record_id: string;
54
+ };
55
+ title: string;
56
+ first_name: string;
57
+ middle_name: string;
58
+ last_name: string;
59
+ gender: string;
60
+ date_of_birth: string;
61
+ place_of_birth: string;
62
+ person_with_disability: number;
63
+ citizenship: string;
64
+ kra_pin: string;
65
+ preferred_primary_care_network: string;
66
+ employment_type: string;
67
+ domestic_worker_type: string;
68
+ civil_status: string;
69
+ identification_type: HieIdentificationType;
70
+ identification_number: string;
71
+ other_identifications: HieIdentifications[];
72
+ dependants: HieDependant[];
73
+ is_alive: number;
74
+ deceased_datetime: string;
75
+ phone: string;
76
+ biometrics_verified: number;
77
+ biometrics_score: number;
78
+ email: string;
79
+ country: string;
80
+ county: string;
81
+ sub_county: string;
82
+ ward: string;
83
+ village_estate: string;
84
+ building_house_no: string;
85
+ latitude: string;
86
+ longitude: string;
87
+ province_state_country: string;
88
+ zip_code: string;
89
+ identification_residence: string;
90
+ employer_name: string;
91
+ employer_pin: string;
92
+ disability_category: string;
93
+ disability_subcategory: string;
94
+ disability_cause: string;
95
+ in_lawful_custody: string;
96
+ admission_remand_number: string;
97
+ document_uploads: any[];
98
+ alternative_contacts: AlternateContact[];
99
+ gross_income: number;
100
+ gross_income_currency: string;
101
+ postal_address: string;
102
+ estimated_contribution: number;
103
+ estimated_annual_contribution: number;
104
+ city: string;
105
+ id_serial: string;
106
+ learning_institution_code: string;
107
+ learning_institution_name: string;
108
+ grade_level: string;
109
+ admission_number: string;
110
+ expected_year_of_graduation: string;
111
+ unconfirmed_dependants: HieDependant[];
112
+ is_agent: number;
113
+ agent_id: string;
114
+ }
115
+
116
+ export interface HieClientSearchDto {
117
+ identificationNumber: number | string;
118
+ identificationType: HieIdentificationType;
119
+ locationUuid: string;
120
+ }
121
+
122
+ export interface HieAmrsObj {
123
+ key: string;
124
+ title: string;
125
+ hieValue: string | number | boolean;
126
+ amrsValue: string | number | boolean;
127
+ }
128
+
129
+ export interface ValidateHieCustomOtpDto {
130
+ sessionId: string;
131
+ otp: number | string;
132
+ locationUuid: string;
133
+ }
134
+
135
+ export type HieOtpValidationStatus = 'valid' | 'invalid';
136
+
137
+ export interface ValidateHieCustomOtpResponse {
138
+ data: {
139
+ identification_type: string;
140
+ identification_number: string;
141
+ status: HieOtpValidationStatus;
142
+ };
143
+ source?: string;
144
+ }
145
+
146
+ export interface ValidateHieCustomOtpErrorResponse {
147
+ error: string;
148
+ details: string;
149
+ }
150
+
151
+ export interface RequestCustomOtpDto {
152
+ identificationNumber: string | number;
153
+ identificationType: string;
154
+ locationUuid: string;
155
+ }
156
+
157
+ export interface RequestCustomOtpResponse {
158
+ message: string;
159
+ sessionId: string;
160
+ maskedPhone: string;
161
+ }
162
+ export interface RequestCustomOtpErrorResponse {
163
+ error: string;
164
+ details: string;
165
+ }
166
+
167
+ export interface HieClientDependant extends HieClient {
168
+ date_added: string;
169
+ relationship: string;
170
+ }
171
+
172
+ export interface HieFacility {
173
+ id: string;
174
+ facility_name: string;
175
+ registration_number: string;
176
+ facility_code: string;
177
+ regulator: string;
178
+ facility_level: string;
179
+ facility_category: string;
180
+ facility_owner: string;
181
+ facility_type: string;
182
+ county: string;
183
+ sub_county: string;
184
+ ward: string;
185
+ found: number;
186
+ approved: number;
187
+ operational_status: string;
188
+ current_license_expiry_date: string;
189
+ }
190
+
191
+ export interface HieFacilitySearchResponse {
192
+ message: HieFacility;
193
+ }
194
+
195
+ export interface FacilitySearchFilter {
196
+ filterType: string;
197
+ filterValue: string;
198
+ locationUuid: string;
199
+ }
200
+
201
+ export enum FacilitySearchFilterType {
202
+ location = 'location',
203
+ facilityCode = 'facilityCode',
204
+ registrationNumber = 'registrationNumber',
205
+ }
206
+
207
+ export interface PatientShrSummaryFilter {
208
+ cr_id: string;
209
+ locationUuid: string;
210
+ }
@@ -0,0 +1,6 @@
1
+ .patientVerification {
2
+ display: flex;
3
+ flex-direction: column;
4
+ row-gap: 10px;
5
+ padding-bottom: 10px;
6
+ }
@@ -25,6 +25,7 @@ import { type SavePatientForm, SavePatientTransactionManager } from './form-mana
25
25
  import { useInitialAddressFieldValues, useInitialFormValues, usePatientUuidMap } from './patient-registration-hooks';
26
26
  import BeforeSavePrompt from './before-save-prompt';
27
27
  import styles from './patient-registration.scss';
28
+ import customStyles from './custom-patient-registration.scss';
28
29
  import ClientRegistryLookupSection from './client-registry/client-registry-search.component';
29
30
 
30
31
  let exportedInitialFormValuesForTesting = {} as FormValues;
@@ -65,6 +66,7 @@ export const PatientRegistration: React.FC<PatientRegistrationProps> = ({ savePa
65
66
  const { data: photo } = usePatientPhoto(patientToEdit?.id);
66
67
  const savePatientTransactionManager = useRef(new SavePatientTransactionManager());
67
68
  const validationSchema = getValidationSchema(config, t);
69
+ const [showVerifyModal, setShowVerifyModal] = useState<boolean>(false);
68
70
 
69
71
  useEffect(() => {
70
72
  exportedInitialFormValuesForTesting = initialFormValues;
@@ -166,6 +168,13 @@ export const PatientRegistration: React.FC<PatientRegistrationProps> = ({ savePa
166
168
  }
167
169
  };
168
170
 
171
+ const openVerifyModal = () => {
172
+ setShowVerifyModal(true);
173
+ };
174
+ const closeVerifyModal = () => {
175
+ setShowVerifyModal(false);
176
+ };
177
+
169
178
  const createContextValue = useCallback(
170
179
  (formikProps) => ({
171
180
  identifierTypes,
@@ -244,20 +253,23 @@ export const PatientRegistration: React.FC<PatientRegistrationProps> = ({ savePa
244
253
  </div>
245
254
  <div className={styles.infoGrid}>
246
255
  <PatientRegistrationContextProvider value={createContextValue(props)}>
247
- <div>
248
- {!isClientVerified && !inEditMode && (
249
- <div className={styles.notificationSpacing} style={{ marginTop: '1rem' }}>
250
- <InlineNotification
251
- title="Verification required"
252
- subtitle="Please complete Client Registry OTP verification before proceeding with registration."
253
- kind="info"
254
- lowContrast
256
+ <div className={customStyles.patientVerification}>
257
+ <h4>Patient Verification</h4>
258
+ <Button onClick={openVerifyModal}>Verify CR</Button>
259
+ {showVerifyModal ? (
260
+ <>
261
+ <ClientRegistryLookupSection
262
+ onClientVerified={() => setIsClientVerified(true)}
263
+ onModalClose={closeVerifyModal}
264
+ open={showVerifyModal}
265
+ isNewClient={true}
255
266
  />
256
- </div>
267
+ </>
268
+ ) : (
269
+ <></>
257
270
  )}
258
-
259
- <ClientRegistryLookupSection onClientVerified={() => setIsClientVerified(true)} />
260
-
271
+ </div>
272
+ <div>
261
273
  {sections.map((section, index) => (
262
274
  <SectionWrapper
263
275
  key={`registration-section-${section.id}`}
@@ -14,12 +14,25 @@ const ClientRegistryVerificationModal: React.FC<ClientRegistryVerificationPropsM
14
14
  props,
15
15
  }) => {
16
16
  const { t } = useTranslation();
17
+
18
+ const registerOnAfyaYangu = () => {
19
+ window.open('https://afyayangu.go.ke/', '_blank');
20
+ };
21
+
17
22
  return (
18
23
  <>
19
24
  <ModalHeader closeModal={close} title={t('hieClientVerificationTitle', 'HIE Client Verification')} />
20
25
  <ModalBody>
21
26
  <Component {...props} />
22
27
  </ModalBody>
28
+ <ModalFooter>
29
+ <Button kind="secondary" size="lg" onClick={close}>
30
+ {t('cancel', 'Cancel')}
31
+ </Button>
32
+ <Button kind="primary" size="lg" onClick={() => registerOnAfyaYangu()}>
33
+ {t('registerOnAfyaYangu', 'Register on Afya Yangu')}
34
+ </Button>
35
+ </ModalFooter>
23
36
  </>
24
37
  );
25
38
  };