-
Notifications
You must be signed in to change notification settings - Fork 992
Fixed Max level org required * not displaying #15055
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
base: develop
Are you sure you want to change the base?
Fixed Max level org required * not displaying #15055
Conversation
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughThe changes adjust how required fields are determined for government organization selectors in patient registration. The component now uses the Changes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (13)**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursorrules)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.cursorrules)
Files:
**/*.{tsx,jsx}📄 CodeRabbit inference engine (.cursorrules)
Files:
src/**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
src/**/*.{ts,tsx,css}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
src/pages/**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
src/**/*.{tsx,ts}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
src/**/*.{tsx,css}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.tsx📄 CodeRabbit inference engine (.cursor/rules/02-coding-standards.mdc)
Files:
**/*.{tsx,ts}📄 CodeRabbit inference engine (.cursor/rules/04-ui-components.mdc)
Files:
**/*.{ts,tsx,js,jsx,json,css,scss,html}📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/components/**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
🧠 Learnings (21)📚 Learning: 2024-12-11T01:32:56.923ZApplied to files:
📚 Learning: 2025-11-22T19:18:25.795ZApplied to files:
📚 Learning: 2025-10-07T08:56:41.983ZApplied to files:
📚 Learning: 2025-07-14T18:35:29.341ZApplied to files:
📚 Learning: 2024-12-02T18:50:29.685ZApplied to files:
📚 Learning: 2025-09-22T19:02:08.124ZApplied to files:
📚 Learning: 2025-11-25T13:52:19.758ZApplied to files:
📚 Learning: 2025-11-25T13:51:41.208ZApplied to files:
📚 Learning: 2025-11-25T13:52:19.758ZApplied to files:
📚 Learning: 2025-10-12T04:44:19.609ZApplied to files:
📚 Learning: 2025-12-17T19:47:58.152ZApplied to files:
📚 Learning: 2025-12-22T10:16:36.690ZApplied to files:
📚 Learning: 2024-11-20T18:54:27.563ZApplied to files:
📚 Learning: 2025-11-25T13:52:19.758ZApplied to files:
📚 Learning: 2025-11-25T13:53:20.837ZApplied to files:
📚 Learning: 2025-11-25T13:52:33.081ZApplied to files:
📚 Learning: 2025-11-25T13:52:51.914ZApplied to files:
📚 Learning: 2025-11-25T13:50:54.683ZApplied to files:
📚 Learning: 2025-11-25T13:52:51.914ZApplied to files:
📚 Learning: 2024-11-07T02:35:08.706ZApplied to files:
📚 Learning: 2025-11-25T13:51:23.408ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Pull request overview
This PR fixes an issue where the required asterisk (*) was not displaying correctly for government organization selector fields. The fix corrects the logic for determining when organization level selections should be marked as required, specifically addressing the case where a minimum required depth is configured.
Key Changes:
- Fixed inverted boolean logic for the
requiredprop in PatientRegistration - Updated required field logic in GovtOrganizationSelector to properly handle requiredDepth parameter
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/components/Patient/PatientRegistration.tsx | Corrected boolean logic - changed required={minGeoOrganizationLevelsRequired == null} to required={minGeoOrganizationLevelsRequired != null} to properly mark field as required when min levels are set |
| src/pages/Organization/components/GovtOrganizationSelector.tsx | Updated required prop logic to conditionally check depth: when requiredDepth is set, only levels below the required depth are marked as required |
🎭 Playwright Test ResultsStatus: ✅ Passed
📊 Detailed results are available in the playwright-final-report artifact. Run: #4451 |
nihal467
left a comment
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
src/pages/Organization/components/GovtOrganizationSelector.tsx (2)
139-160:requiredDepthcheck uses staleselectedLevels.length(can incorrectly clear/set value).
setSelectedLevelsis async; usingselectedLevels.lengthon Lines 153-155 can be stale for the selection that just happened. This can break the “depth reached” case.Minimal fix
- } else if ( - requiredDepth != null && - selectedLevels.length >= requiredDepth - ) { + } else if (requiredDepth != null && index + 1 >= requiredDepth) { onChange(organization.id); } else { onChange(""); }
175-189: Potential off-by-one +refpropagation is broken here (Reactrefis special).
- Line 186:
index < requiredDepthis correct only ifrequiredDepthmeans “number of required levels”. If it instead represents a “max required level index”, you likely wantindex <= requiredDepth. Please confirm against the.envsemantics forminGeoOrganizationLevelsRequired.- Line 181:
ref={props.ref}on a function component won’t be available as a normal prop insideOrganizationLevelSelectunless it’sforwardRef’d. This likely meansAutocompletenever receives the RHF ref, and you may also get “Function components cannot be given refs” warnings from<GovtOrganizationSelector {...field} />callers.Proposed direction (pick one)
Option A (simplest): stop passing RHF
refintoGovtOrganizationSelectorat the callsite (recommended unless you truly need focus/registration on this control). See corresponding diff inPatientRegistration.tsxreview comment.Option B: implement
forwardRefonGovtOrganizationSelectorand attach the forwarded ref to a single concrete element (e.g., the firstAutocomplete). This is trickier because you render multiple levels; you can only meaningfully attach one ref.To verify semantics + other callsites:
#!/bin/bash rg -n --type=tsx '<GovtOrganizationSelector\b' -C2 rg -n --type=ts --type=tsx 'minGeoOrganizationLevelsRequired' -C2src/components/Patient/PatientRegistration.tsx (1)
817-835: Dropreffrom{...field}spread—GovtOrganizationSelectorpasses it to non-forwardRef'dAutocomplete, causing React warnings.The
requiredDepth={minGeoOrganizationLevelsRequired ?? 1}is correct;geo_organizationis always required by the form schema (viageoOrgValidator), and the?? 1only controls the UI depth requirement, not whether the field itself is required.Suggested fix
- render={({ field }) => ( + render={({ field: { ref: _ref, ...field } }) => ( <FormItem className="contents"> <FormControl> <GovtOrganizationSelector
📜 Review details
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
src/components/Patient/PatientRegistration.tsxsrc/pages/Organization/components/GovtOrganizationSelector.tsx
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{ts,tsx}: Write concise, technical TypeScript code with accurate examples
Use TypeScript for all code; prefer interfaces over types
Avoid enums; use maps instead
Use TanStack Query for data fetching from the API along with query and mutate utilities for the queryFn and mutationFn
Use raviger for routing
**/*.{ts,tsx}: Use TypeScript with strict mode and ES2022 target
Useinterfacefor defining object types in TypeScript
Avoid explicitanytype in TypeScript
Use proper nullability annotations in TypeScript types
Use dedicated error handlers and TypeScript strict null checks
**/*.{ts,tsx}: Use TypeScript for all new code
Prefer interfaces over types for object definitions in TypeScript
Avoid usinganytype; use proper type definitions in TypeScript
Use type inference where possible in TypeScript
Use TanStack Query for API data management
Prefer React Context for global state management
**/*.{ts,tsx}: Use TanStack Query with thequeryandmutateutilities from@/Utils/request/
Use appropriate query keys following the resource pattern for TanStack Query
Leverage TanStack Query built-in features for pagination and debouncing
Implement proper error handling using the global error handler for TanStack Query operations
UseuseQueryhook withqueryKeyandqueryFnparameters, wherequeryFnwraps the API route with thequery()utility
UseuseMutationhook withmutationFnparameter wrapping API routes with themutate()utility, and implementonSuccesscallbacks to invalidate related queries
Support path parameters in TanStack Query using thepathParamsoption in query/mutate utilities
Support query parameters in TanStack Query using thequeryParamsoption in query/mutate utilities
Use thesilent: trueoption to suppress global error notifications when custom error handling is needed
**/*.{ts,tsx}: Use TypeScript with strict mode and ES2022 target
Useinterfacefor defining object types
Avoid explicitanytypes and maint...
Files:
src/pages/Organization/components/GovtOrganizationSelector.tsxsrc/components/Patient/PatientRegistration.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursorrules)
**/*.{ts,tsx,js,jsx}: Use functional and declarative programming patterns; avoid classes
Prefer iteration and modularization over code duplication
Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Use the "function" keyword for pure functions
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements
**/*.{ts,tsx,js,jsx}: Use path aliases for imports from src (@/*)
Use double quotes for strings
Semicolons are required at end of statements
Order imports as: 3rd-party → library → CAREUI → UI → components → hooks → utils → relative
Use PascalCase for component and class names
Use camelCase for variable and function names
**/*.{ts,tsx,js,jsx}: Use path aliases@/*for imports from src directory
Use double quotes for strings
Require semicolons at end of statements
Order imports: 3rd-party → library → CAREUI → UI → components → hooks → utils → relative
Use PascalCase for component and class names
Use camelCase for variable and function names
Files:
src/pages/Organization/components/GovtOrganizationSelector.tsxsrc/components/Patient/PatientRegistration.tsx
**/*.{tsx,jsx}
📄 CodeRabbit inference engine (.cursorrules)
Use declarative JSX
Files:
src/pages/Organization/components/GovtOrganizationSelector.tsxsrc/components/Patient/PatientRegistration.tsx
src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.{ts,tsx}: Use strict TypeScript configuration for medical data safety in all TypeScript source files
All literal strings must use i18next for multi-language support in healthcare interfaces
Use comprehensive error boundaries and user-friendly error messages for medical workflow debugging without exposing PHI
Follow ESLint configured rules for React hooks, accessibility, and code quality
Use @tanstack/react-query for server state management in API client code
Localize date and time formats for medical timestamps using locale-aware formatting functions
Use date-fns for date handling and manipulation with locale awareness for medical timestamps
Files:
src/pages/Organization/components/GovtOrganizationSelector.tsxsrc/components/Patient/PatientRegistration.tsx
src/**/*.{ts,tsx,css}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use Prettier for consistent code formatting across the healthcare application
Files:
src/pages/Organization/components/GovtOrganizationSelector.tsxsrc/components/Patient/PatientRegistration.tsx
src/pages/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use raviger for application routing in page components and route definitions
src/pages/**/*.{ts,tsx}: Keep page components insrc/pages/organized by feature
Use descriptive file names that reflect the page purpose
Export page components as default exports
Co-locate page-specific components and utilities with page components
Useravigerrouter for navigation (existing dependency)
Implement proper route parameters and query string handling
Handle navigation guards and authentication checks in page components
Implement proper loading states and error boundaries in page components
Use semantic HTML structure for accessibility in page components
Use@tanstack/react-queryfor API state management in page components (existing dependency)
Implement proper loading, error, and success states for data fetching
Handle pagination and infinite scroll patterns appropriately
Cache data appropriately in page components based on usage patterns
Use controlled components for form inputs in page components
Implement proper form validation withzodschemas in page components
Handle form submission states (loading, success, error) in page components
Use React hooks for local page state
Minimize unnecessary re-renders in page components
Implement proper authentication checks in page components
Handle different user roles and permissions in page components
Redirect to login when authentication is required in page components
Show appropriate UI based on user permissions in page components
Set appropriate page titles and meta descriptions in page components
Handle OpenGraph and Twitter card meta tags in page components
Implement structured data where applicable in page components
Implement code splitting for large page components
Use lazy loading for heavy components within page components
Optimize bundle size with proper imports in page components
Handle image optimization and lazy loading in page components
Implement comprehensive error boundaries in page components
Handle API e...
Files:
src/pages/Organization/components/GovtOrganizationSelector.tsx
src/**/*.{tsx,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.{tsx,ts}: Use React 19.1.1 features and patterns following React 19 Documentation for healthcare application development
Use shadcn/ui as primary component system and CAREUI for healthcare-specific components
Use framer-motion for animations in healthcare UI interfaces
Files:
src/pages/Organization/components/GovtOrganizationSelector.tsxsrc/components/Patient/PatientRegistration.tsx
src/**/*.{tsx,css}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use Tailwind CSS 4.1.3 utility classes with custom healthcare-specific design system for styling
Files:
src/pages/Organization/components/GovtOrganizationSelector.tsxsrc/components/Patient/PatientRegistration.tsx
**/*
📄 CodeRabbit inference engine (CLAUDE.md)
Use 2-space indentation
Files:
src/pages/Organization/components/GovtOrganizationSelector.tsxsrc/components/Patient/PatientRegistration.tsx
**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/02-coding-standards.mdc)
**/*.tsx: Use functional components with proper type definitions in React
One component per file is preferred
Prefer default exports for React components
Follow the component naming pattern:ComponentName.tsxfor React components
Use Tailwind CSS for styling
Use Shadcn UI components when available
Use local state for component-specific data
Use PascalCase for component file names (e.g.,AuthWizard.tsx)
Files:
src/pages/Organization/components/GovtOrganizationSelector.tsxsrc/components/Patient/PatientRegistration.tsx
**/*.{tsx,ts}
📄 CodeRabbit inference engine (.cursor/rules/04-ui-components.mdc)
**/*.{tsx,ts}: Use Shadcn UI components as the primary component library
Follow the component documentation for proper usage
Customize components using Tailwind CSS
UsenavigateanduseRedirectfrom raviger for navigation and redirects
Use Tailwind's responsive classes and follow mobile-first approach
Implement proper ARIA attributes for accessibility
Ensure keyboard navigation works in components
Define component props using TypeScript interfaces
Use translation keys fromsrc/Locale/for internationalization
Support RTL languages in components
Use proper date/time formatting for multiple language support
Files:
src/pages/Organization/components/GovtOrganizationSelector.tsxsrc/components/Patient/PatientRegistration.tsx
**/*.{ts,tsx,js,jsx,json,css,scss,html}
📄 CodeRabbit inference engine (AGENTS.md)
Use 2-space indentation
Files:
src/pages/Organization/components/GovtOrganizationSelector.tsxsrc/components/Patient/PatientRegistration.tsx
src/components/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/components/**/*.{ts,tsx}: Implement WCAG 2.1 AA accessibility compliance in medical applications with screen reader compatibility and keyboard navigation
Include medical use cases, accessibility notes, and WCAG compliance documentation in component documentation
Follow established React component patterns and folder structure organized by feature and domain
src/components/**/*.{ts,tsx}: Use path aliases:@/components/,@/types/,@/lib/,@/pages/for imports
Follow import order: External packages →@/components/ui/→@/components/→@/CAREUI/→@/types/→@/lib/→ relative imports
Use named exports fromlucide-reactfor icons (e.g.,import { SettingsIcon } from "lucide-react")
ImportuseTranslationfromreact-i18nextfor internationalization
Use React 19.1.1 hooks pattern - Functional components only
Always define TypeScript Props interfaces (e.g., PatientInfoCardProps) for component props
Use handle prefix for event handlers (e.g., handleSubmit, handleTagsUpdate, handlePatientSelect)
Use shadcn/ui components as primary UI system (Button, Card, Badge, etc.) from@/components/ui/
Use healthcare-specific CAREUI custom components (Calendar, WeekdayCheckbox, Zoom) from@/CAREUI/
UsebuttonVariantsfrom@/components/ui/buttonwith CVA patterns for button styling
Follow<Card><CardHeader>pattern for consistent card layouts
UsePatientReadtype from@/types/emr/patient/patientfor patient data handling
ImplementTagAssignmentSheetwithTagEntityTypefor patient/facility tags
UsePatientHoverCardfor patient info overlays
Use Badge components to display patient status, facility capacity, medication dosage with color variants
Usecva()from class variance authority for variant-based component styling
Usecn()from@/lib/utilsfor conditional class composition
Follow Tailwind CSS 4.1.3 color system: primary-700, gray-900, red-500 pattern with dark mode variants
Use Tailwind shadow system: shadow-sm, shadow-xs for el...
Files:
src/components/Patient/PatientRegistration.tsx
🧠 Learnings (21)
📚 Learning: 2024-12-11T01:32:56.923Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 8956
File: src/components/Shifting/ShiftDetailsUpdate.tsx:348-370
Timestamp: 2024-12-11T01:32:56.923Z
Learning: In the `ShiftDetailsUpdate` component (`src/components/Shifting/ShiftDetailsUpdate.tsx`), the field `approving_facility` is not required in `initForm`.
Applied to files:
src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-11-22T19:18:25.795Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 14473
File: src/components/ui/multi-select.tsx:68-82
Timestamp: 2025-11-22T19:18:25.795Z
Learning: In the MultiSelect component (src/components/ui/multi-select.tsx), the grouping logic intentionally uses the `value` prop (committed state from parent) instead of `selectedValues` (local draft state) to show the original selected/unselected groups. Changes made by toggling options should only reflect after clicking "Done" and on the next popover/drawer opening, not live as the user makes selections.
Applied to files:
src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-10-07T08:56:41.983Z
Learnt from: yash-learner
Repo: ohcnetwork/care_fe PR: 13918
File: src/components/Common/RequirementsSelector.tsx:330-336
Timestamp: 2025-10-07T08:56:41.983Z
Learning: In src/components/Common/RequirementsSelector.tsx, when custom trigger components (like TriggerButton) are used with Radix UI primitives' asChild prop, they must use React.forwardRef and spread additional props to receive refs and event handlers. Without forwardRef, asChild will not work and the trigger will fail to open the drawer/sheet.
Applied to files:
src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-07-14T18:35:29.341Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 12882
File: src/components/Patient/allergy/AllergyTable.tsx:0-0
Timestamp: 2025-07-14T18:35:29.341Z
Learning: In the AllergyCard component navigation URLs in `src/components/Patient/allergy/AllergyTable.tsx`, hardcoding "organizationId" in the organization path is acceptable and intentional, as confirmed by AdityaJ2305.
Applied to files:
src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2024-12-02T18:50:29.685Z
Learnt from: kihan2518B
Repo: ohcnetwork/care_fe PR: 8956
File: src/components/Patient/PatientRegister.tsx:861-861
Timestamp: 2024-12-02T18:50:29.685Z
Learning: In `src/components/Patient/PatientRegister.tsx`, `insuranceDetails` is not part of `state.form`, so changes to it are not tracked by the `isDirty` state. Therefore, the form's `disabled` state needs to be conditionally set based on `insuranceDetails.length`.
Applied to files:
src/pages/Organization/components/GovtOrganizationSelector.tsxsrc/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-09-22T19:02:08.124Z
Learnt from: Denyme24
Repo: ohcnetwork/care_fe PR: 13799
File: src/pages/Scheduling/components/CreateScheduleTemplateSheet.tsx:115-122
Timestamp: 2025-09-22T19:02:08.124Z
Learning: In the care_fe project's form components (like CreateScheduleTemplateSheet.tsx), maintainers use the union/refine pattern (z.union([z.number().min(1), z.undefined()]).refine()) for numeric fields instead of z.number({ required_error, invalid_type_error }) because their forms initialize with undefined values and use onChange handlers that convert invalid inputs back to undefined. This pattern maintains consistency with existing form architecture and avoids requiring refactoring of initialization and input handling logic.
Applied to files:
src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Use controlled components for form inputs in page components
Applied to files:
src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-11-25T13:51:41.208Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/lib.instructions.md:0-0
Timestamp: 2025-11-25T13:51:41.208Z
Learning: Applies to src/lib/**/validators.ts : Implement form validation for healthcare-specific requirements in validators.ts
Applied to files:
src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Use proper ARIA labels and roles in page components
Applied to files:
src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-10-12T04:44:19.609Z
Learnt from: GSMPRANEETH
Repo: ohcnetwork/care_fe PR: 13940
File: src/components/ui/filter-tabs.tsx:16-20
Timestamp: 2025-10-12T04:44:19.609Z
Learning: In the `filter-tabs` component (src/components/ui/filter-tabs.tsx), the `FilterTabOption` type uses object-only format `{ value: string; label?: string; icon?: ReactNode }` rather than a union with string, as all consumers are updated to use the object format for consistency and to support icons/labels.
Applied to files:
src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-12-17T19:47:58.152Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 14821
File: src/components/Location/LocationNavigation.tsx:161-163
Timestamp: 2025-12-17T19:47:58.152Z
Learning: To ensure the remove-unused-i18n.js cleanup script detects i18n keys, avoid wrapping keys inside a ternary expression passed directly to t(). Instead, call t() separately in each branch of a conditional, e.g. condition ? t("key1") : t("key2"), or compute the key in a variable before passing to t(). For LocationNavigation.tsx (and similar TSX files in the repo), prefer explicit separate i18n calls per branch or a shared precomputed key to guarantee all keys are statically detectable by the script.
Applied to files:
src/pages/Organization/components/GovtOrganizationSelector.tsxsrc/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-12-22T10:16:36.690Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 14804
File: src/pages/Facility/services/pharmacy/DispensesView.tsx:117-135
Timestamp: 2025-12-22T10:16:36.690Z
Learning: In the care_fe repository, prefer the native HTML title attribute for simple tooltips over using shadcn/ui Tooltip components. Use Tooltip components only when the tooltip requires richer content, interactivity, or accessibility enhancements that cannot be achieved with a plain title. For simple cases, add a title attribute to the element (e.g., <span title="...">). If a Tooltip is used, ensure it is accessible and necessary, and avoid duplicating content available in the title attribute.
Applied to files:
src/pages/Organization/components/GovtOrganizationSelector.tsxsrc/components/Patient/PatientRegistration.tsx
📚 Learning: 2024-11-20T18:54:27.563Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9080
File: src/components/Users/UserFormValidations.tsx:137-148
Timestamp: 2024-11-20T18:54:27.563Z
Learning: In the function `ValidateDoctorMedicalCouncilRegistration` in `src/components/Users/UserFormValidations.tsx`, avoid enforcing a specific format for medical council registration numbers, as they vary globally.
Applied to files:
src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:52:19.758Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/pages.instructions.md:0-0
Timestamp: 2025-11-25T13:52:19.758Z
Learning: Applies to src/pages/**/*.{ts,tsx} : Handle patient data with appropriate privacy considerations in healthcare page components
Applied to files:
src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:53:20.837Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/typescript-types.instructions.md:0-0
Timestamp: 2025-11-25T13:53:20.837Z
Learning: Applies to src/types/emr/patient/**/*.{ts,tsx} : EMR-specific interface patterns should include: id, name, blood_group (optional), instance_tags, geo_organization, instance_identifiers, created_by, and year_of_birth fields for patient types
Applied to files:
src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:52:33.081Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/providers.instructions.md:0-0
Timestamp: 2025-11-25T13:52:33.081Z
Learning: Applies to src/Providers/**/*PatientUserProvider*{.ts,.tsx} : PatientUserProvider should handle patient authentication for public appointment booking
Applied to files:
src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use `PatientRead` type from `@/types/emr/patient/patient` for patient data handling
Applied to files:
src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:54.683Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/common.instructions.md:0-0
Timestamp: 2025-11-25T13:50:54.683Z
Learning: Applies to src/common/**/validation.tsx : Implement healthcare system password and identifier validation in validation.tsx
Applied to files:
src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use `PatientHoverCard` for patient info overlays
Applied to files:
src/components/Patient/PatientRegistration.tsx
📚 Learning: 2024-11-07T02:35:08.706Z
Learnt from: khavinshankar
Repo: ohcnetwork/care_fe PR: 9036
File: src/components/Patient/PatientRegister.tsx:947-954
Timestamp: 2024-11-07T02:35:08.706Z
Learning: In `src/components/Patient/PatientRegister.tsx`, passing `state` and `dispatch` to `PLUGIN_Component` is necessary for plugin functionality and is acceptable in our codebase.
Applied to files:
src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:51:23.408Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/context.instructions.md:0-0
Timestamp: 2025-11-25T13:51:23.408Z
Learning: Applies to src/context/**/PatientContext.tsx : Implement Patient Context for current patient selection and medical alerts
Applied to files:
src/components/Patient/PatientRegistration.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: build
- GitHub Check: Test
- GitHub Check: CodeQL-Build

Proposed Changes
Fixes #15052
Tagging: @ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.