Skip to content

Conversation

@vipulpandey21
Copy link

@vipulpandey21 vipulpandey21 commented Jan 14, 2026

Fixes #15126

Summary

This PR fixes multiple validation and UX issues in the public patient registration form.

Changes

  • Ensures all required field errors consistently display: "This field is required."
  • Enforces Date of Birth or Age validation at the group level.
  • Fixes required indicator spacing and error color for the State (Government Organization) field.
  • Aligns error placement across all form sections.

Impact

Prevents silent submission of incomplete patient records and ensures predictable validation behaviour across the form.

Merge Checklist

  • No breaking changes
  • No database / API changes
  • Tests added / updated
  • Documentation updated

Summary by CodeRabbit

  • New Features

    • Form errors now auto-expand sections and focus the first invalid field.
    • Error messages now use internationalized strings when appropriate.
  • Bug Fixes

    • Clearer PIN code validation and handling to reduce validation confusion.
    • Improved accordion trigger behavior and accessibility during form submission.
  • Chores

    • Added new translation key "invalid_pincode" for PIN-related errors.

✏️ Tip: You can customize this high-level summary in your review settings.

@vipulpandey21 vipulpandey21 requested review from a team January 14, 2026 09:12
@netlify
Copy link

netlify bot commented Jan 14, 2026

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit 6b48670
🔍 Latest deploy log https://app.netlify.com/projects/care-ohc/deploys/69676a4c992a49000843af7d
😎 Deploy Preview https://deploy-preview-15133.preview.ohc.network
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link

⚠️ Merge Checklist Incomplete

Thank you for your contribution! To help us review your PR efficiently, please complete the merge checklist in your PR description.

Your PR will be reviewed once you have marked the appropriate checklist items.

To update the checklist:

  • Change - [ ] to - [x] for completed items
  • Only check items that are relevant to your PR
  • Leave items unchecked if they don't apply

The checklist helps ensure code quality, testing coverage, and documentation are properly addressed.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

Walkthrough

Adds a PIN code translation, tightens pincode validation and coercion, enables form error focusing/visibility via controlled accordion and onInvalid handlers, internationalizes form messages, sets an AccordionTrigger button type, and tweaks organization selector label styling and effect dependencies.

Changes

Cohort / File(s) Summary
Translations
public/locale/en.json
Added "invalid_pincode": "Please enter a valid PIN code".
Patient registration (CARE component)
src/components/Patient/PatientRegistration.tsx
Controlled accordion state (openSections), shouldFocusError: true, onInvalid handler to expand sections and focus/scroll first invalid field, convert pincode to Number (or undefined), submit button type and disable logic adjusted, schema refinements for date_of_birth/age.
Patient registration (Public appointments)
src/pages/PublicAppointments/PatientRegistration.tsx
Form uses mode: "onSubmit" and shouldFocusError: true; date_of_birth schema narrowed to string; pincode input switched to type="number" and coerced to Number/undefined for payload.
Validation utilities
src/Utils/validators.ts
pincode now .number({ required_error: t("field_required") }) with min(100000, t("invalid_pincode")) and max(999999, t("invalid_pincode")); removed .positive() and replaced digit-specific error key.
UI primitives
src/components/ui/accordion.tsx, src/components/ui/form.tsx
AccordionTrigger adds type="button"; FormMessage uses useTranslation to map empty/required errors to t("field_required") and ensures messages end with a period.
Organization selector UI
src/pages/Organization/components/GovtOrganizationSelector.tsx
Label className made dynamic via cn(...) to apply error styling; useEffect dependencies expanded to [selectedLevels, onChange, required, requiredDepth].
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix inconsistent validation errors and required field indicators in patient registration form' clearly summarizes the main change and is directly related to the changeset.
Description check ✅ Passed The PR description covers the main objectives, references the linked issue (#15126), summarizes changes, and notes impact; most checklist items are addressed.
Linked Issues check ✅ Passed All objectives from issue #15126 are met: validation errors display consistently, required field text is standardized, Date of Birth/Age group validation is enforced, State field styling is fixed, and error placement is aligned.
Out of Scope Changes check ✅ Passed All code changes align with issue #15126 objectives; no out-of-scope modifications detected beyond fixing validation and field styling issues.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Jan 14, 2026

🚀 Preview Deployment Ready!

🔗 Preview URL: https://pr-15133.care-preview-a7w.pages.dev

📱 Mobile Access:
Scan the QR code below to open the preview on your mobile device.

QR Code


This preview will be automatically updated when you push new commits to this PR.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/Patient/PatientRegistration.tsx (1)

870-882: Minor: FormMessage className override.

The className="mt-1" on FormMessage overrides the default spacing. Verify this aligns with the design system's spacing conventions for form error messages.

🤖 Fix all issues with AI agents
In `@public/locale/en.json`:
- Around line 2591-2593: The JSON key "invalid_pincode" currently ends with a
trailing period; for consistency with other "invalid_*" strings (like
"invalid_email" and "invalid_url") remove the final '.' from the
"invalid_pincode" value so it reads "Please enter a valid PIN code" without
punctuation; update the value for the "invalid_pincode" key in
public/locale/en.json accordingly.

In `@src/components/Patient/PatientRegistration.tsx`:
- Around line 338-354: The duplicate DOM-focus logic in the onInvalid handler
should be extracted into a shared utility (e.g., focusFirstInvalidField) and
reused from this component and the earlier useEffect as well as the other
PatientRegistration file; implement a function that accepts an optional array of
section IDs to open (or call setOpenSections before invoking) and performs the
requestAnimationFrame -> querySelector('[aria-invalid="true"]') ->
scrollIntoView({behavior: "smooth", block: "center"}) -> focus sequence, then
replace the inline logic in onInvalid and the useEffect with calls to
focusFirstInvalidField so both PatientRegistration components import and use the
same helper.
- Around line 114-135: The useEffect that watches form.formState.errors
duplicates the scroll/focus and setOpenSections logic already implemented in the
onInvalid handler (lines ~338-354), causing potential double actions; remove
this useEffect block (the effect that queries '[aria-invalid="true"]' and calls
setOpenSections/scrollIntoView/focus) and rely on the existing onInvalid handler
and shouldFocusError behavior, or alternatively add a guard (e.g., a ref flag
like hasHandledInvalid) to the effect so it only runs when non-submission-driven
validation changes are expected.

In `@src/components/ui/form.tsx`:
- Around line 151-152: The current check rawMessage.toLowerCase() === "required"
can misfire on extra whitespace or different casing; normalize and robustly
compare by trimming and doing a case-insensitive match (e.g., use
rawMessage?.trim().match(/^required$/i)) or, better, prefer inspecting the Zod
issue/code if available (e.g., check the ZodIssue.code or issue.message mapping)
instead of raw text; update the logic around rawMessage in the form component to
use trimmed, case-insensitive matching or Zod issue-based detection and return
t("field_required") accordingly.

In `@src/pages/Organization/components/GovtOrganizationSelector.tsx`:
- Line 124: The effect in GovtOrganizationSelector that depends on the onChange
prop is being retriggered because parent components pass inline arrow functions
that change identity each render; update the parent components
(PublicAppointments/PatientRegistration.tsx, Users/UserForm.tsx,
Facility/FacilityForm.tsx) to memoize the onChange handler with
React.useCallback so its reference is stable (e.g., wrap the function passed to
the onChange prop in useCallback with the correct dependency list) which will
prevent unnecessary re-execution of the effect that calls onChange("").

In `@src/pages/PublicAppointments/PatientRegistration.tsx`:
- Around line 171-184: Extract the duplicated requestAnimationFrame +
querySelector('[aria-invalid="true"]') logic into a reusable function named
focusFirstInvalidField and export it from a shared module (e.g., a new
form-utils module); replace the inline anonymous block in the PublicAppointments
PatientRegistration component and the Patient/PatientRegistration component with
a call to focusFirstInvalidField so both components use the same utility,
preserving the scrollIntoView({ behavior: "smooth", block: "center" }) and
focus() behavior.
📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d70faec and 39e9ebc.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • package.json
  • public/locale/en.json
  • src/components/Patient/PatientRegistration.tsx
  • src/components/ui/accordion.tsx
  • src/components/ui/form.tsx
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/pages/PublicAppointments/PatientRegistration.tsx
🧰 Additional context used
📓 Path-based instructions (17)
**/*.{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
Use interface for defining object types in TypeScript
Avoid explicit any type 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 using any type; 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 the query and mutate utilities 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
Use useQuery hook with queryKey and queryFn parameters, where queryFn wraps the API route with the query() utility
Use useMutation hook with mutationFn parameter wrapping API routes with the mutate() utility, and implement onSuccess callbacks to invalidate related queries
Support path parameters in TanStack Query using the pathParams option in query/mutate utilities
Support query parameters in TanStack Query using the queryParams option in query/mutate utilities
Use the silent: true option to suppress global error notifications when custom error handling is needed

**/*.{ts,tsx}: Use TypeScript with strict mode and ES2022 target
Use interface for defining object types
Avoid explicit any types and maint...

Files:

  • src/components/ui/accordion.tsx
  • src/components/ui/form.tsx
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/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/components/ui/accordion.tsx
  • src/components/ui/form.tsx
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/PatientRegistration.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Use declarative JSX

Files:

  • src/components/ui/accordion.tsx
  • src/components/ui/form.tsx
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/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/components/ui/accordion.tsx
  • src/components/ui/form.tsx
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/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 from lucide-react for icons (e.g., import { SettingsIcon } from "lucide-react")
Import useTranslation from react-i18next for 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/
Use buttonVariants from @/components/ui/button with CVA patterns for button styling
Follow <Card><CardHeader> pattern for consistent card layouts
Use PatientRead type from @/types/emr/patient/patient for patient data handling
Implement TagAssignmentSheet with TagEntityType for patient/facility tags
Use PatientHoverCard for patient info overlays
Use Badge components to display patient status, facility capacity, medication dosage with color variants
Use cva() from class variance authority for variant-based component styling
Use cn() from @/lib/utils for 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/ui/accordion.tsx
  • src/components/ui/form.tsx
  • src/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/components/ui/accordion.tsx
  • src/components/ui/form.tsx
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/PatientRegistration.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/components/ui/accordion.tsx
  • src/components/ui/form.tsx
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/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/components/ui/accordion.tsx
  • src/components/ui/form.tsx
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/PatientRegistration.tsx
**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Use 2-space indentation

Files:

  • src/components/ui/accordion.tsx
  • src/components/ui/form.tsx
  • public/locale/en.json
  • package.json
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/PatientRegistration.tsx
src/components/ui/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/01-project-structure.mdc)

ShadCN UI components should be placed in src/components/ui/ directory

Files:

  • src/components/ui/accordion.tsx
  • src/components/ui/form.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.tsx for 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/components/ui/accordion.tsx
  • src/components/ui/form.tsx
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/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
Use navigate and useRedirect from 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 from src/Locale/ for internationalization
Support RTL languages in components
Use proper date/time formatting for multiple language support

Files:

  • src/components/ui/accordion.tsx
  • src/components/ui/form.tsx
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/PatientRegistration.tsx
**/*.{ts,tsx,js,jsx,json,css,scss,html}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation

Files:

  • src/components/ui/accordion.tsx
  • src/components/ui/form.tsx
  • public/locale/en.json
  • package.json
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/PatientRegistration.tsx
src/**/*{[Ff]orm,[Ii]nput,[Ff]ield}*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use react-hook-form with zod validation for medical data integrity in form components

Files:

  • src/components/ui/form.tsx
public/locale/**/*.json

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use i18n Locale files with English Locale files in public/locale/en.json - non-English languages managed via Crowdin only

Files:

  • public/locale/en.json
package.json

📄 CodeRabbit inference engine (.github/instructions/config-files.instructions.md)

Maintain package.json as the primary dependency and script configuration

Files:

  • package.json
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 in src/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
Use raviger router 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-query for 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 with zod schemas 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/pages/PublicAppointments/PatientRegistration.tsx
🧠 Learnings (82)
📓 Common learnings
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
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 13197
File: src/pages/Facility/settings/observationDefinition/ObservationDefinitionForm.tsx:470-495
Timestamp: 2025-09-16T20:46:59.537Z
Learning: In PR `#13197`, AdityaJ2305 indicated that aria-invalid and ref forwarding improvements for ValueSetSelect components can be deferred to a separate PR, considering them not critical for the current focus/scroll fix implementation.
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
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 medical data validation for patient identifiers and clinical data in validators.ts
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.
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 10260
File: src/components/Patient/PatientRegistration.tsx:286-289
Timestamp: 2025-01-28T15:50:07.442Z
Learning: For patient registration in the frontend, either year_of_birth or date_of_birth is required for successful registration. If date_of_birth is not available, year_of_birth must be present.
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} : Implement proper data validation for medical information in page components
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Implement appropriate validation for clinical data inputs in CAREUI components
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`.
📚 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/components/ui/accordion.tsx
📚 Learning: 2025-11-25T13:54:35.875Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursor/rules/04-ui-components.mdc:0-0
Timestamp: 2025-11-25T13:54:35.875Z
Learning: Applies to **/*.{tsx,ts} : Implement proper ARIA attributes for accessibility

Applied to files:

  • src/components/ui/accordion.tsx
📚 Learning: 2025-11-25T13:54:35.875Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursor/rules/04-ui-components.mdc:0-0
Timestamp: 2025-11-25T13:54:35.875Z
Learning: Applies to **/*.{tsx,ts} : Ensure keyboard navigation works in components

Applied to files:

  • src/components/ui/accordion.tsx
📚 Learning: 2025-06-25T05:54:03.491Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 12680
File: src/components/Questionnaire/QuestionnaireEditor.tsx:813-816
Timestamp: 2025-06-25T05:54:03.491Z
Learning: In React components using UI library Button components (like shadcn/ui), adding `type="submit"` to a Button with an onClick handler does not cause the double execution issues that might occur with native HTML buttons, as the UI library handles form submission differently.

Applied to files:

  • src/components/ui/accordion.tsx
  • 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} : Use semantic HTML structure for accessibility in page components

Applied to files:

  • src/components/ui/accordion.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/components/ui/accordion.tsx
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-11-25T13:54:09.978Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursor/rules/02-coding-standards.mdc:0-0
Timestamp: 2025-11-25T13:54:09.978Z
Learning: Applies to **/*.tsx : Use functional components with proper type definitions in React

Applied to files:

  • src/components/ui/accordion.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} : Ensure keyboard navigation works properly in page components

Applied to files:

  • src/components/ui/accordion.tsx
📚 Learning: 2025-03-04T13:11:05.207Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 10940
File: src/components/Auth/Login.tsx:701-711
Timestamp: 2025-03-04T13:11:05.207Z
Learning: In the CARE frontend application, use the Button component with variant="link" for link-style action triggers rather than using <p> tags with onClick handlers or plain <button> elements, following the established pattern in the codebase.

Applied to files:

  • src/components/ui/accordion.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 shadcn/ui components as primary UI system (Button, Card, Badge, etc.) from `@/components/ui/`

Applied to files:

  • src/components/ui/accordion.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/components/ui/accordion.tsx
  • src/components/ui/form.tsx
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/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/components/ui/accordion.tsx
  • src/components/ui/form.tsx
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/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} : Import `useTranslation` from `react-i18next` for internationalization

Applied to files:

  • src/components/ui/form.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 `i18next` for text translations in page components (existing dependency)

Applied to files:

  • src/components/ui/form.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} : Format dates, numbers, and currencies appropriately in page components using i18n

Applied to files:

  • src/components/ui/form.tsx
📚 Learning: 2025-11-25T13:54:35.875Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursor/rules/04-ui-components.mdc:0-0
Timestamp: 2025-11-25T13:54:35.875Z
Learning: Applies to **/*.{tsx,ts} : Use translation keys from `src/Locale/` for internationalization

Applied to files:

  • src/components/ui/form.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 `const { t } = useTranslation()` pattern for accessing translations

Applied to files:

  • src/components/ui/form.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Applies to src/**/*.{ts,tsx} : All literal strings must use i18next for multi-language support in healthcare interfaces

Applied to files:

  • src/components/ui/form.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} : Wrap all user-facing text content in `t("key.path")` for internationalization

Applied to files:

  • src/components/ui/form.tsx
📚 Learning: 2025-11-25T13:53:40.623Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/utils.instructions.md:0-0
Timestamp: 2025-11-25T13:53:40.623Z
Learning: Applies to src/Utils/**/*.{ts,tsx} : Consider internationalization (i18n) for date formatting in utility functions

Applied to files:

  • src/components/ui/form.tsx
📚 Learning: 2025-11-25T13:54:35.875Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursor/rules/04-ui-components.mdc:0-0
Timestamp: 2025-11-25T13:54:35.875Z
Learning: Applies to **/*.{tsx,ts} : Use proper date/time formatting for multiple language support

Applied to files:

  • src/components/ui/form.tsx
📚 Learning: 2024-11-20T23:25:06.602Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9145
File: src/common/validation.tsx:41-41
Timestamp: 2024-11-20T23:25:06.602Z
Learning: When updating the name validation pattern in `src/common/validation.tsx`, avoid partial internationalization by not adding specific non-Latin Unicode ranges unless we're prepared to support all non-Latin scripts.

Applied to files:

  • src/components/ui/form.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 React 19.1.1 hooks pattern - Functional components only

Applied to files:

  • src/components/ui/form.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/**/*.{ts,tsx} : Use React hooks for local provider state management

Applied to files:

  • src/components/ui/form.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Ensure full compatibility with react-hook-form for medical data collection in CAREUI components

Applied to files:

  • src/components/ui/form.tsx
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/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} : Use React hooks for local page state

Applied to files:

  • src/components/ui/form.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Custom React hooks for healthcare workflows must follow hooks.instructions.md

Applied to files:

  • src/components/ui/form.tsx
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Applies to src/**/*{[Ff]orm,[Ii]nput,[Ff]ield}*.{ts,tsx} : Use react-hook-form with zod validation for medical data integrity in form components

Applied to files:

  • src/components/ui/form.tsx
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: React context definitions and patterns must follow context.instructions.md

Applied to files:

  • src/components/ui/form.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: Provide meaningful error messages to users in page components

Applied to files:

  • src/components/ui/form.tsx
📚 Learning: 2025-11-25T13:51:32.224Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/hooks.instructions.md:0-0
Timestamp: 2025-11-25T13:51:32.224Z
Learning: Applies to src/hooks/**/*.{ts,tsx} : Provide meaningful error messages for clinical workflows in custom hooks

Applied to files:

  • src/components/ui/form.tsx
📚 Learning: 2025-11-25T13:53:40.623Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/utils.instructions.md:0-0
Timestamp: 2025-11-25T13:53:40.623Z
Learning: Applies to src/Utils/**/*.{ts,tsx} : Provide clear validation error messages in validation utilities

Applied to files:

  • src/components/ui/form.tsx
📚 Learning: 2025-01-14T09:50:51.248Z
Learnt from: rajku-dev
Repo: ohcnetwork/care_fe PR: 9887
File: src/components/Users/CreateUserForm.tsx:86-92
Timestamp: 2025-01-14T09:50:51.248Z
Learning: When suggesting new validation messages in code, always check and add corresponding translation keys to the locale files (e.g., public/locale/en.json) to maintain internationalization support.

Applied to files:

  • public/locale/en.json
📚 Learning: 2025-01-14T09:50:51.248Z
Learnt from: rajku-dev
Repo: ohcnetwork/care_fe PR: 9887
File: src/components/Users/CreateUserForm.tsx:86-92
Timestamp: 2025-01-14T09:50:51.248Z
Learning: When suggesting new validation messages or error strings in code, always ensure corresponding translation keys are added to the locale files (e.g., public/locale/en.json).

Applied to files:

  • public/locale/en.json
📚 Learning: 2025-01-15T04:16:14.978Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 9956
File: src/pages/Patient/index.tsx:71-71
Timestamp: 2025-01-15T04:16:14.978Z
Learning: In this project, new translation strings must only be added to the English locale (en.json) through pull requests. Translations for other languages (ta.json, mr.json, ml.json, hi.json, kn.json, etc.) are managed through Crowdin (https://crowdin.com/project/ohccarefe) and should not be modified directly in PRs.

Applied to files:

  • public/locale/en.json
📚 Learning: 2025-11-25T13:51:07.680Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/config-files.instructions.md:0-0
Timestamp: 2025-11-25T13:51:07.680Z
Learning: Applies to package.json : Maintain `package.json` as the primary dependency and script configuration

Applied to files:

  • package.json
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Applies to src/**/*.{ts,tsx,css} : Use Prettier for consistent code formatting across the healthcare application

Applied to files:

  • package.json
📚 Learning: 2025-11-25T13:53:49.727Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T13:53:49.727Z
Learning: Format code with Prettier using `npm run format`

Applied to files:

  • package.json
📚 Learning: 2025-11-25T13:54:43.264Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T13:54:43.264Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Order imports: 3rd-party → library → CAREUI → UI → components → hooks → utils → relative

Applied to files:

  • package.json
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Always run `npm run format` and `npm run lint` before committing changes to maintain code quality

Applied to files:

  • package.json
📚 Learning: 2025-11-25T13:53:49.727Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T13:53:49.727Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Order imports as: 3rd-party → library → CAREUI → UI → components → hooks → utils → relative

Applied to files:

  • package.json
📚 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} : Optimize bundle size with proper imports 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-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 `cn()` from `@/lib/utils` for conditional class composition

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.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/**/*.{ts,tsx} : Use import path conventions with @ alias: cross-domain imports from `@/types/`, organization from `@/types/organization/`, user from `@/types/user/`, and patient identifiers from `@/types/patient/patientIdentifierConfig/`

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.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} : Follow import order: External packages → `@/components/ui/` → `@/components/` → `@/CAREUI/` → `@/types/` → `@/lib/` → relative imports

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Applies to src/**/*.{tsx,ts} : Use shadcn/ui as primary component system and CAREUI for healthcare-specific components

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Use CAREUI imports for medical-specific functionality and shadcn/ui imports for standard UI components - CAREUI for medical interactions/workflows/data, shadcn/ui for buttons, forms, modals, tables, navigation

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/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/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
  • src/pages/PublicAppointments/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
  • src/pages/PublicAppointments/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
  • src/pages/PublicAppointments/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} : Implement proper data validation for medical information in page components

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/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/**/*Form*.{ts,tsx} : Medical form type patterns should organize related fields into logical nested object groups: personalInfo, medicalHistory, insuranceInfo for patient admission forms

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/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: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
  • src/pages/PublicAppointments/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
📚 Learning: 2025-01-14T09:56:07.985Z
Learnt from: rajku-dev
Repo: ohcnetwork/care_fe PR: 9887
File: src/components/Users/CreateUserForm.tsx:153-159
Timestamp: 2025-01-14T09:56:07.985Z
Learning: In react-hook-form, form.formState.isValid being false with an empty form.formState.errors object typically indicates that either not all required fields are filled, some fields haven't been "touched", or there's pending async validation. The errors object only contains validation errors for fields that have been validated.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2024-11-20T19:08:38.025Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9080
File: src/components/Users/UserEditDetails.tsx:90-97
Timestamp: 2024-11-20T19:08:38.025Z
Learning: In the React component `UserEditDetails` (src/components/Users/UserEditDetails.tsx), error handling for form submissions is handled within the `UserAddEditForm` component, so additional error handling is unnecessary.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/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 `tanstack/react-query` for server state management with facility data and patient records

Applied to files:

  • src/components/Patient/PatientRegistration.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 medical data validation for patient identifiers and clinical data in validators.ts

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Implement robust error handling with user-friendly medical context in CAREUI components

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 emergency and critical care scenarios appropriately in healthcare page components

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-08-24T18:00:56.369Z
Learnt from: Denyme24
Repo: ohcnetwork/care_fe PR: 13297
File: src/pages/Facility/settings/activityDefinition/ActivityDefinitionForm.tsx:1096-1099
Timestamp: 2025-08-24T18:00:56.369Z
Learning: In the care_fe project, button disable logic in forms should rely solely on `isDirty` state (`form.formState.isDirty`), not on explicit required field validation, for both create and edit modes.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-03-30T12:22:58.576Z
Learnt from: hrit2773
Repo: ohcnetwork/care_fe PR: 11447
File: src/components/Questionnaire/QuestionnaireEditor.tsx:1055-1069
Timestamp: 2025-03-30T12:22:58.576Z
Learning: In the QuestionnaireEditor component, React Hook Form's onChange handlers are intentionally overridden with custom updateField calls to maintain component-specific state management instead of relying on React Hook Form's internal state.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-09-02T04:58:06.800Z
Learnt from: Denyme24
Repo: ohcnetwork/care_fe PR: 13238
File: src/pages/Facility/settings/billing/discount/discount-components/DiscountMonetaryComponentForm.tsx:63-67
Timestamp: 2025-09-02T04:58:06.800Z
Learning: In the care_fe project's discount forms (DiscountMonetaryComponentForm.tsx), maintainers prefer using path: ["factor", "amount"] for cross-field validation rather than dynamic path binding like path: [valueType]. The approach of adding per-field FormMessage components for either/or validation was previously rejected by maintainers.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-04-13T03:41:38.805Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 11815
File: src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx:332-341
Timestamp: 2025-04-13T03:41:38.805Z
Learning: Form inputs in React components should use the controlled component pattern (using `value` instead of `defaultValue`) to ensure they properly reflect changes from all sources, particularly for textareas and form elements that may be updated from multiple places.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:51:32.224Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/hooks.instructions.md:0-0
Timestamp: 2025-11-25T13:51:32.224Z
Learning: Applies to src/hooks/**/*.{ts,tsx} : Validate medical data inputs using `zod` schemas in custom hooks

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 : Form validation should use zod schemas with appropriate min/max constraints for vital signs (temperature: 95-110, heart rate: 30-200, blood pressure: 60-250 systolic / 40-150 diastolic)

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-01-28T15:50:07.442Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 10260
File: src/components/Patient/PatientRegistration.tsx:286-289
Timestamp: 2025-01-28T15:50:07.442Z
Learning: For patient registration in the frontend, either year_of_birth or date_of_birth is required for successful registration. If date_of_birth is not available, year_of_birth must be present.

Applied to files:

  • src/components/Patient/PatientRegistration.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/PublicAppointments/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} : Implement proper form validation with `zod` schemas in page components

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-01-14T09:22:13.878Z
Learnt from: rajku-dev
Repo: ohcnetwork/care_fe PR: 9887
File: src/components/Users/CreateUserForm.tsx:93-93
Timestamp: 2025-01-14T09:22:13.878Z
Learning: In CreateUserForm.tsx, the gender validation schema uses string literals that match GENDER_TYPES.map(g => g.id). Using GENDER_TYPES directly with z.enum() fails because it's marked with 'as const' which makes it a readonly tuple type incompatible with Zod's enum.

Applied to files:

  • src/pages/PublicAppointments/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/PublicAppointments/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 : Use zod for form validation schemas in validation.tsx

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-01-17T11:34:37.003Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 10027
File: src/components/Users/UserForm.tsx:34-34
Timestamp: 2025-01-17T11:34:37.003Z
Learning: In the care_fe codebase, the GENDERS constant is defined with a type assertion `as [(typeof GENDER_TYPES)[number]["id"]]` which makes it compatible with `z.enum()` in Zod schemas. This pattern is preferred over using string literals directly.

Applied to files:

  • src/pages/PublicAppointments/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 form submission states (loading, success, error) in page components

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-04-13T03:41:38.805Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 11815
File: src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx:332-341
Timestamp: 2025-04-13T03:41:38.805Z
Learning: Textareas and other form inputs in the codebase should use the controlled component pattern (using `value` instead of `defaultValue`) to ensure they properly reflect changes from all sources.

Applied to files:

  • src/pages/PublicAppointments/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} : Handle controlled inputs with proper TypeScript typing for form state

Applied to files:

  • src/pages/PublicAppointments/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} : Use controlled components for form inputs in page components

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
🧬 Code graph analysis (3)
src/pages/Organization/components/GovtOrganizationSelector.tsx (1)
src/lib/utils.ts (1)
  • cn (4-6)
src/components/Patient/PatientRegistration.tsx (2)
src/components/ui/accordion.tsx (1)
  • Accordion (65-65)
src/components/ui/form.tsx (2)
  • FormItem (179-179)
  • FormMessage (181-181)
src/pages/PublicAppointments/PatientRegistration.tsx (1)
src/Utils/utils.ts (1)
  • dateQueryString (81-84)
⏰ 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). (4)
  • GitHub Check: Redirect rules - care-ohc
  • GitHub Check: Header rules - care-ohc
  • GitHub Check: Pages changed - care-ohc
  • GitHub Check: deploy-preview

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (2)
public/locale/en.json (1)

2312-2314: Potential mismatch with PR objective: required-field text missing trailing period.

PR objective states required errors should display “This field is required.” (with a period), but field_required is currently “This field is required”.

Proposed fix
-  "field_required": "This field is required",
+  "field_required": "This field is required.",
src/components/Patient/PatientRegistration.tsx (1)

822-835: Minor edge case: NaN handling in pincode input.

If a user pastes non-numeric content (bypassing browser input restrictions), Number(e.target.value) could return NaN. The current implementation doesn't guard against this, though the schema validator should catch it downstream.

🛡️ Optional defensive fix
 onChange={(e) => {
-  const value = e.target.value
-    ? Number(e.target.value)
-    : undefined;
+  const parsed = Number(e.target.value);
+  const value = e.target.value && !Number.isNaN(parsed)
+    ? parsed
+    : undefined;
   field.onChange(value);
 }}
♻️ Duplicate comments (1)
src/components/Patient/PatientRegistration.tsx (1)

315-331: Consider extracting error focus logic to a shared utility.

This handler duplicates the DOM focus pattern in src/pages/PublicAppointments/PatientRegistration.tsx. A shared utility (e.g., focusFirstInvalidField) would improve maintainability across both registration forms.

📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 39e9ebc and bd8ebf0.

📒 Files selected for processing (2)
  • public/locale/en.json
  • src/components/Patient/PatientRegistration.tsx
🧰 Additional context used
📓 Path-based instructions (13)
public/locale/**/*.json

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use i18n Locale files with English Locale files in public/locale/en.json - non-English languages managed via Crowdin only

Files:

  • public/locale/en.json
**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Use 2-space indentation

Files:

  • public/locale/en.json
  • src/components/Patient/PatientRegistration.tsx
**/*.{ts,tsx,js,jsx,json,css,scss,html}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation

Files:

  • public/locale/en.json
  • src/components/Patient/PatientRegistration.tsx
**/*.{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
Use interface for defining object types in TypeScript
Avoid explicit any type 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 using any type; 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 the query and mutate utilities 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
Use useQuery hook with queryKey and queryFn parameters, where queryFn wraps the API route with the query() utility
Use useMutation hook with mutationFn parameter wrapping API routes with the mutate() utility, and implement onSuccess callbacks to invalidate related queries
Support path parameters in TanStack Query using the pathParams option in query/mutate utilities
Support query parameters in TanStack Query using the queryParams option in query/mutate utilities
Use the silent: true option to suppress global error notifications when custom error handling is needed

**/*.{ts,tsx}: Use TypeScript with strict mode and ES2022 target
Use interface for defining object types
Avoid explicit any types and maint...

Files:

  • src/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/components/Patient/PatientRegistration.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Use declarative JSX

Files:

  • src/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/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 from lucide-react for icons (e.g., import { SettingsIcon } from "lucide-react")
Import useTranslation from react-i18next for 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/
Use buttonVariants from @/components/ui/button with CVA patterns for button styling
Follow <Card><CardHeader> pattern for consistent card layouts
Use PatientRead type from @/types/emr/patient/patient for patient data handling
Implement TagAssignmentSheet with TagEntityType for patient/facility tags
Use PatientHoverCard for patient info overlays
Use Badge components to display patient status, facility capacity, medication dosage with color variants
Use cva() from class variance authority for variant-based component styling
Use cn() from @/lib/utils for 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
src/**/*.{ts,tsx,css}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Prettier for consistent code formatting across the healthcare application

Files:

  • src/components/Patient/PatientRegistration.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/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/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.tsx for 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/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
Use navigate and useRedirect from 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 from src/Locale/ for internationalization
Support RTL languages in components
Use proper date/time formatting for multiple language support

Files:

  • src/components/Patient/PatientRegistration.tsx
🧠 Learnings (38)
📓 Common learnings
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 13197
File: src/pages/Facility/settings/observationDefinition/ObservationDefinitionForm.tsx:470-495
Timestamp: 2025-09-16T20:46:59.537Z
Learning: In PR `#13197`, AdityaJ2305 indicated that aria-invalid and ref forwarding improvements for ValueSetSelect components can be deferred to a separate PR, considering them not critical for the current focus/scroll fix implementation.
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
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
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 medical data validation for patient identifiers and clinical data in validators.ts
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.
📚 Learning: 2025-01-14T09:50:51.248Z
Learnt from: rajku-dev
Repo: ohcnetwork/care_fe PR: 9887
File: src/components/Users/CreateUserForm.tsx:86-92
Timestamp: 2025-01-14T09:50:51.248Z
Learning: When suggesting new validation messages in code, always check and add corresponding translation keys to the locale files (e.g., public/locale/en.json) to maintain internationalization support.

Applied to files:

  • public/locale/en.json
📚 Learning: 2025-01-14T09:50:51.248Z
Learnt from: rajku-dev
Repo: ohcnetwork/care_fe PR: 9887
File: src/components/Users/CreateUserForm.tsx:86-92
Timestamp: 2025-01-14T09:50:51.248Z
Learning: When suggesting new validation messages or error strings in code, always ensure corresponding translation keys are added to the locale files (e.g., public/locale/en.json).

Applied to files:

  • public/locale/en.json
📚 Learning: 2025-01-15T04:16:14.978Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 9956
File: src/pages/Patient/index.tsx:71-71
Timestamp: 2025-01-15T04:16:14.978Z
Learning: In this project, new translation strings must only be added to the English locale (en.json) through pull requests. Translations for other languages (ta.json, mr.json, ml.json, hi.json, kn.json, etc.) are managed through Crowdin (https://crowdin.com/project/ohccarefe) and should not be modified directly in PRs.

Applied to files:

  • public/locale/en.json
📚 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/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: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: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} : Implement proper data validation for medical information in page components

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Ensure full compatibility with react-hook-form for medical data collection in CAREUI components

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/**/*Form*.{ts,tsx} : Medical form type patterns should organize related fields into logical nested object groups: personalInfo, medicalHistory, insuranceInfo for patient admission forms

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: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: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Implement appropriate validation for clinical data inputs in CAREUI components

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2024-11-20T19:08:38.025Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9080
File: src/components/Users/UserEditDetails.tsx:90-97
Timestamp: 2024-11-20T19:08:38.025Z
Learning: In the React component `UserEditDetails` (src/components/Users/UserEditDetails.tsx), error handling for form submissions is handled within the `UserAddEditForm` component, so additional error handling is unnecessary.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-09-16T20:46:59.537Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 13197
File: src/pages/Facility/settings/observationDefinition/ObservationDefinitionForm.tsx:470-495
Timestamp: 2025-09-16T20:46:59.537Z
Learning: In PR `#13197`, AdityaJ2305 indicated that aria-invalid and ref forwarding improvements for ValueSetSelect components can be deferred to a separate PR, considering them not critical for the current focus/scroll fix implementation.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Provide clear and visible focus indicators for complex medical workflows in CAREUI components

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2024-11-13T23:01:50.297Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9080
File: src/components/Users/UserAddEditForm.tsx:655-719
Timestamp: 2024-11-13T23:01:50.297Z
Learning: The duplication in form submission logic in `handleSubmit` has already been addressed in a previous comment.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-12-05T19:05:40.922Z
Learnt from: pratyush07-hub
Repo: ohcnetwork/care_fe PR: 14651
File: src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx:252-257
Timestamp: 2025-12-05T19:05:40.922Z
Learning: In healthcare components handling discharge status (like EncounterQuestion.tsx), maintainers implement defense-in-depth by adding early-return guards in change handlers (e.g., `if (isDischarged) return;`) even when the UI control is also disabled, to ensure business-critical immutability rules are enforced at multiple layers and protect against edge cases like browser extensions or unexpected UI library behavior.

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 focus management for dynamic content in page components

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Implement robust error handling with user-friendly medical context in CAREUI components

Applied to files:

  • src/components/Patient/PatientRegistration.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/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Implement proper error boundaries in CAREUI components for critical medical data handling

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Applies to src/**/*{[Ff]orm,[Ii]nput,[Ff]ield}*.{ts,tsx} : Use react-hook-form with zod validation for medical data integrity in form components

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
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Custom React hooks for healthcare workflows must follow hooks.instructions.md

Applied to files:

  • src/components/Patient/PatientRegistration.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 medical data validation for patient identifiers and clinical data in validators.ts

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 emergency and critical care scenarios appropriately in healthcare page components

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-06-25T05:54:03.491Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 12680
File: src/components/Questionnaire/QuestionnaireEditor.tsx:813-816
Timestamp: 2025-06-25T05:54:03.491Z
Learning: In React components using UI library Button components (like shadcn/ui), adding `type="submit"` to a Button with an onClick handler does not cause the double execution issues that might occur with native HTML buttons, as the UI library handles form submission differently.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-08-24T18:00:56.369Z
Learnt from: Denyme24
Repo: ohcnetwork/care_fe PR: 13297
File: src/pages/Facility/settings/activityDefinition/ActivityDefinitionForm.tsx:1096-1099
Timestamp: 2025-08-24T18:00:56.369Z
Learning: In the care_fe project, button disable logic in forms should rely solely on `isDirty` state (`form.formState.isDirty`), not on explicit required field validation, for both create and edit modes.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-03-30T12:22:58.576Z
Learnt from: hrit2773
Repo: ohcnetwork/care_fe PR: 11447
File: src/components/Questionnaire/QuestionnaireEditor.tsx:1055-1069
Timestamp: 2025-03-30T12:22:58.576Z
Learning: In the QuestionnaireEditor component, React Hook Form's onChange handlers are intentionally overridden with custom updateField calls to maintain component-specific state management instead of relying on React Hook Form's internal state.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-09-02T04:58:06.800Z
Learnt from: Denyme24
Repo: ohcnetwork/care_fe PR: 13238
File: src/pages/Facility/settings/billing/discount/discount-components/DiscountMonetaryComponentForm.tsx:63-67
Timestamp: 2025-09-02T04:58:06.800Z
Learning: In the care_fe project's discount forms (DiscountMonetaryComponentForm.tsx), maintainers prefer using path: ["factor", "amount"] for cross-field validation rather than dynamic path binding like path: [valueType]. The approach of adding per-field FormMessage components for either/or validation was previously rejected by maintainers.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-04-13T03:41:38.805Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 11815
File: src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx:332-341
Timestamp: 2025-04-13T03:41:38.805Z
Learning: Form inputs in React components should use the controlled component pattern (using `value` instead of `defaultValue`) to ensure they properly reflect changes from all sources, particularly for textareas and form elements that may be updated from multiple places.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:51:32.224Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/hooks.instructions.md:0-0
Timestamp: 2025-11-25T13:51:32.224Z
Learning: Applies to src/hooks/**/*.{ts,tsx} : Validate medical data inputs using `zod` schemas in custom hooks

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 : Form validation should use zod schemas with appropriate min/max constraints for vital signs (temperature: 95-110, heart rate: 30-200, blood pressure: 60-250 systolic / 40-150 diastolic)

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-01-28T15:50:07.442Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 10260
File: src/components/Patient/PatientRegistration.tsx:286-289
Timestamp: 2025-01-28T15:50:07.442Z
Learning: For patient registration in the frontend, either year_of_birth or date_of_birth is required for successful registration. If date_of_birth is not available, year_of_birth must be present.

Applied to files:

  • src/components/Patient/PatientRegistration.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/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/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). (4)
  • GitHub Check: Redirect rules - care-ohc
  • GitHub Check: Header rules - care-ohc
  • GitHub Check: Pages changed - care-ohc
  • GitHub Check: deploy-preview
🔇 Additional comments (7)
public/locale/en.json (1)

2591-2593: invalid_pincode locale entry looks good and consistent.

The message is clear and matches the existing invalid_* style (no trailing period). Also good that this is added to public/locale/en.json only (non-English handled via Crowdin). Based on learnings, non-English locale files should not be modified in PRs.

src/components/Patient/PatientRegistration.tsx (6)

88-97: LGTM! Controlled accordion state and focus configuration.

The controlled state initialization correctly opens both sections by default for full registration, ensuring all required fields are visible. Enabling shouldFocusError leverages react-hook-form's built-in accessibility feature for navigating to invalid fields.


291-291: LGTM! Pincode type normalization.

Consistent conversion to Number ensures the API payload contains the expected numeric type.


358-363: LGTM! Form submission and controlled accordion.

Correctly wires onInvalid as the error callback and converts the accordion to controlled mode, enabling programmatic section management when validation fails.


407-417: LGTM! Submit button semantics and disabled logic.

Explicit type="submit" improves form semantics. The disabled logic correctly prevents update submissions when the form is unchanged while allowing create submissions when not pending. This aligns with the project's pattern of relying on isDirty state for button disabling.


847-859: LGTM! FormMessage placement for geo organization field.

The FormMessage placement with mt-1 spacing ensures validation errors display consistently with other form fields.


1067-1090: LGTM! Group-level validation for Date of Birth / Age.

Adding validation issues to both the group selector (age_or_dob) and the specific field (date_of_birth or age) ensures:

  1. The input field receives aria-invalid="true" for accessibility and focus targeting
  2. FormMessage displays the error under the appropriate field

This correctly implements the PR objective of enforcing validation at the group level.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@vipulpandey21
Copy link
Author

I’ve removed the duplicate error-focus logic and kept the pincode input type as number as suggested. Thanks for the review!

@vipulpandey21
Copy link
Author

The Cloudflare deploy-preview failure is because fork contributors don’t have permission to post deployment statuses to the upstream repository.

The build and deploy steps are completing successfully, but the final status update API call is returning a 404, so the check is marked as failed.

This is a known limitation of the current setup and is not caused by this code changes.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🤖 Fix all issues with AI agents
In `@src/pages/Organization/components/GovtOrganizationSelector.tsx`:
- Around line 75-77: The error label in GovtOrganizationSelector (the Label
element using className built with cn) uses dark:text-red-900 which is too dark
on dark backgrounds; update the conditional class for the dark theme to a
lighter red (e.g., dark:text-red-400 or dark:text-red-300) so the error text has
sufficient contrast in dark mode, and adjust the string in the cn call where
isError is applied to the Label component.
📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6b48670 and 356cb00.

📒 Files selected for processing (3)
  • public/locale/en.json
  • src/components/Patient/PatientRegistration.tsx
  • src/pages/Organization/components/GovtOrganizationSelector.tsx
🧰 Additional context used
📓 Path-based instructions (14)
**/*.{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
Use interface for defining object types in TypeScript
Avoid explicit any type 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 using any type; 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 the query and mutate utilities 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
Use useQuery hook with queryKey and queryFn parameters, where queryFn wraps the API route with the query() utility
Use useMutation hook with mutationFn parameter wrapping API routes with the mutate() utility, and implement onSuccess callbacks to invalidate related queries
Support path parameters in TanStack Query using the pathParams option in query/mutate utilities
Support query parameters in TanStack Query using the queryParams option in query/mutate utilities
Use the silent: true option to suppress global error notifications when custom error handling is needed

**/*.{ts,tsx}: Use TypeScript with strict mode and ES2022 target
Use interface for defining object types
Avoid explicit any types and maint...

Files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/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.tsx
  • src/components/Patient/PatientRegistration.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Use declarative JSX

Files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/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.tsx
  • src/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.tsx
  • src/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 in src/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
Use raviger router 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-query for 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 with zod schemas 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.tsx
  • src/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.tsx
  • src/components/Patient/PatientRegistration.tsx
**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Use 2-space indentation

Files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • public/locale/en.json
  • src/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.tsx for 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.tsx
  • src/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
Use navigate and useRedirect from 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 from src/Locale/ for internationalization
Support RTL languages in components
Use proper date/time formatting for multiple language support

Files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/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.tsx
  • public/locale/en.json
  • src/components/Patient/PatientRegistration.tsx
public/locale/**/*.json

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use i18n Locale files with English Locale files in public/locale/en.json - non-English languages managed via Crowdin only

Files:

  • public/locale/en.json
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 from lucide-react for icons (e.g., import { SettingsIcon } from "lucide-react")
Import useTranslation from react-i18next for 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/
Use buttonVariants from @/components/ui/button with CVA patterns for button styling
Follow <Card><CardHeader> pattern for consistent card layouts
Use PatientRead type from @/types/emr/patient/patient for patient data handling
Implement TagAssignmentSheet with TagEntityType for patient/facility tags
Use PatientHoverCard for patient info overlays
Use Badge components to display patient status, facility capacity, medication dosage with color variants
Use cva() from class variance authority for variant-based component styling
Use cn() from @/lib/utils for 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 (58)
📓 Common learnings
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 13197
File: src/pages/Facility/settings/observationDefinition/ObservationDefinitionForm.tsx:470-495
Timestamp: 2025-09-16T20:46:59.537Z
Learning: In PR `#13197`, AdityaJ2305 indicated that aria-invalid and ref forwarding improvements for ValueSetSelect components can be deferred to a separate PR, considering them not critical for the current focus/scroll fix implementation.
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
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
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 medical data validation for patient identifiers and clinical data in validators.ts
📚 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 `cn()` from `@/lib/utils` for conditional class composition

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/**/utils.ts : Implement cn() conditional class name utility using `clsx` and `tailwind-merge` in utils.ts

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-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Ensure full compatibility with react-hook-form for medical data collection in CAREUI components

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • 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 `useState` for UI state and `useCallback` for event handlers

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Applies to src/**/*.{tsx,ts} : Use shadcn/ui as primary component system and CAREUI for healthcare-specific components

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-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} : Optimize bundle size with proper imports in page components

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-10-12T06:10:56.702Z
Learnt from: GSMPRANEETH
Repo: ohcnetwork/care_fe PR: 13940
File: src/components/ui/filter-tabs.tsx:54-88
Timestamp: 2025-10-12T06:10:56.702Z
Learning: In the FilterTabs component (src/components/ui/filter-tabs.tsx), the `options` prop is always static in the codebase. All consumers pass options derived from TypeScript enums (e.g., PrescriptionStatus, Status) or static arrays that don't change at runtime. No useEffect is needed to sync options state because options never change after the initial render.

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.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 React 19.1.1 hooks pattern - Functional components only

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2024-11-25T09:21:37.265Z
Learnt from: sarvesh-official
Repo: ohcnetwork/care_fe PR: 9196
File: src/hooks/useFileManager.tsx:76-76
Timestamp: 2024-11-25T09:21:37.265Z
Learning: In the React TypeScript file `src/hooks/useFileManager.tsx`, resetting `currentIndex` in a `useEffect` when `uploadedFiles` changes will reset the current index every time and can cause uncontrolled issues. It's better to manage `currentIndex` without automatically resetting it upon `uploadedFiles` changes to avoid unexpected behavior.

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-04-13T03:41:38.805Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 11815
File: src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx:332-341
Timestamp: 2025-04-13T03:41:38.805Z
Learning: Textareas and other form inputs in the codebase should use the controlled component pattern (using `value` instead of `defaultValue`) to ensure they properly reflect changes from all sources.

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-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/**/*.{ts,tsx} : Log performance issues affecting patient care

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Optimize CAREUI components for memory efficiency for long-running clinical applications

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} : Minimize unnecessary re-renders in page components

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-12-05T19:05:40.922Z
Learnt from: pratyush07-hub
Repo: ohcnetwork/care_fe PR: 14651
File: src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx:252-257
Timestamp: 2025-12-05T19:05:40.922Z
Learning: In healthcare components handling discharge status (like EncounterQuestion.tsx), maintainers implement defense-in-depth by adding early-return guards in change handlers (e.g., `if (isDischarged) return;`) even when the UI control is also disabled, to ensure business-critical immutability rules are enforced at multiple layers and protect against edge cases like browser extensions or unexpected UI library behavior.

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Applies to src/**/*.{tsx,ts} : Use React 19.1.1 features and patterns following React 19 Documentation for healthcare application development

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
📚 Learning: 2025-09-16T20:46:59.537Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 13197
File: src/pages/Facility/settings/observationDefinition/ObservationDefinitionForm.tsx:470-495
Timestamp: 2025-09-16T20:46:59.537Z
Learning: In PR `#13197`, AdityaJ2305 indicated that aria-invalid and ref forwarding improvements for ValueSetSelect components can be deferred to a separate PR, considering them not critical for the current focus/scroll fix implementation.

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-01-14T09:50:51.248Z
Learnt from: rajku-dev
Repo: ohcnetwork/care_fe PR: 9887
File: src/components/Users/CreateUserForm.tsx:86-92
Timestamp: 2025-01-14T09:50:51.248Z
Learning: When suggesting new validation messages in code, always check and add corresponding translation keys to the locale files (e.g., public/locale/en.json) to maintain internationalization support.

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • public/locale/en.json
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Implement appropriate validation for clinical data inputs in CAREUI components

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • 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/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.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
  • 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} : Implement proper data validation for medical information in page components

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Applies to src/**/*{[Ff]orm,[Ii]nput,[Ff]ield}*.{ts,tsx} : Use react-hook-form with zod validation for medical data integrity in form components

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Use standard medical component interface patterns with medicalContext, accessibility properties (ariaLabel, screenReaderText), clinical validation callbacks (onValidationError), and medical data properties (patientId, facilityId)

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Integrate CAREUI components cleanly with healthcare data sources and support live data updates for critical medical information

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 medical data validation for patient identifiers and clinical data in validators.ts

Applied to files:

  • src/pages/Organization/components/GovtOrganizationSelector.tsx
  • src/components/Patient/PatientRegistration.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.tsx
  • src/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.tsx
  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-01-14T09:50:51.248Z
Learnt from: rajku-dev
Repo: ohcnetwork/care_fe PR: 9887
File: src/components/Users/CreateUserForm.tsx:86-92
Timestamp: 2025-01-14T09:50:51.248Z
Learning: When suggesting new validation messages or error strings in code, always ensure corresponding translation keys are added to the locale files (e.g., public/locale/en.json).

Applied to files:

  • public/locale/en.json
📚 Learning: 2025-01-15T04:16:14.978Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 9956
File: src/pages/Patient/index.tsx:71-71
Timestamp: 2025-01-15T04:16:14.978Z
Learning: In this project, new translation strings must only be added to the English locale (en.json) through pull requests. Translations for other languages (ta.json, mr.json, ml.json, hi.json, kn.json, etc.) are managed through Crowdin (https://crowdin.com/project/ohccarefe) and should not be modified directly in PRs.

Applied to files:

  • public/locale/en.json
📚 Learning: 2025-01-15T04:16:14.978Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 9956
File: src/pages/Patient/index.tsx:71-71
Timestamp: 2025-01-15T04:16:14.978Z
Learning: In this project, translations are only added to the English locale (en.json) through pull requests. Other locale files are managed through Crowdin and should not be modified directly in PRs.

Applied to files:

  • public/locale/en.json
📚 Learning: 2025-08-15T19:51:24.937Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 12882
File: public/locale/en.json:3356-3356
Timestamp: 2025-08-15T19:51:24.937Z
Learning: The redesigned clinical information components (AllergyTable, DiagnosisTable, SymptomTable) in care_fe use dynamic i18n lookups like `t(allergy.verification_status)`, `t(diagnosis.verification_status)`, and `t(symptom.verification_status)`. This means all possible verification status values (including "presumed", "confirmed", "unconfirmed", "refuted", "entered_in_error") need corresponding translation keys in the locale files, even if they're not directly referenced with explicit t() calls in the codebase.

Applied to files:

  • public/locale/en.json
📚 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/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: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/**/*Form*.{ts,tsx} : Medical form type patterns should organize related fields into logical nested object groups: personalInfo, medicalHistory, insuranceInfo for patient admission forms

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: 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: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-20T19:08:38.025Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9080
File: src/components/Users/UserEditDetails.tsx:90-97
Timestamp: 2024-11-20T19:08:38.025Z
Learning: In the React component `UserEditDetails` (src/components/Users/UserEditDetails.tsx), error handling for form submissions is handled within the `UserAddEditForm` component, so additional error handling is unnecessary.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Provide clear and visible focus indicators for complex medical workflows in CAREUI components

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2024-11-13T23:01:50.297Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9080
File: src/components/Users/UserAddEditForm.tsx:655-719
Timestamp: 2024-11-13T23:01:50.297Z
Learning: The duplication in form submission logic in `handleSubmit` has already been addressed in a previous comment.

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 focus management for dynamic content in page components

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Implement robust error handling with user-friendly medical context in CAREUI components

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Implement proper error boundaries in CAREUI components for critical medical data handling

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
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Custom React hooks for healthcare workflows must follow hooks.instructions.md

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 emergency and critical care scenarios appropriately in healthcare page components

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-06-25T05:54:03.491Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 12680
File: src/components/Questionnaire/QuestionnaireEditor.tsx:813-816
Timestamp: 2025-06-25T05:54:03.491Z
Learning: In React components using UI library Button components (like shadcn/ui), adding `type="submit"` to a Button with an onClick handler does not cause the double execution issues that might occur with native HTML buttons, as the UI library handles form submission differently.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-08-24T18:00:56.369Z
Learnt from: Denyme24
Repo: ohcnetwork/care_fe PR: 13297
File: src/pages/Facility/settings/activityDefinition/ActivityDefinitionForm.tsx:1096-1099
Timestamp: 2025-08-24T18:00:56.369Z
Learning: In the care_fe project, button disable logic in forms should rely solely on `isDirty` state (`form.formState.isDirty`), not on explicit required field validation, for both create and edit modes.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-03-30T12:22:58.576Z
Learnt from: hrit2773
Repo: ohcnetwork/care_fe PR: 11447
File: src/components/Questionnaire/QuestionnaireEditor.tsx:1055-1069
Timestamp: 2025-03-30T12:22:58.576Z
Learning: In the QuestionnaireEditor component, React Hook Form's onChange handlers are intentionally overridden with custom updateField calls to maintain component-specific state management instead of relying on React Hook Form's internal state.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-09-02T04:58:06.800Z
Learnt from: Denyme24
Repo: ohcnetwork/care_fe PR: 13238
File: src/pages/Facility/settings/billing/discount/discount-components/DiscountMonetaryComponentForm.tsx:63-67
Timestamp: 2025-09-02T04:58:06.800Z
Learning: In the care_fe project's discount forms (DiscountMonetaryComponentForm.tsx), maintainers prefer using path: ["factor", "amount"] for cross-field validation rather than dynamic path binding like path: [valueType]. The approach of adding per-field FormMessage components for either/or validation was previously rejected by maintainers.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-04-13T03:41:38.805Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 11815
File: src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx:332-341
Timestamp: 2025-04-13T03:41:38.805Z
Learning: Form inputs in React components should use the controlled component pattern (using `value` instead of `defaultValue`) to ensure they properly reflect changes from all sources, particularly for textareas and form elements that may be updated from multiple places.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:51:32.224Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/hooks.instructions.md:0-0
Timestamp: 2025-11-25T13:51:32.224Z
Learning: Applies to src/hooks/**/*.{ts,tsx} : Validate medical data inputs using `zod` schemas in custom hooks

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 : Form validation should use zod schemas with appropriate min/max constraints for vital signs (temperature: 95-110, heart rate: 30-200, blood pressure: 60-250 systolic / 40-150 diastolic)

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
📚 Learning: 2025-01-28T15:50:07.442Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 10260
File: src/components/Patient/PatientRegistration.tsx:286-289
Timestamp: 2025-01-28T15:50:07.442Z
Learning: For patient registration in the frontend, either year_of_birth or date_of_birth is required for successful registration. If date_of_birth is not available, year_of_birth must be present.

Applied to files:

  • src/components/Patient/PatientRegistration.tsx
🧬 Code graph analysis (1)
src/pages/Organization/components/GovtOrganizationSelector.tsx (1)
src/lib/utils.ts (1)
  • cn (4-6)
⏰ 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). (1)
  • GitHub Check: deploy-preview
🔇 Additional comments (12)
public/locale/en.json (1)

2594-2596: invalid_pincode string looks consistent and ready to ship.

Value matches existing “PIN code” casing/wording used elsewhere (e.g., enter_pincode) and avoids trailing punctuation.

src/pages/Organization/components/GovtOrganizationSelector.tsx (2)

10-10: LGTM!

The cn utility import follows the established pattern for conditional class composition.


124-124: LGTM!

The expanded dependency array correctly satisfies exhaustive-deps rules by including all values referenced within the effect.

src/components/Patient/PatientRegistration.tsx (9)

88-92: LGTM!

The controlled accordion state with conditional initial values based on quickRegistration is well implemented. This ensures predictable section visibility behavior.


97-97: LGTM!

Adding shouldFocusError: true enhances accessibility by automatically focusing the first invalid field on submission failure.


291-291: LGTM!

The pincode conversion to Number ensures consistent numeric data for the API payload, matching the input field's onChange handler.


315-331: LGTM!

The onInvalid handler correctly ensures all accordion sections are expanded before focusing the first invalid field. Using requestAnimationFrame appropriately waits for the DOM update after section expansion.


358-358: LGTM!

Proper usage of handleSubmit with both success and error callbacks, combined with noValidate to delegate validation entirely to the zod schema.


359-364: LGTM!

The accordion is now properly controlled via value and onValueChange, enabling programmatic section expansion in the onInvalid handler.


407-417: LGTM!

The submit button correctly distinguishes between create and update modes: for updates, it requires form changes (isDirty) to enable submission, while new patient creation is always available when not pending.


847-858: LGTM!

The mt-1 margin on FormMessage provides consistent error message spacing for the geo_organization field, aligning with the PR's goal of consistent validation error placement.


1064-1089: LGTM!

The dual validation issues for both the group field (age_or_dob) and the specific field (date_of_birth or age) ensure error messages are displayed at both the group and field levels, fulfilling the PR objective for consistent group-level validation.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/pages/PublicAppointments/PatientRegistration.tsx (2)

37-40: Prefer interface for props. (matches repo TS guidelines)


54-90: Blocker: age field can pass validation and submit as NaN.

With <Input type="number">, users can enter non-numeric values like "e" or "1e3". The current superRefine only validates negative values when Number(age) is not NaN—so invalid entries slip through undetected. At submit, Number(data.age) where age="e" evaluates to NaN, creating invalid patient records.

Proposed fix (coerce + validate age as a number)
   const patientSchema = z
     .object({
       name: z
         .string()
         .min(1, t("field_required"))
         .refine(validateName, t("min_char_length_error", { min_length: 3 })),
       gender: z.enum(GENDERS, { required_error: t("gender_is_required") }),
       address: z.string().min(1, t("field_required")),
-      age: z.string().optional(),
+      // Use z.coerce.number() to parse string input and reject non-numeric values,
+      // keeping the undefined-friendly pattern consistent with repo conventions.
+      age: z
+        .union([z.coerce.number().int().min(0), z.undefined()])
+        .optional(),
       date_of_birth: z.string().optional(),
       pincode: validators().pincode,
       geo_organization: z.string().min(1, t("organization_required")),
       ageInputType: z.enum(["age", "date_of_birth"]),
     })
     .superRefine((data, ctx) => {
       const field = data.ageInputType === "age" ? "age" : "date_of_birth";
       if (!data[field]) {
         ctx.addIssue({
           code: z.ZodIssueCode.custom,
           message: t("field_required"),
           path: [field],
         });
         return;
       }
-      if (
-        field === "age" &&
-        data.age &&
-        !isNaN(Number(data.age)) &&
-        Number(data.age) < 0
-      ) {
+      if (field === "age" && typeof data.age === "number" && data.age < 0) {
         ctx.addIssue({
           code: z.ZodIssueCode.custom,
           message: t("age_less_than_0"),
           path: ["age"],
         });
       }
     });
🤖 Fix all issues with AI agents
In `@src/pages/PublicAppointments/PatientRegistration.tsx`:
- Around line 353-364: The PIN input currently uses type="number" which allows
"e", "+", "-", "."; change the Input to use type="text" (or "tel") with
inputMode="numeric" and pattern="\d*" and update the onChange in the same
component (the handler that calls field.onChange) to sanitize the raw value by
stripping any non-digit characters (e.g., value.replace(/\D+/g, '')), treat the
empty string as undefined, and then call field.onChange(Number(sanitized) or
undefined). This keeps the UI from accepting exponent/negative symbols while
preserving the existing conversion via field.onChange.
📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 356cb00 and 3045713.

📒 Files selected for processing (1)
  • src/pages/PublicAppointments/PatientRegistration.tsx
🧰 Additional context used
📓 Path-based instructions (12)
**/*.{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
Use interface for defining object types in TypeScript
Avoid explicit any type 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 using any type; 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 the query and mutate utilities 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
Use useQuery hook with queryKey and queryFn parameters, where queryFn wraps the API route with the query() utility
Use useMutation hook with mutationFn parameter wrapping API routes with the mutate() utility, and implement onSuccess callbacks to invalidate related queries
Support path parameters in TanStack Query using the pathParams option in query/mutate utilities
Support query parameters in TanStack Query using the queryParams option in query/mutate utilities
Use the silent: true option to suppress global error notifications when custom error handling is needed

**/*.{ts,tsx}: Use TypeScript with strict mode and ES2022 target
Use interface for defining object types
Avoid explicit any types and maint...

Files:

  • src/pages/PublicAppointments/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/PublicAppointments/PatientRegistration.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Use declarative JSX

Files:

  • src/pages/PublicAppointments/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/PublicAppointments/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/PublicAppointments/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 in src/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
Use raviger router 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-query for 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 with zod schemas 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/PublicAppointments/PatientRegistration.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/PublicAppointments/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/PublicAppointments/PatientRegistration.tsx
**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Use 2-space indentation

Files:

  • src/pages/PublicAppointments/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.tsx for 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/PublicAppointments/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
Use navigate and useRedirect from 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 from src/Locale/ for internationalization
Support RTL languages in components
Use proper date/time formatting for multiple language support

Files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
**/*.{ts,tsx,js,jsx,json,css,scss,html}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation

Files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
🧠 Learnings (48)
📓 Common learnings
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 13197
File: src/pages/Facility/settings/observationDefinition/ObservationDefinitionForm.tsx:470-495
Timestamp: 2025-09-16T20:46:59.537Z
Learning: In PR `#13197`, AdityaJ2305 indicated that aria-invalid and ref forwarding improvements for ValueSetSelect components can be deferred to a separate PR, considering them not critical for the current focus/scroll fix implementation.
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
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
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 medical data validation for patient identifiers and clinical data in validators.ts
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Implement appropriate validation for clinical data inputs in CAREUI components
📚 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/pages/PublicAppointments/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/pages/PublicAppointments/PatientRegistration.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/PublicAppointments/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} : Implement proper data validation for medical information in page components

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Ensure full compatibility with react-hook-form for medical data collection in CAREUI components

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Applies to src/**/*{[Ff]orm,[Ii]nput,[Ff]ield}*.{ts,tsx} : Use react-hook-form with zod validation for medical data integrity in form components

Applied to files:

  • src/pages/PublicAppointments/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} : Implement proper form validation with `zod` schemas in page components

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.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/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Implement appropriate validation for clinical data inputs in CAREUI components

Applied to files:

  • src/pages/PublicAppointments/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/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Provide clear and visible focus indicators for complex medical workflows in CAREUI components

Applied to files:

  • src/pages/PublicAppointments/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} : Add ARIA labels for critical medical data (patient names, vital signs, medication alerts)

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-09-16T20:46:59.537Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 13197
File: src/pages/Facility/settings/observationDefinition/ObservationDefinitionForm.tsx:470-495
Timestamp: 2025-09-16T20:46:59.537Z
Learning: In PR `#13197`, AdityaJ2305 indicated that aria-invalid and ref forwarding improvements for ValueSetSelect components can be deferred to a separate PR, considering them not critical for the current focus/scroll fix implementation.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Use standard medical component interface patterns with medicalContext, accessibility properties (ariaLabel, screenReaderText), clinical validation callbacks (onValidationError), and medical data properties (patientId, facilityId)

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.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 medical data validation for patient identifiers and clinical data in validators.ts

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2024-11-05T16:18:57.875Z
Learnt from: AnveshNalimela
Repo: ohcnetwork/care_fe PR: 8930
File: cypress/pageobject/Users/UserCreation.ts:31-42
Timestamp: 2024-11-05T16:18:57.875Z
Learning: In `UserCreationPage` of `UserCreation.ts`, methods like `typePhoneNumber` and `typeUserPhoneNumber` target different input fields and are both necessary.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-03-26T03:27:10.527Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 11557
File: src/pages/Organization/OrganizationPatients.tsx:177-178
Timestamp: 2025-03-26T03:27:10.527Z
Learning: In the Patient interface (src/types/emr/newPatient.ts), phone_number is a required field according to the TypeScript type definition and doesn't need null checks before formatting.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2024-11-14T08:09:58.453Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9080
File: cypress/pageobject/Users/ManageUserPage.ts:67-97
Timestamp: 2024-11-14T08:09:58.453Z
Learning: In Cypress test files (`cypress/pageobject/Users/ManageUserPage.ts`), when methods are called to check input provided earlier in the test, adding TypeScript interfaces, input validation, and custom error messages is unnecessary.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:53:40.623Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/utils.instructions.md:0-0
Timestamp: 2025-11-25T13:53:40.623Z
Learning: Applies to src/Utils/**/*.{ts,tsx} : Provide clear validation error messages in validation utilities

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:53:40.623Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/utils.instructions.md:0-0
Timestamp: 2025-11-25T13:53:40.623Z
Learning: Applies to src/Utils/**/*.{ts,tsx} : Validate input parameters in utility functions when necessary

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:53:40.623Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/utils.instructions.md:0-0
Timestamp: 2025-11-25T13:53:40.623Z
Learning: Applies to src/Utils/**/*.{ts,tsx} : Create reusable validation schemas in validation utilities

Applied to files:

  • src/pages/PublicAppointments/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/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2024-11-13T23:01:50.297Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9080
File: src/components/Users/UserAddEditForm.tsx:655-719
Timestamp: 2024-11-13T23:01:50.297Z
Learning: The duplication in form submission logic in `handleSubmit` has already been addressed in a previous comment.

Applied to files:

  • src/pages/PublicAppointments/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 : Use zod for form validation schemas in validation.tsx

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-09-02T04:58:06.800Z
Learnt from: Denyme24
Repo: ohcnetwork/care_fe PR: 13238
File: src/pages/Facility/settings/billing/discount/discount-components/DiscountMonetaryComponentForm.tsx:63-67
Timestamp: 2025-09-02T04:58:06.800Z
Learning: In the care_fe project's discount forms (DiscountMonetaryComponentForm.tsx), maintainers prefer using path: ["factor", "amount"] for cross-field validation rather than dynamic path binding like path: [valueType]. The approach of adding per-field FormMessage components for either/or validation was previously rejected by maintainers.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-01-14T05:04:43.093Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9838
File: src/components/Questionnaire/QuestionnaireForm.tsx:100-105
Timestamp: 2025-01-14T05:04:43.093Z
Learning: The QuestionnaireForm component in care_fe uses raviger's useNavigationPrompt hook for handling navigation prompts, replacing a previous custom hook implementation.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:51:32.224Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/hooks.instructions.md:0-0
Timestamp: 2025-11-25T13:51:32.224Z
Learning: Applies to src/hooks/**/*.{ts,tsx} : Validate medical data inputs using `zod` schemas in custom hooks

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:51:32.224Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/hooks.instructions.md:0-0
Timestamp: 2025-11-25T13:51:32.224Z
Learning: Applies to src/hooks/**/*.{ts,tsx} : Use `useState` for local state and `tanstack/react-query` for server state in custom hooks

Applied to files:

  • src/pages/PublicAppointments/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 `tanstack/react-query` for server state management with facility data and patient records

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Integrate CAREUI components with React Query for real-time data from medical API endpoints

Applied to files:

  • src/pages/PublicAppointments/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/**/*.{ts,tsx} : Integrate with tanstack/react-query for server state management in providers

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-01-31T22:13:06.153Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 10345
File: src/components/Resource/ResourceDetailsUpdate.tsx:132-145
Timestamp: 2025-01-31T22:13:06.153Z
Learning: The migration from useTanStackQueryInstead to useQuery in React components requires:
1. Updating types to use UseQueryResult instead of custom hook return type
2. Replacing loading with isLoading property
3. Using queryKey array for cache management
4. Using queryFn with query utility function

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Custom React hooks for healthcare workflows must follow hooks.instructions.md

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Support zod schemas for medical data validation and FHIR compliance in CAREUI components

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-01-14T09:22:13.878Z
Learnt from: rajku-dev
Repo: ohcnetwork/care_fe PR: 9887
File: src/components/Users/CreateUserForm.tsx:93-93
Timestamp: 2025-01-14T09:22:13.878Z
Learning: In CreateUserForm.tsx, the gender validation schema uses string literals that match GENDER_TYPES.map(g => g.id). Using GENDER_TYPES directly with z.enum() fails because it's marked with 'as const' which makes it a readonly tuple type incompatible with Zod's enum.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-01-17T11:34:37.003Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 10027
File: src/components/Users/UserForm.tsx:34-34
Timestamp: 2025-01-17T11:34:37.003Z
Learning: In the care_fe codebase, the GENDERS constant is defined with a type assertion `as [(typeof GENDER_TYPES)[number]["id"]]` which makes it compatible with `z.enum()` in Zod schemas. This pattern is preferred over using string literals directly.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-01-28T15:50:07.442Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 10260
File: src/components/Patient/PatientRegistration.tsx:286-289
Timestamp: 2025-01-28T15:50:07.442Z
Learning: For patient registration in the frontend, either year_of_birth or date_of_birth is required for successful registration. If date_of_birth is not available, year_of_birth must be present.

Applied to files:

  • src/pages/PublicAppointments/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/pages/PublicAppointments/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/pages/PublicAppointments/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/**/*Form*.{ts,tsx} : Medical form type patterns should organize related fields into logical nested object groups: personalInfo, medicalHistory, insuranceInfo for patient admission forms

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-04-13T03:41:38.805Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 11815
File: src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx:332-341
Timestamp: 2025-04-13T03:41:38.805Z
Learning: Form inputs in React components should use the controlled component pattern (using `value` instead of `defaultValue`) to ensure they properly reflect changes from all sources, particularly for textareas and form elements that may be updated from multiple places.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-04-13T03:41:38.805Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 11815
File: src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx:332-341
Timestamp: 2025-04-13T03:41:38.805Z
Learning: Textareas and other form inputs in the codebase should use the controlled component pattern (using `value` instead of `defaultValue`) to ensure they properly reflect changes from all sources.

Applied to files:

  • src/pages/PublicAppointments/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} : Handle controlled inputs with proper TypeScript typing for form state

Applied to files:

  • src/pages/PublicAppointments/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} : Use controlled components for form inputs in page components

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-03-30T12:22:58.576Z
Learnt from: hrit2773
Repo: ohcnetwork/care_fe PR: 11447
File: src/components/Questionnaire/QuestionnaireEditor.tsx:1055-1069
Timestamp: 2025-03-30T12:22:58.576Z
Learning: In the QuestionnaireEditor component, React Hook Form's onChange handlers are intentionally overridden with custom updateField calls to maintain component-specific state management instead of relying on React Hook Form's internal state.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.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/PublicAppointments/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/PublicAppointments/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). (1)
  • GitHub Check: deploy-preview
🔇 Additional comments (2)
src/pages/PublicAppointments/PatientRegistration.tsx (2)

94-103: mode: "onSubmit" + shouldFocusError: true matches the “show errors on first submit” objective.
Nothing concerning here; just ensure the UI still expands/scrolls appropriately where applicable (if accordions exist elsewhere).


149-163: Fix the pincode schema to handle string-to-number coercion at the validator level.

The current schema expects z.number() but HTML number inputs return strings. The Number(data.pincode) conversion at line 159 is compensating for this type mismatch and is necessary as a workaround. Instead, update the validator to use z.coerce.number() to handle coercion consistently:

pincode: z
  .coerce.number()
  .int()
  .positive()
  .min(100000, t("pincode_must_be_6_digits"))
  .max(999999, t("pincode_must_be_6_digits")),

Then the Number(data.pincode) conversion at submit time becomes truly redundant and can be removed, as the schema will have already coerced the input string to a number.

Likely an incorrect or invalid review comment.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (1)
src/pages/PublicAppointments/PatientRegistration.tsx (1)

407-414: Disable submit button during pending mutations to prevent double submissions.

The isCreatingAppointment state exists but isn't used to disable the submit button. Users could click multiple times during the creation flow, potentially causing duplicate patient records or appointments.

🐛 Proposed fix
               <Button
                 variant="primary_gradient"
                 className="sm:w-1/5"
                 type="submit"
+                disabled={isCreatingAppointment}
               >

Additionally, consider tracking the createPatient mutation's pending state to disable during the entire flow:

const { mutate: createPatient, isPending: isCreatingPatient } = useMutation({
  // ...
});

Then use disabled={isCreatingPatient || isCreatingAppointment}.

♻️ Duplicate comments (1)
src/pages/PublicAppointments/PatientRegistration.tsx (1)

353-368: Pincode input handling looks correct.

The onChange handler properly validates digits-only input and converts to Number or undefined. The type="number" with the regex guard provides functional validation.

📜 Review details

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3045713 and e2ee77f.

📒 Files selected for processing (1)
  • src/pages/PublicAppointments/PatientRegistration.tsx
🧰 Additional context used
📓 Path-based instructions (12)
**/*.{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
Use interface for defining object types in TypeScript
Avoid explicit any type 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 using any type; 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 the query and mutate utilities 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
Use useQuery hook with queryKey and queryFn parameters, where queryFn wraps the API route with the query() utility
Use useMutation hook with mutationFn parameter wrapping API routes with the mutate() utility, and implement onSuccess callbacks to invalidate related queries
Support path parameters in TanStack Query using the pathParams option in query/mutate utilities
Support query parameters in TanStack Query using the queryParams option in query/mutate utilities
Use the silent: true option to suppress global error notifications when custom error handling is needed

**/*.{ts,tsx}: Use TypeScript with strict mode and ES2022 target
Use interface for defining object types
Avoid explicit any types and maint...

Files:

  • src/pages/PublicAppointments/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/PublicAppointments/PatientRegistration.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Use declarative JSX

Files:

  • src/pages/PublicAppointments/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/PublicAppointments/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/PublicAppointments/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 in src/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
Use raviger router 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-query for 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 with zod schemas 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/PublicAppointments/PatientRegistration.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/PublicAppointments/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/PublicAppointments/PatientRegistration.tsx
**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Use 2-space indentation

Files:

  • src/pages/PublicAppointments/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.tsx for 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/PublicAppointments/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
Use navigate and useRedirect from 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 from src/Locale/ for internationalization
Support RTL languages in components
Use proper date/time formatting for multiple language support

Files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
**/*.{ts,tsx,js,jsx,json,css,scss,html}

📄 CodeRabbit inference engine (AGENTS.md)

Use 2-space indentation

Files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
🧠 Learnings (50)
📓 Common learnings
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 13197
File: src/pages/Facility/settings/observationDefinition/ObservationDefinitionForm.tsx:470-495
Timestamp: 2025-09-16T20:46:59.537Z
Learning: In PR `#13197`, AdityaJ2305 indicated that aria-invalid and ref forwarding improvements for ValueSetSelect components can be deferred to a separate PR, considering them not critical for the current focus/scroll fix implementation.
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
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
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 medical data validation for patient identifiers and clinical data in validators.ts
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.
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Implement appropriate validation for clinical data inputs in CAREUI components
Learnt from: rajku-dev
Repo: ohcnetwork/care_fe PR: 9887
File: src/components/Users/CreateUserForm.tsx:86-92
Timestamp: 2025-01-14T09:50:51.248Z
Learning: When suggesting new validation messages in code, always check and add corresponding translation keys to the locale files (e.g., public/locale/en.json) to maintain internationalization support.
📚 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/pages/PublicAppointments/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/pages/PublicAppointments/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} : Implement proper data validation for medical information in page components

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Ensure full compatibility with react-hook-form for medical data collection in CAREUI components

Applied to files:

  • src/pages/PublicAppointments/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/pages/PublicAppointments/PatientRegistration.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/PublicAppointments/PatientRegistration.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/PublicAppointments/PatientRegistration.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 medical data validation for patient identifiers and clinical data in validators.ts

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Applies to src/**/*{[Ff]orm,[Ii]nput,[Ff]ield}*.{ts,tsx} : Use react-hook-form with zod validation for medical data integrity in form components

Applied to files:

  • src/pages/PublicAppointments/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/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Provide clear and visible focus indicators for complex medical workflows in CAREUI components

Applied to files:

  • src/pages/PublicAppointments/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} : Add ARIA labels for critical medical data (patient names, vital signs, medication alerts)

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-09-16T20:46:59.537Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 13197
File: src/pages/Facility/settings/observationDefinition/ObservationDefinitionForm.tsx:470-495
Timestamp: 2025-09-16T20:46:59.537Z
Learning: In PR `#13197`, AdityaJ2305 indicated that aria-invalid and ref forwarding improvements for ValueSetSelect components can be deferred to a separate PR, considering them not critical for the current focus/scroll fix implementation.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Use standard medical component interface patterns with medicalContext, accessibility properties (ariaLabel, screenReaderText), clinical validation callbacks (onValidationError), and medical data properties (patientId, facilityId)

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Implement appropriate validation for clinical data inputs in CAREUI components

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2024-11-05T16:18:57.875Z
Learnt from: AnveshNalimela
Repo: ohcnetwork/care_fe PR: 8930
File: cypress/pageobject/Users/UserCreation.ts:31-42
Timestamp: 2024-11-05T16:18:57.875Z
Learning: In `UserCreationPage` of `UserCreation.ts`, methods like `typePhoneNumber` and `typeUserPhoneNumber` target different input fields and are both necessary.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-03-26T03:27:10.527Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 11557
File: src/pages/Organization/OrganizationPatients.tsx:177-178
Timestamp: 2025-03-26T03:27:10.527Z
Learning: In the Patient interface (src/types/emr/newPatient.ts), phone_number is a required field according to the TypeScript type definition and doesn't need null checks before formatting.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2024-11-14T08:09:58.453Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9080
File: cypress/pageobject/Users/ManageUserPage.ts:67-97
Timestamp: 2024-11-14T08:09:58.453Z
Learning: In Cypress test files (`cypress/pageobject/Users/ManageUserPage.ts`), when methods are called to check input provided earlier in the test, adding TypeScript interfaces, input validation, and custom error messages is unnecessary.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:53:40.623Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/utils.instructions.md:0-0
Timestamp: 2025-11-25T13:53:40.623Z
Learning: Applies to src/Utils/**/*.{ts,tsx} : Provide clear validation error messages in validation utilities

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:53:40.623Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/utils.instructions.md:0-0
Timestamp: 2025-11-25T13:53:40.623Z
Learning: Applies to src/Utils/**/*.{ts,tsx} : Validate input parameters in utility functions when necessary

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:53:40.623Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/utils.instructions.md:0-0
Timestamp: 2025-11-25T13:53:40.623Z
Learning: Applies to src/Utils/**/*.{ts,tsx} : Create reusable validation schemas in validation utilities

Applied to files:

  • src/pages/PublicAppointments/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/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2024-11-13T23:01:50.297Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9080
File: src/components/Users/UserAddEditForm.tsx:655-719
Timestamp: 2024-11-13T23:01:50.297Z
Learning: The duplication in form submission logic in `handleSubmit` has already been addressed in a previous comment.

Applied to files:

  • src/pages/PublicAppointments/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 : Use zod for form validation schemas in validation.tsx

Applied to files:

  • src/pages/PublicAppointments/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} : Implement proper form validation with `zod` schemas in page components

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-09-02T04:58:06.800Z
Learnt from: Denyme24
Repo: ohcnetwork/care_fe PR: 13238
File: src/pages/Facility/settings/billing/discount/discount-components/DiscountMonetaryComponentForm.tsx:63-67
Timestamp: 2025-09-02T04:58:06.800Z
Learning: In the care_fe project's discount forms (DiscountMonetaryComponentForm.tsx), maintainers prefer using path: ["factor", "amount"] for cross-field validation rather than dynamic path binding like path: [valueType]. The approach of adding per-field FormMessage components for either/or validation was previously rejected by maintainers.

Applied to files:

  • src/pages/PublicAppointments/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 : Form validation should use zod schemas with appropriate min/max constraints for vital signs (temperature: 95-110, heart rate: 30-200, blood pressure: 60-250 systolic / 40-150 diastolic)

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-04-13T03:41:38.805Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 11815
File: src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx:332-341
Timestamp: 2025-04-13T03:41:38.805Z
Learning: Textareas and other form inputs in the codebase should use the controlled component pattern (using `value` instead of `defaultValue`) to ensure they properly reflect changes from all sources.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-12-05T19:05:40.922Z
Learnt from: pratyush07-hub
Repo: ohcnetwork/care_fe PR: 14651
File: src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx:252-257
Timestamp: 2025-12-05T19:05:40.922Z
Learning: In healthcare components handling discharge status (like EncounterQuestion.tsx), maintainers implement defense-in-depth by adding early-return guards in change handlers (e.g., `if (isDischarged) return;`) even when the UI control is also disabled, to ensure business-critical immutability rules are enforced at multiple layers and protect against edge cases like browser extensions or unexpected UI library behavior.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-01-14T05:04:43.093Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 9838
File: src/components/Questionnaire/QuestionnaireForm.tsx:100-105
Timestamp: 2025-01-14T05:04:43.093Z
Learning: The QuestionnaireForm component in care_fe uses raviger's useNavigationPrompt hook for handling navigation prompts, replacing a previous custom hook implementation.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:51:32.224Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/hooks.instructions.md:0-0
Timestamp: 2025-11-25T13:51:32.224Z
Learning: Applies to src/hooks/**/*.{ts,tsx} : Validate medical data inputs using `zod` schemas in custom hooks

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:51:32.224Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/hooks.instructions.md:0-0
Timestamp: 2025-11-25T13:51:32.224Z
Learning: Applies to src/hooks/**/*.{ts,tsx} : Use `useState` for local state and `tanstack/react-query` for server state in custom hooks

Applied to files:

  • src/pages/PublicAppointments/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 `tanstack/react-query` for server state management with facility data and patient records

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Integrate CAREUI components with React Query for real-time data from medical API endpoints

Applied to files:

  • src/pages/PublicAppointments/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/**/*.{ts,tsx} : Integrate with tanstack/react-query for server state management in providers

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-01-31T22:13:06.153Z
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 10345
File: src/components/Resource/ResourceDetailsUpdate.tsx:132-145
Timestamp: 2025-01-31T22:13:06.153Z
Learning: The migration from useTanStackQueryInstead to useQuery in React components requires:
1. Updating types to use UseQueryResult instead of custom hook return type
2. Replacing loading with isLoading property
3. Using queryKey array for cache management
4. Using queryFn with query utility function

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:10.786Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T13:50:10.786Z
Learning: Custom React hooks for healthcare workflows must follow hooks.instructions.md

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-11-25T13:50:46.407Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/careui.instructions.md:0-0
Timestamp: 2025-11-25T13:50:46.407Z
Learning: Applies to src/CAREUI/**/*.{ts,tsx} : Support zod schemas for medical data validation and FHIR compliance in CAREUI components

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-01-14T09:22:13.878Z
Learnt from: rajku-dev
Repo: ohcnetwork/care_fe PR: 9887
File: src/components/Users/CreateUserForm.tsx:93-93
Timestamp: 2025-01-14T09:22:13.878Z
Learning: In CreateUserForm.tsx, the gender validation schema uses string literals that match GENDER_TYPES.map(g => g.id). Using GENDER_TYPES directly with z.enum() fails because it's marked with 'as const' which makes it a readonly tuple type incompatible with Zod's enum.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-01-17T11:34:37.003Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 10027
File: src/components/Users/UserForm.tsx:34-34
Timestamp: 2025-01-17T11:34:37.003Z
Learning: In the care_fe codebase, the GENDERS constant is defined with a type assertion `as [(typeof GENDER_TYPES)[number]["id"]]` which makes it compatible with `z.enum()` in Zod schemas. This pattern is preferred over using string literals directly.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-01-28T15:50:07.442Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 10260
File: src/components/Patient/PatientRegistration.tsx:286-289
Timestamp: 2025-01-28T15:50:07.442Z
Learning: For patient registration in the frontend, either year_of_birth or date_of_birth is required for successful registration. If date_of_birth is not available, year_of_birth must be present.

Applied to files:

  • src/pages/PublicAppointments/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/pages/PublicAppointments/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/**/*Form*.{ts,tsx} : Medical form type patterns should organize related fields into logical nested object groups: personalInfo, medicalHistory, insuranceInfo for patient admission forms

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-04-13T03:41:38.805Z
Learnt from: rithviknishad
Repo: ohcnetwork/care_fe PR: 11815
File: src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx:332-341
Timestamp: 2025-04-13T03:41:38.805Z
Learning: Form inputs in React components should use the controlled component pattern (using `value` instead of `defaultValue`) to ensure they properly reflect changes from all sources, particularly for textareas and form elements that may be updated from multiple places.

Applied to files:

  • src/pages/PublicAppointments/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} : Handle controlled inputs with proper TypeScript typing for form state

Applied to files:

  • src/pages/PublicAppointments/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} : Use controlled components for form inputs in page components

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.tsx
📚 Learning: 2025-03-30T12:22:58.576Z
Learnt from: hrit2773
Repo: ohcnetwork/care_fe PR: 11447
File: src/components/Questionnaire/QuestionnaireEditor.tsx:1055-1069
Timestamp: 2025-03-30T12:22:58.576Z
Learning: In the QuestionnaireEditor component, React Hook Form's onChange handlers are intentionally overridden with custom updateField calls to maintain component-specific state management instead of relying on React Hook Form's internal state.

Applied to files:

  • src/pages/PublicAppointments/PatientRegistration.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/PublicAppointments/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/PublicAppointments/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). (1)
  • GitHub Check: deploy-preview
🔇 Additional comments (5)
src/pages/PublicAppointments/PatientRegistration.tsx (5)

14-20: LGTM!

Import reordering follows the project's import order convention.


63-90: LGTM!

The schema correctly simplifies date_of_birth to z.string().optional() to match the DateField output, and the superRefine properly enforces that either DOB or age is provided based on user selection.


94-103: LGTM!

The mode: "onSubmit" and shouldFocusError: true configuration correctly ensures validation errors are shown and focused on form submission, aligning with the PR objectives.


370-388: LGTM!

The GovtOrganizationSelector field structure is correct with the required prop and proper FormMessage placement.


149-163: The pincode field is protected by the required validator z.number().int().positive().min(100000).max(999999), which prevents undefined values from reaching the onSubmit handler. Zod validation will fail if the pincode field is empty or invalid, blocking form submission. When onSubmit executes, data.pincode is guaranteed to be a valid number, making the defensive check unnecessary.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@abhimanyurajeesh
Copy link
Contributor

The Cloudflare deploy-preview failure is because fork contributors don’t have permission to post deployment statuses to the upstream repository.

The build and deploy steps are completing successfully, but the final status update API call is returning a 404, so the check is marked as failed.

This is a known limitation of the current setup and is not caused by this code changes.

#15133 (comment)

"lint-staged": "^15.2.10",
"marked": "^15.0.0",
"prettier": "^3.3.3",
"prettier": "^3.7.4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the package-lock.json changes to keep this PR focused and clean.

@vipulpandey21
Copy link
Author

Hi @abhimanyurajeesh @SiddanthNayak
Could you please guide me further on this PR?

@github-actions github-actions bot added needs-triage question Further information is requested labels Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validation errors do not show on Register click & State field error is misaligned

4 participants