19802-missing-validation-when-saving-without-adding-diagnosis#19912
19802-missing-validation-when-saving-without-adding-diagnosis#19912denuwanhendalage wants to merge 3 commits intodevelopmentfrom
Conversation
WalkthroughAdded input validation to diagnosis saving—checking that both Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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 |
Signed-off-by: denuwanhendalage <shashankadenuwanb@gmail.com>
There was a problem hiding this comment.
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/DiagnosisController.java`:
- Around line 164-171: In DiagnosisController, the second validation block
incorrectly re-checks getCurrent().getName(); change it to validate
getCurrent().getCode() instead and keep the JsfUtil.addErrorMessage("Please
enter a Diagnosis Code before saving."); so the code field is actually
validated; update the condition referencing getCurrent().getCode() (and
trim()/isEmpty() as in the name check) to mirror the first validation block.
🪄 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: 17989bdc-3600-4608-845a-d83499c3a495
📒 Files selected for processing (2)
src/main/java/com/divudi/bean/clinical/DiagnosisController.javasrc/main/webapp/emr/admin/diagnoses.xhtml
Signed-off-by: denuwanhendalage <shashankadenuwanb@gmail.com>
There was a problem hiding this comment.
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/DiagnosisController.java`:
- Around line 164-170: The growl component in clinical_diagnosis.xhtml needs an
id and the save button must update it so validation FacesMessages are shown: add
id="growlMsg" to the existing <p:growl/> (same element referenced in the review)
and include growlMsg in the save button's update attribute (alongside lstSelect
and selectFocus, e.g., update="growlMsg lstSelect selectFocus") to mirror the
working pattern used in emr/admin/diagnoses.xhtml; this ensures the
JsfUtil.addErrorMessage messages from the save logic in DiagnosisController (the
validation at getCurrent().getName()/getCode()) are rendered to users.
🪄 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: 0448f262-936b-44b1-a892-bac786a5d48b
📒 Files selected for processing (1)
src/main/java/com/divudi/bean/clinical/DiagnosisController.java
changes
Summary by CodeRabbit
Bug Fixes
New Features
Style