Skip to content

Commit

Permalink
O3-3212: Ward App - add configurable extension to include address com…
Browse files Browse the repository at this point in the history
…ponent (#1240)

(don't display divider dot if no value present)
  • Loading branch information
mogoodrich authored Jul 18, 2024
1 parent 664edfa commit fbbaa35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ const WardPatientAge: WardPatientCardElement = ({ patient }) => {
const { t } = useTranslation();
// TODO: BED-10
// make the backend return patient.person.birthdate so we can use the age() function to calculate age
return (
return patient?.person?.age ? (
<div>
{t('yearsOld', '{{age}} yrs', {
age: patient?.person?.age,
})}
</div>
) : (
<></>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ const wardPatientAddress = (config: PatientAddressElementConfig) => {

return (
<div className={styles.wardPatientAddress}>
{addressFields?.map((field, i) => <div key={i}>{preferredAddress?.[field] as string}</div>)}
{addressFields?.map((field, i) =>
preferredAddress?.[field] ? <div key={i}>{preferredAddress?.[field] as string}</div> : <></>,
)}
</div>
);
};
Expand Down

0 comments on commit fbbaa35

Please sign in to comment.