Skip to content
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

Merged

Conversation

yash-learner
Copy link
Member

@yash-learner yash-learner commented Nov 11, 2024

Proposed Changes

Things to check:

  • Changes related to events and daily_rounds is left out as events will be deprecated
  • Changing description requires backend change - Need to check whether a backend PR is required as changing the message would be simple but changing constants PATIENT_CONSULTATION_UPDATE_CREATED to PATIENT_LOG_UPDATE_CREATED requires a migration and also we may revamp this DailyRounds table to something else future based on FHIR

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:

Component Updates:

Localization:

  • Change 1
  • Change 2
  • More?

@ohcnetwork/care-fe-code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced localization support for logging functionalities, including new entries for log updates.
    • Updated navigation paths and button functionalities to reflect the new "log_updates" terminology.
  • Bug Fixes

    • Improved error handling and notifications related to patient bed assignments.
  • Refactor

    • Renamed components and updated import paths to align with the new logging structure.
    • Refactored test cases to ensure consistency with updated UI elements.
  • Documentation

    • Updated component titles and button labels for better user experience and clarity.

Copy link
Contributor

coderabbitai bot commented Nov 11, 2024

Walkthrough

The 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

File Path Change Summary
public/locale/en.json Added localization entries for log updates: "log_update", "log_updates", and "no_log_updates".
src/Routers/routes/ConsultationRoutes.tsx Updated route paths from "daily-rounds" to "log_updates" for various consultation-related routes.
src/common/constants.tsx Changed notification event texts from "Patient Consultation Update" to "Patient Log Update".
src/components/Facility/ConsultationCard.tsx Updated button navigation from /daily-rounds to /log_updates/ and changed button label for translation.
src/components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx Renamed references from "daily_rounds" to "log_updates" and updated imports accordingly.
src/components/LogUpdate/CriticalCareEditor.tsx Changed button href from /daily-rounds/${props.id}/update to /log_updates/${props.id}/update.
src/components/LogUpdate/CriticalCarePreview.tsx Updated title to use {t("log_updates")} for localization and refined visibility logic.
src/components/Notifications/NotificationsList.tsx Updated URL paths in resultUrl function for notification events to reflect "log_updates".
src/components/Notifications/ShowPushNotification.tsx Modified return paths in resultUrl for notification events to use "log_updates".
src/components/Patient/DailyRoundListDetails.tsx Changed title and back URL to use "log_updates" instead of "daily-rounds".
src/components/Patient/DailyRounds.tsx Updated header and button text to reflect "log_updates" and changed navigation paths accordingly.
src/components/Patient/PatientInfoCard.tsx Updated button href to point to "log_updates" and added error handling for bed assignment.
cypress/e2e/patient_spec/PatientLogUpdate.cy.ts Renamed button identifiers from "Daily Rounds" to "Log Updates" in test cases.
tailwind.config.js Reformatted content array for improved readability.
cypress/pageobject/Patient/PatientConsultation.ts Updated selector and button text for viewing consultations to reflect "Log Updates".
src/components/Facility/ConsultationDetails/Events/EventsList.tsx Updated import path for LoadingLogUpdateCard.
src/components/Facility/Consultations/LogUpdates/DefaultLogUpdateCard.tsx Updated import path and href attributes for buttons to reflect "log_updates".
src/components/Facility/Consultations/LogUpdates/VirtualNursingAssistantLogUpdateCard.tsx Updated import path for LogUpdateCardAttribute.
src/components/Facility/Consultations/LogUpdatesFilter.tsx Renamed component from DailyRoundsFilter to LogUpdatesFilter.
src/components/Facility/Consultations/LogUpdatesList.tsx Renamed component from DailyRoundsList to LogUpdatesList and updated import paths.

Assessment against linked issues

Objective Addressed Explanation
Consistency in terminology for log updates (7350)
Update routing paths to reflect log updates terminology (7350)
Update localization for log updates (7350)

Possibly related PRs

Suggested labels

tested, good to merge

Suggested reviewers

  • rithviknishad
  • khavinshankar

Poem

In the land of logs, where updates flow,
From daily rounds to new paths we go.
With translations bright, and routes so clear,
Our logging journey brings us cheer!
Hops and jumps, we celebrate this day,
For every log update, hip-hip-hooray! 🐇✨

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx

Oops! 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'
Require stack:

  • /.eslintrc.json
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at Object.resolve (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2346:46)
    at ConfigArrayFactory._loadParser (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3325:39)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3099:43)
    at _normalizeObjectConfigDataBody.next ()
    at ConfigArrayFactory._normalizeObjectConfigData (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3040:20)
    at _normalizeObjectConfigData.next ()
    at ConfigArrayFactory.loadInDirectory (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2886:28)
    at CascadingConfigArrayFactory._loadConfigInAncestors (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3871:46)

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Nov 11, 2024

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit 54c6464
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/6735e78d6fc9e20008ca62be
😎 Deploy Preview https://deploy-preview-9089--care-ohc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Nov 12, 2024
Copy link

👋 Hi, @yash-learner,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@yash-learner yash-learner marked this pull request as ready for review November 12, 2024 21:15
@yash-learner yash-learner requested a review from a team as a code owner November 12, 2024 21:15
@yash-learner
Copy link
Member Author

yash-learner commented Nov 12, 2024

Things to check:

  • Changes related to events and daily_rounds is left out as events will be deprecated
  • Changing description of notification requires backend change - Need to check whether a backend PR is required as changing the message would be simple but changing constants PATIENT_CONSULTATION_UPDATE_CREATED to PATIENT_LOG_UPDATE_CREATED requires a migration and also we may revamp this DailyRounds table to something else future based on FHIR.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 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 consistency

While the URL paths have been updated, there are still references to "dailyround" in the codebase:

  1. The HTML element uses id="dailyround-entry"
  2. 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 props

The 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 terminology

For consistency with the new terminology:

  1. Rename the file from DailyRoundListDetails.tsx to LogUpdateDetails.tsx
  2. Rename the component from DailyRoundListDetails to LogUpdateDetails

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.

  1. Component naming should be updated to match the new terminology:
- <DailyRounds
+ <LogUpdates
- <DailyRoundListDetails
+ <LogUpdateDetails
  1. 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 tsx

Length 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 typescript

Length 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.updateLogUpdate
src/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 fetching

The 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 constants

The 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 rows

The 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 readings

The 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 and DailyRoundsList
  • Variable names like dailyRoundsQuery and setDailyRoundsQuery

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=json

Length 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 components

The 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 logic

The 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 consistency

The 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 clarity

The 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 maintainability

The PatientInfoCard component is quite large and handles multiple responsibilities. Consider breaking it down into smaller, more focused components:

  • PatientHeader for basic patient information
  • PatientStats for medical statistics
  • PatientActions for action buttons and menus

Also applies to: 32-38


Line range hint 596-605: Enhance accessibility with ARIA labels

Consider 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

📥 Commits

Reviewing files that changed from the base of the PR and between 7cb54b3 and d60eba5.

📒 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 type
  • getDailyReport route
  • updateDailyRound 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}`;
Copy link
Contributor

@coderabbitai coderabbitai bot Nov 12, 2024

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

Copy link
Member Author

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 ?

Copy link
Contributor

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!

src/components/Notifications/NotificationsList.tsx Outdated Show resolved Hide resolved
@@ -653,12 +653,12 @@ export const NOTIFICATION_EVENTS: NotificationEvent[] = [
},
{
id: "PATIENT_CONSULTATION_UPDATE_CREATED",
text: "Patient Consultation Update Created",
text: "Patient Log Update Created",
Copy link
Contributor

@coderabbitai coderabbitai bot Nov 12, 2024

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

Copy link
Member Author

@yash-learner yash-learner Nov 13, 2024

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

Copy link
Contributor

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",
  • cypress/e2e/patient_spec/PatientLogUpdate.cy.ts:

    • Lines containing cy.verifyNotification("Consultation updated successfully");
  • cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts:

    • Line containing cy.verifyNotification("Consultation updated successfully");

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

@github-actions github-actions bot removed the merge conflict pull requests with merge conflict label Nov 13, 2024
rithviknishad
rithviknishad previously approved these changes Nov 13, 2024
@rithviknishad rithviknishad dismissed their stale review November 13, 2024 14:19

code rabbit found some more references...

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 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

📥 Commits

Reviewing files that changed from the base of the PR and between 732e1c8 and 465274f.

📒 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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (1)
src/components/Scribe/formDetails.ts (1)

294-294: Consider tracking commented prescription fields as technical debt

The 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

📥 Commits

Reviewing files that changed from the base of the PR and between 465274f and 2487bd3.

📒 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.

src/components/Scribe/formDetails.ts Outdated Show resolved Hide resolved
@yash-learner
Copy link
Member Author

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

@rithviknishad Do you think this change is required as of now ?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
src/components/Facility/Consultations/LogUpdates/DefaultLogUpdateCard.tsx (2)

61-63: Simplify URL construction logic

The 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 values

The 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

📥 Commits

Reviewing files that changed from the base of the PR and between 79a3616 and eccc86a.

📒 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:

@yash-learner
Copy link
Member Author

@yash-learner yes let's do that too

@rithviknishad

Fixed it in eccc86a

Copy link
Member

@rithviknishad rithviknishad Nov 14, 2024

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, fixed in 8d6edaa, 54c6464

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (3)
src/components/Facility/Consultations/LogUpdatesList.tsx (1)

Line range hint 1-100: Consider documenting the terminology migration strategy

While 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:

  1. Creating a tracking issue for the remaining technical debt
  2. Documenting which terms will be migrated in which phase
  3. 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 references DailyRoundsModel. 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:

  1. Using translation keys for internationalization
  2. 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

📥 Commits

Reviewing files that changed from the base of the PR and between eccc86a and 54c6464.

📒 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:

  1. The API route getDailyReports still uses "daily" terminology
  2. The type DailyRoundsModel is still being used
  3. 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.

@bodhish bodhish merged commit 6e37cae into ohcnetwork:develop Nov 17, 2024
23 checks passed
Copy link

@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! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Log Update"- consistency in terminology
3 participants