Skip to content

Commit

Permalink
fix approval bug (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
jabahum authored Feb 21, 2024
1 parent 57067b3 commit 3927aaf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/review-list/dialog/review-item.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,19 @@ const ReviewItem: React.FC<ReviewItemDialogProps> = ({
}) => {
const { t } = useTranslation();

const { encounter, isLoading, isError } = useGetEncounterById(encounterUuid);
const { encounter, isLoading } = useGetEncounterById(encounterUuid);

const testsOrder = useMemo(() => {
return encounter?.obs.filter((item) => item?.order?.type === "testorder");
}, [encounter?.obs]);
return encounter?.orders.filter(
(item) => item?.orderType.display === "Test Order"
);
}, [encounter?.orders]);

const filteredGroupedResults = useMemo(() => {
let groupedResults = [];

testsOrder?.forEach((element) => {
groupedResults[element.order.display] = element;
groupedResults[element.display] = element;
});

return groupedResults;
Expand Down

0 comments on commit 3927aaf

Please sign in to comment.