Skip to content

19804-missing-validation-when-saving-without-adding-procedures#19847

Open
denuwanhendalage wants to merge 2 commits intodevelopmentfrom
19804-missing-validation-when-saving-without-adding-procedures
Open

19804-missing-validation-when-saving-without-adding-procedures#19847
denuwanhendalage wants to merge 2 commits intodevelopmentfrom
19804-missing-validation-when-saving-without-adding-procedures

Conversation

@denuwanhendalage
Copy link
Copy Markdown
Collaborator

@denuwanhendalage denuwanhendalage commented Apr 8, 2026

changes

  1. procedures.xhtml -> added life to <p:growl> , update attribute in save button added gpDetail
  2. procedureController.java -> created field-specific validation messages, swapped the save message and update message to give correct response.

Summary by CodeRabbit

  • Bug Fixes
    • Added validation requiring Name and Code fields when saving procedures
    • Corrected success messages: "Updated" for edits, "Saved" for new procedures
    • Fixed UI refresh behavior after saving
    • Notifications now auto-dismiss after 4 seconds

…oller

Signed-off-by: denuwanhendalage <shashankadenuwanb@gmail.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

Warning

Rate limit exceeded

@denuwanhendalage has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 22 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 6 minutes and 22 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: de2b1576-8ce6-4ddd-9330-4a18b0a5a0f6

📥 Commits

Reviewing files that changed from the base of the PR and between a5c1403 and ff3d56b.

📒 Files selected for processing (1)
  • src/main/java/com/divudi/bean/clinical/ProcedureController.java

Walkthrough

Added validation to prevent saving procedures with null or blank names and codes, corrected success message logic to distinguish between create ("Saved") and update ("Updated") operations. Also configured UI notification timeout and expanded AJAX update targets.

Changes

Cohort / File(s) Summary
Save Logic Validation
src/main/java/com/divudi/bean/clinical/ProcedureController.java
Added guard clauses to validate procedure name and code are non-null and non-blank before saving; corrected success messages to reflect "Updated" for edits and "Saved" for new entries.
UI Notification Settings
src/main/webapp/emr/admin/procedures.xhtml
Added notification timeout (life="4000") to growl component and updated AJAX update targets to include gpDetail in component refresh.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main purpose of the changes: adding validation and fixing feedback messages when saving procedures without proper name/code values.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 19804-missing-validation-when-saving-without-adding-procedures

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a 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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/main/java/com/divudi/bean/clinical/ProcedureController.java`:
- Around line 140-142: In ProcedureController, the null-check for current should
stop execution after reporting the error: when current == null, call
JsfUtil.addErrorMessage("Nothing to save") and immediately return from the
method to avoid the later getCurrent() auto-creating a new ClinicalEntity and
triggering spurious name/code validation errors; modify the method containing
the current null-check (in class ProcedureController) to add a return right
after the JsfUtil.addErrorMessage call.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b771498e-239c-4a37-9df7-679c40d8e590

📥 Commits

Reviewing files that changed from the base of the PR and between d1b19ba and a5c1403.

📒 Files selected for processing (2)
  • src/main/java/com/divudi/bean/clinical/ProcedureController.java
  • src/main/webapp/emr/admin/procedures.xhtml

Signed-off-by: denuwanhendalage <shashankadenuwanb@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant