From 4b4bd52f6106bb07f19508a5a903a8d5ca3cd60a Mon Sep 17 00:00:00 2001 From: jabahum Date: Thu, 27 Jun 2024 10:23:51 +0300 Subject: [PATCH 1/2] fix approval dialog --- src/lab-tiles/referred-tile.component.tsx | 4 ++-- src/lab-tiles/worklist-tile.component.tsx | 2 +- .../patient-laboratory-order-results.resource.ts | 2 +- src/reject-order/rejected-tests-list.component.tsx | 2 +- src/review-list/dialog/review-item.component.tsx | 4 +++- src/review-list/review-list.component.tsx | 2 +- src/work-list/work-list.resource.ts | 3 +++ 7 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/lab-tiles/referred-tile.component.tsx b/src/lab-tiles/referred-tile.component.tsx index 729b5de9..fb89afe7 100644 --- a/src/lab-tiles/referred-tile.component.tsx +++ b/src/lab-tiles/referred-tile.component.tsx @@ -23,8 +23,8 @@ const ReferredTileComponent = () => { return ( ); }; diff --git a/src/lab-tiles/worklist-tile.component.tsx b/src/lab-tiles/worklist-tile.component.tsx index 3ceec07c..9b0edef1 100644 --- a/src/lab-tiles/worklist-tile.component.tsx +++ b/src/lab-tiles/worklist-tile.component.tsx @@ -23,7 +23,7 @@ const WorklistTileComponent = () => { ); }; diff --git a/src/patient-chart/patient-laboratory-order-results.resource.ts b/src/patient-chart/patient-laboratory-order-results.resource.ts index 0c537e34..94961869 100644 --- a/src/patient-chart/patient-laboratory-order-results.resource.ts +++ b/src/patient-chart/patient-laboratory-order-results.resource.ts @@ -134,7 +134,7 @@ export interface Ob { groupMembers: GroupMember[]; comment: any; location: Location; - order: any; + order: Order; encounter: Encounter; voided: boolean; value: any; diff --git a/src/reject-order/rejected-tests-list.component.tsx b/src/reject-order/rejected-tests-list.component.tsx index f896d235..d710f94f 100644 --- a/src/reject-order/rejected-tests-list.component.tsx +++ b/src/reject-order/rejected-tests-list.component.tsx @@ -83,7 +83,7 @@ const RejectedTestsList: React.FC = () => { item?.identifierType?.uuid === "e1731641-30ab-102d-86b0-7a5022ba4115" ) - .display.split("=")[1] + ?.display.split("=")[1] .trim(), orderNumber: entry?.orderNumber, accessionNumber: entry?.accessionNumber, diff --git a/src/review-list/dialog/review-item.component.tsx b/src/review-list/dialog/review-item.component.tsx index f5122fac..7773d6ca 100644 --- a/src/review-list/dialog/review-item.component.tsx +++ b/src/review-list/dialog/review-item.component.tsx @@ -43,7 +43,9 @@ const ReviewItem: React.FC = ({ const { encounter, isLoading } = useGetEncounterById(encounterUuid); const testsOrder = useMemo(() => { - return encounter?.obs?.filter((item) => item?.order?.type === "testorder"); + return encounter?.obs?.filter( + (item) => item?.order?.uuid === orderItem?.uuid + ); }, [encounter?.obs]); const filteredGroupedResults = useMemo(() => { diff --git a/src/review-list/review-list.component.tsx b/src/review-list/review-list.component.tsx index 38ad0425..5a5e0e7d 100644 --- a/src/review-list/review-list.component.tsx +++ b/src/review-list/review-list.component.tsx @@ -40,8 +40,8 @@ interface ApproveResultMenuProps { } const ApproveTestMenu: React.FC = ({ - encounterUuid, orderItem, + encounterUuid, }) => { const { t } = useTranslation(); const launchReviewItemModal = useCallback(() => { diff --git a/src/work-list/work-list.resource.ts b/src/work-list/work-list.resource.ts index 71bb3be5..6ad31ea1 100644 --- a/src/work-list/work-list.resource.ts +++ b/src/work-list/work-list.resource.ts @@ -5,6 +5,7 @@ import useSWR, { mutate } from "swr"; export interface Result { uuid: string; orderNumber: string; + display: string; accessionNumber?: string; instructions?: string; careSetting: CareSetting; @@ -19,6 +20,7 @@ export interface Result { orderer: Orderer; urgency: string; patient: Patient2; + type: string; } export interface CareSetting { @@ -46,6 +48,7 @@ export interface Patient { } export interface OrderType { + uuid: string; display: string; } From f4509ce5294321811966866335a3096e14b9603e Mon Sep 17 00:00:00 2001 From: jabahum Date: Thu, 27 Jun 2024 13:26:58 +0300 Subject: [PATCH 2/2] add orderItem as dependency --- src/review-list/dialog/review-item.component.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/review-list/dialog/review-item.component.tsx b/src/review-list/dialog/review-item.component.tsx index 7773d6ca..c3f74de7 100644 --- a/src/review-list/dialog/review-item.component.tsx +++ b/src/review-list/dialog/review-item.component.tsx @@ -46,7 +46,7 @@ const ReviewItem: React.FC = ({ return encounter?.obs?.filter( (item) => item?.order?.uuid === orderItem?.uuid ); - }, [encounter?.obs]); + }, [encounter?.obs, orderItem]); const filteredGroupedResults = useMemo(() => { let groupedResults = [];