@kenyaemr/esm-patient-clinical-view-app 5.4.2-pre.2188 → 5.4.2-pre.2191
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 +88 -81
- package/dist/40.js +1 -0
- package/dist/40.js.map +1 -0
- package/dist/574.js +1 -1
- package/dist/685.js +2 -0
- package/dist/685.js.map +1 -0
- package/dist/{156.js → 700.js} +2 -2
- package/dist/{156.js.map → 700.js.map} +1 -1
- package/dist/kenyaemr-esm-patient-clinical-view-app.js +1 -1
- package/dist/kenyaemr-esm-patient-clinical-view-app.js.buildmanifest.json +67 -67
- package/dist/kenyaemr-esm-patient-clinical-view-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/contact-list/contact-list.component.tsx +12 -6
- package/src/contact-list/contact-list.resource.tsx +88 -2
- package/src/contact-list/forms/contact-list-update.scss +79 -0
- package/src/contact-list/forms/contact-list-update.workspace.tsx +554 -0
- package/src/family-partner-history/family-history.component.tsx +17 -20
- package/src/index.ts +2 -2
- package/src/relationships/forms/baseline-info-form-section.component.tsx +61 -34
- package/src/routes.json +3 -3
- package/src/types/index.ts +7 -0
- package/translations/en.json +1 -0
- package/dist/66.js +0 -2
- package/dist/66.js.map +0 -1
- package/dist/825.js +0 -1
- package/dist/825.js.map +0 -1
- package/src/relationships/forms/relationships-update-form.workspace.tsx +0 -183
- /package/dist/{66.js.LICENSE.txt → 685.js.LICENSE.txt} +0 -0
- /package/dist/{156.js.LICENSE.txt → 700.js.LICENSE.txt} +0 -0
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"kenyaemr":"^19.0.0"},"pages":[],"extensions":[{"name":"clinical-view-section","component":"clinicalViewPatientDashboard","slot":"patient-chart-dashboard-slot"},{"name":"family-history","slot":"patient-chart-family-history-slot","component":"familyHistory","order":0,"online":true,"offline":false},{"name":"relationships-link","component":"relationshipsLink","slot":"patient-chart-dashboard-slot","order":14,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-relationships-slot","path":"relationships","layoutMode":"anchored"}},{"name":"relationships","slot":"patient-chart-relationships-slot","component":"relationships","order":0,"online":true,"offline":false},{"name":"contact-list-form","component":"contactListForm"},{"name":"maternal-and-child-health-dashboard-group-link","slot":"clinical-view-section","component":"maternalAndChildHealthSideNavGroup"},{"name":"antenatal-care-dashboard-link","component":"antenatalCareLink","slot":"maternal-and-child-health-slot","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-antenatal-care-dashboard-slot","path":"antenatal-care-dashboard","layoutMode":"anchored"}},{"name":"antenatal-care-dashboard","slot":"patient-chart-antenatal-care-dashboard-slot","component":"antenatalCare"},{"name":"postnatal-care-dashboard-link","component":"postnatalCareLink","slot":"maternal-and-child-health-slot","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-postnatal-care-dashboard-slot","path":"postnatal-care-dashboard","layoutMode":"anchored"}},{"name":"postnatal-care-dashboard","slot":"patient-chart-postnatal-care-dashboard-slot","component":"postnatalCare"},{"name":"labour-and-delivery-dashboard-link","component":"labourAndDeliveryLink","slot":"maternal-and-child-health-slot","meta":{"fullWidth":true,"slot":"patient-chart-labour-and-delivery-dashboard-slot","path":"labour-and-delivery-dashboard","layoutMode":"anchored"}},{"name":"labour-and-delivery-dashboard","slot":"patient-chart-labour-and-delivery-dashboard-slot","component":"labourAndDelivery","meta":{"fullWidth":true}},{"name":"hiv-care-and-treatment-dashboard-group-link","slot":"special-clinics-slot","component":"hivCareAndTreatMentSideNavGroup"},{"name":"genericNavLinks","slot":"special-clinics-slot","component":"genericNavLinks","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-special-clinic-dashboard-slot","path":"special-clinics-dashboard","layoutMode":"anchored"}},{"name":"patient-chart-special-clinic-dashboard-slot","slot":"patient-chart-special-clinic-dashboard-slot","component":"genericDashboard"},{"name":"hts-dashboard-link","component":"htsDashboardLink","slot":"hiv-care-and-treatment-slot","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-hts-dashboard-slot","path":"hts-dashboard","layoutMode":"anchored"}},{"name":"hts-clinical-view","slot":"patient-chart-hts-dashboard-slot","component":"htsClinicalView","order":2,"online":true,"offline":false},{"name":"defaulter-tracing-dashboard-link","component":"defaulterTracingLink","slot":"hiv-care-and-treatment-slot","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-defaulter-tracing-dashboard-slot","path":"defaulter-tracing-dashboard","layoutMode":"anchored"}},{"name":"defaulter-tracing-dashboard","slot":"patient-chart-defaulter-tracing-dashboard-slot","component":"defaulterTracing","order":3,"online":true,"offline":false},{"name":"special-clinics-dashboard-group-link","slot":"clinical-view-section","component":"specialClinicsSideNavGroup"},{"name":"clinical-encounter-link","component":"inPatientClinicalEncounterLink","slot":"clinical-view-section","order":40,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-clinical-encounter-slot","path":"clinical-encounter","layoutMode":"anchored"}},{"name":"clinical-encounter","slot":"patient-chart-clinical-encounter-slot","component":"inPatientClinicalEncounter","order":0,"online":true,"offline":false},{"component":"caseManagementDashboardLink","name":"case-management-dashboard-link","meta":{"name":"case-management","title":"Case Management","slot":"case-management-dashboard-slot","path":"/case-management"}},{"name":"in-patient-dashboard-link","component":"inPatientChartLink","slot":"patient-chart-dashboard-slot","order":7,"meta":{"slot":"patient-chart-in-patient-dashboard-slot","path":"in-patient","layoutMode":"anchored","columns":1,"columnSpan":1}},{"name":"in-patient-dashboard","slot":"patient-chart-in-patient-dashboard-slot","component":"inPatientChartDashboard","meta":{"fullWidth":false}},{"name":"wrap-component-view","slot":"case-management-dashboard-slot","component":"wrapComponent","order":2,"online":true,"offline":false},{"name":"case-encounter-link","component":"caseEncounterDashboardLink","slot":"patient-chart-dashboard-slot","order":14,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-case-encounter-slot","path":"case-management-encounters","layoutMode":"anchored"}},{"name":"case-encounter-table","slot":"patient-chart-case-encounter-slot","component":"caseEncounterTable","order":0,"online":true,"offline":false},{"component":"peerCalendarDashboardLink","name":"peer-calendar-dashboard-link","meta":{"name":"peer-calendar","title":"Peer Calendar","slot":"peer-calendar-dashboard-slot","path":"peer-management"}},{"name":"peer-calendar","slot":"peer-calendar-dashboard-slot","component":"peerCalendar","order":0,"online":true,"offline":false},{"name":"deceased-panel-dashboard-link","component":"deceasedPanelDashboardLink","slot":"patient-chart-dashboard-slot","order":15,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-deceased-panel-slot","path":"deceased-panel","layoutMode":"anchored"}},{"name":"deceased-details-tabs","slot":"patient-chart-deceased-panel-slot","component":"deceasedDetailsTabs","order":0,"online":true,"offline":false},{"name":"parto-graph-chart","slot":"patient-chart-labour-and-delivery-dashboard-slot","component":"partograph","meta":{"fullWidth":true}}],"modals":[{"name":"birth-date-calculator","component":"birthDateCalculator"},{"name":"relationship-delete-confirm-dialog","component":"relationshipDeleteConfirmialog"},{"name":"end-relationship-dialog","component":"endRelationshipModal"}],"workspaces":[{"name":"case-management-form","component":"caseManagementForm","title":"Case Management Form","type":"form"},{"name":"family-relationship-form","component":"familyRelationshipForm","title":"Family Relationship Form","type":"form"},{"name":"peers-form","component":"peersForm","title":"Add New Peer","type":"form"},{"name":"kenyaemr-cusom-form-entry-workspace","component":"peerCalendarFormEntry","title":"KVP Peer Educator Outreach Calendar","type":"form","width":"extra-wide","canMaximize":true,"canHide":true},{"name":"
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"kenyaemr":"^19.0.0"},"pages":[],"extensions":[{"name":"clinical-view-section","component":"clinicalViewPatientDashboard","slot":"patient-chart-dashboard-slot"},{"name":"family-history","slot":"patient-chart-family-history-slot","component":"familyHistory","order":0,"online":true,"offline":false},{"name":"relationships-link","component":"relationshipsLink","slot":"patient-chart-dashboard-slot","order":14,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-relationships-slot","path":"relationships","layoutMode":"anchored"}},{"name":"relationships","slot":"patient-chart-relationships-slot","component":"relationships","order":0,"online":true,"offline":false},{"name":"contact-list-form","component":"contactListForm"},{"name":"maternal-and-child-health-dashboard-group-link","slot":"clinical-view-section","component":"maternalAndChildHealthSideNavGroup"},{"name":"antenatal-care-dashboard-link","component":"antenatalCareLink","slot":"maternal-and-child-health-slot","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-antenatal-care-dashboard-slot","path":"antenatal-care-dashboard","layoutMode":"anchored"}},{"name":"antenatal-care-dashboard","slot":"patient-chart-antenatal-care-dashboard-slot","component":"antenatalCare"},{"name":"postnatal-care-dashboard-link","component":"postnatalCareLink","slot":"maternal-and-child-health-slot","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-postnatal-care-dashboard-slot","path":"postnatal-care-dashboard","layoutMode":"anchored"}},{"name":"postnatal-care-dashboard","slot":"patient-chart-postnatal-care-dashboard-slot","component":"postnatalCare"},{"name":"labour-and-delivery-dashboard-link","component":"labourAndDeliveryLink","slot":"maternal-and-child-health-slot","meta":{"fullWidth":true,"slot":"patient-chart-labour-and-delivery-dashboard-slot","path":"labour-and-delivery-dashboard","layoutMode":"anchored"}},{"name":"labour-and-delivery-dashboard","slot":"patient-chart-labour-and-delivery-dashboard-slot","component":"labourAndDelivery","meta":{"fullWidth":true}},{"name":"hiv-care-and-treatment-dashboard-group-link","slot":"special-clinics-slot","component":"hivCareAndTreatMentSideNavGroup"},{"name":"genericNavLinks","slot":"special-clinics-slot","component":"genericNavLinks","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-special-clinic-dashboard-slot","path":"special-clinics-dashboard","layoutMode":"anchored"}},{"name":"patient-chart-special-clinic-dashboard-slot","slot":"patient-chart-special-clinic-dashboard-slot","component":"genericDashboard"},{"name":"hts-dashboard-link","component":"htsDashboardLink","slot":"hiv-care-and-treatment-slot","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-hts-dashboard-slot","path":"hts-dashboard","layoutMode":"anchored"}},{"name":"hts-clinical-view","slot":"patient-chart-hts-dashboard-slot","component":"htsClinicalView","order":2,"online":true,"offline":false},{"name":"defaulter-tracing-dashboard-link","component":"defaulterTracingLink","slot":"hiv-care-and-treatment-slot","meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-defaulter-tracing-dashboard-slot","path":"defaulter-tracing-dashboard","layoutMode":"anchored"}},{"name":"defaulter-tracing-dashboard","slot":"patient-chart-defaulter-tracing-dashboard-slot","component":"defaulterTracing","order":3,"online":true,"offline":false},{"name":"special-clinics-dashboard-group-link","slot":"clinical-view-section","component":"specialClinicsSideNavGroup"},{"name":"clinical-encounter-link","component":"inPatientClinicalEncounterLink","slot":"clinical-view-section","order":40,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-clinical-encounter-slot","path":"clinical-encounter","layoutMode":"anchored"}},{"name":"clinical-encounter","slot":"patient-chart-clinical-encounter-slot","component":"inPatientClinicalEncounter","order":0,"online":true,"offline":false},{"component":"caseManagementDashboardLink","name":"case-management-dashboard-link","meta":{"name":"case-management","title":"Case Management","slot":"case-management-dashboard-slot","path":"/case-management"}},{"name":"in-patient-dashboard-link","component":"inPatientChartLink","slot":"patient-chart-dashboard-slot","order":7,"meta":{"slot":"patient-chart-in-patient-dashboard-slot","path":"in-patient","layoutMode":"anchored","columns":1,"columnSpan":1}},{"name":"in-patient-dashboard","slot":"patient-chart-in-patient-dashboard-slot","component":"inPatientChartDashboard","meta":{"fullWidth":false}},{"name":"wrap-component-view","slot":"case-management-dashboard-slot","component":"wrapComponent","order":2,"online":true,"offline":false},{"name":"case-encounter-link","component":"caseEncounterDashboardLink","slot":"patient-chart-dashboard-slot","order":14,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-case-encounter-slot","path":"case-management-encounters","layoutMode":"anchored"}},{"name":"case-encounter-table","slot":"patient-chart-case-encounter-slot","component":"caseEncounterTable","order":0,"online":true,"offline":false},{"component":"peerCalendarDashboardLink","name":"peer-calendar-dashboard-link","meta":{"name":"peer-calendar","title":"Peer Calendar","slot":"peer-calendar-dashboard-slot","path":"peer-management"}},{"name":"peer-calendar","slot":"peer-calendar-dashboard-slot","component":"peerCalendar","order":0,"online":true,"offline":false},{"name":"deceased-panel-dashboard-link","component":"deceasedPanelDashboardLink","slot":"patient-chart-dashboard-slot","order":15,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-deceased-panel-slot","path":"deceased-panel","layoutMode":"anchored"}},{"name":"deceased-details-tabs","slot":"patient-chart-deceased-panel-slot","component":"deceasedDetailsTabs","order":0,"online":true,"offline":false},{"name":"parto-graph-chart","slot":"patient-chart-labour-and-delivery-dashboard-slot","component":"partograph","meta":{"fullWidth":true}}],"modals":[{"name":"birth-date-calculator","component":"birthDateCalculator"},{"name":"relationship-delete-confirm-dialog","component":"relationshipDeleteConfirmialog"},{"name":"end-relationship-dialog","component":"endRelationshipModal"}],"workspaces":[{"name":"case-management-form","component":"caseManagementForm","title":"Case Management Form","type":"form"},{"name":"family-relationship-form","component":"familyRelationshipForm","title":"Family Relationship Form","type":"form"},{"name":"peers-form","component":"peersForm","title":"Add New Peer","type":"form"},{"name":"kenyaemr-cusom-form-entry-workspace","component":"peerCalendarFormEntry","title":"KVP Peer Educator Outreach Calendar","type":"form","width":"extra-wide","canMaximize":true,"canHide":true},{"name":"contact-list-update-form","component":"contactListUpdateForm","title":"Contact List Update Form","type":"form"},{"name":"other-relationship-form","component":"otherRelationshipsForm","title":"Other Relationships Form","type":"form"},{"name":"end-relationship-form","component":"endRelationshipWorkspace","title":"Discontinue relationship form","type":"form"}],"version":"5.4.2-pre.2191"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenyaemr/esm-patient-clinical-view-app",
|
|
3
|
-
"version": "5.4.2-pre.
|
|
3
|
+
"version": "5.4.2-pre.2191",
|
|
4
4
|
"description": "Patient clinical view microfrontend for the OpenMRS SPA",
|
|
5
5
|
"browser": "dist/kenyaemr-esm-patient-clinical-view-app.js",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -38,6 +38,8 @@ import { deleteRelationship } from '../relationships/relationship.resources';
|
|
|
38
38
|
import styles from './contact-list.scss';
|
|
39
39
|
import ContactTracingHistory from './contact-tracing-history.component';
|
|
40
40
|
import HIVStatus from './hiv-status.component';
|
|
41
|
+
import { type Contact } from '../types';
|
|
42
|
+
import { extractNameString, uppercaseText } from '../utils/expression-helper';
|
|
41
43
|
|
|
42
44
|
interface ContactListProps {
|
|
43
45
|
patientUuid: string;
|
|
@@ -129,12 +131,13 @@ const ContactList: React.FC<ContactListProps> = ({ patientUuid }) => {
|
|
|
129
131
|
});
|
|
130
132
|
};
|
|
131
133
|
|
|
132
|
-
const
|
|
133
|
-
launchWorkspace('
|
|
134
|
-
|
|
134
|
+
const handleEditContactListUpdateForm = (relation: Contact) => {
|
|
135
|
+
launchWorkspace('contact-list-update-form', {
|
|
136
|
+
relation,
|
|
137
|
+
workspaceTitle: t('editContactList', 'Edit contact list'),
|
|
138
|
+
patientUuid,
|
|
135
139
|
});
|
|
136
140
|
};
|
|
137
|
-
|
|
138
141
|
const tableRows =
|
|
139
142
|
results?.map((relation) => {
|
|
140
143
|
const patientUuid = relation.patientUuid;
|
|
@@ -146,7 +149,7 @@ const ContactList: React.FC<ContactListProps> = ({ patientUuid }) => {
|
|
|
146
149
|
<ConfigurableLink
|
|
147
150
|
style={{ textDecoration: 'none' }}
|
|
148
151
|
to={window.getOpenmrsSpaBase() + `patient/${relation.relativeUuid}/chart/Patient Summary`}>
|
|
149
|
-
{relation.name}
|
|
152
|
+
{extractNameString(uppercaseText(relation.name))}
|
|
150
153
|
</ConfigurableLink>
|
|
151
154
|
),
|
|
152
155
|
contactCreated: relation.personContactCreated ?? 'No',
|
|
@@ -163,7 +166,10 @@ const ContactList: React.FC<ContactListProps> = ({ patientUuid }) => {
|
|
|
163
166
|
actions: (
|
|
164
167
|
<>
|
|
165
168
|
<OverflowMenu size={size} flipped>
|
|
166
|
-
<OverflowMenuItem
|
|
169
|
+
<OverflowMenuItem
|
|
170
|
+
itemText={t('edit', 'Edit')}
|
|
171
|
+
onClick={() => handleEditContactListUpdateForm(relation)}
|
|
172
|
+
/>
|
|
167
173
|
<OverflowMenuItem
|
|
168
174
|
itemText={t('traceContact', 'Trace Contact')}
|
|
169
175
|
onClick={() => handleLaunchContactTracingForm(patientUuid)}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Session } from '@openmrs/esm-framework';
|
|
1
|
+
import { FetchResponse, openmrsFetch, Patient, restBaseUrl, Session, showSnackbar } from '@openmrs/esm-framework';
|
|
2
2
|
import omit from 'lodash/omit';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { ConfigObject } from '../config-schema';
|
|
5
5
|
import { BOOLEAN_YES, relationshipFormSchema, saveRelationship } from '../relationships/relationship.resources';
|
|
6
|
-
import { Enrollment, HTSEncounter, Person } from '../types';
|
|
6
|
+
import { type ContactAttributeData, Enrollment, HTSEncounter, type Person } from '../types';
|
|
7
7
|
import { replaceAll } from '../utils/expression-helper';
|
|
8
|
+
import useSWR, { mutate } from 'swr';
|
|
8
9
|
|
|
9
10
|
export const ContactListFormSchema = relationshipFormSchema
|
|
10
11
|
.refine(
|
|
@@ -133,3 +134,88 @@ export const saveContact = async (
|
|
|
133
134
|
],
|
|
134
135
|
);
|
|
135
136
|
};
|
|
137
|
+
|
|
138
|
+
const usePerson = (uuid: string) => {
|
|
139
|
+
const customRepresentation = `custom:(uuid,display,gender,birthdate,dead,age,deathDate,causeOfDeath:(uuid,display),attributes:(uuid,display,value,attributeType:(uuid,display)))`;
|
|
140
|
+
const url = `${restBaseUrl}/person/${uuid}?v=${customRepresentation}`;
|
|
141
|
+
const { isLoading, error, data } = useSWR<FetchResponse<Patient['person']>>(url, openmrsFetch);
|
|
142
|
+
const person = data?.data;
|
|
143
|
+
return { isLoading, error, person };
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export default usePerson;
|
|
147
|
+
|
|
148
|
+
export const createPersonAttribute = (payload: any, personUuid: string) => {
|
|
149
|
+
const url = `${restBaseUrl}/person/${personUuid}/attribute`;
|
|
150
|
+
return openmrsFetch(url, {
|
|
151
|
+
method: 'POST',
|
|
152
|
+
body: JSON.stringify(payload),
|
|
153
|
+
headers: {
|
|
154
|
+
'Content-Type': 'application/json',
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export const updatePersonAttributes = (payload: any, personUuid: string, attributeUuid: string) => {
|
|
160
|
+
const url = `${restBaseUrl}/person/${personUuid}/attribute/${attributeUuid}`;
|
|
161
|
+
return openmrsFetch(url, {
|
|
162
|
+
method: 'POST',
|
|
163
|
+
body: JSON.stringify(payload),
|
|
164
|
+
headers: {
|
|
165
|
+
'Content-Type': 'application/json',
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export const updateContactAttributes = async (
|
|
171
|
+
personUuid: string,
|
|
172
|
+
attributeData: ContactAttributeData,
|
|
173
|
+
config: ConfigObject,
|
|
174
|
+
existingAttributes: Person['attributes'] = [],
|
|
175
|
+
) => {
|
|
176
|
+
try {
|
|
177
|
+
const updatableAttributes = [
|
|
178
|
+
{
|
|
179
|
+
attributeType: config?.contactPersonAttributesUuid?.baselineHIVStatus,
|
|
180
|
+
value: replaceAll(attributeData?.baselineStatus, 'A', ''),
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
attributeType: config?.contactPersonAttributesUuid?.preferedPnsAproach,
|
|
184
|
+
value: replaceAll(attributeData?.preferedPNSAproach, 'A', ''),
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
attributeType: config?.contactPersonAttributesUuid?.livingWithContact,
|
|
188
|
+
value: replaceAll(attributeData?.livingWithClient, 'A', ''),
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
attributeType: config?.contactPersonAttributesUuid?.contactIPVOutcome,
|
|
192
|
+
value: attributeData?.ipvOutCome,
|
|
193
|
+
},
|
|
194
|
+
].filter((attr) => attr?.value !== undefined && attr?.value !== null && attr?.value !== '');
|
|
195
|
+
|
|
196
|
+
await Promise.allSettled(
|
|
197
|
+
updatableAttributes?.map((attr) => {
|
|
198
|
+
const existingAttribute = existingAttributes?.find((at) => at?.attributeType?.uuid === attr?.attributeType);
|
|
199
|
+
|
|
200
|
+
const payload = {
|
|
201
|
+
attributeType: attr?.attributeType,
|
|
202
|
+
value: attr?.value,
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
if (!existingAttribute?.uuid) {
|
|
206
|
+
return createPersonAttribute(payload, personUuid);
|
|
207
|
+
}
|
|
208
|
+
return updatePersonAttributes(payload, personUuid, existingAttribute.uuid);
|
|
209
|
+
}),
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
mutate((key) => typeof key === 'string' && key.startsWith(`${restBaseUrl}/person`));
|
|
213
|
+
} catch (error) {
|
|
214
|
+
showSnackbar({
|
|
215
|
+
title: 'Error',
|
|
216
|
+
kind: 'error',
|
|
217
|
+
subtitle: 'Failed to update person attributes: ' + error?.message,
|
|
218
|
+
});
|
|
219
|
+
throw error;
|
|
220
|
+
}
|
|
221
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
@use '@carbon/type';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/colors';
|
|
4
|
+
|
|
5
|
+
.loading {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
flex-grow: 1;
|
|
10
|
+
height: 100%;
|
|
11
|
+
align-items: center;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.error {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
align-items: center;
|
|
18
|
+
padding: layout.$spacing-08 layout.$spacing-05 0 layout.$spacing-05;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.heading {
|
|
22
|
+
@include type.type-style('heading-compact-01');
|
|
23
|
+
margin: layout.$spacing-05 0 layout.$spacing-05;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.datePickerInput span,
|
|
27
|
+
.datePickerInput div,
|
|
28
|
+
.datePickerInput input,
|
|
29
|
+
.datePickerInput {
|
|
30
|
+
width: 100% !important;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.grid {
|
|
34
|
+
margin: layout.$spacing-05 layout.$spacing-05;
|
|
35
|
+
padding: layout.$spacing-05 0rem 0rem 0rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.buttonSet {
|
|
39
|
+
width: 100%;
|
|
40
|
+
padding-top: layout.$spacing-05;
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
bottom: 0;
|
|
43
|
+
position: absolute;
|
|
44
|
+
& > button {
|
|
45
|
+
max-width: 50% !important;
|
|
46
|
+
width: 50%;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
.preferredPnsApproach {
|
|
50
|
+
margin-bottom: layout.$spacing-13;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.formTitle {
|
|
54
|
+
@include type.type-style('heading-02');
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
margin: layout.$spacing-05;
|
|
59
|
+
row-gap: layout.$spacing-06;
|
|
60
|
+
position: relative;
|
|
61
|
+
|
|
62
|
+
&::after {
|
|
63
|
+
content: '';
|
|
64
|
+
display: block;
|
|
65
|
+
width: layout.$spacing-07;
|
|
66
|
+
border-bottom: 0.375rem solid var(--brand-03);
|
|
67
|
+
position: absolute;
|
|
68
|
+
bottom: -0.75rem;
|
|
69
|
+
left: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
& > span {
|
|
73
|
+
@include type.type-style('body-01');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.sectionHeader {
|
|
78
|
+
@include type.type-style('heading-02');
|
|
79
|
+
}
|