Skip to content

Commit

Permalink
Merge pull request #853 from sayed4900/fix/id-validation-notifications
Browse files Browse the repository at this point in the history
Fix/id validation notifications
  • Loading branch information
mozzy11 authored Mar 21, 2024
2 parents 01d3a0a + a032e28 commit 5e26cdb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/src/components/patient/CreatePatientForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ function CreatePatientForm(props) {
months: "",
days: "",
});
const [nationalId, setNationalId] = useState(props.selectedPatient.nationalId);
const handleNationalIdChange = (event) => {
const newValue = event.target.value;
setNationalId(newValue);
};
const handleDatePickerChange = (values, ...e) => {
var patient = values;
patient.birthDateForDisplay = e[1];
Expand Down Expand Up @@ -234,7 +239,7 @@ function CreatePatientForm(props) {

const accessionNumberValidationResponse = (res, numberType, numberValue) => {
let error;
if (res.status === false) {
if (res.status === false && props.selectedPatient.nationalId !==nationalId) {
setNotificationVisible(true);
addNotification({
kind: NotificationKinds.error,
Expand Down Expand Up @@ -427,6 +432,7 @@ function CreatePatientForm(props) {
values.nationalId,
);
}}
onChange={handleNationalIdChange}
/>
)}
</Field>
Expand Down

0 comments on commit 5e26cdb

Please sign in to comment.