Skip to content

Conversation

@vanitha1822
Copy link
Member

@vanitha1822 vanitha1822 commented Jun 10, 2025

📋 Description

JIRA ID:

AMM-1495

Proposed Changes:

  • Initially, in the supervisor count section, the count was displayed without considering the current date, while the list showed only those records where the current date matched the callDateTo condition.
  • The current date condition has now been added to the count queries as well, to ensure consistency and avoid mismatches in the call allocation process.

✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)

Summary by CodeRabbit

  • Bug Fixes
    • Improved filtering of outbound calls to display only those that have not expired, ensuring users see up-to-date call information.

@coderabbitai
Copy link

coderabbitai bot commented Jun 10, 2025

Walkthrough

The update modifies JPQL queries in the OutboundCallsRepo interface to include an additional filter: only records with callDateTo greater than or equal to the current timestamp are selected. No method signatures or public entity declarations are changed; only the query logic is updated.

Changes

File(s) Change Summary
src/main/java/com/iemr/ecd/repo/call_conf_allocation/OutboundCallsRepo.java Added callDateTo >= CURRENT_TIMESTAMP condition to all relevant JPQL queries for filtering non-expired outbound calls.

Poem

In the warren of code, a filter appears,
Only calls not expired, the logic now steers.
Outbound and timely, the queries align,
With callDateTo checked, the results are just fine.
🕰️🐇—Hopping ahead, right on time!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cbe3193 and 5e99285.

📒 Files selected for processing (1)
  • src/main/java/com/iemr/ecd/repo/call_conf_allocation/OutboundCallsRepo.java (12 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (java)
🔇 Additional comments (7)
src/main/java/com/iemr/ecd/repo/call_conf_allocation/OutboundCallsRepo.java (7)

63-64: Selection queries properly updated with current timestamp filtering.

The addition of t.callDateTo >= CURRENT_TIMESTAMP to these selection queries (getMotherRecordsForANM, getMotherRecordsForAssociate, getChildRecordsForANM, getChildRecordsForAssociate) correctly implements the bug fix to filter out expired calls.

Also applies to: 71-72, 80-81, 87-88


99-100: Count queries correctly aligned with selection queries.

The addition of current timestamp filtering to these count methods properly resolves the count/list mismatch issue described in the PR objectives. These changes ensure consistency between displayed counts and filtered record lists.

Also applies to: 109-110, 118-119, 135-136, 143-144, 151-152


171-172: User-allocated count queries properly updated.

The addition of current timestamp filtering to all user-allocated count methods ensures consistency with the corresponding selection queries. This resolves potential count/list mismatches for user-specific allocations.

Also applies to: 179-180, 187-188, 195-196, 210-211, 218-219, 226-227, 234-235


249-250: User allocation selection queries correctly updated.

The current timestamp condition has been consistently added to all user allocation selection queries, ensuring they return only non-expired records and maintain consistency with the count queries.

Also applies to: 258-259, 267-268, 276-277, 290-291, 298-299, 306-307, 314-315


379-380: Language-specific count queries properly aligned.

The addition of current timestamp filtering to language-specific count methods ensures consistency with selection queries and resolves count/list mismatches for language-filtered allocations.

Also applies to: 388-389, 398-399, 408-409


427-428: MO-specific allocation queries correctly updated.

The current timestamp condition has been properly added to MO (Medical Officer) specific allocation queries, maintaining consistency with the overall pattern of filtering out expired calls.

Also applies to: 435-436


59-442:

Details

❓ Verification inconclusive

Verify complete consistency across all query methods.

While most queries have been updated correctly, please ensure that ALL methods that should filter by current timestamp have been consistently updated to prevent any remaining count/list mismatches.


🏁 Script executed:

#!/bin/bash
# Description: Verify all query methods in the repository for consistency in current timestamp filtering

# Search for @Query annotations and check which ones might be missing the current timestamp condition
echo "=== Query methods without CURRENT_TIMESTAMP condition ==="
ast-grep --pattern $'@Query($$$)
$METHOD_NAME($$$) {
  $$$
}' | grep -A 20 "@Query" | grep -B 5 -A 15 "callDateTo\|callDateFrom" | grep -L "CURRENT_TIMESTAMP"

echo "=== Query methods with CURRENT_TIMESTAMP condition ==="
rg -A 10 "CURRENT_TIMESTAMP" 

echo "=== All Query methods for manual verification ==="
rg -A 5 "@Query.*value.*SELECT.*FROM OutboundCalls"

Length of output: 92581


Consistency of CURRENT_TIMESTAMP Filters

All repository methods that include callDateFrom/callDateTo now correctly append
t.callDateTo >= CURRENT_TIMESTAMP. However, the following methods do not enforce any time-based filter and should be reviewed to determine if they ought to restrict to active/upcoming calls:

  • src/main/java/com/iemr/ecd/repo/call_conf_allocation/OutboundCallsRepo.java
    Page<OutboundCalls> getMotherRecordsForMO(...)
    List<OutboundCalls> getIntroductoryRecordsUser(...)

Please confirm whether these should include a t.callDateTo >= CURRENT_TIMESTAMP clause (or other date constraints) and update accordingly to ensure consistency across all query methods.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

@vanitha1822 vanitha1822 requested a review from drtechie June 10, 2025 11:09
@vanitha1822 vanitha1822 self-assigned this Jun 10, 2025
@sonarqubecloud
Copy link

@vanitha1822 vanitha1822 requested a review from mo839639 June 12, 2025 08:46
@vanitha1822 vanitha1822 merged commit a3c728b into develop Jun 12, 2025
7 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jun 17, 2025
10 tasks
@coderabbitai coderabbitai bot mentioned this pull request Oct 29, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants