From 8187e1d0da721fcb2609d183c9d1561c88c191c4 Mon Sep 17 00:00:00 2001 From: Srayash Singh <146334722+Srayash@users.noreply.github.com> Date: Tue, 12 Nov 2024 20:08:11 +0530 Subject: [PATCH 1/5] "Remove "Add Consultation" if patient is inactive" #9055 --- src/components/Patient/PatientHome.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/Patient/PatientHome.tsx b/src/components/Patient/PatientHome.tsx index 3b5924009bb..6bda169cdc7 100644 --- a/src/components/Patient/PatientHome.tsx +++ b/src/components/Patient/PatientHome.tsx @@ -243,11 +243,7 @@ export const PatientHome = (props: any) => { }; const isPatientEligibleForNewConsultation = (patientData: PatientModel) => { - return patientData.is_active && - (!patientData?.last_consultation || - patientData?.last_consultation?.discharge_date) - ? true - : false; + return patientData.is_active ? true : false; }; return ( @@ -1066,7 +1062,7 @@ export const PatientHome = (props: any) => { "w-full rounded-lg border", isPatientEligibleForNewConsultation(patientData) ? "cursor-pointer border-green-700 hover:bg-primary-400" - : "border-secondary-700 text-secondary-700 hover:cursor-not-allowed", + : "hidden border-secondary-700 text-secondary-700 hover:cursor-not-allowed", )} onClick={() => isPatientEligibleForNewConsultation(patientData) && From 5fcb793c12997f6be38932e92aaad72e144b5cea Mon Sep 17 00:00:00 2001 From: Srayash Singh <146334722+Srayash@users.noreply.github.com> Date: Wed, 13 Nov 2024 20:47:07 +0530 Subject: [PATCH 2/5] Remove Add Consultation from patient details --- src/components/Patient/PatientHome.tsx | 55 ++++---------------------- 1 file changed, 8 insertions(+), 47 deletions(-) diff --git a/src/components/Patient/PatientHome.tsx b/src/components/Patient/PatientHome.tsx index 6bda169cdc7..18f87c010ab 100644 --- a/src/components/Patient/PatientHome.tsx +++ b/src/components/Patient/PatientHome.tsx @@ -241,10 +241,15 @@ export const PatientHome = (props: any) => { !(patientData?.last_consultation?.facility === facilityId) ); }; + // Commented out as this is no longer used should I completely remove this? - const isPatientEligibleForNewConsultation = (patientData: PatientModel) => { - return patientData.is_active ? true : false; - }; + // const isPatientEligibleForNewConsultation = (patientData: PatientModel) => { + // return patientData.is_active && + // (!patientData?.last_consultation || + // patientData?.last_consultation?.discharge_date) + // ? true + // : false; + // }; return ( { )}
{
-
- isPatientEligibleForNewConsultation(patientData) && - navigate( - `/facility/${patientData?.facility}/patient/${id}/consultation`, - ) - } - > -
-
- - - -
- -
-

- Add Consultation -

-
-
-
navigate(`/patient/${id}/investigation_reports`)} From 255e55b87226aa3a47458a16e545dbb0b4aa9a48 Mon Sep 17 00:00:00 2001 From: Srayash Singh <146334722+Srayash@users.noreply.github.com> Date: Wed, 13 Nov 2024 20:50:00 +0530 Subject: [PATCH 3/5] Update PatientHome.tsx --- src/components/Patient/PatientHome.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Patient/PatientHome.tsx b/src/components/Patient/PatientHome.tsx index 18f87c010ab..9f8ed049b5a 100644 --- a/src/components/Patient/PatientHome.tsx +++ b/src/components/Patient/PatientHome.tsx @@ -679,6 +679,7 @@ export const PatientHome = (props: any) => { )}
Date: Thu, 14 Nov 2024 07:59:53 +0530 Subject: [PATCH 4/5] Remove comments. --- src/components/Patient/PatientHome.tsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/components/Patient/PatientHome.tsx b/src/components/Patient/PatientHome.tsx index 9f8ed049b5a..3c7e29379a3 100644 --- a/src/components/Patient/PatientHome.tsx +++ b/src/components/Patient/PatientHome.tsx @@ -241,15 +241,6 @@ export const PatientHome = (props: any) => { !(patientData?.last_consultation?.facility === facilityId) ); }; - // Commented out as this is no longer used should I completely remove this? - - // const isPatientEligibleForNewConsultation = (patientData: PatientModel) => { - // return patientData.is_active && - // (!patientData?.last_consultation || - // patientData?.last_consultation?.discharge_date) - // ? true - // : false; - // }; return ( Date: Thu, 14 Nov 2024 08:15:08 +0530 Subject: [PATCH 5/5] Remove redundant "Add Consultation" Button from mobile view. --- src/components/Patient/PatientHome.tsx | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/components/Patient/PatientHome.tsx b/src/components/Patient/PatientHome.tsx index 3c7e29379a3..9d3ab238e5b 100644 --- a/src/components/Patient/PatientHome.tsx +++ b/src/components/Patient/PatientHome.tsx @@ -1239,28 +1239,6 @@ export const PatientHome = (props: any) => {
-
- - navigate( - `/facility/${patientData?.facility}/patient/${id}/consultation`, - ) - } - > - - - Add Consultation - - -