diff --git a/src/Components/Patient/PatientFilter.tsx b/src/Components/Patient/PatientFilter.tsx index 1bc27733242..ce0b576b468 100644 --- a/src/Components/Patient/PatientFilter.tsx +++ b/src/Components/Patient/PatientFilter.tsx @@ -31,11 +31,13 @@ import DiagnosesFilter, { FILTER_BY_DIAGNOSES_KEYS } from "./DiagnosesFilter"; import useQuery from "../../Utils/request/useQuery"; import routes from "../../Redux/api"; import request from "../../Utils/request/request"; +import useAuthUser from "../../Common/hooks/useAuthUser"; const getDate = (value: any) => value && dayjs(value).isValid() && dayjs(value).toDate(); export default function PatientFilter(props: any) { + const authUser = useAuthUser(); const { kasp_enabled, kasp_string } = useConfig(); const { filter, onChange, closeFilter, removeFilters } = props; @@ -377,23 +379,27 @@ export default function PatientFilter(props: any) { } /> -
- Discharge Reason - o.id} - optionLabel={(o) => o.text} - onChange={(o) => - setFilterState({ - ...filterState, - last_consultation__new_discharge_reason: o, - }) - } - /> -
+ {["StateAdmin", "StateReadOnlyAdmin"].includes( + authUser.user_type, + ) && ( +
+ Discharge Reason + o.id} + optionLabel={(o) => o.text} + onChange={(o) => + setFilterState({ + ...filterState, + last_consultation__new_discharge_reason: o, + }) + } + /> +
+ )}
Telemedicine