Display patient age in mm dd when younger than 1y #6342
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WHAT
🤖 Generated by Copilot at 7274436
This pull request adds a new utility function
formatAge
that handles the display logic of the patient's age based on their date of birth and age in years. The function is used in various components across the application to show the patient's age more accurately and consistently with a unit suffix. The components that are updated include consultation details, investigation reports, legacy monitor card, treatment summary, patient manager, patient home, patient info card, sample details, shifting list view, shift details, and shifting board.Proposed Changes
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
HOW
🤖 Generated by Copilot at 7274436
formatAge
function tosrc/Utils/utils.ts
to display the age of the patient based on their date of birth and age in years (link)formatAge
function fromsrc/Utils/utils.ts
in various components that show the age of the patient (link, link, link, link, link, link, link, link, link, link, link, link)addTwoNumbers
function withformatAge
function inConsultationUpdatesTab.tsx
to display the age of the patient based on their date of birth and age in years (link)date_of_birth
property from the API response inReports/index.tsx
and pass it to theReportTable.tsx
component (link, link, link)formatAge
function to display the age of the patient based on their date of birth and age in years in various components, optionally adding a suffix to indicate the unit of age (link, link, link, link, link, link, link, link, link, link, link, link)