diff --git a/src/Common/constants.tsx b/src/Common/constants.tsx index 4a490f34e78..2bfecf94395 100644 --- a/src/Common/constants.tsx +++ b/src/Common/constants.tsx @@ -201,6 +201,13 @@ export const PATIENT_SORT_OPTIONS: SortOption[] = [ { isAscending: false, value: "-name" }, ]; +export const EVENTS_SORT_OPTIONS: SortOption[] = [ + { isAscending: false, value: "-created_date" }, + { isAscending: true, value: "created_date" }, + { isAscending: false, value: "-taken_at" }, + { isAscending: true, value: "taken_at" }, +]; + export const DISCHARGED_PATIENT_SORT_OPTIONS: SortOption[] = [ { isAscending: false, value: "-created_date" }, { isAscending: true, value: "created_date" }, diff --git a/src/Components/Facility/ConsultationDetails/Events/EventsList.tsx b/src/Components/Facility/ConsultationDetails/Events/EventsList.tsx index f759559c1a1..d77b3d9a8c2 100644 --- a/src/Components/Facility/ConsultationDetails/Events/EventsList.tsx +++ b/src/Components/Facility/ConsultationDetails/Events/EventsList.tsx @@ -7,15 +7,32 @@ import LoadingLogUpdateCard from "../../Consultations/DailyRounds/LoadingCard"; import GenericEvent from "./GenericEvent"; import { getEventIcon } from "./iconMap"; import { EventGeneric } from "./types"; +import SortDropdownMenu from "../../../Common/SortDropdown"; +import { EVENTS_SORT_OPTIONS } from "../../../../Common/constants"; +import { QueryParams } from "../../../../Utils/request/types"; +import { useState } from "react"; export default function EventsList() { const [consultationId] = useSlugs("consultation"); const { t } = useTranslation(); + const [query, setQuery] = useState(); return ( - + {() => ( <> +
+ +
+
diff --git a/src/Locale/en/SortOptions.json b/src/Locale/en/SortOptions.json index 11986b97663..29a8d1e8f4d 100644 --- a/src/Locale/en/SortOptions.json +++ b/src/Locale/en/SortOptions.json @@ -9,6 +9,8 @@ "facility__name,-last_consultation__current_bed__bed__name": "Bed No. N-1", "-review_time": "Latest review date first", "review_time": "Oldest review date first", + "taken_at": "Oldest taken date first", + "-taken_at": "Latest taken date first", "name": "Patient name A-Z", "-name": "Patient name Z-A", "bed__name": "Bed No. 1-N",