From 33b25309bf66f3b96e4b20dedd2df114b44b51c7 Mon Sep 17 00:00:00 2001 From: Khavin Shankar Date: Wed, 26 Apr 2023 20:09:06 +0530 Subject: [PATCH] changed the discharged logic in patient consultation dashboard (#5379) --- .../Facility/ConsultationDetails.tsx | 7 +--- src/Components/Patient/PatientInfoCard.tsx | 38 +++++++++++-------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/Components/Facility/ConsultationDetails.tsx b/src/Components/Facility/ConsultationDetails.tsx index 3b6ce20d87c..75cd6611a2a 100644 --- a/src/Components/Facility/ConsultationDetails.tsx +++ b/src/Components/Facility/ConsultationDetails.tsx @@ -355,7 +355,7 @@ export const ConsultationDetails = (props: any) => { backUrl="/patients" />
- {patientData.is_active && ( + {!consultationData.discharge_date && (
@@ -493,10 +493,7 @@ export const ConsultationDetails = (props: any) => {
- {!patient.is_active && ( + {!!consultation?.discharge_date && (

Discharged from CARE

@@ -199,7 +201,7 @@ export default function PatientInfoCard(props: { ); })}
- {patient.is_active === false && ( + {!!consultation?.discharge_date && (
@@ -241,7 +243,7 @@ export default function PatientInfoCard(props: {
- {patient.is_active === false && ( + {!!consultation?.discharge_date && (
Discharge Reason @@ -264,13 +266,17 @@ export default function PatientInfoCard(props: { `/facility/${patient.facility}/patient/${patient.id}/consultation/${consultation?.id}/update`, "Edit Consultation Details", "pen", - patient.is_active && consultation?.id, + patient.is_active && + consultation?.id && + !consultation?.discharge_date, ], [ `/facility/${patient.facility}/patient/${patient.id}/consultation/${consultation?.id}/daily-rounds`, "Log Update", "plus", - patient.is_active && consultation?.id, + patient.is_active && + consultation?.id && + !consultation?.discharge_date, [ !(consultation?.facility !== patient.facility) && !(consultation?.discharge_date || !patient.is_active) &&