Skip to content

Commit

Permalink
Fix: Date of Birth to Year of Birth on Patient Details Page when DOB …
Browse files Browse the repository at this point in the history
…is Missing (#9242)
  • Loading branch information
AdityaJ2305 authored Nov 29, 2024
1 parent c407120 commit 7c9751d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@
"date_and_time": "Date and Time",
"date_declared_positive": "Date of declaring positive",
"date_of_admission": "Date of Admission",
"date_of_birth": "Date of birth",
"date_of_birth": "Date of Birth",
"date_of_positive_covid_19_swab": "Date of Positive Covid 19 Swab",
"date_of_result": "Covid confirmation date",
"date_of_return": "Date of Return",
Expand Down Expand Up @@ -1433,6 +1433,7 @@
"why_the_asset_is_not_working": "Why the asset is not working?",
"width": "Width ({{unit}})",
"working_status": "Working Status",
"year_of_birth": "Year of Birth",
"years": "years",
"years_of_experience": "Years of Experience",
"years_of_experience_of_the_doctor": "Years of Experience of the Doctor",
Expand Down
11 changes: 9 additions & 2 deletions src/components/Patient/PatientDetailsTab/Demography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,19 @@ export const Demography = (props: PatientProps) => {
),
},
{
label: t("date_of_birth"),
value: (
label: t(
patientData.date_of_birth ? "date_of_birth" : "year_of_birth",
),
value: patientData.date_of_birth ? (
<>
{dayjs(patientData.date_of_birth).format("DD MMM YYYY")} (
{formatPatientAge(patientData, true)})
</>
) : (
<>
{patientData.year_of_birth} ({formatPatientAge(patientData, true)}
)
</>
),
},
{
Expand Down

0 comments on commit 7c9751d

Please sign in to comment.