diff --git a/src/components/encounter/encounter-form.component.tsx b/src/components/encounter/encounter-form.component.tsx index 860b88974..da5af7a5d 100644 --- a/src/components/encounter/encounter-form.component.tsx +++ b/src/components/encounter/encounter-form.component.tsx @@ -561,6 +561,7 @@ export const EncounterForm: React.FC = ({ }; } + let formPatientIdentifiers = ''; const patientIdentifierFields = fields.filter((field) => field.type === 'patientIdentifier'); const patientIdentifierPromises = patientIdentifierFields.map((field) => { const identfier: PatientIdentifier = { @@ -572,8 +573,28 @@ export const EncounterForm: React.FC = ({ }); return Promise.all(patientIdentifierPromises) - .then(() => saveEncounterWithAttachments(encounterForSubmission)) + .then(() => { + for (let i = 0; i < patientIdentifierFields.length; i++) { + formPatientIdentifiers += patientIdentifierFields[i].value; + if (i < patientIdentifierFields.length - 1) { + formPatientIdentifiers += ', '; + } + } + if (patientIdentifierFields.length) { + showSnackbar({ + title: t('identifierCreated', 'Identifier Created'), + subtitle: t( + 'identifierCreatedDescription', + `Patient Identifier(s) ${formPatientIdentifiers} successfully created!`, + ), + kind: 'success', + isLowContrast: true, + }); + } + saveEncounterWithAttachments(encounterForSubmission); + }) .catch((error) => { + setIsSubmitting(false); showSnackbar({ title: t('errorDescriptionTitle', 'Error on saving form'), subtitle: t('errorDescription', error.message), diff --git a/src/utils/patient-identifier-helper.ts b/src/utils/patient-identifier-helper.ts index 8ff279482..ec7673f0c 100644 --- a/src/utils/patient-identifier-helper.ts +++ b/src/utils/patient-identifier-helper.ts @@ -1,5 +1,5 @@ -import { PatientIdentifier } from "../api/types"; import { savePatientIdentifier} from "../api/api"; +import { PatientIdentifier } from "../types"; export const saveIdentifier = (patient: fhir.Patient, patientIdentifier:PatientIdentifier) =>{ const identifier = getPatientLatestIdentifier(patient, patientIdentifier.identifierType);