feat: add report date and requester fields to diagnostic report#15019
Conversation
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughAdds display of patient official identifiers, age, sex, requester, and report date across diagnostic report views/print, introduces a new translation key, and extends the DiagnosticReportRead type with a Changes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR adds report date and requester fields to diagnostic reports, enhancing the metadata displayed on printed diagnostic reports. The changes update the data model and modify the print layout to display the new requester field and use report creation date instead of encounter date.
Key changes:
- Added
requesterfield toDiagnosticReportReadinterface - Updated diagnostic report print view to display requester, report date, patient identifiers, and age/sex
- Added "report_date" internationalization string
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/types/emr/diagnosticReport/diagnosticReport.ts | Added requester field to DiagnosticReportRead interface |
| src/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx | Restructured print layout to display requester, report date, patient identifiers, and age/sex information |
| public/locale/en.json | Added "report_date" translation key |
There was a problem hiding this comment.
Actionable comments posted: 2
Fix all issues with AI Agents 🤖
In @src/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx:
- Around line 187-207: The patient identifier rendering block (checking
report.encounter?.patient and filtering by PatientIdentifierUse.official) needs
ARIA labels and null-safe display; update the mapped JSX for each identifier
(keyed by identifier.config.id) to add aria-label attributes (e.g., aria-label
on the label span and the value span that reference
identifier.config.config.display or identifier.config.id for uniqueness) and
render the value with a safe fallback (e.g., use identifier.value ?? "-" or
identifier.value || "-" ) so null/empty values show a placeholder; keep the
existing structure and key but ensure both accessibility and null safety are
applied.
In @src/types/emr/diagnosticReport/diagnosticReport.ts:
- Line 53: Add a JSDoc comment to the DiagnosticReportRead interface clarifying
the clinical roles of the three UserReadMinimal fields: document that requester
is the clinician who ordered/requested the diagnostic report (clinical workflow
role), created_by is the user who recorded/created the report in the system, and
updated_by is the user who last modified the report; place this comment above
the DiagnosticReportRead interface declaration and mention the field names
requester, created_by, and updated_by explicitly so implementers understand
their distinct meanings.
📜 Review details
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
public/locale/en.jsonsrc/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.tsxsrc/types/emr/diagnosticReport/diagnosticReport.ts
🧰 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
Useinterfacefor defining object types in TypeScript
Avoid explicitanytype in TypeScript
Use proper nullability annotations in TypeScript types
Use dedicated error handlers and TypeScript strict null checks
**/*.{ts,tsx}: Use TypeScript for all new code
Prefer interfaces over types for object definitions in TypeScript
Avoid usinganytype; use proper type definitions in TypeScript
Use type inference where possible in TypeScript
Use TanStack Query for API data management
Prefer React Context for global state management
**/*.{ts,tsx}: Use TanStack Query with thequeryandmutateutilities from@/Utils/request/
Use appropriate query keys following the resource pattern for TanStack Query
Leverage TanStack Query built-in features for pagination and debouncing
Implement proper error handling using the global error handler for TanStack Query operations
UseuseQueryhook withqueryKeyandqueryFnparameters, wherequeryFnwraps the API route with thequery()utility
UseuseMutationhook withmutationFnparameter wrapping API routes with themutate()utility, and implementonSuccesscallbacks to invalidate related queries
Support path parameters in TanStack Query using thepathParamsoption in query/mutate utilities
Support query parameters in TanStack Query using thequeryParamsoption in query/mutate utilities
Use thesilent: trueoption to suppress global error notifications when custom error handling is needed
**/*.{ts,tsx}: Use TypeScript with strict mode and ES2022 target
Useinterfacefor defining object types
Avoid explicitanytypes and maint...
Files:
src/types/emr/diagnosticReport/diagnosticReport.tssrc/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.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/types/emr/diagnosticReport/diagnosticReport.tssrc/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.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/types/emr/diagnosticReport/diagnosticReport.tssrc/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx
src/**/*.{ts,tsx,css}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use Prettier for consistent code formatting across the healthcare application
Files:
src/types/emr/diagnosticReport/diagnosticReport.tssrc/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx
src/{Utils,types,providers}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Document medical data flows, validation requirements, and healthcare workflows with clinical reasoning in API and utility code comments
Files:
src/types/emr/diagnosticReport/diagnosticReport.ts
src/types/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use strict typing for all medical data structures and API interfaces in TypeScript type definitions
src/types/**/*.{ts,tsx}: Organize types into domain-specific subdirectories within src/types/: emr/ (Electronic Medical Records), facility/, auth/, user/, billing/, inventory/, and scheduling/
Follow existing enum patterns from patient.ts: use PascalCase enum names with snake_case enum values, and always include an 'Unknown' fallback option
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/
Use ISO 8601 format strings for all date/time fields in type definitions (e.g., created_date: string for medical appointments and schedules)
Define healthcare-specific utility types as union types: EmergencyPriority ('critical' | 'urgent' | 'semi-urgent' | 'non-urgent'), BedStatus, and MedicationRoute
Zod schema definitions must match corresponding TypeScript interfaces, including validation rules (min/max for strings/numbers, regex for phone numbers, nativeEnum for enums), and export inferred typesTypeScript type definitions and typed API definitions should be organized in src/types/ directory
Files:
src/types/emr/diagnosticReport/diagnosticReport.ts
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/types/emr/diagnosticReport/diagnosticReport.tssrc/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx
src/types/emr/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/instructions/typescript-types.instructions.md)
Apply strict validation for medical records types: blood type, allergies, and medications must be properly typed and validated for patient safety
Files:
src/types/emr/diagnosticReport/diagnosticReport.ts
**/*
📄 CodeRabbit inference engine (CLAUDE.md)
Use 2-space indentation
Files:
src/types/emr/diagnosticReport/diagnosticReport.tspublic/locale/en.jsonsrc/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx
**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/02-coding-standards.mdc)
Use camelCase for utility file names (e.g.,
useAuth.ts)
Files:
src/types/emr/diagnosticReport/diagnosticReport.ts
**/*.{tsx,ts}
📄 CodeRabbit inference engine (.cursor/rules/04-ui-components.mdc)
**/*.{tsx,ts}: Use Shadcn UI components as the primary component library
Follow the component documentation for proper usage
Customize components using Tailwind CSS
UsenavigateanduseRedirectfrom raviger for navigation and redirects
Use Tailwind's responsive classes and follow mobile-first approach
Implement proper ARIA attributes for accessibility
Ensure keyboard navigation works in components
Define component props using TypeScript interfaces
Use translation keys fromsrc/Locale/for internationalization
Support RTL languages in components
Use proper date/time formatting for multiple language support
Files:
src/types/emr/diagnosticReport/diagnosticReport.tssrc/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx
**/*.{ts,tsx,js,jsx,json,css,scss,html}
📄 CodeRabbit inference engine (AGENTS.md)
Use 2-space indentation
Files:
src/types/emr/diagnosticReport/diagnosticReport.tspublic/locale/en.jsonsrc/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.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
**/*.{tsx,jsx}
📄 CodeRabbit inference engine (.cursorrules)
Use declarative JSX
Files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx
src/pages/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use raviger for application routing in page components and route definitions
src/pages/**/*.{ts,tsx}: Keep page components insrc/pages/organized by feature
Use descriptive file names that reflect the page purpose
Export page components as default exports
Co-locate page-specific components and utilities with page components
Useravigerrouter for navigation (existing dependency)
Implement proper route parameters and query string handling
Handle navigation guards and authentication checks in page components
Implement proper loading states and error boundaries in page components
Use semantic HTML structure for accessibility in page components
Use@tanstack/react-queryfor API state management in page components (existing dependency)
Implement proper loading, error, and success states for data fetching
Handle pagination and infinite scroll patterns appropriately
Cache data appropriately in page components based on usage patterns
Use controlled components for form inputs in page components
Implement proper form validation withzodschemas in page components
Handle form submission states (loading, success, error) in page components
Use React hooks for local page state
Minimize unnecessary re-renders in page components
Implement proper authentication checks in page components
Handle different user roles and permissions in page components
Redirect to login when authentication is required in page components
Show appropriate UI based on user permissions in page components
Set appropriate page titles and meta descriptions in page components
Handle OpenGraph and Twitter card meta tags in page components
Implement structured data where applicable in page components
Implement code splitting for large page components
Use lazy loading for heavy components within page components
Optimize bundle size with proper imports in page components
Handle image optimization and lazy loading in page components
Implement comprehensive error boundaries in page components
Handle API e...
Files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.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/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx
**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/02-coding-standards.mdc)
**/*.tsx: Use functional components with proper type definitions in React
One component per file is preferred
Prefer default exports for React components
Follow the component naming pattern:ComponentName.tsxfor React components
Use Tailwind CSS for styling
Use Shadcn UI components when available
Use local state for component-specific data
Use PascalCase for component file names (e.g.,AuthWizard.tsx)
Files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx
🧠 Learnings (28)
📓 Common learnings
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
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.
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)
Learnt from: AdityaJ2305
Repo: ohcnetwork/care_fe PR: 12882
File: public/locale/en.json:3356-3356
Timestamp: 2025-08-15T19:51:24.937Z
Learning: In the AllergyTable component and related redesigned components (SymptomTable, DiagnosisTable) in `src/components/Patient/allergy/AllergyTable.tsx`, dynamic i18n lookups are used like `t(allergy.verification_status)` where the verification_status field can contain values like "presumed", "confirmed", "unconfirmed", etc. These require corresponding translation keys in the locale files.
📚 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/types/emr/diagnosticReport/diagnosticReport.tssrc/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.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/{Utils,types,providers}/**/*.{ts,tsx} : Document medical data flows, validation requirements, and healthcare workflows with clinical reasoning in API and utility code comments
Applied to files:
src/types/emr/diagnosticReport/diagnosticReport.tssrc/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use `PatientRead` type from `@/types/emr/patient/patient` for patient data handling
Applied to files:
src/types/emr/diagnosticReport/diagnosticReport.tssrc/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.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 public/locale/**/*.json : Use i18n Locale files with English Locale files in `public/locale/en.json` - non-English languages managed via Crowdin only
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-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-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-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: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 medical forms and reports render correctly in print media
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx
📚 Learning: 2024-11-06T07:49:19.355Z
Learnt from: Jacobjeevan
Repo: ohcnetwork/care_fe PR: 8781
File: src/components/Facility/ConsultationDetails/Events/EventsList.tsx:67-72
Timestamp: 2024-11-06T07:49:19.355Z
Learning: In `src/components/Facility/ConsultationDetails/Events/EventsList.tsx`, appending ' VENTILATOR' to `values.ventilator_interface` when it is 'INVASIVE' or 'NON_INVASIVE' is required to display the correct values in daily logs, as per requirements.
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.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/Facility/services/diagnosticReports/DiagnosticReportPrint.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/Facility/services/diagnosticReports/DiagnosticReportPrint.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 consistent medical term translations for healthcare terminology in i18n
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.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/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx
📚 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: In the AllergyTable component and related redesigned components (SymptomTable, DiagnosisTable) in `src/components/Patient/allergy/AllergyTable.tsx`, dynamic i18n lookups are used like `t(allergy.verification_status)` where the verification_status field can contain values like "presumed", "confirmed", "unconfirmed", etc. These require corresponding translation keys in the locale files.
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.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/Facility/services/diagnosticReports/DiagnosticReportPrint.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/Facility/services/diagnosticReports/DiagnosticReportPrint.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/**/*Response*.{ts,tsx} : API response types should follow pagination patterns: include count, next, previous, and results array for medical records lists
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.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/Facility/services/diagnosticReports/DiagnosticReportPrint.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/**/*{Query,Result}*.{ts,tsx} : React Query integration types should export query result types with data, isLoading, error, and refetch properties for API operations
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.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/Facility/services/diagnosticReports/DiagnosticReportPrint.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/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.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/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx
📚 Learning: 2025-05-19T16:41:44.446Z
Learnt from: hrit2773
Repo: ohcnetwork/care_fe PR: 11922
File: cypress/pageObject/Patients/PatientEncounter.ts:140-164
Timestamp: 2025-05-19T16:41:44.446Z
Learning: The PatientEncounter class in Cypress tests intentionally uses different element targeting strategies: `position: "first"` for allergies and `position: "last"` for symptoms and diagnoses, reflecting the different UI behaviors of these components.
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.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} : Maintain proper heading hierarchy for screen reader support in medical records display
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.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/Facility/services/diagnosticReports/DiagnosticReportPrint.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/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx
🧬 Code graph analysis (2)
src/types/emr/diagnosticReport/diagnosticReport.ts (1)
src/types/user/user.ts (1)
UserReadMinimal(26-31)
src/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx (1)
src/Utils/utils.ts (2)
formatPatientAge(147-182)formatName(54-75)
⏰ 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). (7)
- GitHub Check: build
- GitHub Check: Redirect rules - care-ohc
- GitHub Check: Header rules - care-ohc
- GitHub Check: lint
- GitHub Check: Test
- GitHub Check: CodeQL-Build
- GitHub Check: Pages changed - care-ohc
🔇 Additional comments (5)
public/locale/en.json (1)
4300-4305: Newreport_datetranslation key looks correct and consistentThe added
"report_date": "Report Date"key aligns with existing naming patterns (e.g.,issue_date,result_date) and supports the updated diagnostic report UI. Onlyen.jsonis modified, which matches the project’s i18n guideline that non-English locales are Crowdin-managed. As per coding guidelines, this is the right place and format for this string.src/pages/Facility/services/diagnosticReports/DiagnosticReportPrint.tsx (4)
13-13: LGTM!The new imports (
formatPatientAgeandPatientIdentifierUse) are properly typed and correctly used in the component for rendering patient age and filtering official identifiers.Also applies to: 17-17
220-226: LGTM!The category field rendering includes proper null safety with optional chaining and a fallback value, plus the
wrap-break-wordclass appropriately handles long category names.
227-234: The translation keyreport_dateis already present in the locale files (public/locale/en.jsonline 4303), so the i18n support is properly configured.
235-241: Verify thatrequested_bytranslation key andrequesterbackend field are available.The code changed to use
t("requested_by")andreport.requester(fromreport.created_by). Before merging, confirm:
- The translation key
requested_byexists in locale files- The backend API actually provides the
requesterfield in the diagnostic report responseThe
formatNameutility provides null safety, but the type definition marksrequesteras required, so runtime errors will occur if either is missing.
| created_date: string; | ||
| modified_date: string; | ||
| updated_by: UserReadMinimal; | ||
| requester: UserReadMinimal; |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Step 1: Examine the diagnosticReport.ts file to understand context
echo "=== Examining diagnosticReport.ts ==="
cat -n src/types/emr/diagnosticReport/diagnosticReport.ts
# Step 2: Check if the file exists and get its size
wc -l src/types/emr/diagnosticReport/diagnosticReport.tsRepository: ohcnetwork/care_fe
Length of output: 1847
🏁 Script executed:
#!/bin/bash
# Step 3: Search for requester field usage in the codebase
echo "=== Searching for direct requester property access (unsafe patterns) ==="
rg -nP --type=ts --type=tsx 'report\.requester(?!\?)' -g '!*.test.*' -g '!*.spec.*' || echo "No unsafe direct access found"
echo ""
echo "=== Searching for any requester field usage (all patterns) ==="
rg -nP --type=ts --type=tsx 'requester' -g '!*.test.*' -g '!*.spec.*' -A2 -B2 || echo "No results found"Repository: ohcnetwork/care_fe
Length of output: 318
🏁 Script executed:
#!/bin/bash
# Step 4: Check other EMR type files for documentation patterns
echo "=== Checking documentation patterns in other EMR types ==="
fd -e ts -e tsx 'src/types/emr' -x head -20 {} \; 2>/dev/null | head -100
# Step 5: Look for similar user fields in diagnostic reports
echo ""
echo "=== Searching for UserReadMinimal usage patterns ==="
rg -nP 'UserReadMinimal' --type=ts --type=tsx -B2 -A2 | head -50Repository: ohcnetwork/care_fe
Length of output: 219
🏁 Script executed:
#!/bin/bash
# Step 6: Check for optional fields in diagnostic report to understand pattern
echo "=== Examining current field definitions in diagnosticReport.ts ==="
sed -n '40,70p' src/types/emr/diagnosticReport/diagnosticReport.ts | cat -nRepository: ohcnetwork/care_fe
Length of output: 562
🏁 Script executed:
#!/bin/bash
# Check for backend PR references and their status
echo "=== Checking backend PR references ==="
git log --all --oneline --grep="3411\|3443" | head -5 || echo "No direct git refs to PRs"
# Look for TODO or FIXME comments related to backend
echo ""
echo "=== Searching for backend-related comments in diagnostic report area ==="
rg -n 'TODO|FIXME|backend' src/types/emr/diagnosticReport/ --type=ts
# Check other EMR type files for JSDoc/comment patterns
echo ""
echo "=== Checking documentation patterns in patient types ==="
head -40 src/types/emr/patient/newPatient.ts 2>/dev/null || echo "File not found"Repository: ohcnetwork/care_fe
Length of output: 416
🏁 Script executed:
#!/bin/bash
# Check for optional vs required fields pattern in EMR types
echo "=== Field patterns in other EMR interfaces ==="
fd -type f -name "*.ts" 'src/types/emr/' -x sh -c 'echo "=== {} ===" && head -60 {}' 2>/dev/null | head -150Repository: ohcnetwork/care_fe
Length of output: 108
🏁 Script executed:
#!/bin/bash
# Look for where DiagnosticReportRead is actually used/imported
echo "=== Searching for DiagnosticReportRead imports and usage ==="
rg -n 'DiagnosticReportRead' --type=ts -g '!*.test.*' -g '!*.spec.*' -B1 -A3
echo ""
echo "=== Checking if diagnostic reports are fetched from API ==="
rg -n 'diagnostic' src/ --type=ts --type=tsx -i | grep -i 'query\|fetch\|api' | head -20Repository: ohcnetwork/care_fe
Length of output: 9135
Add documentation explaining the requester field role in diagnostic report workflows.
The requester field follows the existing pattern of created_by and updated_by (all as required UserReadMinimal types), so the type design is consistent. However, there's no documentation distinguishing the clinical meaning of these three fields in the diagnostic report context. Per EMR guidelines, medical data flows should include comments explaining clinical reasoning.
Consider adding a JSDoc comment to the DiagnosticReportRead interface explaining:
requester: The user who ordered/requested the diagnostic report (clinical workflow role)created_by: The user who created/recorded the report in the systemupdated_by: The user who last modified the report
This clarifies the medical workflow context for developers implementing features that access these fields.
🤖 Prompt for AI Agents
In @src/types/emr/diagnosticReport/diagnosticReport.ts around line 53, Add a
JSDoc comment to the DiagnosticReportRead interface clarifying the clinical
roles of the three UserReadMinimal fields: document that requester is the
clinician who ordered/requested the diagnostic report (clinical workflow role),
created_by is the user who recorded/created the report in the system, and
updated_by is the user who last modified the report; place this comment above
the DiagnosticReportRead interface declaration and mention the field names
requester, created_by, and updated_by explicitly so implementers understand
their distinct meanings.
🎭 Playwright Test ResultsStatus: ✅ Passed
📊 Detailed results are available in the playwright-final-report artifact. Run: #4386 |
|
@nihal467 The issue still exists |
yash-learner
left a comment
There was a problem hiding this comment.
why only on print page ?
Why we decided not to have that info on report page ?
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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
Useinterfacefor defining object types in TypeScript
Avoid explicitanytype in TypeScript
Use proper nullability annotations in TypeScript types
Use dedicated error handlers and TypeScript strict null checks
**/*.{ts,tsx}: Use TypeScript for all new code
Prefer interfaces over types for object definitions in TypeScript
Avoid usinganytype; use proper type definitions in TypeScript
Use type inference where possible in TypeScript
Use TanStack Query for API data management
Prefer React Context for global state management
**/*.{ts,tsx}: Use TanStack Query with thequeryandmutateutilities from@/Utils/request/
Use appropriate query keys following the resource pattern for TanStack Query
Leverage TanStack Query built-in features for pagination and debouncing
Implement proper error handling using the global error handler for TanStack Query operations
UseuseQueryhook withqueryKeyandqueryFnparameters, wherequeryFnwraps the API route with thequery()utility
UseuseMutationhook withmutationFnparameter wrapping API routes with themutate()utility, and implementonSuccesscallbacks to invalidate related queries
Support path parameters in TanStack Query using thepathParamsoption in query/mutate utilities
Support query parameters in TanStack Query using thequeryParamsoption in query/mutate utilities
Use thesilent: trueoption to suppress global error notifications when custom error handling is needed
**/*.{ts,tsx}: Use TypeScript with strict mode and ES2022 target
Useinterfacefor defining object types
Avoid explicitanytypes and maint...
Files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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/Facility/services/diagnosticReports/DiagnosticReportView.tsx
**/*.{tsx,jsx}
📄 CodeRabbit inference engine (.cursorrules)
Use declarative JSX
Files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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/Facility/services/diagnosticReports/DiagnosticReportView.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/Facility/services/diagnosticReports/DiagnosticReportView.tsx
src/pages/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use raviger for application routing in page components and route definitions
src/pages/**/*.{ts,tsx}: Keep page components insrc/pages/organized by feature
Use descriptive file names that reflect the page purpose
Export page components as default exports
Co-locate page-specific components and utilities with page components
Useravigerrouter for navigation (existing dependency)
Implement proper route parameters and query string handling
Handle navigation guards and authentication checks in page components
Implement proper loading states and error boundaries in page components
Use semantic HTML structure for accessibility in page components
Use@tanstack/react-queryfor API state management in page components (existing dependency)
Implement proper loading, error, and success states for data fetching
Handle pagination and infinite scroll patterns appropriately
Cache data appropriately in page components based on usage patterns
Use controlled components for form inputs in page components
Implement proper form validation withzodschemas in page components
Handle form submission states (loading, success, error) in page components
Use React hooks for local page state
Minimize unnecessary re-renders in page components
Implement proper authentication checks in page components
Handle different user roles and permissions in page components
Redirect to login when authentication is required in page components
Show appropriate UI based on user permissions in page components
Set appropriate page titles and meta descriptions in page components
Handle OpenGraph and Twitter card meta tags in page components
Implement structured data where applicable in page components
Implement code splitting for large page components
Use lazy loading for heavy components within page components
Optimize bundle size with proper imports in page components
Handle image optimization and lazy loading in page components
Implement comprehensive error boundaries in page components
Handle API e...
Files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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/Facility/services/diagnosticReports/DiagnosticReportView.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/Facility/services/diagnosticReports/DiagnosticReportView.tsx
**/*
📄 CodeRabbit inference engine (CLAUDE.md)
Use 2-space indentation
Files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.tsx
**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/02-coding-standards.mdc)
**/*.tsx: Use functional components with proper type definitions in React
One component per file is preferred
Prefer default exports for React components
Follow the component naming pattern:ComponentName.tsxfor React components
Use Tailwind CSS for styling
Use Shadcn UI components when available
Use local state for component-specific data
Use PascalCase for component file names (e.g.,AuthWizard.tsx)
Files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.tsx
**/*.{tsx,ts}
📄 CodeRabbit inference engine (.cursor/rules/04-ui-components.mdc)
**/*.{tsx,ts}: Use Shadcn UI components as the primary component library
Follow the component documentation for proper usage
Customize components using Tailwind CSS
UsenavigateanduseRedirectfrom raviger for navigation and redirects
Use Tailwind's responsive classes and follow mobile-first approach
Implement proper ARIA attributes for accessibility
Ensure keyboard navigation works in components
Define component props using TypeScript interfaces
Use translation keys fromsrc/Locale/for internationalization
Support RTL languages in components
Use proper date/time formatting for multiple language support
Files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.tsx
**/*.{ts,tsx,js,jsx,json,css,scss,html}
📄 CodeRabbit inference engine (AGENTS.md)
Use 2-space indentation
Files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.tsx
🧠 Learnings (32)
📓 Common learnings
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.
📚 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 `date-fns` with locale support for formatting medical timestamps
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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} : Use date-fns for date handling and manipulation with locale awareness for medical timestamps
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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} : Localize date and time formats for medical timestamps using locale-aware formatting functions
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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/pages/Facility/services/diagnosticReports/DiagnosticReportView.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 ISO 8601 format strings for all date/time fields in type definitions (e.g., created_date: string for medical appointments and schedules)
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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/pages/Facility/services/diagnosticReports/DiagnosticReportView.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} : Format dates consistently across the application using utility functions
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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} : Use `date-fns` library for date manipulations in date and time utility functions
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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/pages/Facility/services/diagnosticReports/DiagnosticReportView.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} : Handle timezone considerations properly in date and time utilities
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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/Facility/services/diagnosticReports/DiagnosticReportView.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 `tanstack/react-query` for API state management in page components (existing dependency)
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.tsx
📚 Learning: 2025-11-25T13:49:43.065Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T13:49:43.065Z
Learning: Applies to **/*.{ts,tsx} : Use TanStack Query for data fetching from the API along with query and mutate utilities for the queryFn and mutationFn
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.tsx
📚 Learning: 2025-11-25T13:54:24.075Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursor/rules/03-data-fetching.mdc:0-0
Timestamp: 2025-11-25T13:54:24.075Z
Learning: Applies to **/*.{ts,tsx} : Use `useQuery` hook with `queryKey` and `queryFn` parameters, where `queryFn` wraps the API route with the `query()` utility
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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/pages/Facility/services/diagnosticReports/DiagnosticReportView.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 `navigate` and `useRedirect` from raviger for navigation and redirects
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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/Facility/services/diagnosticReports/DiagnosticReportView.tsx
📚 Learning: 2025-11-25T13:54:24.075Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .cursor/rules/03-data-fetching.mdc:0-0
Timestamp: 2025-11-25T13:54:24.075Z
Learning: Applies to **/*.{ts,tsx} : Use TanStack Query with the `query` and `mutate` utilities from `@/Utils/request/`
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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/Facility/services/diagnosticReports/DiagnosticReportView.tsx
📚 Learning: 2025-11-25T13:52:51.914Z
Learnt from: CR
Repo: ohcnetwork/care_fe PR: 0
File: .github/instructions/react-components.instructions.md:0-0
Timestamp: 2025-11-25T13:52:51.914Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use `PatientRead` type from `@/types/emr/patient/patient` for patient data handling
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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/pages/Facility/services/diagnosticReports/DiagnosticReportView.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/Facility/services/diagnosticReports/DiagnosticReportView.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/Facility/services/diagnosticReports/DiagnosticReportView.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/**/*Response*.{ts,tsx} : API response types should follow pagination patterns: include count, next, previous, and results array for medical records lists
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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/pages/Facility/services/diagnosticReports/DiagnosticReportView.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/Facility/services/diagnosticReports/DiagnosticReportView.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/Facility/services/diagnosticReports/DiagnosticReportView.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 medical forms and reports render correctly in print media
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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 Badge components to display patient status, facility capacity, medication dosage with color variants
Applied to files:
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.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/Facility/services/diagnosticReports/DiagnosticReportView.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/Facility/services/diagnosticReports/DiagnosticReportView.tsx
🧬 Code graph analysis (1)
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.tsx (1)
src/Utils/utils.ts (1)
formatName(54-75)
⏰ 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). (6)
- GitHub Check: Redirect rules - care-ohc
- GitHub Check: Header rules - care-ohc
- GitHub Check: Pages changed - care-ohc
- GitHub Check: build
- GitHub Check: Test
- GitHub Check: CodeQL-Build
🔇 Additional comments (1)
src/pages/Facility/services/diagnosticReports/DiagnosticReportView.tsx (1)
145-156: No issues found.The "requested_by" translation key already exists in the locale files (en.json and ml.json), and the implementation is correct.
|
|
@abhimanyurajeesh Your efforts have helped advance digital healthcare and TeleICU systems. 🚀 Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! 🙌 |
Proposed Changes
BE: ohcnetwork/care#3411, ohcnetwork/care#3443
Fixes #15018

Tagging: @ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
New Features
Improvements
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.