diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx index 5cda9d5ab01..b30bb2a2c0a 100644 --- a/src/Components/Facility/ConsultationForm.tsx +++ b/src/Components/Facility/ConsultationForm.tsx @@ -608,6 +608,9 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => { } case "treating_physician": { + if (state.form.suggestion === "DC") { + break; + } if (state.form.suggestion !== "DD" && !state.form[field]) { errors[field] = t("field_required"); invalidForm = true; @@ -632,6 +635,7 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => { return; } }); + if (invalidForm) { dispatch({ type: "set_errors", errors }); const firstError = Object.keys(errors).find((key) => errors[key]); @@ -1444,7 +1448,9 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => { name={"treating_physician"} label={t("treating_doctor")} placeholder="Attending Doctors Name and Designation" - required + required={ + state.form.suggestion === "DC" ? false : true + } value={ state.form.treating_physician_object ?? undefined }