@kenyaemr/esm-patient-registration-app 6.0.1-pre.1.0.5 → 6.0.1-pre.1.0.6
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/130.js +1 -1
- package/dist/574.js +1 -1
- package/dist/59.js +1 -1
- package/dist/59.js.map +1 -1
- package/dist/816.js +1 -1
- package/dist/816.js.map +1 -1
- package/dist/kenyaemr-esm-patient-registration-app.js +1 -1
- package/dist/kenyaemr-esm-patient-registration-app.js.buildmanifest.json +251 -245
- 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-registration/patient-registration.component.tsx +21 -0
- package/src/patient-registration/patient-registration.types.ts +1 -1
- package/src/patient-verification/patient-verification-utils.ts +4 -4
- package/src/patient-verification/patient-verification.component.tsx +9 -14
- package/src/patient-verification/verification-modal/confirm-prompt.component.tsx +1 -1
- package/translations/en.json +2 -2
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":"6.0.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":"6.0.1-local.0"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenyaemr/esm-patient-registration-app",
|
|
3
|
-
"version": "6.0.1-pre.1.0.
|
|
3
|
+
"version": "6.0.1-pre.1.0.6",
|
|
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",
|
|
@@ -121,6 +121,26 @@ export const PatientRegistration: React.FC<PatientRegistrationProps> = ({ savePa
|
|
|
121
121
|
|
|
122
122
|
setTarget(redirectUrl);
|
|
123
123
|
} catch (error) {
|
|
124
|
+
const fieldErrors = Object.entries(error.responseBody?.error?.fieldErrors || {}) as Array<
|
|
125
|
+
[string, Array<{ code: string; message: string }>]
|
|
126
|
+
>;
|
|
127
|
+
|
|
128
|
+
if (savePatientTransactionManager.current.patientSaved) {
|
|
129
|
+
fieldErrors.forEach(([field, error]) => {
|
|
130
|
+
const errorMessage = error.map((e) => e.message).join(', ');
|
|
131
|
+
showSnackbar({
|
|
132
|
+
subtitle: errorMessage,
|
|
133
|
+
title: `Patient registration successful, with errors for registration encounter`,
|
|
134
|
+
kind: 'warning',
|
|
135
|
+
timeoutInMs: 8000,
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
const afterUrl = new URLSearchParams(search).get('afterUrl');
|
|
139
|
+
const redirectUrl = interpolateUrl(afterUrl || config.links.submitButton, { patientUuid: values.patientUuid });
|
|
140
|
+
|
|
141
|
+
setTarget(redirectUrl);
|
|
142
|
+
}
|
|
143
|
+
|
|
124
144
|
if (error.responseBody?.error?.globalErrors) {
|
|
125
145
|
error.responseBody.error.globalErrors.forEach((error) => {
|
|
126
146
|
showSnackbar({
|
|
@@ -141,6 +161,7 @@ export const PatientRegistration: React.FC<PatientRegistrationProps> = ({ savePa
|
|
|
141
161
|
});
|
|
142
162
|
} else {
|
|
143
163
|
createErrorHandler()(error);
|
|
164
|
+
console.error(error);
|
|
144
165
|
}
|
|
145
166
|
|
|
146
167
|
helpers.setSubmitting(false);
|
|
@@ -62,7 +62,7 @@ export function handleClientRegistryResponse(
|
|
|
62
62
|
required: false,
|
|
63
63
|
identifierTypeUuid: '49af6cdc-7968-4abb-bf46-de10d7f4859f',
|
|
64
64
|
identifierName: 'National ID',
|
|
65
|
-
identifierValue: identifications !== undefined && identifications[0]?.identificationNumber
|
|
65
|
+
identifierValue: identifications !== undefined && identifications[0]?.identificationNumber,
|
|
66
66
|
},
|
|
67
67
|
|
|
68
68
|
['nationalUniquePatientIdentifier']: {
|
|
@@ -81,9 +81,9 @@ export function handleClientRegistryResponse(
|
|
|
81
81
|
onConfirm: () => {
|
|
82
82
|
props.setValues({
|
|
83
83
|
...props.values,
|
|
84
|
-
familyName: lastName
|
|
85
|
-
middleName: middleName
|
|
86
|
-
givenName: firstName
|
|
84
|
+
familyName: lastName,
|
|
85
|
+
middleName: middleName,
|
|
86
|
+
givenName: firstName,
|
|
87
87
|
gender: clientResponse.client.gender,
|
|
88
88
|
birthdate: new Date(dateOfBirth),
|
|
89
89
|
isDead: !isAlive,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { Tile, ComboBox, Layer, Button, Search, InlineLoading
|
|
3
|
+
import { Tile, ComboBox, Layer, Button, Search, InlineLoading } from '@carbon/react';
|
|
4
4
|
import styles from './patient-verification.scss';
|
|
5
5
|
import { countries, verificationIdentifierTypes } from './assets/verification-assets';
|
|
6
6
|
import { searchClientRegistry, useGlobalProperties } from './patient-verification-hook';
|
|
7
|
-
import { showSnackbar } from '@openmrs/esm-framework';
|
|
7
|
+
import { showSnackbar, showToast } from '@openmrs/esm-framework';
|
|
8
8
|
import { handleClientRegistryResponse } from './patient-verification-utils';
|
|
9
9
|
import { type FormikProps } from 'formik';
|
|
10
10
|
import { type FormValues } from '../patient-registration/patient-registration.types';
|
|
@@ -48,6 +48,13 @@ const PatientVerification: React.FC<PatientVerificationProps> = ({ props }) => {
|
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
+
if (error) {
|
|
52
|
+
return (
|
|
53
|
+
<Tile className={styles.errorWrapper}>
|
|
54
|
+
<p>Error occurred while reaching the client registry, please proceed with registration and try again later</p>
|
|
55
|
+
</Tile>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
51
58
|
return (
|
|
52
59
|
<div id={'patientVerification'}>
|
|
53
60
|
<h3 className={styles.productiveHeading02} style={{ color: '#161616' }}>
|
|
@@ -103,18 +110,6 @@ const PatientVerification: React.FC<PatientVerificationProps> = ({ props }) => {
|
|
|
103
110
|
)}
|
|
104
111
|
</Tile>
|
|
105
112
|
</div>
|
|
106
|
-
{error && (
|
|
107
|
-
<Tile className={styles.errorWrapper}>
|
|
108
|
-
<InlineNotification
|
|
109
|
-
aria-label="closes notification"
|
|
110
|
-
kind="error"
|
|
111
|
-
statusIconDescription="notification"
|
|
112
|
-
subtitle="Access to national client registry may be blocked by a proxy server. Please proceed with registration and try again later. Contact your system administrator if the issue persists."
|
|
113
|
-
title="Error: Failed to reach client registry."
|
|
114
|
-
lowContrast={true}
|
|
115
|
-
/>
|
|
116
|
-
</Tile>
|
|
117
|
-
)}
|
|
118
113
|
</div>
|
|
119
114
|
);
|
|
120
115
|
};
|
|
@@ -39,7 +39,7 @@ const ConfirmPrompt: React.FC<ConfirmPromptProps> = ({ close, onConfirm, patient
|
|
|
39
39
|
<div style={{ display: 'flex', margin: '1rem' }}>
|
|
40
40
|
<ExtensionSlot
|
|
41
41
|
style={{ display: 'flex', alignItems: 'center' }}
|
|
42
|
-
|
|
42
|
+
name="patient-photo-slot"
|
|
43
43
|
state={{ patientName: `${patient?.firstName} ${patient?.lastName}` }}
|
|
44
44
|
/>
|
|
45
45
|
<div style={{ width: '100%', marginLeft: '0.625rem' }}>
|
package/translations/en.json
CHANGED
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"negativeYears": "Negative years",
|
|
66
66
|
"no": "No",
|
|
67
67
|
"numberInNameDubious": "Number in name is dubious",
|
|
68
|
-
"
|
|
68
|
+
"NUPI": "",
|
|
69
69
|
"obsFieldUnknownDatatype": "Concept for obs field '{{fieldDefinitionId}}' has unknown datatype '{{datatypeName}}'",
|
|
70
70
|
"optional": "optional",
|
|
71
71
|
"other": "Other",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"selectCountry": "Select country",
|
|
98
98
|
"selectIdentifierType": "Select identifier type",
|
|
99
99
|
"sexFieldLabelText": "Sex",
|
|
100
|
-
"
|
|
100
|
+
"SHA Number": "",
|
|
101
101
|
"source": "Source",
|
|
102
102
|
"stroke": "Stroke",
|
|
103
103
|
"submitting": "Submitting",
|