Skip to content

Commit

Permalink
Updated the esm-framework and patient banner actions props
Browse files Browse the repository at this point in the history
  • Loading branch information
vasharma05 committed Oct 11, 2024
1 parent de07ee4 commit 94c956b
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
PatientBannerActionsMenu,
PatientBannerToggleContactDetailsButton,
PatientBannerContactDetails,
usePatient,
} from '@openmrs/esm-framework';
import { type SearchedPatient } from '../../../types';
import styles from './patient-banner.scss';
Expand All @@ -28,6 +29,7 @@ interface PatientBannerProps {
const PatientBanner: React.FC<PatientBannerProps> = ({ patient, patientUuid, hideActionsOverflow }) => {
const { t } = useTranslation();
const { currentVisit } = useVisit(patientUuid);
const { patient: fhirPatient, isLoading } = usePatient(patientUuid);
const { nonNavigationSelectPatientAction } = useContext(PatientSearchContext);

const patientName = patient.person.personName.display;
Expand Down Expand Up @@ -56,12 +58,6 @@ const PatientBanner: React.FC<PatientBannerProps> = ({ patient, patientUuid, hid

const isDeceased = !!patient.person.deathDate;

const fhirPatient = React.useMemo(() => {
return {
deceasedDateTime: patient.person.deathDate,
};
}, [patient]);

return (
<>
<div
Expand Down Expand Up @@ -115,6 +111,7 @@ const PatientBanner: React.FC<PatientBannerProps> = ({ patient, patientUuid, hid
launchPatientChart: true,
}}
isDeceased={patient.person.dead}
patient={fhirPatient}
/>
) : null}
{!isDeceased && !currentVisit && (
Expand Down
Loading

0 comments on commit 94c956b

Please sign in to comment.