Skip to content

Conversation

@chitrankd
Copy link
Collaborator

@chitrankd chitrankd commented Jun 2, 2025

This pull request introduces a comprehensive overhaul of the Rx Print Preview modal -

  1. Rx Print Preview Enhancements:

    • UI Modernization using Bootstrap:
      • Added a new PrintPreview.jsp with Bootstrap for an improved layout, styling, and UX.
      • Replaced the existing LightWindow dialog with a Bootstrap modal, enhancing responsiveness with a cleaner interface.
      • Added loading spinners and error handling for a better UX.
    • Logic and Structure:
      • Moved Java logic from JSP to a new RxPrintPreviewAction.java, for better separation of concerns.
      • Modularized the printPreview method in RxPrintPreviewAction.java into smaller, documented functions for improved readability and maintainability.
      • Moved all JS code to PrintPreview.js.
      • Streamlined data handling and removed redundant code.
      • Replaced scriptlets with JSTL tags.
  2. Signature Pad Integration and Upgrade:

    • New Library: Upgraded the signature pad library to signature_pad.umd.min.js v5.0.7
    • New Implementation:
      • Introduced a new, modular SignaturePad.js and SignaturePad.jsp to replace the previous iframe-based signature component.
      • Created DigitalSignatureAction.java for server-side management and saving of digital signatures.
    • Improved Handling:
      • Refactored signature handling logic with vanilla JS fetch API instead of AJAX to eliminate prototype library.
      • Enhanced signatureHandler in PrintPreview.js with better event management and parameter passing.
      • Improved error handling and initialization flow for the signature pad.
    • UI Integration: Integrated the new signature pad into the redesigned Rx Print Preview modal.
  3. General Code Improvements:

    • Updated SearchDrug3.jsp to utilize the new Rx print preview modal and signature pad components, including responsive style adjustments.
    • Cleaned up unused code and JavaScript functions across related files.
    • Adjusted popup window sizes in demographicsearchresults.jsp for better usability with the new preview.

image
image

chitrankd added 30 commits May 20, 2025 12:48
* Replaced scriptlets with JSTL for improved maintainability and readability.
* Removed unnecessary imports and variables.
Removed redundant imports, inline Java logic, and unnecessary manual encoding in JSP. Migrated to JSTL tags and request attributes for cleaner separation. Consolidated address and pharmacy handling within `RxPrintPreviewAction`.
- Split large printPreview method into 11 smaller, focused methods
- Added JavaDoc comments to all methods
- Organized code into logical functional sections
- Fixed locale handling in setupMultiSiteAddresses method
- Removed unused JavaScript code
- Moved script includes to the end of the body for better performance.
- Updated styling to use CSS instead of outdated attributes.
Removed redundant server-side scriptlets and replaced with JSTL and minor formatting improvements.
…eview UI

- Updated RxPrintPreviewAction.java
- Added fax button disabling logic based on stash size and digital signature.
- Refactored PrintPreview.jsp for improved UI using Bootstrap.
- Improved overall layout and styling of the print preview page.
- Added handling for cases where no pharmacy fax number is available.
- Refactored Rx preview to use Bootstrap modal for improved UI.
- Enhanced Rx preview loading with spinner and error handling.
- Improved responsiveness of the prescription preview modal.
- Adjusted modal sizes for better viewing experience.
- Added a modularized digital signature pad (`SignaturePad.js`) for improved signature handling.
- Replaced static iframe-based signature with a dynamic `SignaturePad` component (`SignaturePad.jsp`).
- Updated `PrintPreview.js` to include event handling and signature saving logic.
- Introduced `DigitalSignatureAction.java` for server-side signature management and saving.
- Improved responsive layout with updated styles for the signature block.
- Refactored Rx PrintPreview-related code in `SearchDrug3.jsp`.
…tation

- Removed `signature_pad.min.js` and replaced it with `signature_pad.umd.min.js` (v5.0.7).
- Updated `SignaturePad.js` with improved methods, better error handling, and async operations.
- Refactored `SignaturePad.js` initialization and event handling flow for better modularity.
- Adjusted `PrintPreview.jsp` and `SignaturePad.jsp` to align with the upgraded signature pad implementation.
- Updated `SearchDrug3.jsp` script to point to the new signature pad library.
- Removed unused and deprecated functions across JavaScript files related to old signature pad usage.
- Updated `SignaturePad.jsp` with a new CSS class for better identification.
- Replaced `Ajax.Request` with `fetch` in `PrintPreview.js` for modern request handling.
- Enhanced `signatureHandler` and passed additional parameters for flexibility.
- Improved conditional logic and initialization flow in `SearchDrug3.jsp`.
- Updated `PrintPreview.jsp` with responsive height adjustments for better UX.
- Added new media query breakpoints to `SearchDrug3.jsp` for enhanced modal responsiveness on larger screens.
- Removed unused and commented-out script block from `SearchDrug3.jsp`.
- Replaced iframe inclusion in `PrintPreview.jsp` with a JSP include for better integration.
- Extracted UI and required logic from `Preview2.jsp` into a new `PreviewContent.jsp`.
- Updated `RxPrintPreviewAction.java` with the major piece of java code from `Preview2.jsp` for data setup.
- Removed redundant security checks and scriptlets from `PreviewContent.jsp`.
- Refactored `PrintPreview.js` to simplify DOM manipulations and eliminate iframe dependencies.
- Updated `RxPrintPreviewAction.java` to streamline prescription data setup and enhance clarity with Joiner utilities.
- Introduced `findBy` method in `DrugDao` and implemented it in `DrugDaoImpl`.
- Updated `RxPrescriptionData` to include `getPrescriptionsByScriptNo` for fetching data by script number and demographic ID.
- Enhanced query logic with `TypedQuery` for better type safety and readability.
- Updated `SignaturePad.jsp` styles to improve layout responsiveness and alignment.
- Enhanced canvas dimension handling in `SignaturePad.js` with device pixel ratio calculations.
- Simplified and reorganized signature-related HTML structure for better maintainability.
- Removed unused debug code from `PreviewContent.jsp`.
- Adjusted fax button logic in `RxPrintPreviewAction.java` for improved conditional handling.
- Introduced `printDivContent` function in `PrintPreview.js` to modularize and simplify printing logic.
- Updated `PreviewContent.jsp` with improved print-related styles and isolated printable content using `#printableContent` div.
- Introduced a switch in `PrintPreview.jsp` to toggle pharmacy address visibility.
- Replaced `reducePreview` function in `PrintPreview.js` with `togglePharmaInfoVisibility` for handling visibility logic.
- Adjusted `popupPage` dimensions in `EctDisplayRxAction.java` from `580x1027` to `900x1080`.
- Enhanced print preview logic in `RxPrintPreviewAction.java` to store `tmpBeanRX` in session when required.
- Updated `RxWriteScriptAction.java` to return the script ID after saving a drug, sending it as a JSON response.
  - Refactored `saveDrug` method to return the script ID for improved data handling.
- Replaced `Ajax.Request` with `fetch` in `PrintPreview.js` for better modern request handling.
- Added safeguard fallback when parsing `Calcs` data in `SearchDrug3.jsp` to prevent JSON errors.
  - Improved error handling and debug logging for script ID in `SearchDrug3.jsp`.
- Fixed "Print and Add to Encounter Note" button by properly defining printPaste2Parent function and ensuring it's accessible in the correct scope
- Resolved "Additional Rx Notes" button issue by updating frame reference handling
- Fixed "Fax" and "Fax & Add" button action error
- Enable Fax and fax paste buttons when a signature is successfully saved.
- Removed unused and redundant commented-out code in `PrintPreview.js`.
Replaced Prototype.js Ajax.Request usage with native fetch API for improved modern browser compatibility and code maintainability. Updated POST requests to use appropriate headers and body formatting, and adjusted success/error handling logic accordingly.
- Modified window focus handling to ensure eChart loads consistently
- Unified window opening behavior for both signed and unsigned prescriptions
- Maintains expected workflow without requiring extra user interaction
The 'btn-lg' class was removed from the print button in PrintPreview.jsp to standardize button sizing and appearance.
Moved the 'Create New Rx' and 'Back to Oscar' buttons from the previous container to a new container with updated layout and spacing for improved UI
Changed the CSS classes for the fax and fax paste buttons from 'btn-outline-info' to 'btn-secondary' for a more consistent appearance.
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