diff --git a/client/src/pages/patients/patient-details/components/MedicalInfo.jsx b/client/src/pages/patients/patient-details/components/MedicalInfo.jsx index ba1b08e8..6916c2f8 100644 --- a/client/src/pages/patients/patient-details/components/MedicalInfo.jsx +++ b/client/src/pages/patients/patient-details/components/MedicalInfo.jsx @@ -22,29 +22,35 @@ export default function MedicalInfo({ allergies, medications, conditions }) {
Allergies - {allergies.length === 0 && None} - {allergies.map((entry) => ( - - {entry.allergy.name} - - ))} + {allergies.length === 0 ? ( + None + ) : ( + allergies.map((entry) => ( + + {entry.allergy.name} + + )) + )}
Medications - {medications.length === 0 && None} - {medications.map((entry) => ( - - {entry.medication.name} - - ))} + {medications.length === 0 ? ( + None + ) : ( + medications.map((entry) => ( + + {entry.medication.name} + + )) + )}
Conditions diff --git a/client/src/pages/patients/patient-details/components/Preferences.jsx b/client/src/pages/patients/patient-details/components/Preferences.jsx index c6f3bc01..26ed2a43 100644 --- a/client/src/pages/patients/patient-details/components/Preferences.jsx +++ b/client/src/pages/patients/patient-details/components/Preferences.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import { Paper, Text } from '@mantine/core'; import classes from '../PatientDetails.module.css'; - +import { humanize } from 'inflection'; const preferencesProps = { codeStatus: PropTypes.string, hospital: PropTypes.object, @@ -20,9 +20,9 @@ export default function Preferences({ codeStatus, hospital }) {
Code status - {codeStatus || 'Not provided'} + {codeStatus ? humanize(codeStatus) : 'Not provided'} Hospital - {hospital?.name} + {hospital ? hospital.name : 'Not provided'}