Skip to content

Commit

Permalink
U4X-581: Fixing counts on the laboratory tiles (#8)
Browse files Browse the repository at this point in the history
* U4X-581 Fixing counts on the laboratory tiles

* U4X-581 Updating the yarn lock file
  • Loading branch information
Daphne210 authored May 22, 2024
1 parent 1abd692 commit 0323cf8
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 80 deletions.
6 changes: 3 additions & 3 deletions src/lab-tiles/completed-tile.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -15,9 +15,9 @@ const ReferredTileComponent = () => {
<SummaryTile
label={t("completed", "Completed")}
value={data?.length}
headerLabel={t("results", "Results")}
headerLabel={t("approved", "Approved")}
/>
);
};

export default ReferredTileComponent;
export default ApprovedTileComponent;
6 changes: 3 additions & 3 deletions src/lab-tiles/rejected-tile.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -21,4 +21,4 @@ const ReferredTileComponent = () => {
);
};

export default ReferredTileComponent;
export default RejectedTileComponent;
4 changes: 2 additions & 2 deletions src/lab-tiles/tests-ordered-tile.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -25,4 +25,4 @@ const ReferredTileComponent = () => {
);
};

export default ReferredTileComponent;
export default TestsOrderedTileComponent;
12 changes: 8 additions & 4 deletions src/referred-orders/referred-orders.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ const ReferredOrdersList: React.FC = () => {
{entry?.patient?.display.split("-")[1]}
</ConfigurableLink>
),
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,
Expand Down
12 changes: 8 additions & 4 deletions src/reject-order/rejected-tests-list.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,14 @@ const RejectedTestsList: React.FC = () => {
</span>
),
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,
Expand Down
10 changes: 0 additions & 10 deletions src/summary-tiles/summary-tile.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ const SummaryTile: React.FC<SummaryTileProps> = ({
{children}
</div>
<div></div>
<Button
kind="ghost"
renderIcon={(props) => (
<ArrowRight size={16} className={styles.arrowIcon} />
)}
iconDescription={t("view", "View ")}
>
{t("view", "View ")}
&nbsp;
</Button>
</div>
<div>
<label className={styles.totalsLabel}>{label}</label>
Expand Down
80 changes: 43 additions & 37 deletions src/tests-ordered/tests-ordered-list.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,43 +66,49 @@ const TestsOrderedList: React.FC<LaboratoryPatientListProps> = () => {
];

const tableRows = useMemo(() => {
return paginatedPickedOrderQueueEntries.map((entry, index) => ({
...entry,
id: entry?.uuid,
date: (
<span className={styles["single-line-display"]}>
{formatDate(parseDate(entry?.dateActivated))}
</span>
),
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: (
<OrderCustomOverflowMenuComponent
menuTitle={
<>
<OverflowMenuVertical
size={16}
style={{ marginLeft: "0.3rem" }}
/>
</>
}
>
<ExtensionSlot
className={styles.menuLink}
state={{ order: paginatedPickedOrderQueueEntries[index] }}
name="order-actions-slot"
/>
</OrderCustomOverflowMenuComponent>
),
}));
return paginatedPickedOrderQueueEntries.map((entry, index) => {
return {
...entry,
id: entry?.uuid,
date: (
<span className={styles["single-line-display"]}>
{formatDate(parseDate(entry?.dateActivated))}
</span>
),
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: (
<OrderCustomOverflowMenuComponent
menuTitle={
<>
<OverflowMenuVertical
size={16}
style={{ marginLeft: "0.3rem" }}
/>
</>
}
>
<ExtensionSlot
className={styles.menuLink}
state={{ order: paginatedPickedOrderQueueEntries[index] }}
name="order-actions-slot"
/>
</OrderCustomOverflowMenuComponent>
),
};
});
}, [paginatedPickedOrderQueueEntries]);

if (isLoading) {
Expand Down
34 changes: 17 additions & 17 deletions src/work-list/work-list.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,23 +113,23 @@ const WorkList: React.FC<WorklistProps> = ({ fulfillerStatus }) => {
{ id: 8, header: t("actions", "Actions"), key: "actions" },
];

const ResultsOrder: React.FC<ResultsOrderProps> = ({
order,
patientUuid,
}) => {
return (
<Button
kind="ghost"
onClick={() => {
launchOverlay(
t("resultForm", "Lab results form"),
<ResultForm patientUuid={patientUuid} order={order} />
);
}}
renderIcon={(props) => <Microscope size={16} {...props} />}
/>
);
};
const ResultsOrder = useCallback(
({ order, patientUuid }) => {
return (
<Button
kind="ghost"
onClick={() => {
launchOverlay(
t("resultForm", "Lab results form"),
<ResultForm patientUuid={patientUuid} order={order} />
);
}}
renderIcon={(props) => <Microscope size={16} {...props} />}
/>
);
},
[t]
);

const tableRows = useMemo(() => {
return paginatedWorkListEntries.map((entry, index) => ({
Expand Down

0 comments on commit 0323cf8

Please sign in to comment.