Skip to content

Commit

Permalink
update: Fix laboratory and visits default filter date values
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGT96 committed Sep 25, 2023
1 parent 2bb3ec7 commit 39f4743
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/components/accessories/opds/Opds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/state/laboratories/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/state/opds/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 39f4743

Please sign in to comment.