Skip to content

Fixed inbox hub documents not showing when clicking on matched patient name#832

Merged
yingbull merged 1 commit intodevelop/dogfishfrom
824-inboxhub-matching-patient-documents-not-showing
Nov 11, 2025
Merged

Fixed inbox hub documents not showing when clicking on matched patient name#832
yingbull merged 1 commit intodevelop/dogfishfrom
824-inboxhub-matching-patient-documents-not-showing

Conversation

@LiamStanziani
Copy link
Copy Markdown
Collaborator

@LiamStanziani LiamStanziani commented Nov 10, 2025

In this PR, I have fixed:

  • An SQL error in InboxResultsDaoImpl.java that results in missing matching documents when selecting a matched patient
  • Removed double whitespace before two FROM clauses
  • Removed dead commented out code

I have tested this by:

  • Following Deval's screenshot with the inbox hub selected options (openodoc instead of oscardoc as the test doctor has been renamed) and tested to see if a matched patient (such as Jacky Jones, which has documents setup by default) matches correctly compared to Magenta main

Summary by Sourcery

Fix the SQL query in populateDocumentResultsData to properly include the provider filter and return all matching documents, clean up SQL formatting, and remove dead commented code.

Bug Fixes:

  • Correct the placement of parentheses in the SQL subquery to ensure the provider_no filter is applied and prevent missing documents for matched patients.

Enhancements:

  • Remove double spaces before FROM clauses to normalize SQL string formatting.

Chores:

  • Eliminate dead commented-out code in the finalResultsCount assignment.

…atching documents when selecting a matched patient, also fixed some double whitespace before the FROM clause
@LiamStanziani LiamStanziani self-assigned this Nov 10, 2025
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Nov 10, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR fixes an SQL bug in populateDocumentResultsData that caused matched patient documents to be omitted, cleans up SQL formatting by removing redundant whitespace before FROM clauses, and removes dead commented-out code in InboxResultsDaoImpl.

ER diagram for updated SQL query in populateDocumentResultsData

erDiagram
DEMOGRAPHIC ||--o{ PROVIDER_LAB_ROUTING : "has"
PROVIDER_LAB_ROUTING ||--o{ DOCUMENT : "routes"
PROVIDER_LAB_ROUTING ||--o{ CTL_DOCUMENT : "links"
PROVIDER_LAB_ROUTING ||--o{ PATIENT_LAB_ROUTING : "matches"
DOCUMENT ||--o{ DEMOGRAPHIC : "belongs to"
Loading

Class diagram for changes in InboxResultsDaoImpl

classDiagram
class InboxResultsDaoImpl {
  +ArrayList<LabResultData> populateDocumentResultsData(String providerNo, String demographicNo, String status, boolean searchProvider, String dateSearchType)
}
class LabResultData {
  +String lastUpdateDate
  +int finalResultsCount
}
InboxResultsDaoImpl --> LabResultData
Loading

File-Level Changes

Change Details Files
Fix SQL conditional logic in subquery to correctly include matched patient documents
  • Moved closing parenthesis inside the provider_no branch
  • Adjusted provider_no filter placement to apply correctly
  • Ensured UNION subquery captures the intended records
src/main/java/ca/openosp/openo/commn/dao/InboxResultsDaoImpl.java
Cleanup SQL query formatting
  • Removed extra whitespace before FROM clauses
  • Standardized spacing in SELECT DISTINCT statements
src/main/java/ca/openosp/openo/commn/dao/InboxResultsDaoImpl.java
Remove dead commented-out code
  • Deleted commented-out getInt("final_result_count") call
  • Simplified finalResultsCount assignment to a literal 0
src/main/java/ca/openosp/openo/commn/dao/InboxResultsDaoImpl.java

Assessment against linked issues

Issue Objective Addressed Explanation
#824 Fix the SQL error in InboxResultsDaoImpl.java that prevents documents from showing when clicking on a matched patient name in the New Inbox.
#824 Ensure that documents for matched patients are correctly displayed when the patient name is clicked, as per the expected result in the issue.

Possibly linked issues

  • Fixed the vulnerabilty #123: The PR fixes the SQL syntax error in the populateDocumentResultsData method by adding a missing parenthesis, which resolves the issue of documents not showing when clicking a patient name in the New Inbox.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions
Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@LiamStanziani LiamStanziani marked this pull request as ready for review November 10, 2025 16:41
Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@yingbull yingbull merged commit 220d13d into develop/dogfish Nov 11, 2025
12 of 14 checks passed
@yingbull yingbull deleted the 824-inboxhub-matching-patient-documents-not-showing branch January 8, 2026 17:02
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.

[Bug]: New Inbox: Documents not showing when clicking on the matched patient name

2 participants