From 0323cf85df4c8e29ef5ab45b2130c69ea795ea49 Mon Sep 17 00:00:00 2001 From: Daphne <89844768+Daphne210@users.noreply.github.com> Date: Wed, 22 May 2024 16:15:20 +0300 Subject: [PATCH] U4X-581: Fixing counts on the laboratory tiles (#8) * U4X-581 Fixing counts on the laboratory tiles * U4X-581 Updating the yarn lock file --- src/lab-tiles/completed-tile.component.tsx | 6 +- src/lab-tiles/rejected-tile.component.tsx | 6 +- .../tests-ordered-tile.component.tsx | 4 +- .../referred-orders.component.tsx | 12 ++- .../rejected-tests-list.component.tsx | 12 ++- src/summary-tiles/summary-tile.component.tsx | 10 --- .../tests-ordered-list.component.tsx | 80 ++++++++++--------- src/work-list/work-list.component.tsx | 34 ++++---- 8 files changed, 84 insertions(+), 80 deletions(-) diff --git a/src/lab-tiles/completed-tile.component.tsx b/src/lab-tiles/completed-tile.component.tsx index 35f65ef2..fedb3e0e 100644 --- a/src/lab-tiles/completed-tile.component.tsx +++ b/src/lab-tiles/completed-tile.component.tsx @@ -4,7 +4,7 @@ import SummaryTile from "../summary-tiles/summary-tile.component"; import { useLabTestsStats } from "../summary-tiles/laboratory-summary.resource"; import dayjs from "dayjs"; -const ReferredTileComponent = () => { +const ApprovedTileComponent = () => { const { t } = useTranslation(); const today = dayjs(new Date()).format("YYYY-MM-DD"); @@ -15,9 +15,9 @@ const ReferredTileComponent = () => { ); }; -export default ReferredTileComponent; +export default ApprovedTileComponent; diff --git a/src/lab-tiles/rejected-tile.component.tsx b/src/lab-tiles/rejected-tile.component.tsx index 9b65bb81..afbb12b6 100644 --- a/src/lab-tiles/rejected-tile.component.tsx +++ b/src/lab-tiles/rejected-tile.component.tsx @@ -3,13 +3,13 @@ import { useTranslation } from "react-i18next"; import SummaryTile from "../summary-tiles/summary-tile.component"; import { useLabTestsStats } from "../summary-tiles/laboratory-summary.resource"; -const ReferredTileComponent = () => { +const RejectedTileComponent = () => { const { t } = useTranslation(); const { data } = useLabTestsStats(""); const filteredData = data?.filter( - (item) => item?.fulfillerStatus === "EXCEPTION" || item?.action === "REVISE" + (item) => item?.fulfillerStatus === "DECLINED" ); return ( @@ -21,4 +21,4 @@ const ReferredTileComponent = () => { ); }; -export default ReferredTileComponent; +export default RejectedTileComponent; diff --git a/src/lab-tiles/tests-ordered-tile.component.tsx b/src/lab-tiles/tests-ordered-tile.component.tsx index 6188039c..3ff04cb6 100644 --- a/src/lab-tiles/tests-ordered-tile.component.tsx +++ b/src/lab-tiles/tests-ordered-tile.component.tsx @@ -4,7 +4,7 @@ import SummaryTile from "../summary-tiles/summary-tile.component"; import dayjs from "dayjs"; import { useGetOrdersWorklist } from "../work-list/work-list.resource"; -const ReferredTileComponent = () => { +const TestsOrderedTileComponent = () => { const { t } = useTranslation(); const today = dayjs(new Date()).format("YYYY-MM-DD"); const { data } = useGetOrdersWorklist("", today); @@ -25,4 +25,4 @@ const ReferredTileComponent = () => { ); }; -export default ReferredTileComponent; +export default TestsOrderedTileComponent; diff --git a/src/referred-orders/referred-orders.component.tsx b/src/referred-orders/referred-orders.component.tsx index cb9aa11b..e313aca9 100644 --- a/src/referred-orders/referred-orders.component.tsx +++ b/src/referred-orders/referred-orders.component.tsx @@ -79,10 +79,14 @@ const ReferredOrdersList: React.FC = () => { {entry?.patient?.display.split("-")[1]} ), - artNumber: entry.patient?.identifiers.find( - (item) => - item?.identifierType?.uuid === "e1731641-30ab-102d-86b0-7a5022ba4115" - ).display, + artNumber: entry.patient?.identifiers + .find( + (item) => + item?.identifierType?.uuid === + "e1731641-30ab-102d-86b0-7a5022ba4115" + ) + .display.split("=")[1] + .trim(), orderNumber: entry?.orderNumber, accessionNumber: entry?.accessionNumber, test: entry?.concept?.display, diff --git a/src/reject-order/rejected-tests-list.component.tsx b/src/reject-order/rejected-tests-list.component.tsx index 928437eb..e88db25f 100644 --- a/src/reject-order/rejected-tests-list.component.tsx +++ b/src/reject-order/rejected-tests-list.component.tsx @@ -72,10 +72,14 @@ const RejectedTestsList: React.FC = () => { ), patient: entry?.patient?.display.split("-")[1], - artNumber: entry.patient?.identifiers.find( - (item) => - item?.identifierType?.uuid === "e1731641-30ab-102d-86b0-7a5022ba4115" - ).display, + artNumber: entry.patient?.identifiers + .find( + (item) => + item?.identifierType?.uuid === + "e1731641-30ab-102d-86b0-7a5022ba4115" + ) + .display.split("=")[1] + .trim(), orderNumber: entry?.orderNumber, accessionNumber: entry?.accessionNumber, test: entry?.concept?.display, diff --git a/src/summary-tiles/summary-tile.component.tsx b/src/summary-tiles/summary-tile.component.tsx index bae9078a..73c87106 100644 --- a/src/summary-tiles/summary-tile.component.tsx +++ b/src/summary-tiles/summary-tile.component.tsx @@ -27,16 +27,6 @@ const SummaryTile: React.FC = ({ {children}
-
diff --git a/src/tests-ordered/tests-ordered-list.component.tsx b/src/tests-ordered/tests-ordered-list.component.tsx index 8d618b3b..de2e788c 100644 --- a/src/tests-ordered/tests-ordered-list.component.tsx +++ b/src/tests-ordered/tests-ordered-list.component.tsx @@ -66,43 +66,49 @@ const TestsOrderedList: React.FC = () => { ]; const tableRows = useMemo(() => { - return paginatedPickedOrderQueueEntries.map((entry, index) => ({ - ...entry, - id: entry?.uuid, - date: ( - - {formatDate(parseDate(entry?.dateActivated))} - - ), - patient: entry?.patient?.display.split("-")[1], - artNumber: entry.patient?.identifiers.find( - (item) => - item?.identifierType?.uuid === "e1731641-30ab-102d-86b0-7a5022ba4115" - ).display, - orderNumber: entry?.orderNumber, - test: entry?.concept?.display, - action: entry?.action, - orderer: entry?.orderer?.display, - urgency: entry?.urgency, - actions: ( - - - - } - > - - - ), - })); + return paginatedPickedOrderQueueEntries.map((entry, index) => { + return { + ...entry, + id: entry?.uuid, + date: ( + + {formatDate(parseDate(entry?.dateActivated))} + + ), + patient: entry?.patient?.display.split("-")[1], + artNumber: entry.patient?.identifiers + .find( + (item) => + item?.identifierType?.uuid === + "e1731641-30ab-102d-86b0-7a5022ba4115" + ) + ?.display.split("=")[1] + .trim(), + orderNumber: entry?.orderNumber, + test: entry?.concept?.display, + action: entry?.action, + orderer: entry?.orderer?.display, + urgency: entry?.urgency, + actions: ( + + + + } + > + + + ), + }; + }); }, [paginatedPickedOrderQueueEntries]); if (isLoading) { diff --git a/src/work-list/work-list.component.tsx b/src/work-list/work-list.component.tsx index 9407c3b6..5881d2c8 100644 --- a/src/work-list/work-list.component.tsx +++ b/src/work-list/work-list.component.tsx @@ -113,23 +113,23 @@ const WorkList: React.FC = ({ fulfillerStatus }) => { { id: 8, header: t("actions", "Actions"), key: "actions" }, ]; - const ResultsOrder: React.FC = ({ - order, - patientUuid, - }) => { - return ( -