-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix wrong terminology used in place of Log Update #9089
Fix wrong terminology used in place of Log Update #9089
Conversation
WalkthroughThe changes in this pull request primarily focus on updating the terminology and routing related to logging functionalities within the application. This includes renaming various routes and components from "daily rounds" to "log updates," enhancing localization entries for logging, and ensuring consistent terminology across the application. Additionally, modifications were made to related notification events and test cases to align with these updates. Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
src/components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsxOops! Something went wrong! :( ESLint: 8.57.1 Error: Failed to load parser '@typescript-eslint/parser' declared in '.eslintrc.json': Cannot find module '@typescript-eslint/parser'
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
👋 Hi, @yash-learner, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
…ls and DailyRounds components
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (19)
src/components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx (1)
Action Required: Update Dependent Test Files
The ID
dailyround-entry
is referenced in the following test files and needs to be updated accordingly:
cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
🔗 Analysis chain
Line range hint
28-31
: Update remaining legacy terminology for consistencyWhile the URL paths have been updated, there are still references to "dailyround" in the codebase:
- The HTML element uses
id="dailyround-entry"
- The component file is still located in the "DailyRounds" directory
Consider applying this change:
- id="dailyround-entry" + id="log-update-entry"Let's check if there are any CSS selectors or JavaScript code depending on this ID:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for any references to the dailyround-entry ID rg "dailyround-entry"Length of output: 574
src/components/Patient/DailyRoundListDetails.tsx (2)
Line range hint
13-13
: Consider adding proper TypeScript interface for propsThe component currently uses
any
type for props which reduces type safety. Consider creating a proper interface:interface DailyRoundListDetailsProps { facilityId: string; patientId: string; consultationId: string; id: string; }
Line range hint
1-1
: Update file and component names to match new terminologyFor consistency with the new terminology:
- Rename the file from
DailyRoundListDetails.tsx
toLogUpdateDetails.tsx
- Rename the component from
DailyRoundListDetails
toLogUpdateDetails
This aligns with the PR objective of standardizing terminology from "daily rounds" to "log updates" throughout the application.
src/Routers/routes/ConsultationRoutes.tsx (2)
Line range hint
1-16
: Update import statements to reflect new terminology.The import statements still use the old terminology (e.g.,
DailyRoundListDetails
,DailyRounds
). These should be updated once the component names are changed to maintain consistency with the new "log updates" terminology.Consider updating the imports like this:
- import { DailyRoundListDetails } from "@/components/Patient/DailyRoundListDetails"; - import { DailyRounds } from "@/components/Patient/DailyRounds"; + import { LogUpdateDetails } from "@/components/Patient/LogUpdateDetails"; + import { LogUpdates } from "@/components/Patient/LogUpdates";
Inconsistent Terminology Usage Detected
Several references to "daily_rounds" remain in the codebase, including API endpoints and model definitions. Ensure all instances are updated to "log_updates" to maintain consistency.
src/Utils/request/api.tsx
src/components/Patient/models.tsx
src/components/LogUpdate/CriticalCarePreview.tsx
cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
🔗 Analysis chain
Line range hint
84-112
: Component names should be updated to match the new terminology.While the routes have been updated to use "log_updates", the component names still use the old "DailyRounds" terminology. This creates inconsistency in the codebase.
- Component naming should be updated to match the new terminology:
- <DailyRounds + <LogUpdates- <DailyRoundListDetails + <LogUpdateDetails
- Let's verify the impact of these route changes:
Update shell scripts to correct syntax errors
Please run the following corrected scripts to verify any remaining references to the old route patterns:
Correct the shell scripts and re-run verification
Please execute the following updated scripts to verify any remaining references to the old route patterns:
Run updated shell scripts to verify remaining references
Run updated shell scripts to verify remaining references
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for any remaining references to the old route patterns rg -i "daily.?rounds" --type ts --type tsx # Search for direct navigation calls that might be affected rg "navigate\(.*daily.?rounds" --type ts --type tsx rg "push\(.*daily.?rounds" --type ts --type tsxLength of output: 213
Script:
#!/bin/bash # Search for any remaining references to the old route patterns rg -i "daily.?rounds" --type ts --type tsx # Search for direct navigation calls that might be affected rg "navigate\(.*daily.?rounds" --type ts --type tsx rg "push\(.*daily.?rounds" --type ts --type tsx # Search for navigate function patterns using ast-grep ast-grep --pattern 'navigate($_)' --type typescriptLength of output: 466
Script:
#!/bin/bash # Search for any remaining references to the old route patterns without specifying the type rg -i "daily.?rounds" --type typescript --type tsx # Search for direct navigation calls that might be affected without specifying the type rg "navigate\(.*daily.?rounds" --type typescript --type tsx rg "push\(.*daily.?rounds" --type typescript --type tsx # Search for navigate function patterns using ast-grep without the --type flag ast-grep --pattern 'navigate($_)'Length of output: 21019
Script:
#!/bin/bash # Search for any remaining references to the old route patterns with correct types rg -i "daily.?rounds" --type ts --type tsx # Search for direct navigation calls that might be affected with correct types rg "navigate\(.*daily.?rounds" --type ts --type tsx rg "push\(.*daily.?rounds" --type ts --type tsx # Search for navigate function patterns using ast-grep without the --type flag ast-grep --pattern 'navigate($_)'Length of output: 20974
Script:
#!/bin/bash # Search for any remaining references to the old route patterns using file extensions rg -i "daily.?rounds" --glob "*.ts" --glob "*.tsx" # Search for direct navigation calls that might be affected using file extensions rg "navigate\(.*daily.?rounds" --glob "*.ts" --glob "*.tsx" rg "push\(.*daily.?rounds" --glob "*.ts" --glob "*.tsx" # Search for navigate function patterns related to daily rounds using ast-grep ast-grep --pattern 'navigate("/facility/:facilityId/patient/:patientId/consultation/:id/log_updates")' ast-grep --pattern 'navigate("/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id/update")' ast-grep --pattern 'navigate("/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id")'Length of output: 18921
src/components/LogUpdate/CriticalCareEditor.tsx (1)
181-181
: Consider updating API endpoint naming for consistency.The slug update from "daily_rounds" to "log_updates" aligns with the new terminology. However, the API endpoint
routes.updateDailyRound
still uses the old terminology.Consider updating the API endpoint name to maintain consistency:
-routes.updateDailyRound +routes.updateLogUpdatesrc/components/Facility/ConsultationCard.tsx (1)
Line range hint
208-213
: Update button text to use consistent terminology.The button text still uses "Add Consultation Updates" while the PR aims to standardize terminology to "Log Updates". This creates an inconsistency in the UI.
Apply this change to maintain terminology consistency:
<ButtonV2 className="h-auto whitespace-pre-wrap border border-secondary-500 bg-white text-black hover:bg-secondary-300" onClick={() => { /* ... */ }} disabled={!!itemData.discharge_date} authorizeFor={NonReadOnlyUsers} > - Add Consultation Updates + Add Log Update </ButtonV2>src/components/LogUpdate/CriticalCarePreview.tsx (4)
Line range hint
32-42
: Add error handling for failed data fetchingThe component only handles loading state but doesn't handle error cases from the useQuery hook.
Consider adding error handling:
- const { data } = useQuery(routes.getDailyReport, { + const { data, error } = useQuery(routes.getDailyReport, { pathParams: { consultationId: props.consultationId, id: props.id, }, }); + if (error) { + return <ErrorMessage message={t("failed_to_load_log_update")} error={error} />; + } if (!data) { return <Loading />; }
Line range hint
249-269
: Extract medical ranges and units into constantsThe vital signs ranges and units are hardcoded in multiple places. This could lead to inconsistencies and make updates difficult.
Create a constants file for medical measurements:
// src/constants/medicalMeasurements.ts export const VITAL_SIGNS = { BLOOD_PRESSURE: { SYSTOLIC: { MIN: 99, MAX: 139, UNIT: 'mmHg' }, DIASTOLIC: { MIN: 49, MAX: 89, UNIT: 'mmHg' } }, SPO2: { MIN: 89, MAX: 100, UNIT: '%' } // ... other measurements };Then update the RangeDetail components to use these constants:
<RangeDetail label="Systolic" value={data.bp.systolic} - max={250} - unit="mmHg" + max={VITAL_SIGNS.BLOOD_PRESSURE.SYSTOLIC.MAX} + unit={VITAL_SIGNS.BLOOD_PRESSURE.SYSTOLIC.UNIT} valueDescriptions={rangeValueDescription({ - low: 99, - high: 139, + low: VITAL_SIGNS.BLOOD_PRESSURE.SYSTOLIC.MIN, + high: VITAL_SIGNS.BLOOD_PRESSURE.SYSTOLIC.MAX, })} />
Line range hint
401-411
: Add missing key prop to table rowsThe table rows in the I/O Balance section are missing key props, which can cause React reconciliation issues and impact performance.
Fix the missing key prop:
- <tr> + <tr key={`${category.key}-${row.name}`}> <td className="px-2 py-1"> <span className="font-semibold"> {category.name} </span> : {row.name} </td> <td className="px-2 py-1 text-right"> {row.quantity} ml </td> </tr>
Line range hint
249-269
: Enhance accessibility for vital signs readingsThe vital signs section lacks proper ARIA labels for screen readers to announce the medical values and their ranges.
Add ARIA labels to the vital signs section:
<RangeDetail label="Blood Pressure" value={data.bp.systolic} + aria-label={`Systolic blood pressure ${data.bp.systolic} mmHg`} max={250} unit="mmHg" valueDescriptions={rangeValueDescription({ low: 99, high: 139, })} />
Also applies to: 270-290
src/components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx (2)
Line range hint
1-691
: Consider updating component and variable names for terminology consistency.While the tab text has been updated, there are several instances where the old "daily rounds" terminology is still being used:
- Component name
DailyRoundsSortDropdown
- Import statements for
DailyRoundsFilter
andDailyRoundsList
- Variable names like
dailyRoundsQuery
andsetDailyRoundsQuery
Consider updating these to maintain consistency with the new "log updates" terminology. Here's a suggested refactor:
- import DailyRoundsFilter from '@/components/Facility/Consultations/DailyRoundsFilter'; - import DailyRoundsList from '@/components/Facility/Consultations/DailyRoundsList'; + import LogUpdatesFilter from '@/components/Facility/Consultations/LogUpdatesFilter'; + import LogUpdatesList from '@/components/Facility/Consultations/LogUpdatesList'; - const [dailyRoundsQuery, setDailyRoundsQuery] = useState<QueryParams>(); + const [logUpdatesQuery, setLogUpdatesQuery] = useState<QueryParams>(); - function DailyRoundsSortDropdown({ + function LogUpdatesSortDropdown({ - setDailyRoundsQuery, + setLogUpdatesQuery, }: { - setDailyRoundsQuery: (query: QueryParams) => void; + setLogUpdatesQuery: (query: QueryParams) => void; }) { - return <DailyRoundsFilter + return <LogUpdatesFilter onApply={(query) => { - setDailyRoundsQuery(query); + setLogUpdatesQuery(query); }} />; }
Multiple References to "Daily Rounds" Detected
The terminology change from "daily rounds" to "log updates" affects numerous parts of the application, including component imports, interfaces, API endpoints, routing paths, and translation files.
🔗 Analysis chain
Line range hint
1-691
: Verify the impact of terminology changes.The terminology change from "daily rounds" to "log updates" might affect other parts of the application that interact with this component.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for other occurrences of "daily rounds" terminology that might need updating # Search for "daily rounds" in TypeScript/JavaScript files echo "Files containing 'daily rounds' or 'dailyRounds':" rg -i "daily.?rounds" --type=ts --type=tsx --type=js --type=jsx # Search for translation keys containing "daily_rounds" echo "\nTranslation files containing 'daily_rounds':" rg "daily_rounds" --type=jsonLength of output: 409
Script:
#!/bin/bash # Description: Check for other occurrences of "daily rounds" terminology that might need updating # Search for "daily rounds" or "dailyRounds" in TypeScript and JavaScript files by file extension echo "Files containing 'daily rounds' or 'dailyRounds':" rg -i "daily.?rounds" --glob "*.ts" --glob "*.tsx" --glob "*.js" --glob "*.jsx" # Search for translation keys containing "daily_rounds" echo "\nTranslation files containing 'daily_rounds':" rg "daily_rounds" --glob "*.json"Length of output: 18796
Script:
#!/bin/bash # Description: Comprehensive search for all occurrences and related patterns of "daily rounds" terminology that may need updating # Search for exact and camelCase variations in TypeScript and JavaScript files echo "Files containing 'daily rounds', 'dailyRounds', or similar variations:" rg -i "\bdaily.?rounds\b" --glob "*.ts" --glob "*.tsx" --glob "*.js" --glob "*.jsx" # Search for related terms that might be impacted by the terminology change echo "\nFiles containing related terminology:" rg -i "\blog.?updates\b|\blogUpdates\b" --glob "*.ts" --glob "*.tsx" --glob "*.js" --glob "*.jsx" # Search for translation keys containing "daily_rounds" or similar echo "\nTranslation files containing 'daily_rounds' or related keys:" rg "daily[_ ]rounds" --glob "*.json"Length of output: 7381
src/components/Patient/DailyRounds.tsx (2)
Line range hint
1-558
: Consider splitting this large component into smaller, focused componentsThe component is quite large (500+ lines) and handles multiple responsibilities including form state management, validation, submission, and various conditional rendering logic. Consider breaking it down into smaller, more focused components for better maintainability.
Suggested structure:
- LogUpdateForm (main container)
- VitalsSection
- DiagnosisSection
- NursingCareSection
- PrescriptionSection
Line range hint
416-444
: Consider consolidating duplicate navigation logicThe navigation paths after form submission contain duplicated logic. Consider extracting this into a helper function to improve maintainability.
+ const getNavigationPath = (roundType: string, consultationId: string, objId?: string) => { + if (["NORMAL", "TELEMEDICINE", "COMMUNITY_NURSES_LOG"].includes(roundType)) { + return `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`; + } + const suffix = roundType === "VENTILATOR" ? "critical_care/update" : "update"; + return `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/log_updates/${objId}/${suffix}`; + }; - if (["NORMAL", "TELEMEDICINE", "COMMUNITY_NURSES_LOG"].includes(state.form.rounds_type)) { - navigate(`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`); - } else { - navigate(`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/log_updates/${obj.id}/update`); - } + navigate(getNavigationPath(state.form.rounds_type, consultationId, obj.id));src/components/Patient/PatientInfoCard.tsx (4)
585-585
: Consider maintaining URL path case consistencyThe URL path uses underscore (
log_updates
) while the previous path used kebab-case (daily-rounds
). Consider using kebab-case for consistency:log-updates
.
Line range hint
586-595
: Enhance error message clarityThe error message could be more descriptive to guide users on the requirement and next steps.
- msg: "Please assign a bed to the patient", + msg: "A bed assignment is required before adding log updates. Please assign a bed to continue.",
Line range hint
1-24
: Consider decomposing the component for better maintainabilityThe
PatientInfoCard
component is quite large and handles multiple responsibilities. Consider breaking it down into smaller, more focused components:
PatientHeader
for basic patient informationPatientStats
for medical statisticsPatientActions
for action buttons and menusAlso applies to: 32-38
Line range hint
596-605
: Enhance accessibility with ARIA labelsConsider adding ARIA labels to improve screen reader support for the log update button:
<ButtonV2 variant={...} href={...} onClick={...} className="w-full" + aria-label={`Add ${authUser.user_type === "Doctor" ? "File Note" : "Log Update"} for patient ${patient.name}`} >
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (13)
public/locale/en.json
(1 hunks)src/Routers/routes/ConsultationRoutes.tsx
(5 hunks)src/common/constants.tsx
(1 hunks)src/components/Facility/ConsultationCard.tsx
(1 hunks)src/components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx
(1 hunks)src/components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx
(2 hunks)src/components/LogUpdate/CriticalCareEditor.tsx
(2 hunks)src/components/LogUpdate/CriticalCarePreview.tsx
(1 hunks)src/components/Notifications/NotificationsList.tsx
(1 hunks)src/components/Notifications/ShowPushNotification.tsx
(1 hunks)src/components/Patient/DailyRoundListDetails.tsx
(2 hunks)src/components/Patient/DailyRounds.tsx
(4 hunks)src/components/Patient/PatientInfoCard.tsx
(1 hunks)
🔇 Additional comments (16)
src/components/Notifications/ShowPushNotification.tsx (1)
27-27
: LGTM! URL paths updated to reflect new terminology.
The changes from /daily-rounds/
to /log_updates/
in the URL paths align with the PR objectives to maintain consistent terminology across the application.
Also applies to: 29-29
src/components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx (1)
62-63
: LGTM! URL paths updated correctly
The URL paths have been properly updated to use "log_updates" instead of "daily-rounds", maintaining the existing logic for different round types.
Also applies to: 84-85
src/components/Patient/DailyRoundListDetails.tsx (3)
34-34
: LGTM! Good use of localization
The change correctly implements localized terminology for "log update" while maintaining the ID display format.
54-54
: LGTM! URL path updated consistently
The href has been correctly updated to use the new "log_updates" terminology.
35-35
: Verify route configuration for the new path
The URL path has been updated to use "log_updates". Let's verify that this route is properly configured.
src/Routers/routes/ConsultationRoutes.tsx (1)
Line range hint 113-131
: Verify the impact of nested critical care routes.
The critical care routes follow a different nesting pattern compared to other routes:
/log_updates/:id/critical_care
/log_updates/:id/critical_care/update
While the naming is consistent, this structure differs from the previous pattern and might affect existing navigation logic.
Let's verify the impact:
src/components/LogUpdate/CriticalCareEditor.tsx (2)
Line range hint 11-11
: Track remaining terminology updates for backend changes.
Several instances of the old terminology remain in backend-related code:
DailyRoundsModel
typegetDailyReport
routeupdateDailyRound
route
These should be updated when the backend changes are implemented.
Let's identify all instances to be updated:
#!/bin/bash
# Search for remaining instances of old terminology
rg -g '*.{ts,tsx}' '(Daily(Rounds|Report)|daily[-_]rounds)'
Also applies to: 13-13
98-98
: LGTM! Verify route handler update.
The URL path change from "daily-rounds" to "log_updates" aligns with the PR objectives for terminology consistency.
Let's verify that the corresponding route handler has been updated:
src/components/Facility/ConsultationCard.tsx (1)
203-203
: LGTM! Path updated to use new terminology.
The navigation path has been correctly updated from /daily-rounds
to /log_updates/
which aligns with the PR objective of standardizing terminology across the application.
src/components/Notifications/NotificationsList.tsx (1)
75-75
: Verify consistent usage of new URL paths
The URL paths have been updated from "daily-rounds" to "log_updates" to align with the new terminology. Let's verify that this change is consistent across the codebase.
Also applies to: 77-77
✅ Verification successful
Consistent usage of new URL paths verified
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for any remaining instances of old terminology in routes and verify consistency of new paths
# Check for any remaining instances of "daily-rounds" in route definitions
echo "Checking for old terminology in routes..."
rg -l "daily-rounds" --type tsx --type ts
# Check for consistency in "log_updates" usage
echo -e "\nVerifying consistency of new terminology..."
rg -l "log_updates?" --type tsx --type ts
# Check for potential typos in "log_updates"
echo -e "\nChecking for potential typos..."
rg -l "log_u[^p]dates?" --type tsx --type ts
Length of output: 491
Script:
#!/bin/bash
# Description: Check for any remaining instances of old terminology in routes and verify consistency of new paths using file extensions.
# Check for any remaining instances of "daily-rounds" in route definitions
echo "Checking for old terminology in routes..."
rg "daily-rounds" --glob "*.ts" --glob "*.tsx"
# Check for consistency in "log_updates" usage
echo -e "\nVerifying consistency of new terminology..."
rg "log_updates" --glob "*.ts" --glob "*.tsx"
# Check for potential typos in "log_updates"
echo -e "\nChecking for potential typos..."
rg "log_u[^p]dates?" --glob "*.ts" --glob "*.tsx"
Length of output: 3964
src/components/LogUpdate/CriticalCarePreview.tsx (1)
64-64
: LGTM: Terminology update aligns with project objectives
The change from hardcoded text to t("log_updates")
correctly implements the terminology standardization while maintaining i18n support.
src/components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx (1)
691-691
: LGTM! Terminology updated as per requirements.
The tab text has been correctly updated from "daily_rounds" to "log_updates" to align with the new terminology.
src/components/Patient/DailyRounds.tsx (3)
149-149
: LGTM: Terminology updated correctly
The header text has been updated to use the new "log_update" terminology, maintaining consistency with the PR objectives.
416-416
: LGTM: Navigation paths updated consistently
All navigation paths have been updated from "daily_rounds" to "log_updates", aligning with the terminology change requirements.
Also applies to: 444-444, 558-558
149-149
: Verify terminology changes in translation files
The code uses translation keys for the updated terminology. Let's verify that corresponding translation entries exist.
Also applies to: 416-416, 444-444, 558-558
✅ Verification successful
Translation entries for "log_update" and related keys are present.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if the translation files contain the new "log_update" keys
# Search for log_update related translation keys
rg -g '*.json' '"log_update":'
rg -g '*.json' '"LOG_UPDATE_'
Length of output: 2254
public/locale/en.json (1)
825-826
: LGTM! The new entries align with the terminology standardization effort.
The added translations for "log_update" and "log_updates" maintain consistent casing and follow the singular/plural pattern used throughout the file.
@@ -24,9 +24,9 @@ export default function ShowPushNotification({ id }: { id: string }) { | |||
case "PATIENT_CONSULTATION_UPDATED": | |||
return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}`; | |||
case "PATIENT_CONSULTATION_UPDATE_CREATED": | |||
return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}/daily-rounds/${caused_objects?.daily_round}`; | |||
return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}/log_updates/${caused_objects?.daily_round}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
The parameter daily_round
is used in multiple locations and should be updated consistently:
src/Utils/request/api.tsx
src/components/Notifications/ShowPushNotification.tsx
src/components/Patient/ManagePatients.tsx
src/components/Patient/DailyRounds.tsx
src/components/Shifting/ShiftDetailsUpdate.tsx
src/components/Notifications/NotificationsList.tsx
src/components/Scribe/formDetails.ts
🔗 Analysis chain
Consider updating the parameter name for consistency.
While the URL paths have been updated to use log_updates
, the parameter daily_round
in caused_objects?.daily_round
still uses the old terminology. Consider updating this to maintain consistency.
- return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}/log_updates/${caused_objects?.daily_round}`;
+ return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}/log_updates/${caused_objects?.log_update}`;
Let's check if this parameter name is used elsewhere in the codebase:
Also applies to: 29-29
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for daily_round parameter usage in TypeScript/JavaScript files
rg -t ts -t tsx -t js "daily_round" -A 3 -B 3
Length of output: 73
Script:
#!/bin/bash
# Search for daily_round parameter usage in TypeScript/JavaScript files
rg -t ts -t typescriptreact -t js "daily_round" -A 3 -B 3
Length of output: 97
Script:
#!/bin/bash
# Search for daily_round parameter usage in TypeScript/JavaScript files
rg -g "*.ts" -g "*.tsx" -g "*.js" "daily_round" -A 3 -B 3
Length of output: 15086
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still call the backend model as DailyRound and not opening an PR as we will soon revamping it according FHIR
src/Utils/request/api.tsx
Backend api routes
src/components/Notifications/ShowPushNotification.tsx
/log_updates/${caused_objects?.daily_round
-> this as well coming from backend
src/components/Patient/ManagePatients.tsx
This as well from backend
src/components/Patient/DailyRounds.tsx && src/components/Scribe/formDetails.ts
This is removed as a plug.
src/components/Shifting/ShiftDetailsUpdate.tsx
This as well related to Model.
src/components/Notifications/NotificationsList.tsx
Left out is the model field coming from backend
@rithviknishad what do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
@@ -653,12 +653,12 @@ export const NOTIFICATION_EVENTS: NotificationEvent[] = [ | |||
}, | |||
{ | |||
id: "PATIENT_CONSULTATION_UPDATE_CREATED", | |||
text: "Patient Consultation Update Created", | |||
text: "Patient Log Update Created", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Remaining instances of "Consultation Update" found.
Please update the following files to ensure terminology consistency:
src/components/Facility/ConsultationCard.tsx
src/common/constants.tsx
cypress/pageobject/Patient/PatientConsultation.ts
cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
🔗 Analysis chain
LGTM! The terminology changes align with the PR objectives.
The text changes from "Patient Consultation Update" to "Patient Log Update" are consistent with the broader effort to standardize terminology across the application.
Let's verify that this terminology change is consistently applied across the codebase:
Also applies to: 661-661
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Search for any remaining instances of "Consultation Update" that might need to be updated
# Search for "Consultation Update" in all files
echo "Searching for remaining instances of 'Consultation Update'..."
rg -i "consultation update" --type ts --type tsx
# Search for notification text usage
echo "Checking notification text usage..."
rg -i "PATIENT_CONSULTATION_UPDATE" --type ts --type tsx
Length of output: 383
Script:
#!/bin/bash
# Description: Corrected search for any remaining instances of "Consultation Update" that might need to be updated
# Search for "Consultation Update" in all .ts and .tsx files
echo "Searching for remaining instances of 'Consultation Update' in .ts and .tsx files..."
rg -i "consultation update" -g "*.ts" -g "*.tsx"
# Search for notification text usage in .ts and .tsx files
echo "Checking notification text usage in .ts and .tsx files..."
rg -i "PATIENT_CONSULTATION_UPDATE" -g "*.ts" -g "*.tsx"
Length of output: 2033
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai Addressed in 79a3616, d2a2e05
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yash-learner, thanks for addressing the previous feedback with your recent commits. However, I have found that there are still some remaining instances of "Consultation Update" in the codebase. Specifically, the phrase appears in the following files:
-
src/common/constants.tsx
:- Line containing
text: "Patient Consultation Updated",
- Line containing
-
cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
:- Lines containing
cy.verifyNotification("Consultation updated successfully");
- Lines containing
-
cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
:- Line containing
cy.verifyNotification("Consultation updated successfully");
- Line containing
Could you please update these instances to "Log Update" to ensure consistent terminology throughout the application?
🔗 Analysis chain
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that there are no remaining instances of "Consultation Update" in the codebase
# Search for "Consultation Update" in all .ts and .tsx files
rg -i "consultation update" -g "*.ts" -g "*.tsx"
Length of output: 576
code rabbit found some more references...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
src/components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx (1)
Line range hint
1-15
: Update import paths to reflect new terminology.The import path still contains "DailyRounds" which should be updated to maintain consistency with the new "LogUpdate" terminology.
- import LogUpdateCardAttribute from "@/components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute"; + import LogUpdateCardAttribute from "@/components/Facility/Consultations/LogUpdates/LogUpdateCardAttribute";Note: This change would require moving the file to the new directory structure. Would you like me to help create a GitHub issue to track this refactoring task?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
(6 hunks)src/components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx
(3 hunks)
🔇 Additional comments (5)
src/components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx (2)
62-63
: LGTM! URL paths updated consistently.
The URL path changes from "daily-rounds" to "log_updates" are consistent with the PR objectives.
Also applies to: 84-85
29-29
: LGTM! Verify test selectors.
The ID change from "dailyround-entry" to "logupdate-entry" aligns with the terminology standardization.
✅ Verification successful
ID change is properly synchronized across codebase
The verification shows that:
- The old ID "dailyround-entry" has been completely removed from the codebase
- The new ID "logupdate-entry" is consistently used in both the component and its corresponding test file (PatientLogUpdate.cy.ts)
- All test references have been updated to use the new selector
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if the old ID is still referenced in tests
# Expected: No references to old "dailyround-entry" ID in test files
rg "dailyround-entry" "cypress/e2e" "**/*.test.{ts,tsx,js,jsx}"
Length of output: 127
Script:
#!/bin/bash
# Let's try a more comprehensive search for test files and the ID
# First, find all test files
echo "=== Test files ==="
fd "\.(test|spec|cy)\.(ts|tsx|js|jsx)$"
echo -e "\n=== Searching for dailyround-entry ==="
rg "dailyround-entry"
echo -e "\n=== Searching for logupdate-entry ==="
rg "logupdate-entry"
Length of output: 2372
cypress/e2e/patient_spec/PatientLogUpdate.cy.ts (3)
Line range hint 1-365
: Excellent test coverage across different scenarios!
The test suite comprehensively covers:
- Different types of updates (TeleIcu, Progress, Critical, Normal)
- Various patient types (admitted, domiciliary)
- Creation and editing workflows
- Data verification and reflection
- Edge cases (incomplete MEWS score)
Line range hint 1-365
: Test suite successfully aligns with PR objectives.
The changes effectively validate the terminology transition from "daily rounds" to "log updates" across:
- Button text
- Selectors
- Notification messages
- UI element interactions
133-135
: LGTM! Terminology changes are consistent.
The button text and selector changes align with the PR objectives to standardize terminology from "daily rounds" to "log updates".
Let's verify the consistency of the new selector usage across the codebase:
Also applies to: 183-185, 198-200, 213-215, 288-290, 312-314
✅ Verification successful
Selector changes are correctly implemented
The changes from "dailyround-entry" to "logupdate-entry" have been consistently implemented across both the component (DefaultLogUpdateCard.tsx
) and the test file (PatientLogUpdate.cy.ts
). The new selector is used uniformly in all instances, and there are no remaining references to the old "dailyround-entry" selector.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that old selectors are not used elsewhere
# and new selectors are used consistently
# Check for any remaining instances of old selector
rg -l "dailyround-entry"
# Verify consistent usage of new selector
rg -l "logupdate-entry"
Length of output: 171
Script:
#!/bin/bash
# Let's check the actual content to see the context of these selectors
rg "dailyround-entry|logupdate-entry" -B2 -A2 src/components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
Length of output: 3096
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
src/components/Scribe/formDetails.ts (1)
294-294
: Consider tracking commented prescription fields as technical debtThe file contains well-documented prescription-related fields that are currently commented out. Consider creating a ticket to track the implementation of these fields if they're planned for future use.
Would you like me to help create a GitHub issue to track this technical debt?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
src/components/Patient/DailyRounds.tsx
(4 hunks)src/components/Scribe/formDetails.ts
(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/components/Patient/DailyRounds.tsx
🔇 Additional comments (2)
src/components/Scribe/formDetails.ts (2)
243-246
: LGTM! Improved type definition formatting
The type definition formatting changes enhance readability while maintaining the same structure.
255-255
: LGTM! Added helpful example for investigation notes
The added example clearly demonstrates how to use the notes field in investigations.
…dates" and add corresponding message in localization file
… in components and localization
@rithviknishad Do you think this change is required as of now ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
src/components/Facility/Consultations/LogUpdates/DefaultLogUpdateCard.tsx (2)
61-63
: Simplify URL construction logicThe URL construction logic is duplicated between the view and update buttons. Consider extracting this into a helper function to improve maintainability and reduce duplication.
+ const getLogUpdateUrl = (roundId: string, action: 'view' | 'update') => { + const baseUrl = `${consultationUrl}/log_updates/${roundId}`; + const isCriticalCare = !["NORMAL", "TELEMEDICINE", "DOCTORS_LOG"].includes(round.rounds_type!); + return isCriticalCare ? `${baseUrl}/critical_care${action === 'update' ? '/update' : ''}` + : `${baseUrl}${action === 'update' ? '/update' : ''}`; + }; // Then use it in the buttons: href={getLogUpdateUrl(round.id, 'view')} // and href={getLogUpdateUrl(round.id, 'update')}Also applies to: 83-85
Line range hint
33-37
: Consider updating rounds_type enum valuesThe component still uses legacy terminology in the
rounds_type
enum values (e.g., "DOCTORS_LOG"). While this might require backend changes, it should be tracked for future updates to maintain consistency with the new "log update" terminology.Would you like me to create a GitHub issue to track the remaining terminology updates?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (4)
src/components/Facility/ConsultationDetails/Events/EventsList.tsx
(1 hunks)src/components/Facility/Consultations/DailyRoundsList.tsx
(2 hunks)src/components/Facility/Consultations/LogUpdates/DefaultLogUpdateCard.tsx
(4 hunks)src/components/Facility/Consultations/LogUpdates/VirtualNursingAssistantLogUpdateCard.tsx
(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- src/components/Facility/ConsultationDetails/Events/EventsList.tsx
- src/components/Facility/Consultations/LogUpdates/VirtualNursingAssistantLogUpdateCard.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/components/Facility/Consultations/DailyRoundsList.tsx
🔇 Additional comments (2)
src/components/Facility/Consultations/LogUpdates/DefaultLogUpdateCard.tsx (2)
29-29
: Verify id selector usage in tests
The HTML id has been updated from "dailyround-entry" to "logupdate-entry". Please ensure that all related test files and selectors have been updated accordingly.
#!/bin/bash
# Search for references to the old and new id in test files
echo "Checking for old id references:"
rg "dailyround-entry" -t tsx -t ts -g "**/*.{test,spec,cy}.*"
echo "Checking for new id references:"
rg "logupdate-entry" -t tsx -t ts -g "**/*.{test,spec,cy}.*"
6-8
: 🛠️ Refactor suggestion
Consider renaming DailyRoundsModel to LogUpdateModel
While the import path has been updated to reflect the new terminology, the component still uses DailyRoundsModel
. To maintain consistency with the terminology changes, consider renaming this model.
Let's check for other usages of DailyRoundsModel:
Fixed it in eccc86a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File could be renamed to LogUpdatesList.tsx
; lgtm otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…sultationUpdatesTab
… ConsultationUpdatesTab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
src/components/Facility/Consultations/LogUpdatesList.tsx (1)
Line range hint
1-100
: Consider documenting the terminology migration strategyWhile the UI-facing terminology has been updated, there are still several technical references (routes, types, props) using the old terminology. This suggests a phased migration approach. Consider:
- Creating a tracking issue for the remaining technical debt
- Documenting which terms will be migrated in which phase
- Planning the API route updates to minimize breaking changes
This will help ensure a smooth transition and prevent confusion during the migration period.
Would you like me to help create a GitHub issue to track the remaining terminology updates?
src/components/Facility/Consultations/LogUpdatesFilter.tsx (2)
Line range hint
13-19
: Consider updating type definitions for consistency.The
FilterState
type still referencesDailyRoundsModel
. This should be updated to use the new terminology once the models are renamed.
Line range hint
91-92
: Consider updating field labels for clarity.The "Measured after" and "Measured before" labels are hardcoded. Consider:
- Using translation keys for internationalization
- Making the labels more specific to log updates
- label="Measured after" + label={t("log_update_measured_after")}- label="Measured before" + label={t("log_update_measured_before")}Also applies to: 106-107
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
src/components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx
(4 hunks)src/components/Facility/Consultations/LogUpdatesFilter.tsx
(1 hunks)src/components/Facility/Consultations/LogUpdatesList.tsx
(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx
🔇 Additional comments (7)
src/components/Facility/Consultations/LogUpdatesList.tsx (4)
24-24
: LGTM: Component renamed correctly
The component has been appropriately renamed from DailyRoundsList
to LogUpdatesList
to align with the new terminology.
40-40
: Verify translation key exists
The translation key has been updated to "no_log_updates". Let's ensure this key exists in all localization files.
#!/bin/bash
# Search for the new translation key in locale files
fd "\.json$" "public/locale" --exec rg "no_log_updates"
Line range hint 27-33
: Address remaining terminology inconsistencies
Several instances of old terminology remain in the code:
- The API route
getDailyReports
still uses "daily" terminology - The type
DailyRoundsModel
is still being used - The prop
rounds_type
still reflects the old terminology
These should be updated to maintain consistency with the new "log updates" terminology.
Let's check for other occurrences of these terms:
#!/bin/bash
# Search for remaining daily/rounds terminology
rg -i "daily|rounds" --type tsx --type ts
Also applies to: 48-50
6-8
: 🛠️ Refactor suggestion
Consider renaming DailyRoundsModel for consistency
While the import paths have been updated to use "LogUpdates", the DailyRoundsModel
type is still using the old terminology. This should be renamed to maintain consistency with the new "log updates" terminology.
Let's check for other occurrences of "DailyRounds" in model files:
src/components/Facility/Consultations/LogUpdatesFilter.tsx (3)
29-29
: LGTM! Component successfully renamed.
The component has been correctly renamed from DailyRoundsFilter
to LogUpdatesFilter
in line with the PR objectives.
Line range hint 67-67
: Update translation keys to use new terminology.
The translation keys still use the old terminology:
LOG_UPDATE_FIELD_LABEL__rounds_type
ROUNDS_TYPE__${o}
These should be updated to maintain consistency with the new "log update" terminology.
Let's verify the translation keys in the locale files:
Also applies to: 82-82
Line range hint 11-11
: Update import path to use new terminology.
The component still imports models using the old "DailyRounds" terminology. This should be updated to maintain consistency.
Let's verify if these models have been renamed in the codebase:
If the models haven't been renamed yet, please create a follow-up ticket to track this technical debt.
@yash-learner 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
This pull request includes significant updates to the application's routing and terminology, specifically changing references from "daily rounds" to "log updates". The changes span multiple files and components, ensuring consistency across the codebase.
Key changes include:
Routing and Terminology Updates:
src/Routers/routes/ConsultationRoutes.tsx
: Updated various routes to replace "daily-rounds" with "log_updates" for patient consultations. [1] [2] [3] [4] [5]src/common/constants.tsx
: Modified notification event text to reflect the new terminology.src/components/Facility/ConsultationCard.tsx
: Updated navigation paths to use "log_updates" instead of "daily-rounds".src/components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx
: Changed tab text from "daily_rounds" to "log_updates".src/components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx
: Updated URLs in theDefaultLogUpdateCard
component. [1] [2]Component Updates:
src/components/LogUpdate/CriticalCareEditor.tsx
: Adjusted links and state variables to use "log_updates". [1] [2]src/components/LogUpdate/CriticalCarePreview.tsx
: Updated text to use the new terminology.src/components/Notifications/NotificationsList.tsx
: Modified notification URLs.src/components/Notifications/ShowPushNotification.tsx
: Updated paths for push notifications.src/components/Patient/DailyRoundListDetails.tsx
: Changed titles and back URLs to reflect "log_updates". [1] [2]src/components/Patient/DailyRounds.tsx
: Updated navigation paths and text. [1] [2] [3] [4]src/components/Patient/PatientInfoCard.tsx
: Adjusted links for patient consultations.Localization:
public/locale/en.json
: Added new entries for "log_update" and "log_updates".@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Refactor
Documentation