-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat) O3-3223: Add configurable element to include alerts on pending…
… items to patient card (#1218) * (feat) - O3-3222 - ward app - add patient card element to include risk factor obs within the current visit * rename codedObs to codedObsTags * remove orders * feat: add pending inpatient request * fix: fix alert message * fix: use layout spacing * rename WardPatientPendingTransfer --------- Co-authored-by: Chi Bong Ho <[email protected]>
- Loading branch information
1 parent
859a449
commit c199364
Showing
6 changed files
with
82 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
packages/esm-ward-app/src/ward-patient-card/row-elements/ward-patient-pending-transfer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React, { useMemo } from 'react'; | ||
import { Movement } from '@carbon/react/icons'; | ||
import styles from '../ward-patient-card.scss'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { type WardPatient } from '../../types'; | ||
|
||
export interface WardPatientTransferProps { | ||
wardPatient: WardPatient; | ||
} | ||
|
||
const WardPatientPendingTransfer: React.FC<WardPatientTransferProps> = ({ wardPatient }) => { | ||
const { t } = useTranslation(); | ||
|
||
const { dispositionType, dispositionLocation } = wardPatient?.inpatientRequest; | ||
const message = useMemo(() => { | ||
if (dispositionType === 'TRANSFER') { | ||
if (dispositionLocation) { | ||
return t('transferToDispositionLocation', 'Transfer to {{location}}', { location: dispositionLocation.name }); | ||
} | ||
return t('pendingTransfer', 'Pending Transfer'); | ||
} | ||
if (dispositionType === 'DISCHARGE') { | ||
return t('pendingDischarge', 'Pending Discharge'); | ||
} | ||
return ''; | ||
}, [dispositionType, dispositionLocation]); | ||
|
||
if (!(dispositionType === 'TRANSFER' || dispositionType === 'DISCHARGE')) return null; | ||
|
||
return ( | ||
<div className={styles.wardPatientCardDispositionTypeContainer}> | ||
<Movement className={styles.movementIcon} size="24" /> | ||
{message} | ||
</div> | ||
); | ||
}; | ||
|
||
export default WardPatientPendingTransfer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters