From 7e83c245a48b69110cd392b7ce84ecf3dd651fb2 Mon Sep 17 00:00:00 2001 From: kushalbhana <68599557+kushalbhana@users.noreply.github.com> Date: Sun, 4 Aug 2024 18:44:43 +0530 Subject: [PATCH 1/4] Scroll to madatory empty fields --- src/Components/Patient/DailyRounds.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index 321536e80f5..7e9b1cc702a 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -1,7 +1,7 @@ import { navigate } from "raviger"; import dayjs from "dayjs"; -import { lazy, useCallback, useEffect, useState } from "react"; +import { lazy, useCallback, useEffect, useState, useRef } from "react"; import { CONSCIOUSNESS_LEVEL, PATIENT_CATEGORIES, @@ -137,6 +137,8 @@ export const DailyRounds = (props: any) => { const headerText = !id ? "Add Consultation Update" : "Info"; const buttonText = !id ? "Save" : "Continue"; + const patientCategory = useRef(null); + const formFields = [ "physical_examination_info", "other_details", @@ -231,6 +233,7 @@ export const DailyRounds = (props: any) => { if (!state.form[field]) { errors[field] = "Please select a category"; invalidForm = true; + patientCategory.current?.scrollIntoView({ behavior: 'smooth' }); } return; case "bp": { @@ -519,7 +522,7 @@ export const DailyRounds = (props: any) => { optionValue={(option) => option.id} /> -
+
Date: Sun, 4 Aug 2024 23:45:26 +0530 Subject: [PATCH 2/4] Update DailyRounds.tsx passed id value in scrollTo function --- src/Components/Patient/DailyRounds.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index 7e9b1cc702a..9965659e32c 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -1,7 +1,7 @@ import { navigate } from "raviger"; import dayjs from "dayjs"; -import { lazy, useCallback, useEffect, useState, useRef } from "react"; +import { lazy, useCallback, useEffect, useState} from "react"; import { CONSCIOUSNESS_LEVEL, PATIENT_CATEGORIES, @@ -45,6 +45,7 @@ import { EncounterSymptomsBuilder } from "../Symptoms/SymptomsBuilder"; import { FieldLabel } from "../Form/FormFields/FormField"; import useAuthUser from "../../Common/hooks/useAuthUser"; import CheckBoxFormField from "../Form/FormFields/CheckBoxFormField"; +import { scrollTo } from "../../Utils/utils"; const Loading = lazy(() => import("../Common/Loading")); @@ -233,7 +234,7 @@ export const DailyRounds = (props: any) => { if (!state.form[field]) { errors[field] = "Please select a category"; invalidForm = true; - patientCategory.current?.scrollIntoView({ behavior: 'smooth' }); + scrollTo('patientCategory'); } return; case "bp": { @@ -522,11 +523,12 @@ export const DailyRounds = (props: any) => { optionValue={(option) => option.id} />
-
+
From 2a4510ca9a652cc26c46884693e7f1eca6dd1a8a Mon Sep 17 00:00:00 2001 From: Kushal Bhana <68599557+kushalbhana@users.noreply.github.com> Date: Sun, 4 Aug 2024 23:47:28 +0530 Subject: [PATCH 3/4] Update DailyRounds.tsx Fixed: Used scrollTo() function by passing id --- src/Components/Patient/DailyRounds.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index 9965659e32c..cf0c8bb67d8 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -138,8 +138,6 @@ export const DailyRounds = (props: any) => { const headerText = !id ? "Add Consultation Update" : "Info"; const buttonText = !id ? "Save" : "Continue"; - const patientCategory = useRef(null); - const formFields = [ "physical_examination_info", "other_details", From 182736279c275ce2b2975f356be2822cc1ef9c23 Mon Sep 17 00:00:00 2001 From: Kushal Bhana <68599557+kushalbhana@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:37:33 +0530 Subject: [PATCH 4/4] Update DailyRounds.tsx Made the changes where handled error in blood pressure field --- src/Components/Patient/DailyRounds.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index cf0c8bb67d8..ba9492bb04f 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -240,6 +240,7 @@ export const DailyRounds = (props: any) => { if (error) { errors.bp = error; invalidForm = true; + scrollTo('bloodPressure'); } return; } @@ -592,7 +593,7 @@ export const DailyRounds = (props: any) => { <>

Vitals

- +