diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx index 6c7e8a6760e..01a5f02b7b1 100644 --- a/src/Components/Facility/ConsultationForm.tsx +++ b/src/Components/Facility/ConsultationForm.tsx @@ -123,7 +123,7 @@ const initForm: FormDetails = { facility: "", admitted: "false", admitted_to: "", - category: "Comfort", + category: "", admission_date: new Date(), discharge_date: null, referred_to: "", @@ -373,8 +373,8 @@ export const ConsultationForm = (props: any) => { admitted_to: res.data.admitted_to ? res.data.admitted_to : "", category: res.data.category ? PATIENT_CATEGORIES.find((i) => i.text === res.data.category) - ?.id ?? "Comfort" - : "Comfort", + ?.id ?? "" + : "", patient_no: res.data.patient_no ?? "", OPconsultation: res.data.consultation_notes, is_telemedicine: `${res.data.is_telemedicine}`, diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index 351136e32d4..a84ad4a3e8b 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -42,7 +42,7 @@ const initForm: any = { other_symptoms: "", physical_examination_info: "", other_details: "", - patient_category: "Comfort", + patient_category: "", current_health: 0, recommend_discharge: false, action: null, @@ -142,14 +142,14 @@ export const DailyRounds = (props: any) => { ); if (!status.aborted) { - if (res && res.data) { + if (res?.data) { const data = { ...res.data, patient_category: res.data.patient_category ? PATIENT_CATEGORIES.find( (i) => i.text === res.data.patient_category - )?.id || "Comfort" - : "Comfort", + )?.id ?? "" + : "", rhythm: (res.data.rhythm && RHYTHM_CHOICES.find((i) => i.text === res.data.rhythm)?.id) || @@ -186,8 +186,8 @@ export const DailyRounds = (props: any) => { patient_category: res.data.patient_category ? PATIENT_CATEGORIES.find( (i) => i.text === res.data.patient_category - )?.id || "Comfort" - : "Comfort", + )?.id ?? "" + : "", rhythm: (res.data.rhythm && RHYTHM_CHOICES.find((i) => i.text === res.data.rhythm)?.id) || @@ -205,6 +205,12 @@ export const DailyRounds = (props: any) => { let invalidForm = false; Object.keys(state.form).forEach((field) => { switch (field) { + case "patient_category": + if (!state.form[field]) { + errors[field] = "Please select a category"; + invalidForm = true; + } + return; case "other_symptoms": if ( state.form.additional_symptoms?.includes(9) &&