diff --git a/src/common/groupedOrdersTable.component.tsx b/src/common/groupedOrdersTable.component.tsx index c49c41f..3717bda 100644 --- a/src/common/groupedOrdersTable.component.tsx +++ b/src/common/groupedOrdersTable.component.tsx @@ -27,6 +27,7 @@ import { import ListOrderDetails from "./listOrderDetails.component"; import Overlay from "../components/overlay/overlay.component"; import { GroupedOrdersTableProps, OrderStatusFilterType } from "../types"; +import TransitionLatestQueueEntryButton from "../procedures-ordered/transition-patient-new-queue/transition-latest-queue-entry-button.component"; // render Grouped by patient Orders in procedures app const GroupedOrdersTable: React.FC = (props) => { @@ -102,13 +103,26 @@ 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 showActionColumn = filteredEntries.some( + (order) => order.fulfillerStatus === "COMPLETED" + ); + const tableColumns = [ { id: 0, header: t("patient", "Patient"), key: "patientName" }, { id: 1, header: t("totalorders", "Total Orders"), key: "totalOrders" }, + ...(showActionColumn + ? [{ id: 2, header: t("actionButton", "Action"), key: "action" }] + : []), ]; + 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/procedures-ordered/transition-patient-new-queue/transition-latest-queue-entry-button.scss b/src/procedures-ordered/transition-patient-new-queue/transition-latest-queue-entry-button.scss new file mode 100644 index 0000000..3208152 --- /dev/null +++ b/src/procedures-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: 1rem; +}