Skip to content

Fix: String object comparison and forward-iteration deletion in medication stash, missing GCN_SEQNO for drug search flow, and drug name encoding on input#2344

Merged
lacarmen merged 5 commits into
developfrom
bug/string-object-checking-and-forward-iteration-deletion-loop-medications
Apr 7, 2026
Merged

Fix: String object comparison and forward-iteration deletion in medication stash, missing GCN_SEQNO for drug search flow, and drug name encoding on input#2344
lacarmen merged 5 commits into
developfrom
bug/string-object-checking-and-forward-iteration-deletion-loop-medications

Conversation

@LiamStanziani

@LiamStanziani LiamStanziani commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes two interconnected bugs in the medication prescription stash that cause duplicate entries and IndexOutOfBoundsException crashes when re-staging previously saved medications.

Fixes #2340
Fixes #1879

Note: These bug numbers are based on a google document listing medication issues found, not other issues tracked in GitHub.

Problem

Bug #2 (Regression): String == comparison (RxSessionBean.java:228): After GCN_SEQNO was refactored from int to String, the duplicate detection in addStashItem() uses == (reference comparison) instead of value comparison. This silently allows duplicate
"ghost" entries into the stash when re-adding the same drug.
Bug #3 (Pre-existing): Forward-iteration deletion (RxWriteScript2Action.java:1250-1255): The stash cleanup loop iterates forward through indices while calling ArrayList.remove(), which shifts remaining elements down after each removal. This causes wrong
items to be deleted or throws IndexOutOfBoundsException: Index 3 out of bounds for length 3.

Bug #8 (Cascading): Together, Bugs #2 and #3 cascade into a 500 crash during Save & Print after re-staging medications via Edit Rx.

Missing GCN_SEQNO in drug search flow (#1879): The GCN_SEQNO assignment in RxChooseDrug2Action was commented out during the Vigilance integration, leaving prescriptions with null GCN_SEQNO and breaking duplicate detection, custom name classification, and favorite lookups.

Drug name corruption (Pre-existing + Regression): Encode.forJava() was misapplied to input data in createNewRx(), encoding values at storage time instead of at output time. Combined with manual replace("'", "\'") calls in prescribe.jsp, this double-escaped apostrophes and quotes in brand names (e.g., CHILDREN'S → CHILDREN\'S), corrupting data stored in the database and breaking duplicate detection for affected drugs.

Solution

Bug #2: Changed == to Objects.equals() for null-safe String value comparison on GCN_SEQNO.
Bug #3: Added Collections.sort(deletedIndex, Collections.reverseOrder()) before the removal loop so indices are removed highest-first, preventing index shifting corruption. Used a defensive copy (new ArrayList<>(allIndex)) to avoid mutating the original list.

#1879: Restored rx.setGCN_SEQNO(drugId) in RxChooseDrug2Action, matching the pre-Vigilance behavior where the drug reference ID was used as GCN_SEQNO.

Drug name corruption: Removed Encode.forJava() calls on text and drugId in RxWriteScript2Action.createNewRx() — these encoded input data that should be stored raw and encoded only at output time. Removed manual drugName.replace("'", "\'") and drugName.replace(""","\"") in prescribe.jsp. Fixed three raw <%=drugName%> JavaScript usages with proper Encode.forJavaScript(drugName) for XSS prevention.

Found Issues (Will be separate investigations, and have been added under the additional concerns section in the google document)

  • Drugref data inconsistency: The drug reference service search endpoint and detail endpoint (get_drug_2) can return different drug names for the same ID (e.g., search returns ACETAMINOPHEN for ID 70652, but detail returns JUNIPER BERRIES). This seems to be a data issue in Open-Drugref, not in OpenO.
  • DB data corruption: Drugs with special characters (apostrophes, quotes) saved since the Vigilance integration (August 2025) may have backslash-escaped brand names in the database. A migration script may be needed to clean up affected records.

Summary by Sourcery

Fix medication prescription stash handling to correctly deduplicate entries and safely remove closed prescriptions without index errors.

Bug Fixes:

  • Use value-based, null-safe comparison for medication GCN_SEQNO when checking for existing stash items to prevent duplicate entries.
  • Sort stash deletion indices in descending order before removal to avoid index shifting and IndexOutOfBoundsException during cleanup.

Summary by cubic

Fixes duplicate medications and IndexOutOfBounds crashes in the prescription stash, and corrects drug name handling in the UI. Compares GCN_SEQNO by value, sets it from drugId, deletes closed items safely, and uses JavaScript-safe encoding for names.

  • Bug Fixes
    • Set prescription GCN_SEQNO from drugId to keep stash keys consistent.
    • Use null-safe Objects.equals for GCN_SEQNO String comparison to prevent duplicates.
    • Copy deletion indices, sort descending, and remove highest-first to avoid wrong deletions and out-of-bounds errors.
    • Remove input-side Java encoding and unnecessary trimming; encode drugName with Encode.forJavaScript in prescribe.jsp and use JS-safe values in the UI.

Written for commit 188c0d5. Summary will update on new commits.

Summary by Sourcery

Fix medication stash handling to correctly detect existing prescriptions and safely delete closed entries without index errors.

Bug Fixes:

  • Use value-based, null-safe comparison for prescription GCN_SEQNO when checking for existing stash items to prevent duplicate entries.
  • Sort stash deletion indices in descending order before removal to avoid index shifting and IndexOutOfBoundsException during cleanup.

Summary by Sourcery

Fix medication prescription stash duplicate detection and cleanup, and correct drug name handling and encoding in the prescribing UI.

Bug Fixes:

  • Ensure medication stash deduplication compares prescription identifiers by String value to avoid duplicate entries.
  • Stabilize stash cleanup by deleting prescription indices from a sorted defensive copy in descending order to prevent index shifting errors.
  • Restore assignment of prescription GCN_SEQNO from the selected drug ID so duplicate detection and lookups function correctly.
  • Remove incorrect input-side encoding of drug identifiers and names that was corrupting stored data and breaking comparisons.
  • Use JavaScript-safe encoding for drug names when passing them into client-side scripts and favorite handling to avoid escaping issues and potential XSS.

Summary by CodeRabbit

Release Notes

Bug Fixes

  • Improved duplicate prescription detection to more reliably handle medication matching

Refactor

  • Updated drug selection process for prescriptions
  • Modified prescription item deletion workflow
  • Enhanced encoding and handling of medication information throughout prescription forms and favorites functionality

@LiamStanziani LiamStanziani self-assigned this Mar 18, 2026
@coderabbitai

coderabbitai Bot commented Mar 18, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The changes fix three interconnected bugs in prescription/drug handling: activating GCN_SEQNO assignment in drug selection, replacing primitive equality checks with null-safe comparison for stash duplicate detection, fixing ArrayList deletion order to prevent index corruption, and updating JavaScript encoding for drug names in the JSP.

Changes

Cohort / File(s) Summary
GCN_SEQNO Assignment
src/main/java/ca/openosp/openo/prescript/pageUtil/RxChooseDrug2Action.java
Activates setGCN_SEQNO() call in success path using incoming drugId parameter instead of commented-out code, ensuring GCN sequence is populated during drug lookup.
Stash Duplicate Detection
src/main/java/ca/openosp/openo/prescript/pageUtil/RxSessionBean.java
Replaces primitive == operator with Objects.equals() for null-safe GCN_SEQNO comparison in duplicate detection, fixing stash corruption from reference equality bug.
Batch Removal & Encoding
src/main/java/ca/openosp/openo/prescript/pageUtil/RxWriteScript2Action.java
Removes encoding calls on text and drugId parameters; copies deletion index list and explicitly sorts in reverse order before removal loop to prevent ArrayList index shifts and corruption.
JavaScript Encoding
src/main/webapp/oscarRx/prescribe.jsp
Replaces ad-hoc quote escaping with consistent OWASP Encode.forJavaScript() encoding for drugName in JavaScript context and "Add to Favorites" links, removing manual encode/decode round-trip.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Openosp main #1872: Contains overlapping coordinated changes to GCN_SEQNO handling and prescription/drug processing that establish the baseline for this PR's bug fixes.

Suggested reviewers

  • yingbull

Poem

🐰 A stash full of ghosts haunts the queue,
With == comparisons not quite true—
Reverse-sorted deletions clear the way,
And encoding makes drugNames display! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR fully addresses all objectives from linked issues #2340 and #1879: null-safe GCN_SEQNO comparison [#2340], reverse-order index deletion [#2340], and restoring GCN_SEQNO assignment in RxChooseDrug2Action [#1879].
Out of Scope Changes check ✅ Passed Changes to prescribe.jsp and removal of Encode.forJava() calls, while not explicitly mentioned in linked issues, are reasonably scoped as they address double-escaping and XSS concerns related to the encoding/decoding issues discovered during GCN_SEQNO investigation.
Title check ✅ Passed The PR title directly summarizes the main changes: fixing duplicate detection via null-safe comparison, correcting deletion order to prevent crashes, restoring GCN_SEQNO assignment, and addressing drug name encoding issues.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bug/string-object-checking-and-forward-iteration-deletion-loop-medications
📝 Coding Plan
  • Generate coding plan for human review comments

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai

sourcery-ai Bot commented Mar 18, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts medication stash duplicate detection and deletion logic, restores GCN_SEQNO assignment during drug selection, and fixes drug name encoding/escaping in the prescribing UI to prevent duplicates, crashes, and corrupted names.

Sequence diagram for medication re-staging and stash deduplication

sequenceDiagram
    actor User
    participant prescribe_jsp as prescribe_jsp
    participant RxChooseDrug2Action as RxChooseDrug2Action
    participant RxWriteScript2Action as RxWriteScript2Action
    participant RxSessionBean as RxSessionBean
    participant RxPrescription as RxPrescriptionData_Prescription

    User->>prescribe_jsp: Selects drug from search results
    prescribe_jsp->>RxChooseDrug2Action: execute(drugId)
    RxChooseDrug2Action->>RxPrescription: setGCN_SEQNO(drugId)
    RxChooseDrug2Action-->>prescribe_jsp: Preconfigured RxPrescription

    User->>prescribe_jsp: Save_and_Print or stage_medication
    prescribe_jsp->>RxWriteScript2Action: createNewRx()
    RxWriteScript2Action->>RxSessionBean: addStashItem(loggedInInfo, rx)
    RxSessionBean->>RxSessionBean: loop over existing stash items
    RxSessionBean->>RxSessionBean: compare brandName and Objects.equals(GCN_SEQNO)
    alt matching_item_found
        RxSessionBean-->>RxWriteScript2Action: return_existing_index
    else new_item
        RxSessionBean-->>RxWriteScript2Action: add_new_and_return_index
    end
Loading

Sequence diagram for safe deletion of closed prescriptions from stash

sequenceDiagram
    participant RxWriteScript2Action as RxWriteScript2Action
    participant allIndex as allIndex_List_Integer
    participant deletedIndex as deletedIndex_ArrayList_Integer
    participant Collections as java_util_Collections
    participant RxSessionBean as RxSessionBean

    RxWriteScript2Action->>allIndex: collect indices of closed prescriptions
    RxWriteScript2Action->>deletedIndex: new ArrayList(allIndex)
    RxWriteScript2Action->>Collections: sort(deletedIndex, reverseOrder())
    Collections-->>RxWriteScript2Action: deletedIndex sorted_desc

    loop for each index in deletedIndex
        RxWriteScript2Action->>RxSessionBean: removeStashItem(index)
    end
Loading

Class diagram for updated medication stash and drug selection logic

classDiagram
    class RxSessionBean {
        +int addStashItem(LoggedInInfo loggedInInfo, RxPrescriptionData_Prescription rx)
    }

    class RxChooseDrug2Action {
        +String execute()
        -RxPrescriptionData_Prescription rx
    }

    class RxWriteScript2Action {
        +String createNewRx()
        +String updateSaveAllDrugs()
    }

    class RxPrescriptionData_Prescription {
        +String getBrandName()
        +String getGCN_SEQNO()
        +void setGCN_SEQNO(String gcnSeqno)
    }

    class LoggedInInfo

    class java_util_Objects {
        +static boolean equals(Object a, Object b)
    }

    class java_util_List_Integer {
        +void add(Integer index)
    }

    class java_util_Collections {
        +static void sort(java_util_List_Integer list, java_util_Comparator_Integer comparator)
        +static java_util_Comparator_Integer reverseOrder()
    }

    class java_util_ArrayList_Integer {
        +java_util_ArrayList_Integer(java_util_List_Integer source)
    }

    class java_util_Comparator_Integer

    RxSessionBean --> RxPrescriptionData_Prescription : operates_on
    RxSessionBean --> LoggedInInfo : uses
    RxSessionBean ..> java_util_Objects : uses_equals

    RxChooseDrug2Action --> RxPrescriptionData_Prescription : configures_rx
    RxChooseDrug2Action ..> RxWriteScript2Action : part_of_prescribing_flow

    RxWriteScript2Action ..> RxSessionBean : manages_stash
    RxWriteScript2Action ..> java_util_List_Integer : uses_allIndex
    RxWriteScript2Action ..> java_util_ArrayList_Integer : copies_to_deletedIndex
    RxWriteScript2Action ..> java_util_Collections : sorts_deletedIndex

    java_util_Collections ..> java_util_Comparator_Integer
Loading

File-Level Changes

Change Details Files
Make stash duplicate detection for prescriptions use null-safe String value comparison on GCN_SEQNO instead of reference comparison.
  • Replace reference equality check on GCN_SEQNO with Objects.equals for String comparison in prescription stash matching logic
src/main/java/ca/openosp/openo/prescript/pageUtil/RxSessionBean.java
Fix forward-iteration deletion bug when removing closed prescriptions from the stash.
  • Create a defensive copy of indices to delete instead of mutating the original list
  • Sort deletion indices in descending order before calling removeStashItem to avoid index shifting and IndexOutOfBoundsException
src/main/java/ca/openosp/openo/prescript/pageUtil/RxWriteScript2Action.java
Restore and standardize GCN_SEQNO assignment during drug selection to keep it in sync with drugId.
  • Set rx.setGCN_SEQNO(drugId) after loading the chosen drug to re-enable GCN-based behaviors like deduping and favorites
src/main/java/ca/openosp/openo/prescript/pageUtil/RxChooseDrug2Action.java
Correct encoding strategy for drug names and related fields to avoid data corruption while preserving XSS protection in the UI.
  • Remove Encode.forJava on request parameters text and drugId so they are stored raw instead of pre-escaped
  • Remove manual quote-escaping on drugName in JSP prior to rendering
  • Wrap drugName in Encode.forJavaScript when passing into JavaScript functions and populating input values, including addFav calls and drugName_ field initialization
src/main/java/ca/openosp/openo/prescript/pageUtil/RxWriteScript2Action.java
src/main/webapp/oscarRx/prescribe.jsp

Assessment against linked issues

Issue Objective Addressed Explanation
https://github.com/openo-beta/Open-O/issues/1879 Restore setting of GCN_SEQNO in the success path of RxChooseDrug2Action.execute() so that GCN_SEQNO is populated when drug lookup succeeds.
https://github.com/openo-beta/Open-O/issues/2340 In RxSessionBean.addStashItem(), change the GCN_SEQNO comparison from reference comparison on Strings (==) to a proper value-based comparison that handles null safely, so duplicate stash entries are correctly detected (fix Bug #2).
https://github.com/openo-beta/Open-O/issues/2340 In RxWriteScript2Action.updateSaveAllDrugs(), fix the forward-iteration removal of stash items by deleting indices in a way that avoids index shifting and IndexOutOfBoundsException (e.g., remove in descending index order) (fix Bug #3).
https://github.com/openo-beta/Open-O/issues/2340 By fixing Bugs #2 and #3, eliminate the cascading 500 IndexOutOfBoundsException crash when re-staging the same medications and saving/printing again (Bug #8).

Possibly linked issues


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

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses critical bugs in the medication prescription stash, specifically preventing duplicate entries and resolving IndexOutOfBoundsException crashes during the re-staging of medications. The changes ensure robust handling of medication data by correcting string comparison logic and improving the safety of list item removal operations.

Highlights

  • String Comparison Fix: Updated the medication duplicate detection logic in RxSessionBean.java to use Objects.equals() instead of == for GCN_SEQNO comparison, resolving an issue where duplicate "ghost" entries could be added to the stash.
  • Stash Deletion Logic Improvement: Modified the medication stash cleanup loop in RxWriteScript2Action.java to sort deletion indices in reverse order using Collections.reverseOrder() before removal, preventing IndexOutOfBoundsException and incorrect item deletions caused by forward iteration.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions

github-actions Bot commented Mar 18, 2026

Copy link
Copy Markdown

Dependency Review

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

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 188c0d5.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@LiamStanziani LiamStanziani requested a review from Copilot March 18, 2026 19:59
@LiamStanziani

Copy link
Copy Markdown
Collaborator Author

@SourceryAI review

@LiamStanziani

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • In RxWriteScript2Action.updateSaveAllDrugs, List<Integer> deletedIndex = allIndex; followed by sorting mutates allIndex as well; if you intend to preserve the original ordering of allIndex, create a copy instead (e.g., List<Integer> deletedIndex = new ArrayList<>(allIndex);).
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `RxWriteScript2Action.updateSaveAllDrugs`, `List<Integer> deletedIndex = allIndex;` followed by sorting mutates `allIndex` as well; if you intend to preserve the original ordering of `allIndex`, create a copy instead (e.g., `List<Integer> deletedIndex = new ArrayList<>(allIndex);`).

## Individual Comments

### Comment 1
<location path="src/main/java/ca/openosp/openo/prescript/pageUtil/RxWriteScript2Action.java" line_range="1250" />
<code_context>
             }
         }
         List<Integer> deletedIndex = allIndex;
+        Collections.sort(deletedIndex, Collections.reverseOrder());
         // remove closed Rx from stash
         for (Integer n : deletedIndex) {
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Sorting the alias list may unintentionally mutate the original allIndex list.

Because `deletedIndex` references `allIndex`, sorting it will reorder `allIndex` in place. To avoid unintended side effects on `allIndex` (especially if it’s used elsewhere or expected to be unmodified), create a copy before sorting, e.g. `List<Integer> deletedIndex = new ArrayList<>(allIndex);`.

Suggested implementation:

```java
import java.util.ArrayList;
import java.util.Collections;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

```

```java
        List<Integer> deletedIndex = new ArrayList<>(allIndex);
        Collections.sort(deletedIndex, Collections.reverseOrder());

```
</issue_to_address>

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

The pull request introduces two key fixes: in RxSessionBean.java, it updates the comparison of GCN_SEQNO values from == to Objects.equals() to ensure correct Integer value comparison and handle potential nulls; and in RxWriteScript2Action.java, it adds a reverse sort to the deletedIndex list before removing items, which prevents index shifting issues and ensures accurate item removal from a collection.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes two stash-handling defects in the Rx prescribing flow that could create duplicate “ghost” stash items and trigger incorrect deletions / IndexOutOfBoundsException during cleanup when re-staging previously saved medications.

Changes:

  • Fix duplicate detection in RxSessionBean.addStashItem() by switching GCN_SEQNO comparison from reference (==) to value-based Objects.equals(...).
  • Prevent index-shift corruption during stash cleanup in RxWriteScript2Action.updateSaveAllDrugs() by sorting deletion indices in descending order before removals.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/main/java/ca/openosp/openo/prescript/pageUtil/RxWriteScript2Action.java Sorts deletion indices in reverse order before removing stash entries to avoid index shifting.
src/main/java/ca/openosp/openo/prescript/pageUtil/RxSessionBean.java Uses null-safe value equality for GCN_SEQNO to properly deduplicate stash items.

Comment thread src/main/java/ca/openosp/openo/prescript/pageUtil/RxSessionBean.java Outdated
Comment thread src/main/java/ca/openosp/openo/prescript/pageUtil/RxWriteScript2Action.java Outdated
@LiamStanziani

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@LiamStanziani

LiamStanziani commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator Author

I think I see another issue with duplication checking, now the duplication checking is working in terms of comparing String values, but it seems to still show a duplicate if following the "Save And Print" flow, what I expect is the issue is that GCN_SEQNO does not seem to be set in the success path of the action, I tried to prompt claude with this before in this PR: #2176

But it didn't seem to work out well, will probably investigate and fix it in this PR.

@LiamStanziani LiamStanziani linked an issue Mar 18, 2026 that may be closed by this pull request
@LiamStanziani

LiamStanziani commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator Author

There seems to be another matching issue, will be investigating it, see information below:

In both additions, I searched for:

ACETAMINOPHEN 1000MG/DEXTROMETHORPHAN HYDROBROMIDE 30MG SYRUP

first addition after save and print debug logs:

2026-03-18 18:24:36,264 WARN pageUtil.RxSessionBean (RxSessionBean.java:216) - addStashItem: incoming item isCustom=false, brandName='JUNIPER BERRIES 100MG/ZEA MAYS 100MG/ALTHAEA OFFICINALIS 50MG/UVA URSI 100MG CAPSULE',
GCN_SEQNO='70652', stashSize=0
2026-03-18 18:24:36,264 WARN pageUtil.RxSessionBean (RxSessionBean.java:253) - addStashItem: NO duplicate found, adding new item

second addition after edit, then save and print, debug logs (should be the same drug):

2026-03-18 18:25:23,937 WARN pageUtil.RxSessionBean (RxSessionBean.java:216) - addStashItem: incoming item isCustom=false, brandName='JUNIPER BERRIES 100MG/ZEA MAYS 100MG/ALTHAEA OFFICINALIS 50MG/UVA URSI 100MG CAPSULE',
GCN_SEQNO='70652', stashSize=1
2026-03-18 18:25:23,938 WARN pageUtil.RxSessionBean (RxSessionBean.java:222) - addStashItem: stash[0] isCustom=false, brandName='ACETAMINOPHEN 1000MG/DEXTROMETHORPHAN HYDROBROMIDE 30MG SYRUP', GCN_SEQNO='70652'
2026-03-18 18:25:23,938 WARN pageUtil.RxSessionBean (RxSessionBean.java:234) - addStashItem: brandNameMatch=false, gcnMatch=true
2026-03-18 18:25:23,938 WARN pageUtil.RxSessionBean (RxSessionBean.java:253) - addStashItem: NO duplicate found, adding new item

Querying for last 5 meds added to test DB, still set as the correct brand name but it failed to match on duplicate?:

SELECT drugid, BN, GCN_SEQNO FROM drugs WHERE demographic_no = 1 ORDER BY drugid DESC LIMIT 5;

+--------+---------------------------------------------------------------+-----------+
| drugid | BN                                                            | GCN_SEQNO |
+--------+---------------------------------------------------------------+-----------+
|    196 | ACETAMINOPHEN 1000MG/DEXTROMETHORPHAN HYDROBROMIDE 30MG SYRUP |     70652 |
|    195 | ACETAMINOPHEN 1000MG/DEXTROMETHORPHAN HYDROBROMIDE 30MG SYRUP |     70652 |
|    194 | ACETAMINOPHEN 1000MG/DEXTROMETHORPHAN HYDROBROMIDE 30MG SYRUP |     70652 |
|    193 | ACETAMINOPHEN 1000MG/DEXTROMETHORPHAN HYDROBROMIDE 30MG SYRUP |     70652 |
|    192 | ACETAMINOPHEN 1000MG/DEXTROMETHORPHAN HYDROBROMIDE 30MG SYRUP |     70652 |
+--------+---------------------------------------------------------------+-----------+

@LiamStanziani

LiamStanziani commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator Author

Ok, I am pretty sure this is an Open-Drugref issue, I have tried with other medications and I see that some work, some don't:

Tried with:

ACETAMINOPHEN 500MG

first addition after save and print debug logs:

2026-03-18 19:03:16,110 WARN pageUtil.RxSessionBean (RxSessionBean.java:216) - addStashItem: incoming item isCustom=false, brandName='ACETAMINOPHEN 500MG', GCN_SEQNO='27734', stashSize=0
2026-03-18 19:03:16,110 WARN pageUtil.RxSessionBean (RxSessionBean.java:253) - addStashItem: NO duplicate found, adding new item

second addition after edit, then save and print, debug logs (should be the same drug):

2026-03-18 19:03:25,822 WARN pageUtil.RxSessionBean (RxSessionBean.java:216) - addStashItem: incoming item isCustom=false, brandName='ACETAMINOPHEN 500MG', GCN_SEQNO='27734', stashSize=1
2026-03-18 19:03:25,822 WARN pageUtil.RxSessionBean (RxSessionBean.java:222) - addStashItem: stash[0] isCustom=false, brandName='ACETAMINOPHEN 500MG', GCN_SEQNO='27734'
2026-03-18 19:03:25,822 WARN pageUtil.RxSessionBean (RxSessionBean.java:234) - addStashItem: brandNameMatch=true, gcnMatch=true
2026-03-18 19:03:25,822 WARN pageUtil.RxSessionBean (RxSessionBean.java:248) - addStashItem: DUPLICATE found at index 0


CHILDREN'S IBUPROFEN SUSPENSION 100MG

first addition after save and print debug logs:

2026-03-18 19:04:13,843 WARN pageUtil.RxSessionBean (RxSessionBean.java:216) - addStashItem: incoming item isCustom=false, brandName='CHILDREN'S IBUPROFEN SUSPENSION 100MG', GCN_SEQNO='4052', stashSize=0
2026-03-18 19:04:13,843 WARN pageUtil.RxSessionBean (RxSessionBean.java:253) - addStashItem: NO duplicate found, adding new item

second addition after edit, then save and print, debug logs (should be the same drug):

2026-03-18 19:04:22,177 WARN pageUtil.RxSessionBean (RxSessionBean.java:216) - addStashItem: incoming item isCustom=false, brandName='CHILDREN'S IBUPROFEN SUSPENSION 100MG', GCN_SEQNO='4052', stashSize=1
2026-03-18 19:04:22,177 WARN pageUtil.RxSessionBean (RxSessionBean.java:222) - addStashItem: stash[0] isCustom=false, brandName='CHILDREN\'S IBUPROFEN SUSPENSION 100MG', GCN_SEQNO='4052'
2026-03-18 19:04:22,177 WARN pageUtil.RxSessionBean (RxSessionBean.java:234) - addStashItem: brandNameMatch=false, gcnMatch=true
2026-03-18 19:04:22,177 WARN pageUtil.RxSessionBean (RxSessionBean.java:253) - addStashItem: NO duplicate found, adding new item


AG-AMOXICILLIN 250MG

first addition after save and print debug logs:

2026-03-18 19:04:54,958 WARN pageUtil.RxSessionBean (RxSessionBean.java:216) - addStashItem: incoming item isCustom=false, brandName='AG-AMOXICILLIN 250MG', GCN_SEQNO='10421', stashSize=0
2026-03-18 19:04:54,958 WARN pageUtil.RxSessionBean (RxSessionBean.java:253) - addStashItem: NO duplicate found, adding new item

second addition after edit, then save and print, debug logs (should be the same drug):

2026-03-18 19:05:01,800 WARN pageUtil.RxSessionBean (RxSessionBean.java:216) - addStashItem: incoming item isCustom=false, brandName='AG-AMOXICILLIN 250MG', GCN_SEQNO='10421', stashSize=1
2026-03-18 19:05:01,800 WARN pageUtil.RxSessionBean (RxSessionBean.java:222) - addStashItem: stash[0] isCustom=false, brandName='AG-AMOXICILLIN 250MG', GCN_SEQNO='10421'
2026-03-18 19:05:01,801 WARN pageUtil.RxSessionBean (RxSessionBean.java:234) - addStashItem: brandNameMatch=true, gcnMatch=true
2026-03-18 19:05:01,801 WARN pageUtil.RxSessionBean (RxSessionBean.java:248) - addStashItem: DUPLICATE found at index 0


As you can see, only some of the medications searched result in this issue of duplicate medications still being staged.

With testing I can see that the medications that don't match the correct brand name are:

  • ACETAMINOPHEN 1000MG/DEXTROMETHORPHAN HYDROBROMIDE 30MG SYRUP
  • CHILDREN'S IBUPROFEN SUSPENSION 100MG

While some that do match and the blocking duplicate medications when staging are:

  • ACETAMINOPHEN 500MG
  • AG-AMOXICILLIN 250MG

This shows that the duplication functionality works for some but not all, I assume there is something wrong with how Open-Drugref is mapping these medications to their ID's

Since the IBUPROFEN issue seems more contained (\ beside the 's), it might be an issue on our end? will investigate.

@LiamStanziani

Copy link
Copy Markdown
Collaborator Author

So at this point, the issue with CHILDREN'S IBUPROFEN SUSPENSION 100MG has been fixed, still unsure about ACETAMINOPHEN 1000MG/DEXTROMETHORPHAN HYDROBROMIDE 30MG SYRUP

@LiamStanziani

Copy link
Copy Markdown
Collaborator Author

I will investigate the reported "Found Issues" after I have finished my other tasks, I think I have a good idea of both but I don't think either are high priority to fix.

@LiamStanziani LiamStanziani marked this pull request as ready for review March 19, 2026 13:08
@qodo-code-review

Copy link
Copy Markdown

Review Summary by Qodo

Fix medication stash bugs: duplicate detection, deletion loop, and encoding issues

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Fixed String reference comparison using == instead of Objects.equals() for GCN_SEQNO duplicate
  detection
• Fixed forward-iteration deletion causing IndexOutOfBoundsException by sorting indices in reverse
  order
• Restored GCN_SEQNO assignment from drugId in drug selection flow
• Removed improper Encode.forJava() calls on input data and added proper output encoding
• Fixed XSS vulnerabilities in JavaScript contexts with Encode.forJavaScript()
Diagram
flowchart LR
  A["String == comparison bug"] -->|Fix with Objects.equals| B["Correct duplicate detection"]
  C["Forward-iteration deletion"] -->|Sort indices reverse| D["Safe ArrayList removal"]
  E["Missing GCN_SEQNO assignment"] -->|Restore drugId mapping| F["Enable duplicate detection"]
  G["Improper input encoding"] -->|Remove forJava on input| H["Store raw data"]
  H -->|Add forJavaScript on output| I["Prevent XSS and corruption"]
Loading

Grey Divider

File Changes

1. src/main/java/ca/openosp/openo/prescript/pageUtil/RxChooseDrug2Action.java 🐞 Bug fix +1/-1

Restore GCN_SEQNO assignment from drugId

• Uncommented and restored rx.setGCN_SEQNO(drugId) assignment that was previously disabled during
 Vigilance integration
• This ensures the drug reference ID is properly set as GCN_SEQNO for duplicate detection

src/main/java/ca/openosp/openo/prescript/pageUtil/RxChooseDrug2Action.java


2. src/main/java/ca/openosp/openo/prescript/pageUtil/RxSessionBean.java 🐞 Bug fix +1/-1

Fix String comparison for GCN_SEQNO duplicate detection

• Changed rx.getGCN_SEQNO() == item.getGCN_SEQNO() to `Objects.equals(rx.getGCN_SEQNO(),
 item.getGCN_SEQNO())`
• Fixes silent duplicate entry bug caused by reference comparison instead of value comparison for
 String objects

src/main/java/ca/openosp/openo/prescript/pageUtil/RxSessionBean.java


3. src/main/java/ca/openosp/openo/prescript/pageUtil/RxWriteScript2Action.java 🐞 Bug fix +3/-8

Fix forward-iteration deletion and remove input encoding

• Added import java.util.Collections for reverse sorting functionality
• Removed improper Encode.forJava() calls on input parameters text and drugId that were
 encoding data at storage time
• Created defensive copy of allIndex list with new ArrayList<>(allIndex) instead of reference
 assignment
• Added Collections.sort(deletedIndex, Collections.reverseOrder()) to sort deletion indices in
 descending order before removal loop
• Prevents IndexOutOfBoundsException and incorrect item deletion caused by forward-iteration with
 ArrayList.remove()

src/main/java/ca/openosp/openo/prescript/pageUtil/RxWriteScript2Action.java


View more (1)
4. src/main/webapp/oscarRx/prescribe.jsp 🐞 Bug fix +3/-5

Remove input encoding and add output XSS protection

• Removed manual string escaping: drugName.replace("'", "\\'") and drugName.replace("\"","\\\"")
 that caused double-escaping and data corruption
• Added Encode.forJavaScript(drugName) to three JavaScript context usages: addFav() calls and
 drugName_ value assignment
• Ensures proper encoding only at output time for XSS prevention without corrupting stored data

src/main/webapp/oscarRx/prescribe.jsp


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented Mar 19, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1) 📎 Requirement gaps (0) 📐 Spec deviations (0)

Grey Divider


Action required

1. addFav() uses wrong encoder 📘 Rule violation ⛨ Security
Description
drugName is inserted into a JavaScript string literal inside an HTML onclick attribute using
Encode.forJavaScript(...) instead of an attribute-safe JavaScript encoder. This can reintroduce
XSS/injection risk if drugName contains characters that break out of the attribute/JS context.
Code

src/main/webapp/oscarRx/prescribe.jsp[242]

+    <a tabindex="-1" href="javascript:void(0);"  style="float:right;;margin-left:5px;margin-top:0px;padding-top:0px;" title="Add to Favorites" onclick="addFav('<%=rand%>','<%=Encode.forJavaScript(drugName)%>')">F</a>
Evidence
PR Compliance ID 4 requires context-appropriate OWASP encoding; in an HTML event-handler attribute,
JavaScript-string data should be encoded for the JavaScript-attribute context (the file already uses
Encode.forJavaScriptAttribute(...) elsewhere). The changed line uses
Encode.forJavaScript(drugName) in an onclick attribute.

CLAUDE.md
src/main/webapp/oscarRx/prescribe.jsp[242-242]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`drugName` is encoded with `Encode.forJavaScript(...)` while being embedded inside an HTML `onclick` attribute, which is a JavaScript-in-HTML-attribute context. This should use an attribute-safe JavaScript encoder to prevent breaking out of the attribute/JS string.

## Issue Context
The same JSP already uses `Encode.forJavaScriptAttribute(...)` for other `onclick` handlers, indicating the expected pattern.

## Fix Focus Areas
- src/main/webapp/oscarRx/prescribe.jsp[242-242]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Unescaped Rx name output 🐞 Bug ⛨ Security
Description
RxWriteScript2Action.createNewRx no longer Java-escapes text/drugId before storing them on the
prescription, but several Rx JSP views still render brand/generic names with raw JSP expressions (no
HTML encoding). If a medication name containing HTML/JS is saved (e.g., via a crafted request or
later edits), these pages will interpret it in the browser (stored XSS).
Code

src/main/java/ca/openosp/openo/prescript/pageUtil/RxWriteScript2Action.java[R589-594]

            String drugId = request.getParameter("drugId");
            String text = request.getParameter("text");

-			if(text != null) {
-				text = Encode.forJava(text);
-			}
-
-			if(drugId != null) {
-				drugId = Encode.forJava(drugId);
-			}

            logger.debug("requesting drug from drugref id=" + drugId);
            RxDrugData.DrugMonograph dmono = drugData.getDrug2(drugId);
Evidence
The PR removes the previous Encode.forJava input escaping for text/drugId in createNewRx,
and saveDrug persists stash items without any sanitization/encoding step. Multiple JSPs render
medication names using raw <%= output (HTML context) with no Encode.forHtml*/c:out, so if
untrusted content reaches the DB it can execute as HTML/JS when displayed.

src/main/java/ca/openosp/openo/prescript/pageUtil/RxWriteScript2Action.java[589-598]
src/main/java/ca/openosp/openo/prescript/pageUtil/RxWriteScript2Action.java[1318-1336]
src/main/webapp/oscarRx/DisplayRxRecord.jsp[203-212]
src/main/webapp/oscarRx/ViewScript.jsp[411-418]
src/main/webapp/oscarRx/ViewScript2.jsp[879-889]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Several JSP pages render medication names (brand/generic/custom) using raw JSP expressions (`&lt;%=`) without HTML encoding. With this PR removing storage-time Java escaping in `createNewRx`, these views should be updated to perform proper output encoding (`Encode.forHtmlContent`, `Encode.forHtml`, or `c:out`) to prevent stored XSS.

### Issue Context
- `Encode.forJava(...)` was removed from `createNewRx` (correctly, since it is not HTML output encoding), but output encoding must be consistently applied anywhere medication names are rendered into HTML.
- JavaScript-context output in `prescribe.jsp` was improved in this PR, but other HTML views remain unencoded.

### Fix Focus Areas
- src/main/webapp/oscarRx/DisplayRxRecord.jsp[203-212]
- src/main/webapp/oscarRx/ViewScript.jsp[411-418]
- src/main/webapp/oscarRx/ViewScript2.jsp[879-889]
- src/main/java/ca/openosp/openo/prescript/pageUtil/RxWriteScript2Action.java[1318-1336]
- src/main/java/ca/openosp/openo/prescript/pageUtil/RxWriteScript2Action.java[589-598]

### Expected change
- Wrap displayed medication names in HTML context with `Encode.forHtmlContent(...)` (or equivalent) and use attribute-specific encoding where applicable.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Comment thread src/main/webapp/oscarRx/prescribe.jsp

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/main/webapp/oscarRx/prescribe.jsp (1)

242-242: Use the event-handler-specific encoder for inline onclick attributes.

drugName is being inserted into JavaScript that lives inside an HTML onclick attribute. Encode.forJavaScriptAttribute(...) is the appropriate encoder for this context, not Encode.forJavaScript(...). This JSP already uses Encode.forJavaScriptAttribute() for similar inline event handlers elsewhere in the file, so standardizing on this encoder improves consistency and matches OWASP Java Encoder guidance for attribute-embedded JavaScript.

Suggested change
-    <a tabindex="-1" href="javascript:void(0);"  style="float:right;;margin-left:5px;margin-top:0px;padding-top:0px;" title="Add to Favorites" onclick="addFav('<%=rand%>','<%=Encode.forJavaScript(drugName)%>')">F</a>
+    <a tabindex="-1" href="javascript:void(0);"  style="float:right;;margin-left:5px;margin-top:0px;padding-top:0px;" title="Add to Favorites" onclick="addFav('<%=rand%>','<%=Encode.forJavaScriptAttribute(drugName)%>')">F</a>

Also applies to: line 456

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/webapp/oscarRx/prescribe.jsp` at line 242, The onclick inline
JavaScript uses Encode.forJavaScript(drugName) but should use the
attribute-specific encoder; update the onclick call that invokes
addFav('<%=rand%>','<%=Encode.forJavaScript(drugName)%>') to use
Encode.forJavaScriptAttribute for drugName (and similarly fix the same pattern
at the other occurrence around line 456) so the value is properly encoded for an
HTML attribute-embedded event handler while keeping the rand parameter and
addFav function call intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/main/java/ca/openosp/openo/prescript/pageUtil/RxSessionBean.java`:
- Around line 226-228: The current condition in RxSessionBean that requires both
matching brandName and GCN_SEQNO still blocks matches when GCN_SEQNO alone
should identify the drug; change the logic around rx.getBrandName(),
item.getBrandName(), and Objects.equals(rx.getGCN_SEQNO(), item.getGCN_SEQNO())
so that a matching GCN_SEQNO is sufficient (i.e., check
Objects.equals(rx.getGCN_SEQNO(), item.getGCN_SEQNO()) first and accept the
match regardless of brandName), and only fall back to brandName-based comparison
when GCN_SEQNO is null/empty; update the branch containing
getBrandName()/getGCN_SEQNO() accordingly in RxSessionBean to reflect this
priority.

In `@src/main/java/ca/openosp/openo/prescript/pageUtil/RxWriteScript2Action.java`:
- Around line 1242-1246: When removing closed Rx entries, also remove the
corresponding annotation keys so indexes stay aligned: after building
deletedIndex and inside the loop that calls bean.removeStashItem(n), also remove
the i-th element from the attributeNames/attrib_names list (or call the
attributeNames.remove(n) equivalent) using the same index n (deletedIndex
entries are in reverse order to avoid shifting). Ensure the same index set
(deletedIndex) is applied to both bean.removeStashItem(n) and
attributeNames.remove(n) so that saveDrug(HttpServletRequest request) pairing of
bean.getStashItem(i) with attrib_names.get(i) remains correct.

---

Nitpick comments:
In `@src/main/webapp/oscarRx/prescribe.jsp`:
- Line 242: The onclick inline JavaScript uses Encode.forJavaScript(drugName)
but should use the attribute-specific encoder; update the onclick call that
invokes addFav('<%=rand%>','<%=Encode.forJavaScript(drugName)%>') to use
Encode.forJavaScriptAttribute for drugName (and similarly fix the same pattern
at the other occurrence around line 456) so the value is properly encoded for an
HTML attribute-embedded event handler while keeping the rand parameter and
addFav function call intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3100438e-b447-4a85-b1e6-d612a3f001a3

📥 Commits

Reviewing files that changed from the base of the PR and between f5eb92f and 188c0d5.

📒 Files selected for processing (4)
  • src/main/java/ca/openosp/openo/prescript/pageUtil/RxChooseDrug2Action.java
  • src/main/java/ca/openosp/openo/prescript/pageUtil/RxSessionBean.java
  • src/main/java/ca/openosp/openo/prescript/pageUtil/RxWriteScript2Action.java
  • src/main/webapp/oscarRx/prescribe.jsp

@LiamStanziani LiamStanziani requested a review from D3V41 March 19, 2026 14:34
@LiamStanziani LiamStanziani changed the title Fix: String object comparison and forward-iteration deletion in medication stash Fix: String object comparison and forward-iteration deletion in medication stash, missing GCN_SEQNO for drug search flow, and drug name encoding on input Mar 19, 2026
@LiamStanziani LiamStanziani requested a review from lacarmen March 19, 2026 19:59
lacarmen added a commit that referenced this pull request Apr 1, 2026
@lacarmen lacarmen merged commit 4667eb4 into develop Apr 7, 2026
55 of 57 checks passed
LiamStanziani pushed a commit that referenced this pull request Jun 18, 2026
…nd-forward-iteration-deletion-loop-medications

Fix: String object comparison and forward-iteration deletion in medication stash, missing GCN_SEQNO for drug search flow, and drug name encoding on input
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants