Skip to content

Update QA1#19681

Merged
damithdeshan98 merged 20 commits intohims-qa1from
development
Apr 3, 2026
Merged

Update QA1#19681
damithdeshan98 merged 20 commits intohims-qa1from
development

Conversation

@damithdeshan98
Copy link
Copy Markdown
Collaborator

No description provided.

buddhika75 and others added 20 commits April 2, 2026 05:33
…-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
@damithdeshan98 damithdeshan98 self-assigned this Apr 3, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

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: 3498e77f-a4ce-45de-9975-9603474dfc01

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 and usage tips.

@damithdeshan98 damithdeshan98 merged commit 0dcda64 into hims-qa1 Apr 3, 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.

3 participants