-
Notifications
You must be signed in to change notification settings - Fork 515
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
Reorder Patient Search buttons #9319
Conversation
WalkthroughThe changes in the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 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. |
Deploying care-fe with Cloudflare Pages
|
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: 0
🧹 Outside diff range and nitpick comments (1)
src/components/Patient/ManagePatients.tsx (1)
Phone number validation is inconsistent across the codebase
The verification reveals inconsistencies in phone number validation:
phonePreg
in common/validation.tsx uses regex/^((\+91|91|0)[- ]{0,1})?[123456789]\d{9}$/
which validates 10-digit numbers with optional +91/91/0 prefix- DischargedPatientsList.tsx checks for length >= 13
- FacilityCreate.tsx checks for length == 10
- Some components automatically append +91 prefix while others don't
- Different validation rules for toll-free numbers starting with 1800
These inconsistencies could lead to validation issues and inconsistent user experience.
🔗 Analysis chain
Line range hint
800-815
: Verify phone number validation behavior.The validation logic ensures phone numbers are either empty or at least 13 characters long, which is consistent with the existing pattern. However, let's verify this validation pattern is used consistently across the codebase.
Let me gather more information about phone number validation patterns across the codebase to ensure we have a complete picture.
Let me check one more thing to understand the phone number validation pattern defined in the common validation file.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for consistent phone number validation patterns across the codebase # Search for phone number validation patterns rg -A 2 "phone_number.*length.*13" # Search for similar validation in emergency contact numbers rg -A 2 "emergency.*phone.*length.*13"Length of output: 1653
Script:
#!/bin/bash # Search for phone number validation patterns using different approaches # Look for phone-related validation rules rg -A 3 "phone.*validation|validatePhone|isValidPhone" # Look for phone number length checks with different numbers rg -A 2 "phone.*length.*[0-9]+" # Look for phone number related form fields and their validation ast-grep --pattern 'phone: $$$'Length of output: 2961
Script:
#!/bin/bash # Check the phone number validation pattern in common validation file cat src/common/validation.ts # Also look for any phone-related regex patterns rg -A 2 "phonePreg|PHONE_REGEX"Length of output: 1741
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (1)
src/components/Patient/ManagePatients.tsx
(1 hunks)
🔇 Additional comments (1)
src/components/Patient/ManagePatients.tsx (1)
768-775
: LGTM! Search option reordering aligns with PR objectives.
The phone number search option has been correctly repositioned while maintaining all its essential properties and validation logic.
CARE Run #4003
Run Properties:
|
Project |
CARE
|
Branch Review |
reorder-patient-search
|
Run status |
Passed #4003
|
Run duration | 05m 13s |
Commit |
9a510b16b3: Reorder Patient Search buttons
|
Committer | Shivank Kacker |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
144
|
View all changes introduced in this branch ↗︎ |
package-lock.json
Outdated
@@ -119,6 +119,21 @@ | |||
"node": ">=22.11.0" | |||
} | |||
}, | |||
"apps/care_scribe_fe": { |
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.
Are the changes in this file needed for this PR 🤔
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.
Whoops forgot to recheck files, thanks
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.
other than lockfile lgtm
90b567f
to
9a510b1
Compare
LGTM |
@shivankacker 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
Merge Checklist
Summary by CodeRabbit
New Features
phone_number
andemergency_contact_number
as search options.Bug Fixes
Style