Skip to content

fix: restore server-side drug filtering and heading display broken by…#115

Open
D3V41 wants to merge 1 commit intoMagentaHealth:release/2026-03-17from
openo-beta:fix/restore-drug-profile-view-legend-searchdrug3-base-release
Open

fix: restore server-side drug filtering and heading display broken by…#115
D3V41 wants to merge 1 commit intoMagentaHealth:release/2026-03-17from
openo-beta:fix/restore-drug-profile-view-legend-searchdrug3-base-release

Conversation

@D3V41
Copy link
Copy Markdown
Collaborator

@D3V41 D3V41 commented Apr 8, 2026

Summary

  • Restores the drug profile view legend table (filter tabs + "Change View" link) in SearchDrug3.jsp that was removed in edac1715d550de8062d066badc82eab62d833908
  • Restores server-side drug filtering in ListDrugs.jsp that was commented out in the same commit, causing the Active, Inactive, Long Term/Acute, and External filter tabs to return unfiltered results regardless of which tab was clicked
image

Summary by Sourcery

Restore the drug profile view controls and re-enable server-side drug list filtering in the prescription module.

Bug Fixes:

  • Reinstate the drug profile legend UI, including filter tabs and change-view link, so users can switch between different drug profile views.
  • Re-enable server-side filtering of drugs by status, long-term/acute classification, and external source so the profile tabs return correctly filtered results.

@D3V41 D3V41 self-assigned this Apr 8, 2026
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 8, 2026

Reviewer's Guide

Restores the Rx drug profile legend UI and re-enables the corresponding server-side filtering logic for drug lists, so profile view tabs once again send filter parameters and ListDrugs.jsp honors them.

Sequence diagram for restored drug profile filter interactions

sequenceDiagram
    actor User
    participant Browser
    participant SearchDrug3_jsp as SearchDrug3_jsp
    participant ListDrugs_jsp as ListDrugs_jsp

    User->>Browser: Click filter tab in legend
    Browser->>SearchDrug3_jsp: onclick handler for selected tab
    activate SearchDrug3_jsp
    SearchDrug3_jsp->>Browser: callReplacementWebService(ListDrugs_jsp_url, drugProfile)
    deactivate SearchDrug3_jsp

    Browser->>ListDrugs_jsp: HTTP GET ListDrugs.jsp with filter parameters
    activate ListDrugs_jsp
    ListDrugs_jsp->>ListDrugs_jsp: Apply status, longTermOnly, drugLocation filters
    ListDrugs_jsp-->>Browser: Filtered drug list HTML
    deactivate ListDrugs_jsp

    Browser->>Browser: Replace drugProfile inner HTML
    Browser-->>User: Updated filtered drug profile view
Loading

File-Level Changes

Change Details Files
Reintroduce the drug profile legend table and filter tabs in the Rx drug search profile view.
  • Add a legend table with a 'Change Profile View' link wired to popupPage('../setProviderStaleDate.do?method=viewRxProfileView')
  • Restore conditional rendering of filter tabs (current, all, active, inactive, long-term/acute variants) based on existing JSP flags
  • Wire each filter tab to callReplacementWebService/callAdditionWebService with appropriate ListDrugs.jsp query parameters (status, longTermOnly, heading, drugLocation) and CSS class toggling
src/main/webapp/oscarRx/SearchDrug3.jsp
Re-enable server-side filtering of drugs based on status, long-term/acute, and drug location parameters.
  • Uncomment and reinstate request parameter checks for status to filter active vs inactive prescriptions
  • Uncomment and reinstate longTermOnly=true and longTermOnly=acute checks to filter long-term vs acute medications
  • Uncomment and reinstate drugLocation=external check to include only external medications when requested
src/main/webapp/oscarRx/ListDrugs.jsp

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

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 - I've left some high level feedback:

  • In ListDrugs.jsp you repeatedly call request.getParameter("longTermOnly") and compare to two different values; consider reading it into a local variable once and using a clearer conditional structure to avoid duplication and make the filtering logic easier to follow.
  • The long onclick attribute values in the legend links on SearchDrug3.jsp are hard to read and maintain; consider extracting them into named JavaScript functions or helpers instead of composing multi-call strings inline.
  • The repeated <fmt:setBundle basename="oscarResources"/> calls inside each legend link in SearchDrug3.jsp could be reduced by setting the bundle once at a higher scope and then only using <fmt:message> to simplify the JSP markup.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In ListDrugs.jsp you repeatedly call `request.getParameter("longTermOnly")` and compare to two different values; consider reading it into a local variable once and using a clearer conditional structure to avoid duplication and make the filtering logic easier to follow.
- The long `onclick` attribute values in the legend links on SearchDrug3.jsp are hard to read and maintain; consider extracting them into named JavaScript functions or helpers instead of composing multi-call strings inline.
- The repeated `<fmt:setBundle basename="oscarResources"/>` calls inside each legend link in SearchDrug3.jsp could be reduced by setting the bundle once at a higher scope and then only using `<fmt:message>` to simplify the JSP markup.

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.

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.

1 participant