-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Date of Birth to Year of Birth on Patient Details Page when DOB is Missing #9242
Fix: Date of Birth to Year of Birth on Patient Details Page when DOB is Missing #9242
Conversation
WalkthroughThe changes include updates to the localization JSON file for English, correcting the capitalization of "date_of_birth" and adding a new key "year_of_birth." Additionally, the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Warning Rate limit exceeded@AdityaJ2305 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 37 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
public/locale/en.json
(2 hunks)src/components/Patient/PatientDetailsTab/Demography.tsx
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- public/locale/en.json
🔇 Additional comments (2)
src/components/Patient/PatientDetailsTab/Demography.tsx (2)
18-18
: LGTM: Import addition is appropriate
The addition of patientAgeInYears
utility function import is well-placed alongside related utility functions.
191-193
: Verify i18n keys for label translation
The dynamic label switching between "date_of_birth" and "year_of_birth" looks good, but let's verify the i18n keys exist.
✅ Verification successful
Translation keys for date/year of birth are properly configured
Both "date_of_birth" and "year_of_birth" translation keys are present in the locale files with appropriate English translations. The dynamic label switching in the code will work as expected.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that both i18n keys exist in the translation files
# Expected: Both keys should be present in the translation files
# Search for the translation keys in all translation files
rg -l "date_of_birth|year_of_birth" "src/**/translations/*.json"
Length of output: 133
Script:
#!/bin/bash
# Let's first find where translation files are located
fd -e json translations
# Then search for the keys in those files
rg --json-keys "date_of_birth|year_of_birth" -l
Length of output: 511
Script:
#!/bin/bash
# Let's first find translation files
fd -e json
# Then search for the keys in those files
rg "\"(date_of_birth|year_of_birth)\"" -l
Length of output: 1060
Script:
#!/bin/bash
# Let's check the actual content of these keys in the locale files
rg -A 1 "\"(date_of_birth|year_of_birth)\"" "public/locale/en.json"
Length of output: 230
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
src/components/Patient/PatientDetailsTab/Demography.tsx
(2 hunks)
🧰 Additional context used
🪛 eslint
src/components/Patient/PatientDetailsTab/Demography.tsx
[error] 18-18: 'patientAgeInYears' is defined but never used. Allowed unused vars must match /^_/u.
(@typescript-eslint/no-unused-vars)
🪛 GitHub Check: lint
src/components/Patient/PatientDetailsTab/Demography.tsx
[failure] 18-18:
'patientAgeInYears' is defined but never used. Allowed unused vars must match /^_/u
🔇 Additional comments (1)
src/components/Patient/PatientDetailsTab/Demography.tsx (1)
191-203
: LGTM! Verify i18n keys exist
The implementation looks good:
- Uses dynamic labeling based on data availability
- Correctly uses backend-provided year_of_birth
- Maintains consistent age display format
Let's verify the i18n keys are properly defined:
✅ Verification successful
i18n keys are properly defined and used correctly
Both "date_of_birth" and "year_of_birth" translation keys are present in the English locale file with appropriate translations.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if the required i18n keys exist in the English locale file
# Search for the required keys in the locale file
rg -A 1 '"date_of_birth"|"year_of_birth"' public/locale/en.json
Length of output: 230
…om/AdityaJ2305/care_fe into issue/9241/yob_when_dob_is_missing
@AdityaJ2305 Your efforts have helped advance digital healthcare and TeleICU systems. 🚀 Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! 🙌 |
Proposed Changes
@ohcnetwork/care-fe-code-reviewers
Screenshot
Merge Checklist
Summary by CodeRabbit
New Features
Bug Fixes