diff --git a/src/completed-list/completed-list.component.tsx b/src/completed-list/completed-list.component.tsx index 6e279cc1..b6dd36c0 100644 --- a/src/completed-list/completed-list.component.tsx +++ b/src/completed-list/completed-list.component.tsx @@ -34,11 +34,88 @@ import { import styles from "./completed-list.scss"; import { getStatusColor } from "../utils/functions"; -interface CompletedlistProps { +interface CompletedListProps { fulfillerStatus: string; } -const CompletedList: React.FC = ({ fulfillerStatus }) => { +interface TableRowProps { + entry: { + uuid: string; + orderNumber: string; + accessionNumber: string; + concept: { display: string }; + action: string; + fulfillerStatus: string; + orderer: { display: string }; + urgency: string; + dateActivated: string; + patient: { display: string }; + }; +} + +const StatusTag: React.FC<{ fulfillerStatus: string }> = ({ + fulfillerStatus, +}) => { + return ( + + + {fulfillerStatus} + + + ); +}; + +const CustomTableRow: React.FC = ({ entry }) => { + const { + uuid, + orderNumber, + accessionNumber, + concept, + action, + fulfillerStatus, + orderer, + urgency, + dateActivated, + patient, + } = entry; + + return ( + + + {formatDate(parseDate(dateActivated))} + + + {orderNumber} + + + {patient.display.split("-")[1]} + + + {accessionNumber} + + + {concept.display} + + + {action} + + + + + + {orderer.display} + + + {urgency} + + + ); +}; + +const CompletedList: React.FC = ({ fulfillerStatus }) => { const { t } = useTranslation(); const [activatedOnOrAfterDate, setActivatedOnOrAfterDate] = useState(""); @@ -59,13 +136,10 @@ const CompletedList: React.FC = ({ fulfillerStatus }) => { currentPage, } = usePagination(workListEntries, currentPageSize); - // get picked orders - let columns = [ + const tableColumns = [ { id: 0, header: t("date", "Date"), key: "date" }, - { id: 1, header: t("orderNumber", "Order Number"), key: "orderNumber" }, { id: 2, header: t("patient", "Patient"), key: "patient" }, - { id: 3, header: t("accessionNumber", "Accession Number"), @@ -74,166 +148,37 @@ const CompletedList: React.FC = ({ fulfillerStatus }) => { { id: 4, header: t("test", "Test"), key: "test" }, { id: 5, header: t("action", "Action"), key: "action" }, { id: 6, header: t("status", "Status"), key: "status" }, - { id: 8, header: t("orderer", "Orderer"), key: "orderer" }, - { id: 9, header: t("urgency", "Urgency"), key: "urgency" }, + { id: 7, header: t("orderer", "Orderer"), key: "orderer" }, + { id: 8, header: t("urgency", "Urgency"), key: "urgency" }, ]; const tableRows = useMemo(() => { - return paginatedWorkListEntries?.map((entry, index) => ({ - ...entry, - id: entry.uuid, - date: { - content: ( - <> - {formatDate(parseDate(entry.dateActivated))} - - ), - }, - patient: { - content: ( - <> - {entry.patient.display.split("-")[1]} - - ), - }, - orderNumber: { content: {entry.orderNumber} }, - accessionNumber: { content: {entry.accessionNumber} }, - test: { content: {entry.concept.display} }, - action: { content: {entry.action} }, - status: { - content: ( - <> - - - {entry.fulfillerStatus} - - - - ), - }, - orderer: { content: {entry.orderer.display} }, - orderType: { content: {entry.orderType.display} }, - urgency: { content: {entry.urgency} }, - })); + return paginatedWorkListEntries?.map((entry, index) => ( + + )); }, [paginatedWorkListEntries]); if (isLoading) { return ; } - if (paginatedWorkListEntries?.length >= 0) { + if (paginatedWorkListEntries?.length > 0) { return (
- - {({ - rows, - headers, - getHeaderProps, - getTableProps, - getRowProps, - onInputChange, - }) => ( - - - - - - { - setActivatedOnOrAfterDate(event.target.value); - }} - type="date" - value={activatedOnOrAfterDate} - /> - - - - - - - -
- - - - {headers.map((header) => ( - - {header.header?.content ?? header.header} - - ))} - - - - {rows.map((row, index) => { - return ( - - - {row.cells.map((cell) => ( - - {cell.value?.content ?? cell.value} - - ))} - - - ); - })} - -
- {rows.length === 0 ? ( -
- -
-

- {t( - "noCompletedListToDisplay", - "No Completed List to display" - )} -

-
-
-
- ) : null} - { - if (pageSize !== currentPageSize) { - setPageSize(pageSize); - } - if (page !== currentPage) { - goTo(page); - } - }} - /> -
- )} -
+ +
+ ); + } else { + return ( +
+ +
+

+ {t("noCompletedListToDisplay", "No Completed List to display")} +

+
+
); } diff --git a/src/completed-list/completed-list.scss b/src/completed-list/completed-list.scss index 0be385f2..fa3c9391 100644 --- a/src/completed-list/completed-list.scss +++ b/src/completed-list/completed-list.scss @@ -229,4 +229,5 @@ title { @include type.type-style('heading-compact-02'); color: $text-02; margin-bottom: 0.5rem; -} \ No newline at end of file +} + diff --git a/src/queue-list/laboratory-patient-list.component.tsx b/src/queue-list/laboratory-patient-list.component.tsx index 7084e8d3..0e000708 100644 --- a/src/queue-list/laboratory-patient-list.component.tsx +++ b/src/queue-list/laboratory-patient-list.component.tsx @@ -111,7 +111,9 @@ const LaboratoryPatientList: React.FC = () => { date: { content: ( <> - {formatDate(parseDate(entry.dateActivated))} + + {formatDate(parseDate(entry.dateActivated))} + ), }, diff --git a/src/queue-list/laboratory-queue.scss b/src/queue-list/laboratory-queue.scss index fbb62759..58587688 100644 --- a/src/queue-list/laboratory-queue.scss +++ b/src/queue-list/laboratory-queue.scss @@ -210,4 +210,9 @@ title { @include type.type-style('heading-compact-02'); color: $text-02; margin-bottom: 0.5rem; -} \ No newline at end of file +} + + .single-line-display { + white-space: nowrap; + } +