Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix date display #410

Merged
merged 3 commits into from
Feb 10, 2024
Merged

Fix date display #410

merged 3 commits into from
Feb 10, 2024

Conversation

crosskayla
Copy link
Contributor

Issue

On the homepage dashboard to the right, where it says [Patient Name] | [Age] years | Gender:

  • A patient birthdate of, for example, "2000-08-01" will incorrectly return 24 years on the homepage
  • It should return the correct age 23 years (since the birthday has not passed yet this year).

I believe this was an issue because it was somehow parsing the year but not the month and day of the birthDate, at least when there are multiple patient objects in the DB.

Fix

Check if it is an array before calculating age.

Other considerations

It is not an issue in SourceDetailComponent's function getPatientAge(), because that uses a flattener helper method getPath(). I can centralize this logic instead in the PR, if you'd like.

@CLAassistant
Copy link

CLAassistant commented Feb 9, 2024

CLA assistant check
All committers have signed the CLA.

@AnalogJ
Copy link
Member

AnalogJ commented Feb 10, 2024

this is great, thanks for the PR @crosskayla !

I'm ok with the code duplication for now. We'll need to make significant changes to the frontend FHIR resource processing soon.

@AnalogJ AnalogJ merged commit 4f986e9 into fastenhealth:main Feb 10, 2024
2 of 4 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants