From 89137e88bcccac238275fa1db0b4b33e46b1328f Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Fri, 8 Sep 2023 20:04:28 +0530 Subject: [PATCH 1/2] fix verified by validation --- src/Components/Facility/ConsultationForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx index 97f35f292f8..d8353a3562f 100644 --- a/src/Components/Facility/ConsultationForm.tsx +++ b/src/Components/Facility/ConsultationForm.tsx @@ -538,7 +538,7 @@ export const ConsultationForm = (props: any) => { } case "verified_by": { - if (!state.form[field]) { + if (state.form.suggestion !== "DD" && !state.form[field]) { errors[field] = "Please fill verified by"; invalidForm = true; break; From 4a7d832ee9bc8fb487234243f5f6665832c5dafe Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Fri, 8 Sep 2023 20:47:55 +0530 Subject: [PATCH 2/2] fix decalre dead --- src/Components/Facility/ConsultationForm.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx index d8353a3562f..49028a62953 100644 --- a/src/Components/Facility/ConsultationForm.tsx +++ b/src/Components/Facility/ConsultationForm.tsx @@ -618,6 +618,7 @@ export const ConsultationForm = (props: any) => { }; const declareThePatientDead = async ( + id: string, cause_of_death: string, death_datetime: string, death_confirmed_doctor: string @@ -629,6 +630,7 @@ export const ConsultationForm = (props: any) => { discharge_notes: cause_of_death, death_datetime: death_datetime, death_confirmed_doctor: death_confirmed_doctor, + discharge_date: dayjs().toISOString(), }, { id } ) @@ -714,6 +716,7 @@ export const ConsultationForm = (props: any) => { if (data.suggestion === "DD") { await declareThePatientDead( + res.data.id, state.form.cause_of_death, state.form.death_datetime, state.form.death_confirmed_doctor