Skip to content

update qa1#19659

Merged
PasinduW99 merged 88 commits intohims-qa1from
development
Apr 2, 2026
Merged

update qa1#19659
PasinduW99 merged 88 commits intohims-qa1from
development

Conversation

@PasinduW99
Copy link
Copy Markdown
Collaborator

No description provided.

denuwanhendalage and others added 30 commits February 27, 2026 16:49
Signed-off-by: denuwanhendalage <shashankadenuwanb@gmail.com>
Signed-off-by: denuwanhendalage <shashankadenuwanb@gmail.com>
I improved PDF, Excel and Print function to give better looking files with datailed informations what is the file.
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
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
The float transfer request integration fix closes #17939
(Float Request Process Integration), not the duplicate #19603
which has been closed.

Closes #17939
…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
buddhika75 and others added 28 commits April 1, 2026 15:22
- 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
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b51973e2-3e06-406a-8f00-424377c14e19

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch development

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.

@PasinduW99 PasinduW99 merged commit 98f4f72 into hims-qa1 Apr 2, 2026
2 checks passed
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.

6 participants