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 && (