Skip to content

Commit

Permalink
Merge pull request #1 from JOSHIK27/fixes#8304
Browse files Browse the repository at this point in the history
Fixes#8304
  • Loading branch information
JOSHIK27 authored Aug 19, 2024
2 parents 9a5e833 + 30bf7a2 commit b989470
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Components/Facility/ConsultationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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]);
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit b989470

Please sign in to comment.