diff --git a/src/radiology-tabs/common/groupedOrdersTable.component.tsx b/src/radiology-tabs/common/groupedOrdersTable.component.tsx index 6541e3f..63c4d6f 100644 --- a/src/radiology-tabs/common/groupedOrdersTable.component.tsx +++ b/src/radiology-tabs/common/groupedOrdersTable.component.tsx @@ -22,6 +22,7 @@ import { TableToolbarSearch, } from "@carbon/react"; import ListOrderDetails from "./listOrderDetails.component"; +import TransitionLatestQueueEntryButton from "../test-ordered/transition-patient-new-queue/transition-latest-queue-entry-button.component"; // render Grouped by patient Orders in radiology module const GroupedOrdersTable: React.FC = (props) => { @@ -68,13 +69,34 @@ const GroupedOrdersTable: React.FC = (props) => { patientname: patient.orders[0].patient?.display?.split("-")[1], orders: patient.orders, totalorders: patient.orders?.length, + fulfillerStatus: patient.orders[0].fulfillerStatus, + action: + patient.orders[0].fulfillerStatus === "COMPLETED" ? ( + + ) : null, })); }, [paginatedResults]); - const tableColumns = [ - { id: 0, header: t("patient", "Patient"), key: "patientname" }, - { id: 1, header: t("totalorders", "Total Orders"), key: "totalorders" }, - ]; + const tableColumns = useMemo(() => { + const showActionColumn = workListEntries.some( + (order) => order.fulfillerStatus === "COMPLETED" + ); + + const columns = [ + { id: 0, header: t("patientName", "Patient Name"), key: "patientname" }, + { id: 1, header: t("totalorders", "Total Orders"), key: "totalorders" }, + ]; + + if (showActionColumn) { + columns.push({ + id: 2, + header: t("action", "Action"), + key: "action", + }); + } + + return columns; + }, [workListEntries, t]); return (
= ({ patientUuid }) => { + const { t } = useTranslation(); + + const launchModal = () => { + const dispose = showModal("transition-patient-to-latest-queue-modal", { + closeModal: () => dispose(), + patientUuid, + }); + }; + + return ( + + ); +}; + +export default TransitionLatestQueueEntryButton; diff --git a/src/radiology-tabs/test-ordered/transition-patient-new-queue/transition-latest-queue-entry-button.scss b/src/radiology-tabs/test-ordered/transition-patient-new-queue/transition-latest-queue-entry-button.scss new file mode 100644 index 0000000..326b443 --- /dev/null +++ b/src/radiology-tabs/test-ordered/transition-patient-new-queue/transition-latest-queue-entry-button.scss @@ -0,0 +1,13 @@ +@use '@carbon/layout'; +@use '@carbon/styles/scss/type'; + +.addPatientToQueue { + --cds-layout-size-height-context: var(--cds-layout-size-height-sm, 2rem); + --cds-layout-size-height: var(--cds-layout-size-height-context); + display: flex; + align-items: center; + justify-content: center; + text-align: center; + padding: 0 layout.$spacing-04; + gap: layout.$spacing-05; +}