From 3f6c777b798fd3f617c759b67250966c3197ef4d Mon Sep 17 00:00:00 2001 From: jabahum Date: Fri, 11 Oct 2024 14:40:39 +0300 Subject: [PATCH] fix name display bug --- src/completed-list/completed-list.component.tsx | 2 +- src/referred-orders/referred-orders.component.tsx | 4 +--- src/reject-order/rejected-tests-list.component.tsx | 11 +++++------ src/review-list/review-list.component.tsx | 2 +- src/tests-ordered/tests-ordered-list.component.tsx | 2 +- src/work-list/work-list.component.tsx | 2 +- src/work-list/work-list.resource.ts | 2 +- 7 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/completed-list/completed-list.component.tsx b/src/completed-list/completed-list.component.tsx index 98b0b5e9..5b7dfb95 100644 --- a/src/completed-list/completed-list.component.tsx +++ b/src/completed-list/completed-list.component.tsx @@ -83,7 +83,7 @@ const CompletedList: React.FC = ({ fulfillerStatus }) => { - {entry?.patient?.display.split("-")[1]} + {entry?.patient?.names[0]?.display} ), orderNumber: entry?.orderNumber, diff --git a/src/referred-orders/referred-orders.component.tsx b/src/referred-orders/referred-orders.component.tsx index d9924274..994a921a 100644 --- a/src/referred-orders/referred-orders.component.tsx +++ b/src/referred-orders/referred-orders.component.tsx @@ -23,8 +23,6 @@ import { TableToolbarSearch, Layer, Tile, - DatePicker, - DatePickerInput, } from "@carbon/react"; import { getStatusColor, useOrderDate } from "../utils/functions"; import styles from "./referred-orders.scss"; @@ -83,7 +81,7 @@ const ReferredOrdersList: React.FC = () => { - {entry?.patient?.display.split("-")[1]} + {entry?.patient?.names[0]?.display} ), artNumber: entry.patient?.identifiers diff --git a/src/reject-order/rejected-tests-list.component.tsx b/src/reject-order/rejected-tests-list.component.tsx index 329a76b7..d7467efc 100644 --- a/src/reject-order/rejected-tests-list.component.tsx +++ b/src/reject-order/rejected-tests-list.component.tsx @@ -57,13 +57,12 @@ const RejectedTestsList: React.FC = () => { key: "accessionNumber", }, { id: 4, header: t("patient", "Patient"), key: "patient" }, - { id: 5, header: t("artNumber", "Art Number"), key: "artNumber" }, - { id: 6, header: t("test", "Test"), key: "test" }, - { id: 7, header: t("orderer", "Ordered By"), key: "orderer" }, - { id: 8, header: t("urgency", "Urgency"), key: "urgency" }, + { id: 5, header: t("test", "Test"), key: "test" }, + { id: 6, header: t("orderer", "Ordered By"), key: "orderer" }, + { id: 7, header: t("urgency", "Urgency"), key: "urgency" }, { - id: 9, + id: 8, header: t("fulfillerComment", "Reason for Rejection"), key: "fulfillerComment", }, @@ -78,7 +77,7 @@ const RejectedTestsList: React.FC = () => { {formatDate(parseDate(entry?.dateActivated))} ), - patient: entry?.patient?.display.split("-")[1], + patient: entry?.patient?.names[0]?.display, artNumber: entry.patient?.identifiers .find( (item) => diff --git a/src/review-list/review-list.component.tsx b/src/review-list/review-list.component.tsx index 3ad26c1f..84ef86cf 100644 --- a/src/review-list/review-list.component.tsx +++ b/src/review-list/review-list.component.tsx @@ -115,7 +115,7 @@ const ReviewList: React.FC = ({ fulfillerStatus }) => { ...entry, id: entry?.uuid, date: formatDate(parseDate(entry?.dateActivated)), - patient: entry?.patient?.display.split("-")[1], + patient: entry?.patient?.names[0]?.display, orderNumber: entry?.orderNumber, artNumber: entry.patient?.identifiers .find( diff --git a/src/tests-ordered/tests-ordered-list.component.tsx b/src/tests-ordered/tests-ordered-list.component.tsx index a63c0798..ccd0e306 100644 --- a/src/tests-ordered/tests-ordered-list.component.tsx +++ b/src/tests-ordered/tests-ordered-list.component.tsx @@ -80,7 +80,7 @@ const TestsOrderedList: React.FC = () => { {formatDate(parseDate(entry?.dateActivated))} ), - patient: entry?.patient?.display.split("-")[1], + patient: entry?.patient?.names[0]?.display, artNumber: entry.patient?.identifiers .find( (item) => diff --git a/src/work-list/work-list.component.tsx b/src/work-list/work-list.component.tsx index cd12a5fa..28076a2b 100644 --- a/src/work-list/work-list.component.tsx +++ b/src/work-list/work-list.component.tsx @@ -136,7 +136,7 @@ const WorkList: React.FC = ({ fulfillerStatus }) => { - {entry?.patient?.display.split("-")[1]} + {entry?.patient?.names[0]?.display} ), orderNumber: entry?.orderNumber, diff --git a/src/work-list/work-list.resource.ts b/src/work-list/work-list.resource.ts index 6ad31ea1..f23bf509 100644 --- a/src/work-list/work-list.resource.ts +++ b/src/work-list/work-list.resource.ts @@ -90,7 +90,7 @@ export interface IdentifierType { export function useGetOrdersWorklist(fulfillerStatus: string, dateTo?: string) { const { laboratoryOrderTypeUuid } = useConfig(); const customRepresentation = - "v=custom:(uuid,orderNumber,accessionNumber,instructions,careSetting:(uuid),encounter:(uuid,obs:(order:(uuid,display,patient:(uuid,display)))),fulfillerComment,orderType:(display),concept:(display,uuid),action,dateStopped,fulfillerStatus,dateActivated,orderer:(uuid,display),urgency,patient:(uuid,names:(display),display,gender,birthdate,identifiers:(voided,preferred,uuid,display,identifierType:(uuid))))"; + "v=custom:(uuid,orderNumber,accessionNumber,instructions,careSetting:(uuid),encounter:(uuid,obs:(order:(uuid,display,patient:(uuid,display,names)))),fulfillerComment,orderType:(display),concept:(display,uuid),action,dateStopped,fulfillerStatus,dateActivated,orderer:(uuid,display),urgency,patient:(uuid,names:(display),display,gender,birthdate,identifiers:(voided,preferred,uuid,display,identifierType:(uuid))))"; const orderTypeQuery = laboratoryOrderTypeUuid !== "" ? `orderTypes=${laboratoryOrderTypeUuid}`