Skip to content

qa4#22040

Merged
buddhika75 merged 70 commits into
hims-qa4from
development
Jul 11, 2026
Merged

qa4#22040
buddhika75 merged 70 commits into
hims-qa4from
development

Conversation

@buddhika75

Copy link
Copy Markdown
Member

No description provided.

Pubudu-Piyankara and others added 30 commits July 8, 2026 12:01
… 17857-create-report-for-hospital-census
… 17857-create-report-for-hospital-census
Charge Types rows can now record a reason per charge type, persisted on
the summary BillItem's existing descreption field and reloaded when
revisiting an already-settled bill.

Closes #21939
Add per-charge-type Comment column to inward final bill
Grounds the agent in the existing com.divudi.ws.lims.* integration
layer (MiddlewareController, LimsMiddlewareController, MachineApi,
the Analyzer enum, and API_LIMS.md) so it can extend or debug
analyzer/middleware integrations with protocol-accurate detail
instead of generic LIS knowledge.

Closes #21962

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Removes "real" from "verified real sample ID" (ambiguous — read as
license to write live results once an ID looks valid) and makes
QC/test samples the required option for non-production validation
rather than just a preference.

Addresses CodeRabbit review comment on PR #21963.
…agent

Add lab-analyzer-integration Claude Code subagent
The Pharmacy Transfer Receive print/reprint composites bound their item
tables to bill.billItems, an unfiltered @onetomany that lazy-loads every
BillItem regardless of retired status. Retired lines (from duplicate-cleanup
retirements, cancelled lines, etc.) therefore rendered on the printed bill.

Switch all six transfer-receive print composites to bill.activeBillItems,
the in-memory retired-item filter added for the same problem class in
issue #21856. This is a view-only change scoped to the transfer-receive
print path:

- transferReceive.xhtml
- pharmacy_transfer_receive_receipt.xhtml (item count too)
- transferReceive_custom_1_letter.xhtml
- transfeRecieve_detailed.xhtml
- transfer_receive_custom_1.xhtml
- transfer_receive_custom_2.xhtml

Closes #21913

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tired-items

Exclude retired BillItem lines from Transfer Receive bill print (#21913)
…2 evict

Settling an inpatient Direct Issue (BHT Issue) bill took ~30 seconds on the
first issue of a batch and was fast for subsequent issues of the same batch.

Split timing instrumentation in InpatientDirectIssueNativeSqlService.settle()
showed the entire cost was a single em.refresh(bill) call: everything up to
the bill-totals UPDATE ran in ~257ms, the L2 evictions in 0ms, and
em.refresh(bill) alone took ~30,120ms.

Root cause: Bill.stockBill is FetchType.EAGER and StockBill.bill is also EAGER,
forming a circular EAGER reference. em.refresh(bill) reloads the Bill's whole
EAGER graph, and every Bill pulled in drags its own EAGER one-to-ones
(pharmacyBill / stockBill / billFinanceDetails / currentRequest), fanning
recursively across the batch's related bill graph. When that graph is not yet
in the EclipseLink L2 cache (first issue of a batch) the load takes ~30s; once
warm (later issues of the same batch) it is fast -- exactly the reported symptom.

The refresh existed only to keep the JPA caches consistent with the natively
written BILLFINANCEDETAILS_ID FK (issue #20435). Replace it with the same
pattern every sibling native-settle service already uses (RetailSale,
TransferIssue/Receive, Wholesale, GRN) and which never had this problem:
detach the managed Bill so its stale null FK is not merged into L2 at commit,
and evict Bill from L2 so the next read reloads the correct FK from the DB.
Same #20435 correctness guarantee, none of the EAGER-graph cost.

Verified end-to-end with Playwright against a local deployment: settle time
dropped from 30,377ms to 210ms (~145x). DB linkage correct
(BILLFINANCEDETAILS_ID + BillItemFinanceDetails rows written, totals match)
and the bill preview renders correctly.

Closes #21888

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The @schedule automatic timer processPendingLabReportApprovalSmsQueue read
config options and ran its JPQL query outside any try/catch, inside the
container transaction. On Southern Lanka production a transient database
connectivity storm made the timeout method throw a system exception to the EJB
container, after which the non-persistent automatic timer stopped firing and
never self-recovered even once the DB was healthy again - producing the
recurring pending Lab Report SMS freeze that only a server restart cleared,
roughly every 3-4 days.

Wrap the whole timeout callback in try/catch(Throwable) so the timer callback
never propagates an exception to the container; the timer keeps firing every
minute and resumes sending automatically once the underlying issue clears.

Signed-off-by: damithdeshan98 <hkddrajapaksha@gmail.com>
fix(sms): prevent Lab Report SMS timer freeze on transient DB failure
…refresh

Fix 30s Direct Issue settle: replace em.refresh(bill) with detach + L2 evict
Wire the existing (previously unused) PriceMatrix.roomCategory field
through the Inward Price Adjustment service-margin UI, REST API, and the
billing lookup, so admins can make the service charge depend on the
patient's current room facility category.

Semantics mirror the admissionType dimension (#21551): a matrix row with
a room category applies only to that category; a row without one is a
wildcard applying to all; when both match, the room-category-specific row
wins; and when the patient is not yet in a room the lookup restricts to
wildcard rows. Pure additive, backward compatible — no schema migration
(the column already existed).

- PriceMatrixController: consolidate the inward-margin lookup into one
  predicate-builder that threads paymentMethod/creditCompany/admissionType/
  roomCategory; existing overloads retained as delegates; new room-category-
  aware fetchInwardMargin + getInwardPriceAdjustment overloads. Tie-break
  between admissionType and roomCategory specificity is config-driven
  ("Inward Matrix - Room Category takes priority over Admission Type",
  default off).
- BillBhtController (inpatient + surgery), ServiceFeeEdit, and
  InwardBeanController credit-company overrides pass the patient's current
  room category (currentPatientRoom.roomFacilityCharge.roomCategory).
- InwardPriceAdjustmntController + inward_price_adjustment_service.xhtml:
  Room Category selector on the add form and edit dialog, matrix table
  column, persisted in saveSelected + addForAllCategory.
- InwardPriceAdjustmentApi: roomCategoryId in list/create/update/getById +
  duplicate detection, new room-categories/search lookup, and threaded into
  /diagnose so the diagnostic matches real billing.
- Docs: new Playwright gotcha (§21) for the inward item picker.

Verified end-to-end against real settled bills: an A/C-room Cash BHT got
the room-specific 25% margin (feeMargin 475 on 1900) while a Non-A/C Cash
BHT fell back to the wildcard 10% (feeMargin 190).

Closes #21977

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
feat(inward): room-facility-category-aware service margin matrix
…vice details

Add InwardBeanController.getLatestCheckedBillItemsByItem() which bulk-loads
the most recently checked inward BillItem per item for a patient encounter,
and expose it via BhtSummeryController.getLatestCheckedBillItem(Item). Check
information (checkedBy/checkeAt) is sourced from Bill via BillItem rather than
adding transient fields to the shared master Item entity.

Supports #21983
… Service Details

Add three columns to the Service Details tab of the interim bill page:
Pending Check Count (billed count minus checked count), Checked By and
Checked At (from the most recent checked bill for each item, via
bhtSummeryController.getLatestCheckedBillItem).

Closes #21983
feat(inward): show Checked By / Checked At and Pending Check Count in interim bill Service Details
…avigation

Call refillPaymentDetail() when navigating to the inward deposit payment
cancellation page so the payment method data (including the patient
deposit account) is populated from the original bill before the page
loads. Without this, cancelling an inward deposit paid via Patient
Deposit could fail and render an error page even though the deposit was
reduced.

Closes #18195
buddhika75 and others added 26 commits July 11, 2026 07:31
Server-side isAuthorized() guards added to every mutating method in
PharmacyIssueController and IssueReturnController (previously zero
server-side checks in either). Adds PharmacyDisposalIssueCancel (Cancel
had no privilege at all) and PharmacyDiscardCategoryManage (the admin
CRUD page for the Discard Category lookup had zero guard).

Page-level "not authorized" guards added to pharmacy_issue.xhtml, the
three previously-unguarded search pages, and pharmacy_bill_return_issue.xhtml.
Save/Finalize/Approve buttons converted from rendered to disabled per the
project's disabled-preferred standard. "Returns and Cancellations" menu
entry now gated on the union of GRN-return + Disposal-return privileges.

Proactively split two cross-call chains to avoid the finalize-calls-
unguarded-save bug pattern found in #22019/#22021:
- PharmacyIssueController.finalizeCurrentDraft() -> doSaveDisposalIssueDraft()
- IssueReturnController.finalizeDisposalIssueReturnBill() -> doSaveDisposalIssueReturnBill()

Part of #21994
Part of #21992

Co-Authored-By: Claude <noreply@anthropic.com>
…essage

CodeRabbit review comment on #22026 (comment id 3562856492): the denial
message interpolated action.toLowerCase() directly, rendering as e.g.
"You don't have permission to settle_direct_issue direct transfer
issues." Use a fixed, human-readable message instead.

Co-Authored-By: Claude <noreply@anthropic.com>
fix(pharmacy): enforce privilege guards across GRN & GRN Return workflow
…guards

fix(pharmacy): enforce privilege guards across Purchase Order workflow
…vilege-guards

fix(pharmacy): enforce privilege guards across Disbursement/Transfer workflow
…e-guards

feat(pharmacy): privilege guards for Discard/Disposal issue workflow
…l-census

17857 create report for hospital census
…ileges, icons, subscriptions & per-department default login page for single and bulk users

Roles become admin-time templates. New UserRoleApplicationService is the
single engine (UI + REST + AI) applying RESET/EXPAND/NARROW of a role's
template (privileges, icons, subscriptions, login page) onto users'
department-level records, with previews, audit events, and
WebUserRoleUser history rows.

- New entity WebUserDefaultLoginPage (user+department) with runtime
  resolution in SessionController (user+dept row -> WebUser.loginPage -> HOME)
- WebUserRole.loginPage template field editable on user_roles.xhtml
- Reworked user_role_users.xhtml into Manage User Role & Defaults
- New Bulk Role Operations page (filter by role/department/institution,
  select-all, preview, per-user results)
- REST: /api/users/{id}/role/{reset|expand|narrow}, /api/users/bulk/role-operations
  (preview->confirm), GET /api/users/roles, PUT/DELETE /api/users/{id}/login-page,
  registered in CapabilityStatementResource + AnthropicApiService tools
- Fix missing @manytoone on WebUserRoleUser.department
- Playwright-verified end to end; learnings appended to testing workflow doc

Closes #22023
Closes #6178
Closes #17493
Closes #4722

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…plate-user-management

# Conflicts:
#	developer_docs/testing/playwright-e2e-workflow.md
…tion on development

Three parallel privilege-guard PRs (#22019, #22020, #22021 via #22025/#22026)
each added an identical-signature private isAuthorized(String, String) to
PharmacyBillSearch; the merged result does not compile
(method is already defined). Keep one generic helper (uses the
underscore-to-space message so all existing call sites read correctly)
and drop the two duplicates.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…le button id

- Cap UI bulk role operations at 500 users per run (same MAX_BULK_USERS
  as UserManagementApi.bulkRoleOperations), enforced in executeBulk and
  previewBulk with a clear error message
- Add stable id to the User Roles button on admin/users/index.xhtml

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ment

feat(admin): role-template user management — reset/expand/narrow privileges, icons, subscriptions & per-department default login page (single + bulk)
…up failure

getStoredDdlVersion() reads/creates a ConfigOption row on every render of
mf.xhtml. On a database that is itself mid-migration (e.g. config_option.id
not yet AUTO_INCREMENT after the GenerationType.IDENTITY switch), that
lookup throws and Payara appends the full error page into the still-open
response, corrupting the DOM and breaking the AccordionPanel's client
widget so no tab or button on the page responds. This page exists
specifically to fix pending-migration databases, so it must not itself
crash because of one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…r-payment-voucher

21806 need to improve inward dr payment voucher
fix(admin): don't crash Add Missing Fields page on config-option lookup failure
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

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: d7df9bc1-98f6-4002-9d43-8f8656077f84

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.

@buddhika75 buddhika75 merged commit 32ceb4d into hims-qa4 Jul 11, 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.

4 participants