diff --git a/packages/esm-patient-banner-app/src/banner-tags/visit-tag.component.tsx b/packages/esm-patient-banner-app/src/banner-tags/visit-tag.component.tsx index 1629f696ce..cb573e1672 100644 --- a/packages/esm-patient-banner-app/src/banner-tags/visit-tag.component.tsx +++ b/packages/esm-patient-banner-app/src/banner-tags/visit-tag.component.tsx @@ -12,7 +12,7 @@ interface VisitTagProps { function VisitTag({ patientUuid, patient }: VisitTagProps) { const { activeVisit } = useVisitOrOfflineVisit(patientUuid); - const isNotDeceased = !patient.deceasedDateTime; + const isNotDeceased = !patient?.deceasedDateTime; return activeVisit && isNotDeceased ? : null; } diff --git a/packages/esm-patient-banner-app/src/banner/patient-banner.component.tsx b/packages/esm-patient-banner-app/src/banner/patient-banner.component.tsx index d1e56d7ea3..e13aa71be5 100644 --- a/packages/esm-patient-banner-app/src/banner/patient-banner.component.tsx +++ b/packages/esm-patient-banner-app/src/banner/patient-banner.component.tsx @@ -154,8 +154,8 @@ const PatientBanner: React.FC = ({ )}
- {getGender(patient.gender)} · {age(patient.birthDate)} ·{' '} - {formatDate(parseDate(patient.birthDate), { mode: 'wide', time: false })} + {getGender(patient?.gender)} · {age(patient?.birthDate)} ·{' '} + {formatDate(parseDate(patient?.birthDate), { mode: 'wide', time: false })}
diff --git a/packages/esm-patient-chart-app/src/deceased/deceased.resource.ts b/packages/esm-patient-chart-app/src/deceased/deceased.resource.ts index fd953f71e0..78d7300e21 100644 --- a/packages/esm-patient-chart-app/src/deceased/deceased.resource.ts +++ b/packages/esm-patient-chart-app/src/deceased/deceased.resource.ts @@ -46,8 +46,8 @@ export function usePatientDeceased(patientUuid: string) { } return { - deathDate: patient.deceasedDateTime, - isDead: patient.deceasedBoolean ?? Boolean(patient.deceasedDateTime), + deathDate: patient?.deceasedDateTime, + isDead: patient?.deceasedBoolean ?? Boolean(patient?.deceasedDateTime), isLoading: isPatientLoading, }; }