From 1a95cea420944b747db7a4991e26adad8221e41c Mon Sep 17 00:00:00 2001 From: vivek Date: Fri, 22 Dec 2023 14:24:03 +0530 Subject: [PATCH] fix based on review --- .../Facility/ConsultationDetails/index.tsx | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/Components/Facility/ConsultationDetails/index.tsx b/src/Components/Facility/ConsultationDetails/index.tsx index 0f8efa18f69..d404e071cc8 100644 --- a/src/Components/Facility/ConsultationDetails/index.tsx +++ b/src/Components/Facility/ConsultationDetails/index.tsx @@ -117,6 +117,11 @@ export const ConsultationDetails = (props: any) => { }); data.symptoms_text = symptoms.join(", "); } + if (facilityId != data.facility || patientId != data.patient) { + navigate( + `/facility/${data.facility}/patient/${data.patient}/consultation/${data?.id}` + ); + } setConsultationData(data); const assetRes = await dispatch( listAssetBeds({ @@ -147,14 +152,7 @@ export const ConsultationDetails = (props: any) => { : "No", is_vaccinated: patientData.is_vaccinated ? "Yes" : "No", }; - if ( - facilityId != data.facility_object?.id || - patientId != data.id - ) { - navigate( - `/facility/${data.facility_object?.id}/patient/${data.id}/consultation/${data?.last_consultation?.id}` - ); - } + setPatientData(data); } @@ -458,11 +456,7 @@ export const ConsultationDetails = (props: any) => { {p.desc} @@ -476,15 +470,15 @@ export const ConsultationDetails = (props: any) => { {showPatientNotesPopup && (