Skip to content

Conversation

@vanitha1822
Copy link
Member

@vanitha1822 vanitha1822 commented Jun 16, 2025

πŸ“‹ Description

JIRA ID: AMM-1495

Add current timestamp to filter the counts for high risk mother records


βœ… Type of Change

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

Summary by CodeRabbit

  • Bug Fixes
    • Improved filtering of outbound calls for high-risk mothers to include only those with a valid call date in the present or future.

@coderabbitai
Copy link

coderabbitai bot commented Jun 16, 2025

Walkthrough

A condition was added to two JPQL queries in the OutboundCallsRepo interface to include only records where callDateTo is greater than or equal to the current timestamp. No method signatures or public API declarations were changed; only the query strings were updated.

Changes

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

Sequence Diagram(s)

sequenceDiagram
    participant Service
    participant OutboundCallsRepo
    participant Database

    Service->>OutboundCallsRepo: getMotherRecordsForMO()
    OutboundCallsRepo->>Database: Query with callDateTo >= CURRENT_TIMESTAMP
    Database-->>OutboundCallsRepo: Filtered mother call records
    OutboundCallsRepo-->>Service: Return records

    Service->>OutboundCallsRepo: getMotherUnAllocatedCountHR()
    OutboundCallsRepo->>Database: Count query with callDateTo >= CURRENT_TIMESTAMP
    Database-->>OutboundCallsRepo: Filtered count
    OutboundCallsRepo-->>Service: Return count
Loading

Possibly related PRs

Suggested reviewers

  • mo839639

Poem

A timestamp hops into the code,
Filtering calls on the motherly road.
Only those still fresh and new,
Will now appear in the query’s view.
With every hop, the logic’s tightβ€”
The future’s calls are now in sight! πŸ‡β°

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

@sonarqubecloud
Copy link

@vanitha1822 vanitha1822 requested a review from mo839639 June 16, 2025 10:20
@vanitha1822 vanitha1822 self-assigned this Jun 16, 2025
Copy link

@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

🧹 Nitpick comments (1)
src/main/java/com/iemr/ecd/repo/call_conf_allocation/OutboundCallsRepo.java (1)

248-262: Consider centralising the callDateTo >= CURRENT_TIMESTAMP clause

The same string literal is now duplicated in 25+ queries.
For maintainability:

- ... AND t.callDateTo >= CURRENT_TIMESTAMP
+ ... AND t.callDateTo >= CURRENT_TIMESTAMP  -- duplicated everywhere

Options:

  1. Introduce a database view that already applies the filter and query the view.
  2. Use a Spring Data @EntityGraph or specification to append the predicate programmatically.

Either approach removes duplication and future-proofs the code.

πŸ“œ Review details

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

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between a3c728b and 1e6fb87.

πŸ“’ Files selected for processing (1)
  • src/main/java/com/iemr/ecd/repo/call_conf_allocation/OutboundCallsRepo.java (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: style-check / checkstyle
  • GitHub Check: Build
  • GitHub Check: Package-test
  • GitHub Check: Analyze (java)
πŸ”‡ Additional comments (5)
src/main/java/com/iemr/ecd/repo/call_conf_allocation/OutboundCallsRepo.java (5)

63-65: Verify impact of the new CURRENT_TIMESTAMP guard on ANM work-list window

The extra predicate narrows the result set to future calls only, regardless of the :fDate / :tDate window already supplied.
If callers occasionally request historical windows (e.g. back-dated reconciliation) those rows will now be silently dropped.

Please double-check that this behavioural change is intentional for getMotherRecordsForANM.


71-72: Same temporal guard applied to Associate work-list – confirm requirement

The logic change is identical to the ANM query. Make sure Associates are also expected to see only calls whose callDateTo is β‰₯ now.


93-94: High-risk MO list correctly restricted to current / upcoming calls

The added constraint directly addresses AMM-1495; no further issues spotted.


111-121: Low-risk counters now filtered by CURRENT_TIMESTAMP – possible scope creep

The JIRA ticket mentions only high-risk mother records, yet the same condition has been added to low-risk mother/child counters.
Confirm that reporting dashboards relying on historical counts are not affected.


127-130: High-risk mother count safeguarded – looks good

Change is in line with the stated objective and mirrors the MO work-list update.

Copy link
Contributor

@mo839639 mo839639 left a comment

Choose a reason for hiding this comment

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

Please test the functionality with new mother excel

@vanitha1822 vanitha1822 merged commit 260c238 into develop Jun 16, 2025
7 checks passed
@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