@kenyaemr/esm-patient-registration-app 8.0.1-pre.103 → 8.0.1-pre.107
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 +2 -2
- package/dist/574.js +1 -1
- package/dist/830.js +1 -1
- package/dist/830.js.map +1 -1
- package/dist/kenyaemr-esm-patient-registration-app.js.buildmanifest.json +9 -9
- 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/hie-resource.ts +25 -9
- package/src/client-registry/hie-client-registry/modal/confirm-hie.modal.tsx +3 -3
- package/translations/en.json +1 -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}],"modals":[{"component":"hieConfirmationModal","name":"hie-confirmation-modal"}],"version":"8.0.1-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}],"modals":[{"component":"hieConfirmationModal","name":"hie-confirmation-modal"}],"version":"8.0.1-pre.107"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenyaemr/esm-patient-registration-app",
|
|
3
|
-
"version": "8.0.1-pre.
|
|
3
|
+
"version": "8.0.1-pre.107",
|
|
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",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { add, capitalize } from 'lodash-es';
|
|
2
2
|
import { type PatientIdentifierValue, type FormValues } from '../../patient-registration/patient-registration.types';
|
|
3
|
-
import {
|
|
3
|
+
import { type MapperConfig, type HIEPatient, type ErrorResponse } from './hie-types';
|
|
4
4
|
import { getConfig } from '@openmrs/esm-framework';
|
|
5
5
|
import { type RegistrationConfig } from '../../config-schema';
|
|
6
|
+
import { v4 } from 'uuid';
|
|
6
7
|
/**
|
|
7
8
|
* Represents a client for interacting with a Health Information Exchange (HIE) resource.
|
|
8
9
|
* @template T - The type of the resource being fetched.
|
|
@@ -59,13 +60,18 @@ class PatientMapper extends Mapper<HIEPatient, FormValues> {
|
|
|
59
60
|
address: extensionAddressEntries,
|
|
60
61
|
identifiers: updatedIdentifiers,
|
|
61
62
|
attributes: telecomAttributes,
|
|
63
|
+
relationships: [],
|
|
64
|
+
patientUuid: v4(),
|
|
62
65
|
} as FormValues;
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
private mapTelecomToAttributes(telecom: Array<fhir.ContactPoint>): Record<string, string> {
|
|
66
69
|
return telecom.reduce<Record<string, string>>((acc, { system, value }) => {
|
|
67
70
|
if (system && value && this.config.teleComMap[system]) {
|
|
68
|
-
|
|
71
|
+
const filteredValue = value.replace(/^254/, '0');
|
|
72
|
+
if (filteredValue) {
|
|
73
|
+
acc[this.config.teleComMap[system]] = filteredValue;
|
|
74
|
+
}
|
|
69
75
|
}
|
|
70
76
|
return acc;
|
|
71
77
|
}, {});
|
|
@@ -95,17 +101,27 @@ class PatientMapper extends Mapper<HIEPatient, FormValues> {
|
|
|
95
101
|
}
|
|
96
102
|
});
|
|
97
103
|
|
|
104
|
+
// Filter out undefined keys and values
|
|
105
|
+
Object.keys(updatedIdentifiers).forEach((key) => {
|
|
106
|
+
if (updatedIdentifiers[key] === undefined || updatedIdentifiers[key].identifierValue === undefined) {
|
|
107
|
+
delete updatedIdentifiers[key];
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
98
111
|
return updatedIdentifiers;
|
|
99
112
|
}
|
|
100
113
|
|
|
101
114
|
private mapExtensionsToAddress(extensions: HIEPatient['extension']): Record<string, string> {
|
|
102
|
-
return extensions
|
|
103
|
-
.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
115
|
+
return extensions.reduce<Record<string, string>>((acc, ext) => {
|
|
116
|
+
const identifierType = ext.url.split('/').pop();
|
|
117
|
+
const mappedKey = this.config.addressHierarchyMap[identifierType];
|
|
118
|
+
|
|
119
|
+
if (mappedKey && ext.valueString) {
|
|
120
|
+
acc[mappedKey] = capitalize(ext.valueString);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return acc;
|
|
124
|
+
}, {});
|
|
109
125
|
}
|
|
110
126
|
}
|
|
111
127
|
|
|
@@ -44,16 +44,16 @@ const HIEConfirmationModal: React.FC<HIEConfirmationModalProps> = ({ closeModal,
|
|
|
44
44
|
state={{ patientName: `${firstName} ${lastName}` }}
|
|
45
45
|
/>
|
|
46
46
|
<div style={{ width: '100%', marginLeft: '0.625rem' }}>
|
|
47
|
-
<PatientInfo label={t('healthID', 'HealthID')} value={patient
|
|
47
|
+
<PatientInfo label={t('healthID', 'HealthID')} value={patient?.id} />
|
|
48
48
|
<PatientInfo label={t('patientName', 'Patient name')} value={`${firstName} ${lastName}`} />
|
|
49
49
|
<PatientInfo label={t('age', 'Age')} value={age(patient?.birthDate)} />
|
|
50
50
|
<PatientInfo label={t('dateOfBirth', 'Date of birth')} value={formatDate(new Date(patient?.birthDate))} />
|
|
51
51
|
<PatientInfo label={t('gender', 'Gender')} value={capitalize(patient?.gender)} />
|
|
52
52
|
<PatientInfo
|
|
53
53
|
label={t('maritalStatus', 'Marital status')}
|
|
54
|
-
value={patient
|
|
54
|
+
value={patient?.maritalStatus?.coding?.map((m) => m.code).join('')}
|
|
55
55
|
/>
|
|
56
|
-
<PatientInfo label={t('
|
|
56
|
+
<PatientInfo label={t('dependents', 'Dependents')} value="--" />
|
|
57
57
|
</div>
|
|
58
58
|
</div>
|
|
59
59
|
<div>
|
package/translations/en.json
CHANGED
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"deleteIdentifierTooltip": "Delete",
|
|
34
34
|
"deleteRelationshipTooltipText": "Delete",
|
|
35
35
|
"demographicsSection": "Basic Info",
|
|
36
|
+
"dependents": "Dependents",
|
|
36
37
|
"discard": "Discard",
|
|
37
38
|
"discardModalBody": "The changes you made to this patient's details have not been saved. Discard changes?",
|
|
38
39
|
"discardModalHeader": "Confirm Discard Changes",
|
|
@@ -95,7 +96,6 @@
|
|
|
95
96
|
"relationshipPersonMustExist": "Related person must be an existing person",
|
|
96
97
|
"relationshipPlaceholder": "Relationship",
|
|
97
98
|
"relationshipRemovedText": "Relationship removed",
|
|
98
|
-
"relationships": "Relationships",
|
|
99
99
|
"relationshipsSection": "Relationships",
|
|
100
100
|
"relationshipToPatient": "Relationship to patient",
|
|
101
101
|
"relativeFullNameLabelText": "Related person",
|