Merged
Conversation
Signed-off-by: denuwanhendalage <shashankadenuwanb@gmail.com>
Signed-off-by: denuwanhendalage <shashankadenuwanb@gmail.com>
Signed-off-by: denuwanhendalage <shashankadenuwanb@gmail.com>
… 19554-handover-status-report-filter-by-initiator-and-acceptor-with-all-shifts-report-improvements
… 19568-fix-to-handover-value-incorrect-with-float-transfers
…-with-float-transfers
FUND_TRANSFER_BILL and FUND_TRANSFER_RECEIVED_BILL payments were skipped during handover create/accept (isFundTransferPayment → continue), so their handingOverStarted and cashbookEntryStated flags were never updated. Both fetch methods filter on these flags, causing float payments to reappear indefinitely in the shift end page even after the handover was complete. Fix: - settleHandoverStartBill: mark the user's float transfer payments within the current shift as handingOverStarted=true after saving the CREATE bill - acceptHandoverBillAndWriteToCashbook: mark the sender's float transfer payments as handingOverCompleted/cashbookEntryStated=true after ACCEPT Closes #19591 Part of #17532 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1. rejectToReceiveHandoverBill (receiver rejects the handover) — after resetting regular payments, now also resets float transfer payments for the sender back to handingOverStarted=false. 2. recallMyHandoverBill (sender recalls their own handover) — same float reset block added. Key design decisions: - Uses selectedBill.getReferenceBill() as the shift start bill anchor — this is exactly what the CREATE block stored there (currentBill.setReferenceBill(bundle.getStartBill())) - Uses selectedBill.getFromWebUser() as the user — this is the handover sender (the cashier whose floats need to be reset) - Filters handingOverStarted=true AND cashbookEntryStated=false — only touches float payments that are in the "stuck" state from CREATE, not ones already completed - The AND p.id > :sid bound scopes to this shift's float payments only Signed-off-by: Dr M H B Ariyaratne <buddhika.ari@gmail.com>
Signed-off-by: ChinthakaPrasad <chinthakaprasad30@gmail.com>
…-correctly-when-removing-additional-items 19548 the total is not updating correctly when removing additional items
…t-will-not-be-updated-after-the-hospital-fee-is-refunded 19547 hospital fee in the report will not be updated after the hospital fee is refunded
- Added institutionName and departmentName fields to WebUserLight DTO - Added 7-arg constructor delegating to existing 5-arg - Updated JPQL in fillLightUsers() and fillLightUsersRetired() to include wu.institution.name and wu.department.name - Added Institution and Department columns (sortable, filterable) to user_list.xhtml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When a FundTransferBill was created from a Float Transfer Request, referenceBill was set to the request bill. Since the entire system uses referenceBill=null to mean "pending" and referenceBill!=null to mean "accepted", this caused the transfer to be invisible in the to-receive list, incorrectly blocked from cancellation/decline, and excluded from shift-end drawer accumulation. Fix: remove setReferenceBill(requestBill) from navigateToFundTransferBillFromRequest(). The link back to the request is tracked via selectedFundTransferRequest (instance variable) and forwardReferenceBill on the request bill. Also clear selectedFundTransferRequest in both reset methods to prevent stale state bleeding into subsequent direct transfers. Closes #19603
…equest info After removing setReferenceBill(requestBill), the request info panel and read-only Transfer To field were still reading from currentBill.referenceBill (now always null). Switch all rendered conditions and data expressions to use selectedFundTransferRequest instead. Closes #19603
…s doc All three cashier fund-transfer pages were using f:viewAction on @SessionScoped bean methods that the navigation methods already called. This caused double initialisation on normal navigation and silent state resets on browser refresh or back-button. Removed f:metadata/f:viewAction from: - cashier/fund_transfer_bill.xhtml (ensureFundTransferBillInitialized) - cashier/fund_transfer_request_bill.xhtml (ensureFundTransferRequestBillInitialized) - cashier/fund_transfer_request_bills_for_me.xhtml (fillFundTransferRequestsForMe) Added developer_docs/jsf/navigation-patterns.md with: - Rule: init belongs in navigation methods, not viewAction - When viewAction IS legitimate (f:viewParam / @ViewScoped) - Known misuses tracked as issues #19607–#19612 Updated CLAUDE.md and jsf-ajax skill to reference the new doc. Closes #19603
…ear-in-shift-end-after-handover Fix float transfers still appearing in shift end page after handover
1. Reload selectedFundTransferRequest from DB in settleFundTransferBill() before marking it fulfilled. Validates it is still a non-cancelled, unfulfilled FUND_TRANSFER_REQUEST addressed to the logged-in user. Aborts with an error message if any check fails. 2. Fix p:outputLabel for="acStaff" pointing to a hidden component when in read-only (request) mode. Now renders two conditional labels — one targeting acStaff (direct transfer) and one targeting txtTransferTo (request-originated transfer). 3. Soften "All controllers are @SessionScoped" to "Most controllers" in jsf-ajax skill and navigation-patterns doc — @ViewScoped beans exist (e.g. BookingControllerViewScope). Closes #17939
…t-in-receive-list Fix request-originated float transfers not appearing in receive list
- Split Shift Management into Shift, Drawer, and Handover tabs - Add Legacy tab for all deprecated handover buttons - Apply consistent PrimeFaces colour semantics across all tabs - Replace p:badge pending count (broke w-100) with CSS pulse animation - Add fundTransferRequestsForMeCount field with getter/setter - Populate count in fillFundTransferRequestsForMe() - Handover Current Shift promoted to 3rd button in Shift tab Closes #19617
- Call fillFundTransferRequestsForMe() in navigateToFinancialTransactionIndex() so pending count is correct on initial index load - Add prefers-reduced-motion media query for btn-pending animation (accessibility) - Remove incorrect rendered condition on My Shifts button (was gated on 'Completed Shift Handover is enabled' — should always show) - Fix typo: Supplimantary → Supplementary Closes #19617
Restructure cashier index UI: tabs, colour semantics, pending indicators
… 19320-inward-charge-type-detail-report
- Use BillType.InwardFinalBill instead of InwardBill (charges are stored on final bill) - Filter on bi.inwardChargeType (stored on BillItem) instead of bi.item.inwardChargeType - Get PatientEncounter from bi.getBill() since BillItem.patientEncounter is null - Fall back to charge type label when BillItem has no linked Item entity - Fall back to bill.billTime for sort when billItem.billTime is null Closes #19320 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace hardcoded 6-digit serial format (%06d) with configurable "Bill Number Serial Digit Count" option (default: 6). This allows institutions to reduce leading zeros for QuickBooks compatibility (e.g., GRN/RHD/LBK/26/000001 → GRN/RHD/LBK/26/00001). - Add formatSerialNumber() helper in BillNumberGenerator - Register config option in ConfigOptionApplicationController - Add setInteger API endpoint in ConfigResource Closes #19635 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add validation to reject impossible filter (dischargeDate basis + ADMITTED_BUT_NOT_DISCHARGED status always returns zero rows) - Add from/to date order validation - Replace two-step fetchEncounters() + IN :encs pattern with direct JOIN on PatientEncounter in both fetchBillItemRows and fetchTimedItemRows, eliminating the intermediate entity materialisation - Extract appendEncounterFilters() helper to share filter criteria across both detail queries - Remove now-unused PatientEncounterFacade EJB Closes #19320 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-report Add Inward Charge Type Detail report
…onventions - Add MAX_SERIAL_DIGITS=12 upper bound in formatSerialNumber() to prevent excessive allocations from misconfigured values - Document hotfix branch naming convention (must end with -hotfix) and feature branch naming patterns in commit-conventions.md Closes #19635 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…file link - New AdmissionReportDTO (JPQL SELECT NEW constructor) and AdmissionReportController with institution, site, department, date basis (createdAt/admissionDate), payment method and admission type filters - New AdmissionController.navigateToAdmissionProfileById(Long) for row-level inpatient dashboard navigation from DTO-only context - report_admissions.xhtml: full filter panel matching BHT Payment Summary style, results panel with Excel/PDF export buttons, Status columns use exportValue for print-clean plain text while keeping badges on screen - MdInwardReportController.fillAdmissions/fillAdmissionsByConsultants commented out with TODO for later deletion - inward_reports.xhtml sidebar calls admissionReportController.makeNull() on nav Closes #19640 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1. roomName projected in SELECT NEW via left join on currentPatientRoom / roomFacilityCharge — was always blank before 2. paymentFinalized changed from primitive boolean to Boolean in DTO constructor to survive NULL database values without NPE 3. clearDepartment() called on institution/site AJAX change so a stale department selection is not silently carried into the next query Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…serial-digits Add configurable bill number serial digit count
Enhance Admission Report: filters, DTO, Excel/PDF export, inpatient profile link
…(Issue #19642) - New AdmissionReportController: shared @SessionScoped bean for both Admission Report (#19640) and Admission by Consultant Report - Filters: date range, date basis (createdAt/admissionDate), admission type, payment method, institution, site, department - Consultant-specific filters: speciality (autocomplete) and consultant (autocomplete, filtered by selected speciality) - DTO-based JPQL SELECT NEW — eliminates lazy-load N+1 round-trips - clearConsultant() listener keeps consultant in sync when speciality changes - New AdmissionReportDTO: projection DTO for both report pages - Null-safe Boolean unboxing for discharged/paymentFinalized - dischargeStatusText/paymentStatusText helpers for clean export - report_admission_by_consultant.xhtml: full rewrite - All new filters added alongside existing speciality/consultant filters - Inpatient profile link per BHT No row - Print, Excel, PDF export with exportValue for clean output - Status badges on screen; plain text in export columns - report_admissions.xhtml: rewritten to use AdmissionReportController (same work as #19640 — included here as both pages share the controller) - AdmissionController: added navigateToAdmissionProfileById(Long) for DTO-context navigation from report tables - MdInwardReportController: commented out fillAdmissions() and fillAdmissionsByConsultants() — superseded by AdmissionReportController - inward_reports.xhtml: sidebar buttons updated to call admissionReportController.makeNull() Closes #19642 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ultant-report Enhance Admission by Consultant Report: DTO approach + new filters (Issue #19642)
…ield Person.nameWithTitle is @transient (computed getter) and cannot be used in JPQL SELECT NEW. Replace with Person.name (persisted) as documented in developer_docs/dto/implementation-guidelines.md. Closes #19642 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduce new config option 'Inward Admission - Auto Mark Claimable for Credit Admissions' (Boolean, default false). When enabled: - Selecting the Credit payment method on the admission form automatically checks the Claimable field (findLastUsedCreditCompanies). - The checkbox remains enabled for all payment methods so users can override for Credit or manually set Claimable for Cash admissions (isClaimableAllowed now short-circuits to true). - The save validation no longer forces Claimable to be set or unset when this config is active, allowing intentional user overrides. The existing 'Inward Admission - Auto Apply Claimable For Credit' key is preserved unchanged for backward compatibility. Closes #19646 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t-admissions Add config to auto-mark credit admissions as claimable (#19646)
…ultant-report Fix JPQL error: replace transient nameWithTitle with persisted name f…
Add AbstractFacade.getTableName() which resolves the actual DB table name via EclipseLink ClassDescriptor at runtime, then use it in dischargeOldDuplicateEncounters() and dischargeStaleEncounters() instead of hardcoded lowercase "patientencounter". This fixes Table not found errors on MySQL instances with lower_case_table_names=0. Closes #19648 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Before completing an admission, check if the patient already has an undischarged active admission. If so, show a warning dialog (consistent with the Surgery Workbench duplicate surgery pattern) that lets the user cancel or explicitly confirm and proceed. Changes: - AdmissionController: add checkBeforeAdmit() (AJAX entry point), isPatientAlreadyAdmitted() (JPQL count check), and activeAdmissionConfirmationPending field + accessors - inward_admission.xhtml: change "Admit" button to AJAX calling checkBeforeAdmit, add dlgActiveAdmission warning dialog with cancel/confirm buttons Closes #19650 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…me-case Fix admin inward functions failing on uppercase table name databases
The flag was set in checkBeforeAdmit() but never read anywhere. The dialog flow works correctly without it — removed to address CodeRabbit's dead-code finding on PR #19651. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds three files to help prevent accidental credential commits: - .gitleaks.toml: project-specific config with HMIS-aware rules (DB passwords in XML, GlassFish/Payara passwords, JDBC URLs) and an allowlist for known-safe historical commits and placeholder text. - .pre-commit-config.yaml: runs gitleaks on every git commit via the pre-commit framework. - scripts/install-dev-hooks.sh: one-time setup script — installs gitleaks and pre-commit if missing, then activates the hook. Setup (run once after cloning): chmod +x scripts/install-dev-hooks.sh && ./scripts/install-dev-hooks.sh Closes #19652 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…new-admit Warn when admitting a patient who already has an active admission
Add gitleaks secret scanning pre-commit hook for developers
Previously the NIC field was only shown when the config key 'Print Patient NIC on Final Bill' was explicitly enabled. Now the NIC is also shown automatically whenever the patient has a non-empty NIC on record, without requiring config changes. Closes #19357 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Apply the same conditional NIC display (show when patient has a recorded NIC) to all remaining print templates: - finalBill_1.xhtml - finalBill_Cancel.xhtml - finalBill_vat.xhtml - intrimBill.xhtml - intrimBillGreenSheet.xhtml - finalBillGreenSheet_old.xhtml finalBillGreenSheet.xhtml already showed NIC unconditionally. finalBill.xhtml was updated in the previous commit. Closes #19357 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…bill Show NIC on inward final bill when already recorded
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.