-
Notifications
You must be signed in to change notification settings - Fork 486
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
Adds support for review missed logic #8607 #9486
base: develop
Are you sure you want to change the base?
Adds support for review missed logic #8607 #9486
Conversation
Warning Rate limit exceeded@Sancharisingh has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 4 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. 📒 Files selected for processing (1)
WalkthroughThe pull request introduces changes to the patient management interface, specifically in the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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. |
Try to salvage the other PR instead #9259 Since you haven't force pushed, you should be able to rollback all the changes (just push your new code on stash beforehand) and then merge all the changes since you opened the PR/merge and pop from stash. |
Hi @Jacobjeevan @rithviknishad , Thank you for your guidance! I have made the changes you suggested. Could you please reopen PR #9259 so I can push the updated changes? Looking forward to your response. Best regards, |
You should have the option to reopen it 👍 But looks like the branch is deleted, so let's use this PR instead then. |
<Badge | ||
variant={ | ||
dayjs().isAfter(patient.review_time) | ||
? "purple" |
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.
Let's use the destructive instead 🤔 That should be in line in what we had originally (red color).
Primary should work for the green color.
Try both of those and remove success/purple styles from badge component if they work.
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.
Ok
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.
There is no primary, so I changed the name of 'success' to 'primary.'
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.
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.
@Sancharisingh Can you do the above as well (switch existing chips in the component to use badge)?
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.
yes
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.
Hi @Jacobjeevan,
I updated the Chip to Badge in the ManagePatient file. Should this change be applied project-wide, or is it fine to keep other instances as they are?
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.
Hi @Jacobjeevan, I updated the Chip to Badge in the ManagePatient file. Should this change be applied project-wide, or is it fine to keep other instances as they are?
Just this file/component is enough.
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.
Okay.
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
🧹 Nitpick comments (4)
src/components/ui/badge.tsx (1)
59-61
: Consider using aria-describedby for tooltipFor better accessibility, consider using aria-describedby to associate the tooltip text with the badge element.
+ <div + role="status" - aria-label={tooltip || children?.toString()} + aria-describedby={tooltip ? "badge-tooltip" : undefined} className={cn(badgeVariants({ variant, size }), className)} - title={tooltip} + {...props} + > + {tooltip && ( + <span id="badge-tooltip" className="sr-only"> + {tooltip} + </span> + )}src/components/Patient/ManagePatients.tsx (3)
549-556
: Consider consolidating duplicate badge stylingMultiple badges share the same styling pattern (small size, destructive variant, startIcon). Consider extracting this into a reusable component to reduce duplication.
+ const AlertBadge = ({ children, ...props }) => ( + <span className="relative inline-flex"> + <Badge + size="small" + variant="destructive" + startIcon="l-notes" + {...props} + > + {children} + </Badge> + <span className="absolute -right-1 -top-1 flex h-3 w-3 items-center justify-center"> + <span className="center absolute inline-flex h-4 w-4 animate-ping rounded-full bg-red-400"></span> + <span className="relative inline-flex h-3 w-3 rounded-full bg-red-600"></span> + </span> + </span> + );Also applies to: 565-577
635-642
: Consider using consistent variant namingThe badges use a mix of variant styles - some use semantic variants (primary/destructive) while others use custom styling. Consider standardizing this approach.
- variant="custom" - className="bg-pink-100 text-pink-600" + variant="antenatal"Add to badge.tsx:
variants: { variant: { + antenatal: "bg-pink-100 text-pink-600", + medical: "bg-blue-100 text-blue-600", } }Also applies to: 645-652
1035-1123
: Consider grouping related filter badgesThe filter badges list is quite long and could be more maintainable if grouped by category (e.g., patient info, dates, facility info, etc.).
+ const patientInfoBadges = [ + phoneNumber("Primary number", "phone_number"), + phoneNumber("Emergency number", "emergency_phone_number"), + badge("Patient name", "name"), + badge("IP/OP number", "patient_no"), + ]; + const dateBadges = [ + ...dateRange("Modified", "modified_date"), + ...dateRange("Created", "created_date"), + ...dateRange("Admitted", "last_consultation_encounter_date"), + ...dateRange("Discharged", "last_consultation_discharge_date"), + ]; badges={({ badge, value, kasp, phoneNumber, dateRange, range, ordering }) => [ + ...patientInfoBadges, + ...dateBadges, // ... rest of the badges ]}🧰 Tools
🪛 eslint
[error] 1035-1035: Delete
··
(prettier/prettier)
[error] 1036-1036: Delete
··
(prettier/prettier)
[error] 1037-1037: Delete
··
(prettier/prettier)
[error] 1038-1038: Replace
··············
with············
(prettier/prettier)
[error] 1039-1039: Delete
··
(prettier/prettier)
[error] 1040-1040: Delete
··
(prettier/prettier)
[error] 1041-1041: Replace
··············
with············
(prettier/prettier)
[error] 1042-1042: Delete
··
(prettier/prettier)
[error] 1043-1043: Delete
··
(prettier/prettier)
[error] 1044-1044: Replace
··············
with············
(prettier/prettier)
[error] 1045-1045: Delete
··
(prettier/prettier)
[error] 1046-1046: Delete
··
(prettier/prettier)
[error] 1047-1047: Replace
··············
with············
(prettier/prettier)
[error] 1048-1048: Delete
··
(prettier/prettier)
[error] 1049-1049: Delete
··
(prettier/prettier)
[error] 1050-1050: Delete
··
(prettier/prettier)
[error] 1051-1051: Delete
··
(prettier/prettier)
[error] 1052-1052: Replace
··············
with············
(prettier/prettier)
[error] 1053-1053: Delete
··
(prettier/prettier)
[error] 1054-1054: Delete
··
(prettier/prettier)
[error] 1055-1055: Delete
··
(prettier/prettier)
[error] 1056-1056: Delete
··
(prettier/prettier)
[error] 1057-1057: Replace
··················
with················
(prettier/prettier)
[error] 1058-1058: Delete
··
(prettier/prettier)
[error] 1059-1059: Delete
··
(prettier/prettier)
[error] 1060-1060: Delete
··
(prettier/prettier)
[error] 1061-1061: Delete
··
(prettier/prettier)
[error] 1062-1062: Replace
················
with··············
(prettier/prettier)
[error] 1063-1063: Delete
··
(prettier/prettier)
[error] 1064-1064: Delete
··
(prettier/prettier)
[error] 1065-1065: Delete
··
(prettier/prettier)
[error] 1066-1066: Delete
··
(prettier/prettier)
[error] 1067-1067: Delete
··
(prettier/prettier)
[error] 1068-1068: Delete
··
(prettier/prettier)
[error] 1069-1069: Replace
··················
with················
(prettier/prettier)
[error] 1070-1070: Insert
··
(prettier/prettier)
[error] 1071-1071: Delete
··
(prettier/prettier)
[error] 1072-1072: Delete
··
(prettier/prettier)
[error] 1073-1073: Delete
··
(prettier/prettier)
[error] 1074-1074: Delete
··
(prettier/prettier)
[error] 1075-1075: Delete
··
(prettier/prettier)
[error] 1076-1076: Delete
··
(prettier/prettier)
[error] 1077-1077: Delete
··
(prettier/prettier)
[error] 1078-1078: Delete
··
(prettier/prettier)
[error] 1079-1079: Replace
··············
with············
(prettier/prettier)
[error] 1080-1080: Delete
··
(prettier/prettier)
[error] 1081-1081: Delete
··
(prettier/prettier)
[error] 1082-1082: Delete
··
(prettier/prettier)
[error] 1083-1083: Delete
··
(prettier/prettier)
[error] 1084-1084: Delete
··
(prettier/prettier)
[error] 1086-1086: Delete
··
(prettier/prettier)
[error] 1087-1087: Replace
··············
with············
(prettier/prettier)
[error] 1088-1088: Delete
··
(prettier/prettier)
[error] 1089-1089: Delete
··
(prettier/prettier)
[error] 1090-1090: Delete
··
(prettier/prettier)
[error] 1091-1091: Delete
··
(prettier/prettier)
[error] 1092-1092: Replace
··············
with············
(prettier/prettier)
[error] 1093-1093: Delete
··
(prettier/prettier)
[error] 1094-1094: Delete
··
(prettier/prettier)
[error] 1095-1095: Delete
··
(prettier/prettier)
[error] 1096-1096: Delete
··
(prettier/prettier)
[error] 1097-1097: Replace
··············
with············
(prettier/prettier)
[error] 1098-1098: Delete
··
(prettier/prettier)
[error] 1099-1099: Delete
··
(prettier/prettier)
[error] 1100-1100: Delete
··
(prettier/prettier)
[error] 1101-1101: Delete
··
(prettier/prettier)
[error] 1102-1102: Replace
··············
with············
(prettier/prettier)
[error] 1103-1103: Delete
··
(prettier/prettier)
[error] 1104-1104: Delete
··
(prettier/prettier)
[error] 1105-1105: Delete
··
(prettier/prettier)
[error] 1106-1106: Delete
··
(prettier/prettier)
[error] 1107-1107: Delete
··
(prettier/prettier)
[error] 1108-1108: Delete
··
(prettier/prettier)
[error] 1109-1109: Replace
··············
with············
(prettier/prettier)
[error] 1110-1110: Delete
··
(prettier/prettier)
[error] 1111-1111: Delete
··
(prettier/prettier)
[error] 1112-1112: Delete
··
(prettier/prettier)
[error] 1113-1113: Delete
··
(prettier/prettier)
[error] 1114-1114: Replace
················
with··············
(prettier/prettier)
[error] 1115-1115: Delete
··
(prettier/prettier)
[error] 1116-1116: Replace
··············
with············
(prettier/prettier)
[error] 1117-1117: Delete
··
(prettier/prettier)
[error] 1118-1118: Delete
··
(prettier/prettier)
[error] 1119-1119: Delete
··
(prettier/prettier)
[error] 1120-1120: Delete
··
(prettier/prettier)
[error] 1121-1121: Replace
··················
with················
(prettier/prettier)
[error] 1122-1122: Delete
··
(prettier/prettier)
[error] 1123-1123: Delete
··
(prettier/prettier)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/components/Patient/ManagePatients.tsx
(9 hunks)src/components/ui/badge.tsx
(2 hunks)
🧰 Additional context used
🪛 eslint
src/components/ui/badge.tsx
[error] 3-5: Replace import·CareIcon,·{·IconName·}·from·"@/CAREUI/icons/CareIcon";⏎⏎import·{·cn·}·from·"@/lib/utils
with ⏎import·{·cn·}·from·"@/lib/utils";⏎⏎import·CareIcon,·{·IconName·}·from·"@/CAREUI/icons/CareIcon
(prettier/prettier)
src/components/Patient/ManagePatients.tsx
[error] 113-113: Delete ··
(prettier/prettier)
[error] 463-463: Delete ··
(prettier/prettier)
[error] 565-565: Delete ··
(prettier/prettier)
[error] 566-566: Delete ··
(prettier/prettier)
[error] 567-567: Delete ··
(prettier/prettier)
[error] 568-568: Delete ··
(prettier/prettier)
[error] 586-589: Replace ⏎··························size="small"⏎··························variant="primary"⏎························
with ·size="small"·variant="primary"
(prettier/prettier)
[error] 590-590: Insert ⏎····························
(prettier/prettier)
[error] 591-591: Delete ··
(prettier/prettier)
[error] 592-593: Delete ⏎
(prettier/prettier)
[error] 611-611: Insert ··
(prettier/prettier)
[error] 612-612: Replace ··························
with ····························
(prettier/prettier)
[error] 614-614: Insert ··
(prettier/prettier)
[error] 615-615: Insert ··
(prettier/prettier)
[error] 628-629: Delete ⏎
(prettier/prettier)
[error] 1035-1035: Delete ··
(prettier/prettier)
[error] 1036-1036: Delete ··
(prettier/prettier)
[error] 1037-1037: Delete ··
(prettier/prettier)
[error] 1038-1038: Replace ··············
with ············
(prettier/prettier)
[error] 1039-1039: Delete ··
(prettier/prettier)
[error] 1040-1040: Delete ··
(prettier/prettier)
[error] 1041-1041: Replace ··············
with ············
(prettier/prettier)
[error] 1042-1042: Delete ··
(prettier/prettier)
[error] 1043-1043: Delete ··
(prettier/prettier)
[error] 1044-1044: Replace ··············
with ············
(prettier/prettier)
[error] 1045-1045: Delete ··
(prettier/prettier)
[error] 1046-1046: Delete ··
(prettier/prettier)
[error] 1047-1047: Replace ··············
with ············
(prettier/prettier)
[error] 1048-1048: Delete ··
(prettier/prettier)
[error] 1049-1049: Delete ··
(prettier/prettier)
[error] 1050-1050: Delete ··
(prettier/prettier)
[error] 1051-1051: Delete ··
(prettier/prettier)
[error] 1052-1052: Replace ··············
with ············
(prettier/prettier)
[error] 1053-1053: Delete ··
(prettier/prettier)
[error] 1054-1054: Delete ··
(prettier/prettier)
[error] 1055-1055: Delete ··
(prettier/prettier)
[error] 1056-1056: Delete ··
(prettier/prettier)
[error] 1057-1057: Replace ··················
with ················
(prettier/prettier)
[error] 1058-1058: Delete ··
(prettier/prettier)
[error] 1059-1059: Delete ··
(prettier/prettier)
[error] 1060-1060: Delete ··
(prettier/prettier)
[error] 1061-1061: Delete ··
(prettier/prettier)
[error] 1062-1062: Replace ················
with ··············
(prettier/prettier)
[error] 1063-1063: Delete ··
(prettier/prettier)
[error] 1064-1064: Delete ··
(prettier/prettier)
[error] 1065-1065: Delete ··
(prettier/prettier)
[error] 1066-1066: Delete ··
(prettier/prettier)
[error] 1067-1067: Delete ··
(prettier/prettier)
[error] 1068-1068: Delete ··
(prettier/prettier)
[error] 1069-1069: Replace ··················
with ················
(prettier/prettier)
[error] 1070-1070: Insert ··
(prettier/prettier)
[error] 1071-1071: Delete ··
(prettier/prettier)
[error] 1072-1072: Delete ··
(prettier/prettier)
[error] 1073-1073: Delete ··
(prettier/prettier)
[error] 1074-1074: Delete ··
(prettier/prettier)
[error] 1075-1075: Delete ··
(prettier/prettier)
[error] 1076-1076: Delete ··
(prettier/prettier)
[error] 1077-1077: Delete ··
(prettier/prettier)
[error] 1078-1078: Delete ··
(prettier/prettier)
[error] 1079-1079: Replace ··············
with ············
(prettier/prettier)
[error] 1080-1080: Delete ··
(prettier/prettier)
[error] 1081-1081: Delete ··
(prettier/prettier)
[error] 1082-1082: Delete ··
(prettier/prettier)
[error] 1083-1083: Delete ··
(prettier/prettier)
[error] 1084-1084: Delete ··
(prettier/prettier)
[error] 1086-1086: Delete ··
(prettier/prettier)
[error] 1087-1087: Replace ··············
with ············
(prettier/prettier)
[error] 1088-1088: Delete ··
(prettier/prettier)
[error] 1089-1089: Delete ··
(prettier/prettier)
[error] 1090-1090: Delete ··
(prettier/prettier)
[error] 1091-1091: Delete ··
(prettier/prettier)
[error] 1092-1092: Replace ··············
with ············
(prettier/prettier)
[error] 1093-1093: Delete ··
(prettier/prettier)
[error] 1094-1094: Delete ··
(prettier/prettier)
[error] 1095-1095: Delete ··
(prettier/prettier)
[error] 1096-1096: Delete ··
(prettier/prettier)
[error] 1097-1097: Replace ··············
with ············
(prettier/prettier)
[error] 1098-1098: Delete ··
(prettier/prettier)
[error] 1099-1099: Delete ··
(prettier/prettier)
[error] 1100-1100: Delete ··
(prettier/prettier)
[error] 1101-1101: Delete ··
(prettier/prettier)
[error] 1102-1102: Replace ··············
with ············
(prettier/prettier)
[error] 1103-1103: Delete ··
(prettier/prettier)
[error] 1104-1104: Delete ··
(prettier/prettier)
[error] 1105-1105: Delete ··
(prettier/prettier)
[error] 1106-1106: Delete ··
(prettier/prettier)
[error] 1107-1107: Delete ··
(prettier/prettier)
[error] 1108-1108: Delete ··
(prettier/prettier)
[error] 1109-1109: Replace ··············
with ············
(prettier/prettier)
[error] 1110-1110: Delete ··
(prettier/prettier)
[error] 1111-1111: Delete ··
(prettier/prettier)
[error] 1112-1112: Delete ··
(prettier/prettier)
[error] 1113-1113: Delete ··
(prettier/prettier)
[error] 1114-1114: Replace ················
with ··············
(prettier/prettier)
[error] 1115-1115: Delete ··
(prettier/prettier)
[error] 1116-1116: Replace ··············
with ············
(prettier/prettier)
[error] 1117-1117: Delete ··
(prettier/prettier)
[error] 1118-1118: Delete ··
(prettier/prettier)
[error] 1119-1119: Delete ··
(prettier/prettier)
[error] 1120-1120: Delete ··
(prettier/prettier)
[error] 1121-1121: Replace ··················
with ················
(prettier/prettier)
[error] 1122-1122: Delete ··
(prettier/prettier)
[error] 1123-1123: Delete ··
(prettier/prettier)
[error] 1124-1124: Delete ··
(prettier/prettier)
[error] 1125-1125: Delete ··
(prettier/prettier)
🔇 Additional comments (5)
src/components/ui/badge.tsx (3)
21-23
: Consider using semantic color tokens for the primary variant
The primary variant is using specific color values like bg-green-500
. Consider using semantic color tokens (e.g., bg-primary-500
) to maintain consistency with the design system and make it easier to update colors globally.
- "border-transparent bg-green-500 text-gray-50 shadow hover:bg-green-500/80 dark:bg-green-900 dark:text-gray-50 dark:hover:bg-green-900/80",
+ "border-transparent bg-primary-500 text-gray-50 shadow hover:bg-primary-500/80 dark:bg-primary-900 dark:text-gray-50 dark:hover:bg-primary-900/80",
25-28
: LGTM: Size variants are well defined
The size variants provide good flexibility with appropriate spacing and text size adjustments.
40-44
: LGTM: Props interface is well structured
The BadgeProps interface cleanly extends HTMLDivElement props and includes well-typed optional properties for icons and tooltip.
src/components/Patient/ManagePatients.tsx (2)
599-616
: LGTM: Review missed logic is well implemented
The implementation correctly:
- Checks for review time and review interval
- Shows appropriate messages for missed and upcoming reviews
- Uses correct variants (destructive/primary) based on status
🧰 Tools
🪛 eslint
[error] 611-611: Insert ··
(prettier/prettier)
[error] 612-612: Replace ··························
with ····························
(prettier/prettier)
[error] 614-614: Insert ··
(prettier/prettier)
[error] 615-615: Insert ··
(prettier/prettier)
586-593
: LGTM: Patient information badges are well structured
The badges for patient numbers and IP day count are appropriately styled and provide clear information.
Also applies to: 622-629
🧰 Tools
🪛 eslint
[error] 586-589: Replace ⏎··························size="small"⏎··························variant="primary"⏎························
with ·size="small"·variant="primary"
(prettier/prettier)
[error] 590-590: Insert ⏎····························
(prettier/prettier)
[error] 591-591: Delete ··
(prettier/prettier)
[error] 592-593: Delete ⏎
(prettier/prettier)
Seeing all these together 😅 and all the consultations filed ones, I feel these might be a bit too intense. Let's ping @vinutv |
Yeah, I am also thinking of modifying all these variants. |
Proposed Changes
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
New Features
Badge
component for patient status notifications, replacing the previousChip
component.Bug Fixes
Badge
component for various notifications.