@kenyaemr/esm-patient-registration-app 8.0.3-pre.138 → 8.0.3-pre.143
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 +17 -17
- package/dist/108.js +1 -1
- package/dist/250.js +1 -1
- package/dist/574.js +1 -1
- package/dist/610.js +1 -0
- package/dist/610.js.map +1 -0
- package/dist/662.js +1 -1
- package/dist/76.js +1 -1
- package/dist/94.js +2 -0
- package/dist/94.js.map +1 -0
- package/dist/kenyaemr-esm-patient-registration-app.js +1 -1
- package/dist/kenyaemr-esm-patient-registration-app.js.buildmanifest.json +62 -62
- package/dist/kenyaemr-esm-patient-registration-app.js.map +1 -1
- 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/client-registry/hie-client-registry/dependants/dependants.component.tsx +5 -7
- package/src/client-registry/hie-client-registry/hie-client-registry.component.tsx +6 -4
- package/src/client-registry/hie-client-registry/hie-resource.ts +101 -18
- package/src/client-registry/hie-client-registry/hie-types.ts +100 -0
- package/src/client-registry/hie-client-registry/modal/confirm-hie.modal.tsx +79 -73
- package/src/client-registry/hie-client-registry/modal/confirm-hie.scss +12 -0
- package/src/client-registry/hie-client-registry/modal/hie-otp-verification-form.component.tsx +88 -0
- package/src/client-registry/hie-client-registry/modal/hie-patient-detail-preview.component.tsx +77 -0
- package/src/config-schema.ts +1 -1
- package/translations/en.json +7 -0
- package/dist/652.js +0 -1
- package/dist/652.js.map +0 -1
- package/dist/895.js +0 -2
- package/dist/895.js.map +0 -1
- /package/dist/{895.js.LICENSE.txt → 94.js.LICENSE.txt} +0 -0
package/src/client-registry/hie-client-registry/modal/hie-patient-detail-preview.component.tsx
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Accordion, AccordionItem, CodeSnippet } from '@carbon/react';
|
|
2
|
+
import { age, ExtensionSlot, formatDate } from '@openmrs/esm-framework';
|
|
3
|
+
import capitalize from 'lodash-es/capitalize';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import DependentInfo from '../dependants/dependants.component';
|
|
7
|
+
import { getPatientName, maskData } from '../hie-resource';
|
|
8
|
+
import PatientInfo from '../patient-info/patient-info.component';
|
|
9
|
+
import styles from './confirm-hie.scss';
|
|
10
|
+
import { type HIEPatientResponse } from '../hie-types';
|
|
11
|
+
|
|
12
|
+
type HIEPatientDetailPreviewProps = {
|
|
13
|
+
patient: HIEPatientResponse;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const HIEPatientDetailPreview: React.FC<HIEPatientDetailPreviewProps> = ({ patient }) => {
|
|
17
|
+
const { familyName, givenName, middleName } = getPatientName(patient);
|
|
18
|
+
const { t } = useTranslation();
|
|
19
|
+
const getidentifier = (code: string) =>
|
|
20
|
+
patient?.entry[0]?.resource.identifier?.find(
|
|
21
|
+
(identifier) => identifier?.type?.coding?.some((coding) => coding?.code === code),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
<div className={styles.patientDetails}>
|
|
27
|
+
<ExtensionSlot
|
|
28
|
+
className={styles.patientPhotoContainer}
|
|
29
|
+
name="patient-photo-slot"
|
|
30
|
+
state={{ patientName: `${maskData(givenName)} . ${maskData(middleName)} . ${maskData(familyName)}` }}
|
|
31
|
+
/>
|
|
32
|
+
<div className={styles.patientInfoContainer}>
|
|
33
|
+
<PatientInfo label={t('healthID', 'HealthID')} value={getidentifier('SHA-number')?.value} />
|
|
34
|
+
<PatientInfo
|
|
35
|
+
label={t('patientName', 'Patient name')}
|
|
36
|
+
customValue={
|
|
37
|
+
<span className={styles.patientNameValue}>
|
|
38
|
+
<p>{maskData(givenName)}</p>
|
|
39
|
+
<span>•</span>
|
|
40
|
+
<p>{maskData(middleName)}</p>
|
|
41
|
+
<span>•</span>
|
|
42
|
+
<p>{maskData(familyName)}</p>
|
|
43
|
+
</span>
|
|
44
|
+
}
|
|
45
|
+
/>
|
|
46
|
+
|
|
47
|
+
<PatientInfo label={t('age', 'Age')} value={age(patient?.entry[0]?.resource.birthDate)} />
|
|
48
|
+
<PatientInfo
|
|
49
|
+
label={t('dateOfBirth', 'Date of birth')}
|
|
50
|
+
value={formatDate(new Date(patient?.entry[0]?.resource?.birthDate))}
|
|
51
|
+
/>
|
|
52
|
+
<PatientInfo label={t('gender', 'Gender')} value={capitalize(patient?.entry[0]?.resource.gender)} />
|
|
53
|
+
<PatientInfo
|
|
54
|
+
label={t('maritalStatus', 'Marital status')}
|
|
55
|
+
value={patient?.entry[0]?.resource.maritalStatus?.coding?.map((m) => m.code).join('')}
|
|
56
|
+
/>
|
|
57
|
+
|
|
58
|
+
{!patient?.entry[0]?.resource.contact && <PatientInfo label={t('dependents', 'Dependents')} value="--" />}
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<DependentInfo dependents={patient?.entry[0]?.resource.contact} />
|
|
63
|
+
|
|
64
|
+
<div>
|
|
65
|
+
<Accordion>
|
|
66
|
+
<AccordionItem title={t('viewFullResponse', 'View full response')}>
|
|
67
|
+
<CodeSnippet type="multi" feedback="Copied to clipboard">
|
|
68
|
+
{JSON.stringify(patient, null, 2)}
|
|
69
|
+
</CodeSnippet>
|
|
70
|
+
</AccordionItem>
|
|
71
|
+
</Accordion>
|
|
72
|
+
</div>
|
|
73
|
+
</>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export default HIEPatientDetailPreview;
|
package/src/config-schema.ts
CHANGED
|
@@ -416,7 +416,7 @@ export const esmPatientRegistrationSchema = {
|
|
|
416
416
|
},
|
|
417
417
|
},
|
|
418
418
|
_default: [
|
|
419
|
-
{ identifierType: 'National ID', identifierValue: '
|
|
419
|
+
{ identifierType: 'National ID', identifierValue: 'National ID' },
|
|
420
420
|
{ identifierType: 'Passport Number', identifierValue: 'passport-number' },
|
|
421
421
|
{ identifierType: 'Birth Certificate Number', identifierValue: 'birth-certificate-number' },
|
|
422
422
|
{ identifierType: 'Alien ID Number', identifierValue: 'alien-id-number' },
|
package/translations/en.json
CHANGED
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"givenNameRequired": "Given name is required",
|
|
75
75
|
"healthID": "HealthID",
|
|
76
76
|
"hieModal": "HIE Patient Record Found",
|
|
77
|
+
"hiePatientVerification": "HIE Patient Verification",
|
|
77
78
|
"identifierSearch": "Identifier search",
|
|
78
79
|
"identifierType": "Identifier type",
|
|
79
80
|
"identifierValueRequired": "Identifier value is required",
|
|
@@ -101,12 +102,15 @@
|
|
|
101
102
|
"optional": "optional",
|
|
102
103
|
"optionalIdentifierLabel": "{{identifierName}} (optional)",
|
|
103
104
|
"other": "Other",
|
|
105
|
+
"otpCode": "OTP Authorization code",
|
|
104
106
|
"patientDetailsFound": "Patient information found in the registry, do you want to use the information to continue with registration?",
|
|
105
107
|
"patientName": "Patient name",
|
|
106
108
|
"patientNameKnown": "Patient's Name is Known?",
|
|
107
109
|
"patientNotFound": "The patient records could not be found in Client registry, do you want to continue to create and post patient to registry",
|
|
110
|
+
"patientPhoneNUmber": "Patient Phone number",
|
|
108
111
|
"patientRegistrationBreadcrumb": "Patient Registration",
|
|
109
112
|
"patientVerificationFromHIE": "Patient verification from HIE",
|
|
113
|
+
"phoneNumberHelper": "Patient will receive OTP on this number",
|
|
110
114
|
"postToRegistry": "Post to registry",
|
|
111
115
|
"refreshOrContactAdmin": "Try refreshing the page or contact your system administrator",
|
|
112
116
|
"registerPatient": "Register patient",
|
|
@@ -124,6 +128,7 @@
|
|
|
124
128
|
"removeIdentifierButton": "Remove identifier",
|
|
125
129
|
"resetIdentifierTooltip": "Reset",
|
|
126
130
|
"restoreRelationshipActionButton": "Undo",
|
|
131
|
+
"retry": "Retry",
|
|
127
132
|
"searchAddress": "Search address",
|
|
128
133
|
"searchClientRegistry": "Search client registry",
|
|
129
134
|
"searchIdentifierPlaceholder": "Search identifier",
|
|
@@ -149,6 +154,8 @@
|
|
|
149
154
|
"updatePatientSuccessSnackbarTitle": "Patient Details Updated",
|
|
150
155
|
"useValues": "Use values",
|
|
151
156
|
"validate": "Validate",
|
|
157
|
+
"verifyAndUseValues": "Verify & Use values",
|
|
158
|
+
"verifyOTP": "Verify with OTP",
|
|
152
159
|
"viewFullResponse": "View full response",
|
|
153
160
|
"yearsEstimateRequired": "Estimated years required",
|
|
154
161
|
"yes": "Yes"
|