Fix: Discharge Duplicate Encounters groups by physical room, not assignment ID#19676
Conversation
The admin function was grouping by currentPatientRoom_id (PatientRoom assignment entity ID). Each new admission creates a new PatientRoom record, so multiple admissions to the same physical room had different currentPatientRoom_id values and were all retained. Fix: join the patientroom table and group by roomFacilityCharge_id (the actual physical room) so only the latest encounter per room is kept and all older ones are discharged. Closes #19675 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.42.0)src/main/java/com/divudi/bean/common/DataAdministrationController.java[] 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 |
Summary
dischargeOldDuplicateEncounters()was grouping bycurrentPatientRoom_id(PatientRoom assignment entity), causing it to treat each admission as a unique room even when multiple admissions targeted the same physical roompatientroomand group byroomFacilityCharge_idso only the latest encounter per physical room is keptTest plan
admin_functions.xhtmlnurse/index.xhtmlshows at most one entry per room (no duplicate room buttons)Closes #19675
🤖 Generated with Claude Code
Summary by CodeRabbit