Skip to content

Commit

Permalink
update consultation redirect url
Browse files Browse the repository at this point in the history
  • Loading branch information
konavivekramakrishna committed Dec 13, 2023
1 parent 16a4a6c commit 85e6e6d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/Components/Facility/Consultations/DailyRoundsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ interface Props {
}

export default function DailyRoundsList({ consultation }: Props) {
const [consultationId] = useSlugs("consultation");
const [facilityId, patientId, consultationId] = useSlugs(
"facility",
"patient",
"consultation"
);
const { t } = useTranslation();

const consultationUrl = `/consultation/${consultationId}`;

const consultationUrl = `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`;
return (
<PaginatedList
route={routes.getDailyReports}
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Patient/ManagePatients.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ export const PatientManager = () => {
patient.last_consultation?.facility === patient.facility &&
!(patient.last_consultation?.discharge_date && patient.is_active)
) {
patientUrl = `/consultation/${patient.last_consultation.id}`;
patientUrl = `/facility/${patient.facility}/patient/${patient.id}/consultation/${patient.last_consultation.id}`;
} else if (patient.facility) {
patientUrl = `/facility/${patient.facility}/patient/${patient.id}`;
} else {
Expand Down
3 changes: 2 additions & 1 deletion src/Routers/routes/ConsultationRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { FileUpload } from "../../Components/Patient/FileUpload";
import { make as CriticalCareRecording } from "../../Components/CriticalCareRecording/CriticalCareRecording.bs";
import { ConsultationDetails } from "../../Components/Facility/ConsultationDetails";
import TreatmentSummary from "../../Components/Facility/TreatmentSummary";
import { Redirect } from "raviger";

export default {
"/facility/:facilityId/patient/:patientId/consultation": ({
Expand Down Expand Up @@ -139,6 +140,6 @@ export default {
/>
),
"/consultation/:consultationId": ({ consultationId }: any) => (
<ConsultationDetails consultationId={consultationId} tab={"updates"} />
<Redirect to={`/facility/id/patient/id/consultation/${consultationId}/`} />
),
};

0 comments on commit 85e6e6d

Please sign in to comment.