From 39f474365527429e77bc0cd9312ff0e8cf830c2e Mon Sep 17 00:00:00 2001 From: SteveGT96 Date: Mon, 25 Sep 2023 16:05:24 +0100 Subject: [PATCH] update: Fix laboratory and visits default filter date values --- src/components/accessories/opds/Opds.tsx | 1 - src/state/laboratories/actions.ts | 4 ++-- src/state/opds/actions.ts | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/accessories/opds/Opds.tsx b/src/components/accessories/opds/Opds.tsx index e06bc8d69..8d640be4c 100644 --- a/src/components/accessories/opds/Opds.tsx +++ b/src/components/accessories/opds/Opds.tsx @@ -24,7 +24,6 @@ export const Opds: FC = () => { const fields = initialFilterFields; const { t } = useTranslation(); const dispatch = useDispatch(); - const navigate = useNavigate(); const [filter, setFilter] = useState({} as TFilterValues); diff --git a/src/state/laboratories/actions.ts b/src/state/laboratories/actions.ts index 800e8060e..29311085d 100644 --- a/src/state/laboratories/actions.ts +++ b/src/state/laboratories/actions.ts @@ -214,8 +214,8 @@ export const searchLabs = }); labsApi .getLaboratoryForPrint({ - dateTo: query.dateTo ?? moment().add("-30", "days").toISOString(), - dateFrom: query.dateFrom ?? moment().toISOString(), + dateFrom: query.dateFrom ?? moment().add("-30", "days").toISOString(), + dateTo: query.dateTo ?? moment().toISOString(), examName: query.examName, patientCode: !isNaN(query.patientCode) ? query.patientCode : undefined, status: query.status ?? undefined, diff --git a/src/state/opds/actions.ts b/src/state/opds/actions.ts index f9b359e3e..d58bab11e 100644 --- a/src/state/opds/actions.ts +++ b/src/state/opds/actions.ts @@ -237,8 +237,8 @@ export const searchOpds = .getOpdByDates({ sex: query.sex, newPatient: query.newPatient, - dateTo: query.dateTo ?? moment().add("-30", "days").toISOString(), - dateFrom: query.dateFrom ?? moment().toISOString(), + dateFrom: query.dateFrom ?? moment().add("-30", "days").toISOString(), + dateTo: query.dateTo ?? moment().toISOString(), ageFrom: isNaN(query.ageFrom) ? null : query.ageFrom, ageTo: isNaN(query.ageTo) ? null : query.ageTo, diseaseCode: query.diseaseCode,