Merged
Conversation
…-level-charge-type-breakdown-detail-report' of https://github.com/hmislk/hmis.git into 19655-inward-reports-rename-charge-type-summary-add-bht-level-charge-type-breakdown-detail-report
Complete — 6 files changed Step 1 — CalculationMethod.java (NEW) 6-value enum: BILL_ITEM, PHARMACY_BILL, STORE_BILL, PATIENT_ROOM, BILL_FEE, ADMISSION_FEE Step 2 — InwardChargeType.java (MODIFIED) - Added private CalculationMethod calculationMethod field - Added new 2-arg constructor (existing 1-arg untouched) - Added getCalculationMethod() with null-safe default → BILL_ITEM - Updated 12 constants: RoomCharges, MOCharges, NursingCharges, LinenCharges, AdministrationCharge, MedicalCareICU, MaintainCharges → PATIENT_ROOM; Medicine → PHARMACY_BILL; GeneralIssuing → STORE_BILL; ProfessionalCharge, DoctorAndNurses → BILL_FEE; AdmissionFee → ADMISSION_FEE Step 3 — InwardChargeTypeBreakdownController.java (NEW) Branches on selectedChargeType.getCalculationMethod() across 6 cases, each producing a List<BhtBreakdownRow> + columnKeys/columnLabels/columnTotals. Step 4 — inward_report_inward_charge_type_breakdown.xhtml (NEW) ui:repeat-based HTML pivot table — dynamic columns for items/staff, blank cells for missing values, footer totals. Step 5 — inward_report_inward_charge_type_detail.xhtml (MODIFIED) Panel header renamed to "Inward Charge Type Summary by BHT Report". Step 6 — inward_reports.xhtml (MODIFIED) Button renamed to "Inward Charge Type Summary by BHT"; new "Inward Charge Type Breakdown by BHT" button added immediately below it. Signed-off-by: Dr M H B Ariyaratne <buddhika.ari@gmail.com>
…ischarge - Add PatientEncounterType.ClinicalDischarge and SymanticType.Discharge_Condition - Add InpatientClinicalDischarge privilege - Add clinical discharge fields to PatientEncounter (clinicallyDischarged, clinicalDischargeDateTime, clinicalDischargedBy, roomDischargeDateTime, roomDischargedBy, dischargeCondition, followUpPlan, activityInstructions, dietInstructions) - Add DischargeConditionController and discharge_conditions.xhtml admin page for configurable discharge condition values (Stable, DAMA, Referred, etc.) - Add inward_clinical_discharge.xhtml page with condition, diagnoses, summary, follow-up, activity/diet sections and confirm/cancel actions - Add navigateToClinicalDischargeFromAdmission, saveClinicalDischarge, confirmClinicalDischarge, cancelClinicalDischarge to InpatientClinicalDataController - Sync roomDischargeDateTime to PatientEncounter when last room is discharged - Warn on hospital discharge if clinical discharge not yet confirmed - Add Clinical Discharge button to admission_profile.xhtml (green/orange status) Closes #19657 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Null-safe label lookup in completeInwardChargeType (Comment 1) - Add grandTotal field and expose getter; show grand total in XHTML footer (Comment 2) - Add DISCHARGED_BUT_FINAL_BILL_NOT_COMPLETED case in appendEncounterFilters (Comment 3) Closes #19655 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e in RoomChangeController AdmissionFacade cannot accept PatientEncounter directly; inject and use PatientEncounterFacade for the roomDischargeDateTime sync. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ay-in-po-print 19599 incorrect datetime display in po print
…rge-type-summary-add-bht-level-charge-type-breakdown-detail-report 19655 inward reports rename charge type summary add bht level charge type breakdown detail report
- Fix swapped success messages in DischargeConditionController.saveSelected() - Add null/empty guard in completeDischargeConditions() to prevent NPE - Fix row numbering bug in downloadAsExcel() (first row showed 2 instead of 1) - Use try-with-resources for Workbook and show user-facing error on failure - Wrap NumberFormatException in converter getAsObject() - Add privilege guard (InpatientClinicalDischarge) to discharge_conditions.xhtml form - Replace raw HTML labels with p:outputLabel in discharge_conditions.xhtml - Add for/id associations on labels in inward_clinical_discharge.xhtml - Add title tooltip to Clinical Discharge button in admission_profile.xhtml - Add room discharge sync logic to discharge() in RoomChangeController (was only in dischargeWithCurrentTime(), leaving inconsistent state when discharge() is called from BhtSummeryController) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implement three-tier discharge system: clinical, room, and hospital discharge
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>
…ncounters Fix: Discharge Duplicate Encounters groups by physical room, not assignment ID
…process The InpatientClinicalDischarge privilege was added to Privileges.java in PR #19658 but was not registered in UserPrivilageController.java, making it invisible in the admin privilege management UI. Administrators had no way to grant this privilege through the UI. Changes: - Register InpatientClinicalDischarge as a DefaultTreeNode under the "Clinical" branch of the Inward section in UserPrivilageController.java - Update developer_docs/security/privilege-system.md with an explicit 3-step checklist and warning that enum-only addition is not sufficient - Update CLAUDE.md with a "When Adding a New Privilege" section linking to the privilege system guide Closes #19677 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…scharge-privilege-to-tree Add InpatientClinicalDischarge to privilege tree; document 3-step privilege process
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.