-
Notifications
You must be signed in to change notification settings - Fork 100
11641 need images in sysmex xs series #11708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
11641 need images in sysmex xs series #11708
Conversation
Update to Latest
Update to Latest
Update to Latest
Signed-off-by: DamithDeshan <hkddrajapaksha@gmail.com>
update_southernLanka_prod
…-part-analyzer-with-core 11212 incorporation of sysmex 5 part analyzer with core
Up to date changes to qa environment
Up to date changes to qa environment
…-for-pharmacy-retail-sale 11260 staff discount validation for pharmacy retail sale
Update QA to Latest
Update from development
up to date changes to qa environment
up to date changes to qa environment
up to date changes to qa environemnt
up to date changes to qa test
up to date changes to qa test
Updates from development
up to date changes to qa test
Updates from development
Updates from development
Updates from development
Southernlanka update
Updates from development
To get latest dev to QA
Update from development
…nt-report-gives-null-pointer-exception Better to keep all EJB referances and Injection at one please
…ull-pointet-exception 11443 cc bill item list gives null pointet exception
up to date changes to qa environment
new changes to qa environment
Signed-off-by: Lawan Samarasekara <lawan.chaamindu1234@gmail.com>
Signed-off-by: Lawan Samarasekara <lawan.chaamindu1234@gmail.com>
…-named-provisional-bill 11681 need to create a new bill named provisional bill
…es-in-by-item-report-on-inward 11684 need to show timed services in by item report on inward
Updating staging from qa2
Signed-off-by: Lawan Samarasekara <lawan.chaamindu1234@gmail.com>
Update staging from QA2
Updating SLH from Staging
Signed-off-by: damithdeshan98 <hkddrajapaksha@gmail.com>
…o southernlanka-prod
…b.com/hmislk/hmis.git into 11641-need-images-in-sysmex-xs-series # Conflicts: # src/main/webapp/resources/pharmacy/search/purchase.xhtml Signed-off-by: Dr M H Buddhika Ariyaratne <buddhika.ari@gmail.com>
WalkthroughThis pull request introduces a new GitHub Actions workflow for the CI/CD process on the Changes
Sequence Diagram(s)sequenceDiagram
participant GitHub
participant BuildJob
participant DeployJob
participant PayaraServer
GitHub->>BuildJob: Trigger CI/CD workflow (hmis-qa1 branch)
BuildJob->>BuildJob: Checkout code, set up JDK, cache Maven, update JDBC in persistence.xml, build & archive WAR artifact
BuildJob->>GitHub: Archive artifact
GitHub->>DeployJob: Signal build success
DeployJob->>DeployJob: Checkout code, download artifact, set up SSH, backup existing WAR, deploy via asadmin
DeployJob->>PayaraServer: Deploy application
PayaraServer-->>DeployJob: Confirm application running
DeployJob->>GitHub: Cleanup & report deployment result
sequenceDiagram
participant User
participant AdmissionProfileUI
participant AdmissionController
participant InwardSearch
participant BhtSummeryController
User->>AdmissionProfileUI: Click "Provisional Bill" button
AdmissionProfileUI->>AdmissionController: Check provisional bill availability (isAddmissionHaveProvisionalBill)
AdmissionController-->>AdmissionProfileUI: Return bill availability status
alt Provisional bill exists
AdmissionProfileUI->>InwardSearch: Execute navigateToProvisionalBillForAdmission
InwardSearch-->>AdmissionProfileUI: Return provisional bill details
User->>AdmissionProfileUI: Edit provisional bill (via provisional bill edit page)
AdmissionProfileUI->>BhtSummeryController: Save provisional bill
BhtSummeryController-->>AdmissionProfileUI: Confirm bill saved
else No provisional bill
AdmissionProfileUI-->>User: Display error message
end
Possibly related PRs
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 9
🧹 Nitpick comments (16)
src/main/java/com/divudi/core/data/BillType.java (1)
186-314
: Consider adding a specific label for InwardProvisionalBillWhile the new enum constant has been added, I noticed it doesn't have a corresponding case in the
getLabel()
method's switch statement. Currently, it will default to returning the enum name as-is through the default case.switch (this) { case OpdBill: return "OPD Bill"; + case InwardProvisionalBill: + return "Inward Provisional Bill"; // other cases... default: return this.toString(); }src/main/java/com/divudi/bean/common/SearchController.java (3)
12487-12491
: Consider finalizing the commented-out pagination logic.There seems to be uncertainty about whether to limit the result set or not. The commented-out code suggests there was once a limit of 50 records based on a boolean flag. Leaving code in this indecisive state can be confusing for future developers.
Either remove the commented code if pagination is no longer needed, or implement proper pagination controls if large result sets are possible.
12515-12518
: Consider additional validation for phone number.The current implementation just uses a LIKE query for phone numbers, which could match partial or malformed phone numbers.
Consider adding additional validation or a more specific format for phone number searches:
if (getSearchKeyword().getPatientPhone() != null && !getSearchKeyword().getPatientPhone().trim().equals("")) { + // Remove non-digit characters for more accurate phone searching + String phoneDigitsOnly = getSearchKeyword().getPatientPhone().trim().replaceAll("[^0-9]", ""); + if (!phoneDigitsOnly.isEmpty()) { sql += " and ((b.patientEncounter.patient.person.phone) like :patientPhone )"; - temMap.put("patientPhone", "%" + getSearchKeyword().getPatientPhone().trim().toUpperCase() + "%"); + temMap.put("patientPhone", "%" + phoneDigitsOnly + "%"); + } }
12501-12502
: Unused startTime variable.You initialize a startTime variable but don't appear to use it later in the method. This suggests that some performance tracking or logging code might be missing.
Either remove the unused variable or add code to measure and log the execution time:
Date startTime = new Date(); // Rest of method... +// Log execution time at end of method +Date endTime = new Date(); +long executionTime = endTime.getTime() - startTime.getTime(); +if (executionTime > 1000) { // Only log if over 1 second + System.out.println("Provisonal bill search took " + executionTime + "ms"); +}src/main/webapp/inward/inward_provisional_bill_edit.xhtml (5)
48-49
: Use a valid FontAwesome icon class.
The class"fa-cancel"
is not a standard FontAwesome icon; consider using"fa-times"
,"fa-ban"
, or another valid icon name for better consistency and reliability.- icon="fa fa-cancel" + icon="fa fa-ban"
56-57
: Trim trailing space in CSS class.
There is an extra space at the end of"ui-button-secondary "
. Removing it helps keep code tidy and consistent.- class="ui-button-secondary " + class="ui-button-secondary"
248-269
: Add data table filters and sorting if needed.
Currently, the table applies a text filter to the “Discription” column. Consider adding an additional filter or sorting for the numeric columns if the user needs to quickly locate or order specific charge values. This can enhance usability in large data sets.
260-267
: Remove or clarify commented-out AJAX code.
The commented-out<p:ajax>
block may be outdated or might need reactivation for partial updates. Keeping commented code can lead to confusion. Either remove it or add a comment justifying why it's left in the code.-<!-- <p:ajax process="@this" event="keyup" - update="@all" - listener="#{inwardSearch.changeIsMade()}"/>-->
336-342
: Review purpose of hidden panels.
These panels are rendered asfalse
, so they never appear in the current UI. If these are needed for future functionality, consider leaving a short comment explaining their usage; otherwise, remove them if not required..github/workflows/hmis_qa1_ci_cd.yml (3)
100-100
: Remove trailing spaces.
Trailing spaces on this line can cause lint errors and reduce readability.+
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 100-100: trailing spaces
(trailing-spaces)
127-127
: Remove trailing spaces.
Similarly, remove unneeded whitespace from the end of this line to pass lint checks and maintain consistency.+
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 127-127: trailing spaces
(trailing-spaces)
143-143
: Add a newline and remove trailing spaces at the file end.
YAML linting flags the missing newline and trailing spaces. Keeping the file properly terminated helps avoid parse issues in some tools.\ No newline at end of file +
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 143-143: no new line character at the end of file
(new-line-at-end-of-file)
[error] 143-143: trailing spaces
(trailing-spaces)
src/main/java/com/divudi/bean/report/MdInwardReportController.java (1)
16-17
: Prefer explicit imports over wildcard imports.
Wildcard imports (com.divudi.core.entity.*
,com.divudi.core.facade.*
) can obscure dependencies and increase potential naming conflicts. Prefer explicit imports to improve clarity.src/main/java/com/divudi/bean/inward/AdmissionController.java (1)
848-852
: Simplify conditional return logic.The current implementation has redundant checks and can be simplified.
- if (ads.size() > 0 || !ads.isEmpty()) { - return true; - } else { - return false; - } + return !ads.isEmpty();src/main/webapp/inward/inward_cancel_bill_provisional.xhtml (2)
191-248
: Remove commented HTML markup to improve code readability.There's a large block of commented-out HTML markup that should be removed. This commented code appears to be an older implementation of the bill preview functionality, which has been replaced by the
<bi:finalBill_Cancel>
composite component.-<!-- <div style="border: 1px solid;" > - <h:panelGroup id="gpBillP1review" > - <div style="height:100cm; width:12cm; padding:0.5cm; overflow:hidden!important; page-break-after:always; font-family: sans-serif; font-size: 16px; position: relative; " > - <h:outputLabel value="#{inwardSearch.bill.cancelledBill.deptId} **Cancelled" style="position:absolute;left:4.5cm; top:1.5cm;" /> - - <h:outputLabel value="#{inwardSearch.bill.cancelledBill.billDate}" style="position: absolute; left: 10.5cm; top:1.5cm;" > - <f:convertDateTime pattern="#{sessionController.applicationPreference.shortDateFormat}"/> - </h:outputLabel> - - <h:outputLabel value="#{inwardSearch.bill.cancelledBill.paymentMethod} / #{inwardSearch.bill.deptId}" style="position:absolute;left:4.5cm; top:2.0cm;" /> - - <h:outputLabel value="#{inwardSearch.bill.cancelledBill.billTime}" style="position: absolute; left: 10.5cm; top:2.0cm;" > - <f:convertDateTime pattern="#{sessionController.applicationPreference.longTimeFormat}"/> - </h:outputLabel> - - <h:outputLabel value="#{inwardSearch.bill.patient.person.nameWithTitle}" style="position:absolute;left:4.5cm; top:2.5cm; text-transform: uppercase; " /> - - <h:outputLabel value="#{inwardSearch.bill.patient.person.phone}" style="position: absolute;left:4.5cm; top:3.0cm;" /> - - <h:outputLabel value="Cashier : #{inwardSearch.bill.cancelledBill.creater.code}" style="position:absolute;left:1.5cm; top:14.1cm;" /> - - <h:outputLabel value="#{inwardSearch.bill.collectingCentre.name} #{inwardSearch.bill.creditCompany.name}" style="position:absolute;left:5.5cm; top:14.1cm;" /> - - <h:dataTable value="#{inwardSearch.billItems}" var="bip" style="position: absolute;left:1.6cm; top:4.5cm; border: 0px; "> - <h:column > - <h:outputLabel value="#{bip.inwardChargeType}" style="margin: 4px;" /> - </h:column> - </h:dataTable> - - <div style="position: absolute;left:9.6cm; top:4.5cm; border: 0px; text-align: right;" > - <h:dataTable value="#{inwardSearch.billItems}" var="bip1" > - <h:column> - <h:outputLabel value="#{bip1.netValue}" style="margin: 4px;" > - <f:convertNumber pattern="#,##0.00" /> - </h:outputLabel> - </h:column> - </h:dataTable> - </div> - <div style="position: relative;left:3.6cm; margin-top: 0.5cm; top:9.5cm; border: 0px; text-align: right;" > - <table><tr><td><br/><br/></td> - <td><br/><br/></td> - </tr> - <tr> - <td style="min-width: 4.5cm;text-align: left;"> - <h:outputLabel value="Total"/> - </td> - <td> - <h:outputLabel value="#{inwardSearch.bill.netTotal}" style="font-size: 110%; font-weight: bold ; text-align: right; "> - <f:convertNumber pattern="#,##0.00" /> - </h:outputLabel> - </td> - </tr> - </table> - </div> - </div> - - </h:panelGroup> - </div>-->
174-182
: Consider adding error messages display for better user feedback.The page should include a messages component to display any errors that might occur during the bill cancellation process. This would improve the user experience by providing clear feedback.
<f:facet name="header"> <h:outputLabel value="Cancel Bill Preview" class="mt-2"/> + <p:messages id="messages" showDetail="true" closable="true" /> <p:commandButton icon="fa fa-print" class="ui-button-info" style="float: right;" value="Print" ajax="false" action="#" > <p:printer target="gpBillPreview" /> </p:commandButton> </f:facet>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (20)
.github/workflows/hmis_qa1_ci_cd.yml
(1 hunks)src/main/java/com/divudi/bean/common/SearchController.java
(1 hunks)src/main/java/com/divudi/bean/inward/AdmissionController.java
(5 hunks)src/main/java/com/divudi/bean/inward/BhtSummeryController.java
(2 hunks)src/main/java/com/divudi/bean/inward/InwardSearch.java
(5 hunks)src/main/java/com/divudi/bean/lab/ByteArrayToStreamContentController.java
(1 hunks)src/main/java/com/divudi/bean/report/MdInwardReportController.java
(6 hunks)src/main/java/com/divudi/core/data/BillType.java
(1 hunks)src/main/java/com/divudi/core/data/BillTypeAtomic.java
(1 hunks)src/main/java/com/divudi/core/entity/lab/PatientReportItemValue.java
(1 hunks)src/main/java/com/divudi/ws/lims/LimsMiddlewareController.java
(3 hunks)src/main/webapp/home.xhtml
(2 hunks)src/main/webapp/inward/admission_profile.xhtml
(7 hunks)src/main/webapp/inward/inward_bill_final.xhtml
(20 hunks)src/main/webapp/inward/inward_cancel_bill_provisional.xhtml
(1 hunks)src/main/webapp/inward/inward_provisional_bill_edit.xhtml
(1 hunks)src/main/webapp/inward/inward_search_provisional.xhtml
(1 hunks)src/main/webapp/lab/patient_report.xhtml
(3 hunks)src/main/webapp/resources/ezcomp/menu.xhtml
(1 hunks)src/main/webapp/resources/pharmacy/search/purchase.xhtml
(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/main/java/com/divudi/bean/report/MdInwardReportController.java (3)
src/main/java/com/divudi/bean/pharmacy/PharmacyController.java (1)
Named
(90-5049)src/main/java/com/divudi/bean/report/CashierReportController.java (1)
Named
(65-2885)src/main/java/com/divudi/bean/report/CommonReport.java (1)
Named
(67-8069)
src/main/java/com/divudi/bean/inward/InwardSearch.java (1)
src/main/java/com/divudi/core/util/CommonFunctions.java (1)
CommonFunctions
(38-1076)
🪛 actionlint (1.7.4)
.github/workflows/hmis_qa1_ci_cd.yml
14-14: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
17-17: the runner of "actions/setup-java@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
23-23: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
58-58: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 YAMLlint (1.35.1)
.github/workflows/hmis_qa1_ci_cd.yml
[error] 100-100: trailing spaces
(trailing-spaces)
[error] 127-127: trailing spaces
(trailing-spaces)
[error] 143-143: no new line character at the end of file
(new-line-at-end-of-file)
[error] 143-143: trailing spaces
(trailing-spaces)
🔇 Additional comments (43)
src/main/java/com/divudi/core/data/BillType.java (1)
33-33
: New enum constant for inward provisional billing addedThe addition of the
InwardProvisionalBill
enum constant is aligned with the PR's objective to enhance functionality for FBC in the Sysmex XS series. This enum will support the new provisional billing capabilities being implemented.src/main/webapp/home.xhtml (2)
9-9
: Minor whitespace changeSimple addition of a blank line after the opening
<ui:define>
tag. This is a purely cosmetic change that doesn't affect functionality.
41-41
: Minor whitespace changeRemoval of a blank line before the
pharmacy_analytics
panel group. This is a purely cosmetic change that doesn't affect functionality.src/main/webapp/resources/ezcomp/menu.xhtml (1)
394-395
: LGTM! Well-placed menu item for provisional bill search functionality.The new menu item for "Provisional Bill Search" is correctly implemented and positioned before the "Final Bill Search" item, following the natural workflow progression. The rendering condition appropriately uses the 'InwardSearchFinalBill' privilege, and the action listener properly clears previous search results.
src/main/java/com/divudi/core/data/BillTypeAtomic.java (1)
30-31
: LGTM: Proper addition of new bill types for provisional billing functionality.The addition of these two enum entries is well-structured and follows the existing pattern in the codebase. They correctly define the necessary types for handling inward provisional bills and their cancellations.
src/main/java/com/divudi/core/entity/lab/PatientReportItemValue.java (1)
91-99
: Improved file extension handling for image reports.This enhancement properly manages file extensions for lab report images by:
- Handling null/empty filenames gracefully
- Checking for existing image extensions
- Appending the correct file extension based on fileType when needed
This ensures consistent and proper file naming for image-based reports.
src/main/java/com/divudi/ws/lims/LimsMiddlewareController.java (3)
1033-1064
: Enhanced image type detection and file name handling for lab results.The code now properly extracts image types from the result data rather than hardcoding "BMP", making the system more flexible when handling different image formats. The file naming logic has been improved to ensure proper extensions are included.
1233-1233
: Improved Base64 parsing for all image types.Modified the regex pattern to work with any image type prefix, not just BMP, providing better flexibility for handling various image formats in the reports.
1423-1439
: LGTM: Well-implemented image type extraction method.This new helper method properly extracts the image type from the result string using regex with good error handling and logging. It defaults to "BMP" when no type can be determined, ensuring backward compatibility.
src/main/webapp/resources/pharmacy/search/purchase.xhtml (2)
28-30
: Added Excel export functionality to improve usability.The addition of an XLSX download button provides a convenient way for users to export purchase data for offline analysis or reporting.
32-50
: Improved data table formatting and structure.The table styling and column formatting have been standardized for better readability and consistency across the application.
src/main/webapp/inward/inward_provisional_bill_edit.xhtml (1)
200-224
: Validate credit limit updates for proper user roles and data safety.
While editing the credit limit is essential, confirm there's role-based access control or robust validations to prevent unauthorized changes. Also, ensure any modifications are guarded by secure data handling to prevent potential misuse.Would you like to verify role-based checks and validations in upstream code? I can generate a script to locate relevant code that enforces or bypasses permission checks.
.github/workflows/hmis_qa1_ci_cd.yml (1)
14-14
: Upgrade GitHub Actions to supported runner versions.
Static analysis indicates that the versions of “actions/checkout@v3” and “actions/setup-java@v3” etc., used on lines 14, 17, 23, 58 might not be supported on older runners. Verify if these versions still run correctly or consider upgrading them to a recognized stable release.Also applies to: 17-17, 23-23, 58-58
🧰 Tools
🪛 actionlint (1.7.4)
14-14: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
src/main/java/com/divudi/bean/report/MdInwardReportController.java (2)
92-93
: Injection of new facade looks good; confirm usage and test coverage.
The@EJB private PatientItemFacade patientItemFacade;
field is a vital addition. Ensure references to it are covered by unit tests, especially if it’s used in new or existing logic.
106-108
: InjectingConfigOptionApplicationController
at class level.
The annotation@Named
is generally used for the class itself. Verify if the@Named
annotation on line 106 is intended or if you only need@Inject
for the field. If@Named
is for a second bean definition, ensure no namespace conflicts exist.src/main/java/com/divudi/bean/lab/ByteArrayToStreamContentController.java (4)
46-47
: Improved error handling for the render phase.Returning null instead of an empty DefaultStreamedContent provides a more consistent approach to handling cases where no content is needed during the render phase.
51-52
: Consistent error handling for invalid inputs.The implementation now uses a consistent approach (returning null) for all error conditions, which improves code maintainability and predictability. This includes handling missing IDs, number format exceptions, and missing image data.
Also applies to: 58-59, 62-64
69-74
: Enhanced file type handling with proper fallback.The improved file type handling now properly checks for null or empty values and defaults to "image/png" when necessary. The conversion to lowercase and proper formatting as "image/[type]" ensures consistent content type values.
76-79
: Properly applied file type to the streamed content.The content type is now set based on properly validated and formatted file type information, ensuring correct MIME type specification for the browser.
src/main/java/com/divudi/bean/inward/AdmissionController.java (3)
556-559
: Consistent string validation in search methods.The search conditions now use
trim().equals("")
instead ofisEmpty()
which handles whitespace-only strings differently. This makes the string validation more robust by treating strings with only whitespace as empty.Also applies to: 560-563, 565-568, 570-573, 575-578
581-602
: Added null check for defensive programming.Adding a null check before the switch statement prevents potential NullPointerExceptions, making the code more robust.
816-824
: Enhanced patient selection by filtering out provisional admissions.The new conditional logic in
completePatientDishcargedNotFinalized
improves the user experience by optionally removing provisional admissions from the suggestions list based on a configuration setting.src/main/webapp/inward/inward_search_provisional.xhtml (2)
1-215
: Well-structured search interface with comprehensive functionality.This new provisional bill search interface provides a complete set of features including date filtering, multiple search criteria, sortable/filterable results, pagination, and export capabilities. The responsive layout and proper use of PrimeFaces components create a good user experience.
51-57
: Incomplete functionality for cancelled bills search.The "Search Cancelled Bills" button is rendered as false, suggesting this functionality may be planned but not yet implemented or intentionally disabled.
Is the cancelled bills search functionality meant to be disabled, or is this a feature that will be enabled in a future update?
src/main/java/com/divudi/bean/inward/BhtSummeryController.java (2)
1273-1278
: Good addition of total calculation before saving.Adding
updateTotal()
before saving the temporary bill ensures that all financial values are correctly calculated and up-to-date before the bill is saved, preventing potential calculation discrepancies.
1280-1299
: Implementation of provisional bill saving looks good.The method handles error checking appropriately, updates the original bill with discount and net total, sets the correct bill types, and provides user feedback. The method completes the operation by cleaning up state variables.
src/main/webapp/inward/inward_cancel_bill_provisional.xhtml (1)
146-162
: Good use of data table with conditional row styling.The implementation uses appropriate PrimeFaces components and includes conditional row styling to hide rows with zero gross value, ensuring a cleaner user interface.
src/main/webapp/lab/patient_report.xhtml (3)
505-511
: Improved button formatting and readability.The button structure for adding a new doctor has been properly formatted with consistent indentation, making the code more readable and maintainable.
708-708
: Added image accessibility enhancement.Adding the
alt
attribute to the GraphicImage component improves accessibility by providing alternative text when images cannot be displayed. This is a good practice for web accessibility compliance.
880-974
: Enhanced debug panel with image visualization.The debug panel has been restructured to include image visualization capabilities, which aligns with the PR objective of adding images for the Sysmex XS series. The panel is properly secured with a developer privilege check, ensuring that sensitive debugging information is only visible to authorized users.
The new column for displaying images allows developers to visually inspect image data stored in the system, which is essential for debugging image-related functionality.
src/main/webapp/inward/admission_profile.xhtml (2)
89-89
: Updated conditional rendering for Interim Bill button.The Interim Bill button now has an additional condition to check if the admission doesn't have a provisional bill, which ensures proper user flow by preventing access to interim billing when a provisional bill exists.
98-107
: Added new Provisional Bill button.A new button has been added to navigate to the provisional bill when one exists for the current admission. This enhancement provides a direct way for users to access provisional bills directly from the admission profile, improving workflow efficiency.
src/main/webapp/inward/inward_bill_final.xhtml (3)
39-39
: Updated button update attributes to include new component.The update attributes for the Process and Process Bill buttons now include the saveProvisional component, ensuring that this new component gets refreshed when these actions are performed.
Also applies to: 51-52
60-70
: Added Save Provisional Bill functionality.A new button has been added that allows users to save a provisional bill directly from the final bill screen. This enhances the billing workflow by providing a way to save an interim state of the bill before final settlement.
The button is conditionally rendered based on a configuration option, which provides flexibility for different deployment scenarios.
225-225
: Updated AJAX listeners to refresh save provisional button.Multiple AJAX listeners throughout the form have been updated to refresh the saveProvisional button when changes are made to various billing components. This ensures that the UI stays consistent when users make changes that affect the bill's state.
Also applies to: 249-250, 313-314, 329-330, 368-369, 392-393, 408-409, 434-435, 450-452, 476-477, 494-495, 518-519, 534-536, 560-561, 574-576, 602-603
src/main/java/com/divudi/bean/inward/InwardSearch.java (8)
150-151
: Added fields for enhanced functionality.These new boolean fields support the provisional bill management.
showZeroInwardChargeCategoryTypes
likely controls the visibility of zero-value charge categories, whilechanged
tracks whether the bill has been modified.
346-374
: New navigation method for provisional bills looks good.This method follows the same pattern as the existing
navigateToFinalBillForAdmission()
method, properly checking if an admission is selected, retrieving any associated provisional bill, and navigating to the appropriate view.
1017-1077
: Provisional bill cancellation logic implemented correctly.The cancellation method includes appropriate checks for:
- Time limit validation
- Bill cancellation status
- Refund status
- Presence of a patient encounter
- Comment requirement
The method creates a
CancelledBill
with the appropriate bill type atomic value and updates relationships between the bills correctly.However, I noticed that lines 1060-1066 are commented out, suggesting that unlike final bills, canceling a provisional bill doesn't reset the patient encounter's financial data. This difference in behavior is likely intentional since provisional bills are temporary.
1756-1758
: Simple flag method implemented correctly.This method correctly sets the
changed
flag to track when modifications are made to a bill.
1760-1772
: Bill total calculation method implemented correctly.The
updateTotal()
method properly calculates the grant total from bill items, applies any discount, and resets thechanged
flag after the update.
1774-1789
: Professional fee calculation method implemented correctly.This method properly calculates the total of professional fees for a bill item, considering both adjusted and original fee values, and then calls
updateTotal()
to update the bill's overall totals.
1791-1804
: Provisional bill saving method looks good.The method correctly:
- Records who edited the bill and when
- Updates the bill in the database
- Updates all bill items
- Updates all professional fees within each bill item
- Provides appropriate user feedback
This maintains a proper audit trail and ensures all bill components are saved.
1975-1989
: Getters and setters for new fields implemented correctly.Standard getter and setter implementations for the two new boolean fields.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (2)
src/main/java/com/divudi/bean/common/SearchController.java (2)
12503-12545
: 🛠️ Refactor suggestionAdd pagination to prevent performance issues with large result sets.
The method retrieves all matching records without any limits, which could cause performance problems with large datasets. Consider implementing pagination or setting a reasonable limit on the number of results returned.
temMap.put("billType", BillType.InwardProvisionalBill); temMap.put("toDate", toDate); temMap.put("fromDate", fromDate); - bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP); + // Add pagination to prevent performance issues + int maxResults = 100; // Set a reasonable default limit + bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, maxResults); + + if (bills.size() >= maxResults) { + JsfUtil.addWarningMessage("Results limited to " + maxResults + " records. Please refine your search."); + }
12495-12500
: 🛠️ Refactor suggestionImplement the commented-out date range validation.
Date range validation is critical to prevent performance issues with excessively large queries. The commented-out validation code should be implemented to protect against potential performance problems.
public void createInwardProvisionalBills() { + double d = commonController.dateDifferenceInMinutes(fromDate, toDate) / (60 * 24); + if (d > 32) { + JsfUtil.addErrorMessage("Date Range Too Long (Maximum 32 days)"); + return; + } -// double d = commonController.dateDifferenceInMinutes(fromDate, toDate) / (60 * 24); -// if (d > 32 && getReportKeyWord().isBool1()) { -// JsfUtil.addErrorMessage("Date Range To Long"); -// return; -// } Date startTime = new Date();
🧹 Nitpick comments (2)
src/main/java/com/divudi/bean/common/SearchController.java (2)
12487-12493
: Remove commented-out code for better maintainability.These commented-out lines about conditional filtering and result limiting make the code harder to maintain. Either implement this functionality or remove the comments if they're no longer needed.
-// if (getReportKeyWord().isBool1()) { bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP); -// } else { -// bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP, 50); -// }
12546-12548
: Remove commented-out conditional code.Similar to earlier comments, these commented-out lines should either be implemented or removed for better code maintainability.
-// if (getReportKeyWord().isBool1()) { bills = getBillFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP); -// } else {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/main/java/com/divudi/bean/common/SearchController.java
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: validate-compilation
🔇 Additional comments (1)
src/main/java/com/divudi/bean/common/SearchController.java (1)
12530-12538
: Good implementation of numeric field handling.You've correctly implemented the proper handling of the numeric netTotal field by parsing it as a double and using exact equality in the query, which is more appropriate than using LIKE for numeric values.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
src/main/webapp/inward/inward_search_provisional.xhtml (3)
64-68
: Incorrect export filename for Provisional Bills.The data exporter filename is set to "Inward Final Bills" but this page is for Provisional Bills.
<p:dataExporter target="tblBills" type="xlsx" - fileName="Inward Final Bills" > + fileName="Inward Provisional Bills" > </p:dataExporter>
184-190
: Add sortBy and filterBy attributes to Comments column.The Comments column is missing sortBy and filterBy attributes, making it inconsistent with other columns and preventing users from sorting or filtering by comments.
<p:column - headerText="Comments" > + headerText="Comments" + sortBy="#{bb.comments}" + filterBy="#{bb.comments}" + filterMatchMode="contains" > <h:outputLabel rendered="#{bb.refundedBill ne null}" value="#{bb.refundedBill.comments}" > </h:outputLabel> <h:outputLabel rendered="#{bb.cancelledBill ne null}" value="#{bb.cancelledBill.comments}" > </h:outputLabel> </p:column>
14-14
: Consider responsive design for panel height.Setting fixed panel height to
height: 100vh
may cause layout issues on small screens or in certain browsers.- <p:panel header="Search Provisional Bills" style="height: 100vh" > + <p:panel header="Search Provisional Bills" style="min-height: 85vh" >
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/main/webapp/inward/inward_search_provisional.xhtml
(1 hunks)
🔇 Additional comments (2)
src/main/webapp/inward/inward_search_provisional.xhtml (2)
56-57
: Verify the rendering condition for "Search Cancelled Bills" button.The "Search Cancelled Bills" button is currently set to not render with
rendered="false"
. If this functionality is intended to be available, the rendering condition should be updated. Otherwise, consider removing the button or documenting why it's disabled.
196-198
:❓ Verification inconclusive
Verify navigation and actionListener in View Bill button.
The View Bill button navigates to "inward_provisional_bill_edit" and calls
inwardSearch.refreshFinalBillBackwordReferenceBills
. Verify that:
- The navigation target exists and is correctly named for provisional bills
- The actionListener method name refers to "FinalBill" but this page is for provisional bills
🏁 Script executed:
#!/bin/bash # Check if the navigation target page exists echo "Checking if target page exists:" find src/main/webapp -name "inward_provisional_bill_edit.xhtml" -type f # Check for the actionListener method echo "Checking for the actionListener method definition:" grep -r "refreshFinalBillBackwordReferenceBills" --include="*.java" src/Length of output: 605
Attention: Confirm Navigation and ActionListener Consistency
- The navigation target “inward_provisional_bill_edit.xhtml” exists as expected.
- The actionListener method
refreshFinalBillBackwordReferenceBills
is defined and called; however, its naming suggests it relates to a “final bill” rather than a provisional bill. Please verify if this is intentional or if the method name (and potentially its implementation) should be adjusted to reflect the provisional bill context.
now images will be there for FBC
Summary by CodeRabbit
New Features
Style