From 70127e093b9f187bbe90e057c2cf2455c28818b0 Mon Sep 17 00:00:00 2001 From: Ashesh <3626859+Ashesh3@users.noreply.github.com> Date: Wed, 13 Dec 2023 10:56:55 +0530 Subject: [PATCH] Fix investigation builder crash (#6755) * Fix investigation advice assignment in ConsultationForm * allow category selection if null --- src/Components/Facility/ConsultationForm.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx index 1d4abbedc39..3207787a27d 100644 --- a/src/Components/Facility/ConsultationForm.tsx +++ b/src/Components/Facility/ConsultationForm.tsx @@ -400,7 +400,9 @@ export const ConsultationForm = (props: any) => { cause_of_death: res.data?.discharge_notes || "", death_datetime: res.data?.death_datetime || "", death_confirmed_doctor: res.data?.death_confirmed_doctor || "", - InvestigationAdvice: res.data.investigation, + InvestigationAdvice: Array.isArray(res.data.investigation) + ? res.data.investigation + : [], diagnoses: res.data.diagnoses.sort( (a: ConsultationDiagnosis, b: ConsultationDiagnosis) => ConditionVerificationStatuses.indexOf(a.verification_status) - @@ -410,7 +412,7 @@ export const ConsultationForm = (props: any) => { dispatch({ type: "set_form", form: { ...state.form, ...formData } }); setBed(formData.bed); - if (res.data.last_daily_round) { + if (res.data.last_daily_round && state.form.category) { setDisabledFields((fields) => [...fields, "category"]); } } else {