@kenyaemr/esm-patient-registration-app 7.0.3-pre.76 → 7.0.3-pre.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +3 -3
- package/dist/453.js +1 -1
- package/dist/453.js.map +1 -1
- package/dist/kenyaemr-esm-patient-registration-app.js.buildmanifest.json +6 -6
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/patient-verification/patient-verification-utils.ts +33 -3
- package/src/patient-verification/patient-verification.component.tsx +6 -1
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.24.0"},"pages":[{"component":"root","route":"patient-registration","online":true,"offline":true},{"component":"editPatient","routeRegex":"patient\\/([a-zA-Z0-9\\-]+)\\/edit","online":true,"offline":true}],"extensions":[{"component":"addPatientLink","name":"add-patient-action","slot":"top-nav-actions-slot","online":true,"offline":true},{"component":"cancelPatientEditModal","name":"cancel-patient-edit-modal","online":true,"offline":true},{"component":"patientPhotoExtension","name":"patient-photo-widget","slot":"patient-photo-slot","online":true,"offline":true},{"component":"editPatientDetailsButton","name":"edit-patient-details-button","slot":"patient-actions-slot","online":true,"offline":true},{"component":"editPatientDetailsButton","name":"edit-patient-details-button","slot":"patient-search-actions-slot","online":true,"offline":true},{"component":"deleteIdentifierConfirmationModal","name":"delete-identifier-confirmation-modal","online":true,"offline":true},{"component":"emptyClientRegistryModal","name":"empty-client-registry-modal","online":true,"offline":true},{"component":"confirmClientRegistryModal","name":"confirm-client-registry-modal","online":true,"offline":true}],"version":"7.0.3-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.24.0"},"pages":[{"component":"root","route":"patient-registration","online":true,"offline":true},{"component":"editPatient","routeRegex":"patient\\/([a-zA-Z0-9\\-]+)\\/edit","online":true,"offline":true}],"extensions":[{"component":"addPatientLink","name":"add-patient-action","slot":"top-nav-actions-slot","online":true,"offline":true},{"component":"cancelPatientEditModal","name":"cancel-patient-edit-modal","online":true,"offline":true},{"component":"patientPhotoExtension","name":"patient-photo-widget","slot":"patient-photo-slot","online":true,"offline":true},{"component":"editPatientDetailsButton","name":"edit-patient-details-button","slot":"patient-actions-slot","online":true,"offline":true},{"component":"editPatientDetailsButton","name":"edit-patient-details-button","slot":"patient-search-actions-slot","online":true,"offline":true},{"component":"deleteIdentifierConfirmationModal","name":"delete-identifier-confirmation-modal","online":true,"offline":true},{"component":"emptyClientRegistryModal","name":"empty-client-registry-modal","online":true,"offline":true},{"component":"confirmClientRegistryModal","name":"confirm-client-registry-modal","online":true,"offline":true}],"version":"7.0.3-pre.85"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenyaemr/esm-patient-registration-app",
|
|
3
|
-
"version": "7.0.3-pre.
|
|
3
|
+
"version": "7.0.3-pre.85",
|
|
4
4
|
"description": "Patient registration microfrontend for the OpenMRS SPA",
|
|
5
5
|
"browser": "dist/kenyaemr-esm-patient-registration-app.js",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -4,16 +4,18 @@ import { type ClientRegistryPatient, type RegistryPatient } from './verification
|
|
|
4
4
|
import counties from './assets/counties.json';
|
|
5
5
|
import { type FormValues } from '../patient-registration/patient-registration.types';
|
|
6
6
|
import { capitalize } from 'lodash-es';
|
|
7
|
+
import { IdentifierInput } from '../patient-registration/input/custom-input/identifier/identifier-input.component';
|
|
7
8
|
|
|
8
9
|
export function handleClientRegistryResponse(
|
|
9
10
|
clientResponse: ClientRegistryPatient,
|
|
10
11
|
props: FormikProps<FormValues>,
|
|
11
12
|
searchTerm: string,
|
|
13
|
+
identifierType: string,
|
|
12
14
|
) {
|
|
13
15
|
if (clientResponse?.clientExists === false) {
|
|
14
|
-
const
|
|
15
|
-
['
|
|
16
|
-
initialValue:
|
|
16
|
+
const allNupiIdentifiers = {
|
|
17
|
+
['national-id']: {
|
|
18
|
+
initialValue: '',
|
|
17
19
|
identifierUuid: undefined,
|
|
18
20
|
selectedSource: { uuid: '', name: '' },
|
|
19
21
|
preferred: false,
|
|
@@ -22,7 +24,35 @@ export function handleClientRegistryResponse(
|
|
|
22
24
|
identifierName: 'National ID',
|
|
23
25
|
identifierValue: searchTerm,
|
|
24
26
|
},
|
|
27
|
+
|
|
28
|
+
['birth-certificate']: {
|
|
29
|
+
initialValue: '',
|
|
30
|
+
identifierUuid: undefined,
|
|
31
|
+
selectedSource: { uuid: '', name: '' },
|
|
32
|
+
preferred: false,
|
|
33
|
+
required: false,
|
|
34
|
+
identifierTypeUuid: '68449e5a-8829-44dd-bfef-c9c8cf2cb9b2',
|
|
35
|
+
identifierName: 'Birth Certificate Number',
|
|
36
|
+
identifierValue: searchTerm,
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
['passport']: {
|
|
40
|
+
initialValue: '',
|
|
41
|
+
identifierUuid: undefined,
|
|
42
|
+
selectedSource: { uuid: '', name: '' },
|
|
43
|
+
preferred: false,
|
|
44
|
+
required: false,
|
|
45
|
+
identifierTypeUuid: 'be9beef6-aacc-4e1f-ac4e-5babeaa1e303',
|
|
46
|
+
identifierName: 'Passport Number',
|
|
47
|
+
identifierValue: searchTerm,
|
|
48
|
+
},
|
|
25
49
|
};
|
|
50
|
+
|
|
51
|
+
// Select only the relevant identifier
|
|
52
|
+
const nupiIdentifiers = {
|
|
53
|
+
[identifierType]: allNupiIdentifiers[identifierType],
|
|
54
|
+
};
|
|
55
|
+
|
|
26
56
|
const dispose = showModal('empty-client-registry-modal', {
|
|
27
57
|
onConfirm: () => {
|
|
28
58
|
props.setValues({ ...props.values, identifiers: { ...props.values.identifiers, ...nupiIdentifiers } });
|
|
@@ -35,7 +35,12 @@ const PatientVerification: React.FC<PatientVerificationProps> = ({ props }) => {
|
|
|
35
35
|
);
|
|
36
36
|
setIsLoadingSearch(false);
|
|
37
37
|
|
|
38
|
-
handleClientRegistryResponse(
|
|
38
|
+
handleClientRegistryResponse(
|
|
39
|
+
clientRegistryResponse,
|
|
40
|
+
props,
|
|
41
|
+
verificationCriteria.searchTerm,
|
|
42
|
+
verificationCriteria.identifierType,
|
|
43
|
+
);
|
|
39
44
|
} catch (error) {
|
|
40
45
|
showSnackbar({
|
|
41
46
|
title: 'Client registry error',
|