From ebe3d352b012eedeec04d54e512c97481bbebf29 Mon Sep 17 00:00:00 2001 From: Mark Goodrich Date: Fri, 26 Jul 2024 13:38:46 -0400 Subject: [PATCH 1/2] (fix) O3-3661: Admission Requests List should include both Admission and Transfer requests --- packages/esm-ward-app/src/hooks/useInpatientRequest.ts | 5 ++++- .../ward-view-header/admission-requests-bar.component.tsx | 3 +-- .../src/ward-workspace/admission-requests.workspace.tsx | 6 ++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/esm-ward-app/src/hooks/useInpatientRequest.ts b/packages/esm-ward-app/src/hooks/useInpatientRequest.ts index 3767c1002..df374eedf 100644 --- a/packages/esm-ward-app/src/hooks/useInpatientRequest.ts +++ b/packages/esm-ward-app/src/hooks/useInpatientRequest.ts @@ -6,7 +6,10 @@ import useWardLocation from './useWardLocation'; const defaultRep = 'custom:(dispositionLocation,dispositionType,disposition,dispositionEncounter:full,patient:default,dispositionObsGroup,visit)'; -export function useInpatientRequest(dispositionType: Array = ['ADMIT'], rep: string = defaultRep) { +export function useInpatientRequest( + dispositionType: Array = ['ADMIT', 'TRANSFER'], + rep: string = defaultRep, +) { const { location } = useWardLocation(); const searchParams = new URLSearchParams(); searchParams.set('dispositionType', dispositionType.join(',')); diff --git a/packages/esm-ward-app/src/ward-view-header/admission-requests-bar.component.tsx b/packages/esm-ward-app/src/ward-view-header/admission-requests-bar.component.tsx index 7b24a4e1a..1562f4991 100644 --- a/packages/esm-ward-app/src/ward-view-header/admission-requests-bar.component.tsx +++ b/packages/esm-ward-app/src/ward-view-header/admission-requests-bar.component.tsx @@ -4,11 +4,10 @@ import { Button, InlineNotification } from '@carbon/react'; import { ArrowRightIcon, isDesktop, launchWorkspace, useLayoutType } from '@openmrs/esm-framework'; import { useInpatientRequest } from '../hooks/useInpatientRequest'; import { useTranslation } from 'react-i18next'; -import useWardLocation from '../hooks/useWardLocation'; import styles from './admission-requests.scss'; const AdmissionRequestsBar = () => { - const { inpatientRequests, isLoading, error } = useInpatientRequest(['ADMIT']); + const { inpatientRequests, isLoading, error } = useInpatientRequest(['ADMIT', 'TRANSFER']); const { t } = useTranslation(); const layout = useLayoutType(); diff --git a/packages/esm-ward-app/src/ward-workspace/admission-requests.workspace.tsx b/packages/esm-ward-app/src/ward-workspace/admission-requests.workspace.tsx index e097d462d..b3181d989 100644 --- a/packages/esm-ward-app/src/ward-workspace/admission-requests.workspace.tsx +++ b/packages/esm-ward-app/src/ward-workspace/admission-requests.workspace.tsx @@ -3,15 +3,13 @@ import styles from './admission-requests-workspace.scss'; import AdmissionRequestCard from './admission-request-card.component'; import { getCoreTranslation, type DefaultWorkspaceProps } from '@openmrs/esm-framework'; import { useInpatientRequest } from '../hooks/useInpatientRequest'; -import useWardLocation from '../hooks/useWardLocation'; import { Loading } from '@carbon/react'; import { InlineNotification } from '@carbon/react'; import { useTranslation } from 'react-i18next'; const AdmissionRequestsWorkspace: React.FC = () => { const { t } = useTranslation(); - const { inpatientRequests, isLoading, error } = useInpatientRequest(); - const admissionRequests = inpatientRequests?.filter((request) => request.dispositionType == 'ADMIT'); + const { inpatientRequests, isLoading, error } = useInpatientRequest(['ADMIT', 'TRANSFER']); if (isLoading) { return ; @@ -29,7 +27,7 @@ const AdmissionRequestsWorkspace: React.FC = () => { return (
- {admissionRequests.map((admissionRequest, indx) => ( + {inpatientRequests.map((admissionRequest, indx) => ( ))}
From 027d128446eef534f1df3c631d3255d2ee9b626c Mon Sep 17 00:00:00 2001 From: Brandon Istenes Date: Tue, 30 Jul 2024 10:05:04 -0400 Subject: [PATCH 2/2] Update packages/esm-ward-app/src/ward-workspace/admission-requests.workspace.tsx --- .../src/ward-workspace/admission-requests.workspace.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/esm-ward-app/src/ward-workspace/admission-requests.workspace.tsx b/packages/esm-ward-app/src/ward-workspace/admission-requests.workspace.tsx index b3181d989..03c5b765d 100644 --- a/packages/esm-ward-app/src/ward-workspace/admission-requests.workspace.tsx +++ b/packages/esm-ward-app/src/ward-workspace/admission-requests.workspace.tsx @@ -28,7 +28,7 @@ const AdmissionRequestsWorkspace: React.FC = () => { return (
{inpatientRequests.map((admissionRequest, indx) => ( - + ))}
);