From eca48318e4261c144ae57d624c77e3847ac2178a Mon Sep 17 00:00:00 2001 From: JOSHIK Date: Thu, 22 Aug 2024 08:56:16 +0100 Subject: [PATCH 1/2] made treating physician non manditory for domicilary care --- src/Components/Facility/ConsultationForm.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx index 8b946cf3cc6..cf23798cf5a 100644 --- a/src/Components/Facility/ConsultationForm.tsx +++ b/src/Components/Facility/ConsultationForm.tsx @@ -599,6 +599,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; @@ -1428,7 +1431,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 } From a5144b154a36d6d34059afd411a46d7cda7891a5 Mon Sep 17 00:00:00 2001 From: JOSHIK Date: Thu, 22 Aug 2024 08:59:57 +0100 Subject: [PATCH 2/2] minor fix --- src/Components/Facility/ConsultationForm.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx index cf23798cf5a..df69208bf2a 100644 --- a/src/Components/Facility/ConsultationForm.tsx +++ b/src/Components/Facility/ConsultationForm.tsx @@ -1431,9 +1431,7 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => { name={"treating_physician"} label={t("treating_doctor")} placeholder="Attending Doctors Name and Designation" - required={ - state.form.suggestion === "DC" ? false : true - } + required={state.form.suggestion !== "DC"} value={ state.form.treating_physician_object ?? undefined }