Skip to content

Rx Bugfixes 20260428#219

Closed
lacarmen wants to merge 48 commits into
open-osp:mainfrom
openo-beta:rx-bugfixes/20260428
Closed

Rx Bugfixes 20260428#219
lacarmen wants to merge 48 commits into
open-osp:mainfrom
openo-beta:rx-bugfixes/20260428

Conversation

@lacarmen

Copy link
Copy Markdown
Contributor

Summary

This package contains a collection of bug fixes and regression repairs for the Rx module. Some issues were long-standing bugs, some were regressions introduced to the main branch when updating the Rx Module.

Individual PRs

1. PR #2343 - Fix: medication X button passes wrong ID and removed flawed archival mechanism (4 commits)

  • The "X" (remove) button on staged medications was passing an incorrect ID, causing the wrong medication to be targeted
  • A faulty archival mechanism that only triggered when re-staging medications after re-editing has been removed

Related Issues: https://github.com/openo-beta/Open-O/issues/2339, https://github.com/openo-beta/Open-O/issues/2341

2. PR #2344 - Fix: string object comparison, forward-iteration deletion, missing GCN_SEQNO, and drug name encoding (5 commits)

  • Incorrect string equality checks (== instead of .equals()) in the medication stash caused lookup failures
  • A forward-iteration deletion loop corrupted the medication stash when removing entries
  • Resolved a missing GCN_SEQNO field in the drug search flow and fixed drug name encoding on input

Related Issues: https://github.com/openo-beta/Open-O/issues/2340, https://github.com/openo-beta/Open-O/issues/1879

3. PR #2345 - Fix: ghost card appears when unchecking ReRx checkbox after staging (3 commits)

  • When unchecking the "ReRx" checkbox after a medication was staged, only the server-side stash entry was removed — the card remained on screen
  • Both the client-side card and server-side entry are now properly cleaned up together

Related Issue: https://github.com/openo-beta/Open-O/issues/2342

4. PR #2414 - Fix: Instructions Field Reference popup in the Rx module cannot be closed (1 commit)

  • A regression caused the "Instructions Field Reference" help popup to become impossible to close once opened
  • Close functionality has been restored

Related Issue: https://github.com/openo-beta/Open-O/issues/2391

5. PR #2404 - Fix: restore drug profile legend and filter tab functionality broken by DataTables upgrade (6 commits)

  • An upgrade to DataTables broke the legend display and filter tab in the Drug Profile view
  • Both features have been restored to their correct working state

Related Issue: https://github.com/openo-beta/Open-O/issues/2387

6. PR #2413 - Fix: "Reprint" button in Rx module no longer works (4 commits)

  • A regression caused the "Reprint" button in the Rx module to stop functioning entirely
  • The ability to reprint previously issued prescriptions has been restored

Related Issue: https://github.com/openo-beta/Open-O/issues/2397

7. PR #2415 - Fix: medication list in Rx module sorted in wrong order (4 commits)

  • A regression caused the medication list in the Rx module to appear in an incorrect order
  • The expected sort order has been restored

Related Issue: https://github.com/openo-beta/Open-O/issues/2390

8. PR #2417 - Fix: restore line break rendering and fix missing labels in Rx Preview (2 commits)

  • Line breaks were not rendering in the Rx prescription preview, causing medications to run together without separation
  • Several labels were also missing from the print layout; both issues are resolved

Related Issue: https://github.com/openo-beta/Open-O/issues/2388

9. PR #2261 - Fix: missing staged medications when saving with multiple Rx-related pages open - LEGACY BUG (18 commits)

  • A long-standing bug caused staged medications to disappear when using "Save and Print" while multiple Rx-related pages were open simultaneously (e.g., Medications and Allergies for different patients)
  • Session state was being overwritten across tabs; the fix introduces proper per-patient Rx session management to prevent cross-tab interference

Related Issue: https://github.com/openo-beta/Open-O/issues/2237

@lacarmen lacarmen force-pushed the rx-bugfixes/20260428 branch from 77e0a03 to 35e7752 Compare April 28, 2026 22:17
LiamStanziani and others added 29 commits April 28, 2026 18:24
…echanism that was only used to archive re-staged medications after re-editing
…th CSRF and POST fetch, update JSDoc to align with uncheckReRxForExistingPrescribedDrug parameters
…o searchDrug3.jsp, updated javadoc in delete action, added drugList null or empty check
  Unchecking a ReRx checkbox after staging failed to remove the UI card
  because removeDrugFromReRxList looked up the card by prescription ID
  (set_<prescriptIdInt>) but the card uses a randomId (set_<randomId>).
  Added data-drug-ref-id attribute to staged card fieldsets and updated
  the lookup to use querySelector with that attribute.
…ference for window to be used when hiding modalBox
…ering

- Fetch all drugs once on load (show=all) instead of a separate server request per legend button click
- Cache all <tr> rows via DataTables fnGetNodes() after each load so pagination does not silently truncate the row set
- Filter the cached rows in JS on every legend click — no AJAX round-trips
- Track activeViewMode / activeSectionDefs so non-legend refreshes  (changeLt, re-rx) re-apply the correct view automatically after recaching
- Extract showLongTermAcuteView() and showFullProfileView() named functions to replace unreadable inline showSections blobs in onclick attributes
- Add row predicate helpers (rowIsArchived, rowIsLongTerm, rowIsCurrent, rowIsExternal) to eliminate repeated data-* string comparisons
- Move ListDrugs.jsp legend styles to SearchDrug3.jsp <head> so they survive the rebuildDrugProfile() container wipe on every legend switch
- Fix legend selected-state highlight: clear link-default-selected class from Current button when another legend item is activated
…missing csrfguard

Moved reprint visibility from Prototype $('reprint').toggle() with a CSS      display:none rule to vanilla JS toggleAttribute('hidden'). Prototype's       show() clears inline styles but cannot override CSS rules, so the reprint section was invisible even after toggling, changed in de82590. Also restored the csrfguard script include removed in f5eb92f
…csrfguard near global.js script to match the ctx variable usage
…each medication, and underlines on specifically singular medication reprints
…anged to be in ascending order instead of previous descending order)
…ate to match original behaviour instead of enetered date
… Date is unknown, to match the previous server side sorting behaviour
…age data changing the default sort order, since changes have not been added to prod, so this issue doesn't currently cause issues
LiamStanziani and others added 19 commits April 28, 2026 18:24
…eeded for fixes to this issue when reproducing the workflow
…ate as needed for fixes to this issue when reproducing the workflow"

This reverts commit 8d3b9b7.
…providers, will need to update to iron out bugs and less memory usage
…working fully, but works for most actions inside of the Medications module
…icNo and there was no per-patient session bean for the connected demographicNo, meaning a bean was never created in the first place
  - Move RxSessionFilter after auth filters in web.xml to prevent
    unauthenticated session mutation
  - Add Patient session attribute swapping to RxSessionFilter, removing
    redundant manual lookups in ListDrugs.jsp
  - Support both demographicNo and demographic_no params in filter
  - Fix fetch interceptor to preserve Request object properties
  - Revert generatePreviewPDF.jsp bean read to use filter-swapped legacy key
  - Remove deferred stash clearing fix (resetStashAndClose) from
    ViewScript.jsp and ViewScript2.jsp
  - Revert RxSessionFilter mappings to before Struts2 in web.xml.
    Struts2 short-circuits chain.doFilter() for .do action URLs,
    so placing the filter after Struts2 prevented bean swapping
    for actions like RxWriteScript2Action. Auth for .do URLs is
    handled by SecurityInfoManager inside actions, not LoginFilter.
  - Simplify CaseManagementView2Action and RxChoosePatient2Action
    bean setup — remove redundant getFromSession lookups since
    the filter handles per-request swapping.
  - Restore RxShowAllergy2Action's original provider/demographic
    match check to preserve existing bean state (stash, view).
  - All three actions now use saveToSession instead of setAttribute
    for per-patient key storage.
WIP session isolation commits reintroduced the deleted updateDeleteOnCloseRxBox
function and left popForm2 truncated (missing pharmacy URL logic, myLightWindow
call, and the title bar update). Removed the stale function and restored the
complete popForm2 body to match the correct reference state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lacarmen lacarmen force-pushed the rx-bugfixes/20260428 branch from 35e7752 to fb4f1e9 Compare April 28, 2026 23:02
@lacarmen lacarmen closed this Apr 29, 2026
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