From 78f0483b95e01f4bcd56ca09e1fffdee2fdf1121 Mon Sep 17 00:00:00 2001 From: imexh Date: Thu, 19 Dec 2024 23:29:00 +0530 Subject: [PATCH] External Laboratory Workload Report #9762 --- .../divudi/bean/common/ReportsController.java | 58 +++++++++++-------- .../lab/external_laboratory_workload.xhtml | 22 +++---- 2 files changed, 46 insertions(+), 34 deletions(-) diff --git a/src/main/java/com/divudi/bean/common/ReportsController.java b/src/main/java/com/divudi/bean/common/ReportsController.java index 9c103ea87c..d62a201319 100644 --- a/src/main/java/com/divudi/bean/common/ReportsController.java +++ b/src/main/java/com/divudi/bean/common/ReportsController.java @@ -21,6 +21,7 @@ import com.divudi.entity.inward.Admission; import com.divudi.entity.inward.AdmissionType; import com.divudi.entity.inward.RoomCategory; +import com.divudi.entity.lab.Investigation; import com.divudi.entity.lab.PatientInvestigation; import com.divudi.entity.lab.PatientReport; import com.divudi.facade.*; @@ -311,6 +312,8 @@ public class ReportsController implements Serializable { private String settlementStatus; private String dischargedStatus; + private Investigation investigation; + public String getDischargedStatus() { return dischargedStatus; } @@ -324,11 +327,11 @@ public PaymentMethod getPaymentMethod() { return paymentMethod; } - + public void setPaymentMethod(PaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; } - + public CommonController getCommonController() { return commonController; @@ -354,6 +357,14 @@ public void setPatientReportFacade(PatientReportFacade patientReportFacade) { this.patientReportFacade = patientReportFacade; } + public Investigation getInvestigation() { + return investigation; + } + + public void setInvestigation(Investigation investigation) { + this.investigation = investigation; + } + public Institution getCreditCompany() { return creditCompany; } @@ -2383,7 +2394,7 @@ public void generateDebtorBalanceReport(final boolean onlyDueBills) { } public ReportTemplateRowBundle generateDebtorBalanceReportBills(List bts, List billPaymentMethods, - boolean onlyDueBills) { + boolean onlyDueBills) { Map parameters = new HashMap<>(); String jpql = "SELECT new com.divudi.data.ReportTemplateRow(bill) " + "FROM Bill bill " @@ -2873,6 +2884,7 @@ public void externalLaboratoryWorkloadReport() { opdBts.add(BillTypeAtomic.OPD_BATCH_BILL_PAYMENT_COLLECTION_AT_CASHIER); opdBts.add(BillTypeAtomic.PACKAGE_OPD_BATCH_BILL_WITH_PAYMENT); opdBts.add(BillTypeAtomic.PACKAGE_OPD_BILL_PAYMENT_COLLECTION_AT_CASHIER); + opdBts.add(BillTypeAtomic.PACKAGE_OPD_BILL_WITH_PAYMENT); opdBts.add(BillTypeAtomic.OPD_BATCH_BILL_CANCELLATION); opdBts.add(BillTypeAtomic.OPD_BILL_CANCELLATION); opdBts.add(BillTypeAtomic.PACKAGE_OPD_BATCH_BILL_CANCELLATION); @@ -2899,20 +2911,20 @@ public void externalLaboratoryWorkloadReport() { private ReportTemplateRowBundle generateExternalLaboratoryWorkloadBillItems(List bts) { Map parameters = new HashMap<>(); - String jpql = "SELECT new com.divudi.data.ReportTemplateRow(billItem) " - + "FROM BillItem billItem " - + "JOIN billItem.bill bill " - + "LEFT JOIN PatientInvestigation pi ON pi.billItem = billItem " - + "WHERE bill.billTypeAtomic IN :bts " - + "AND bill.createdAt BETWEEN :fd AND :td "; - // String jpql = "SELECT new com.divudi.data.ReportTemplateRow(billItem) " -// + "FROM PatientInvestigation pi " -// + "JOIN pi.billItem billItem " +// + "FROM BillItem billItem " // + "JOIN billItem.bill bill " -// + "WHERE pi.retired=false " -// + " and billItem.retired=false " -// + " and bill.retired=false "; +// + "LEFT JOIN PatientInvestigation pi ON pi.billItem = billItem " +// + "WHERE bill.billTypeAtomic IN :bts " +// + "AND bill.createdAt BETWEEN :fd AND :td "; + + String jpql = "SELECT new com.divudi.data.ReportTemplateRow(billItem) " + + "FROM PatientInvestigation pi " + + "JOIN pi.billItem billItem " + + "JOIN billItem.bill bill " + + "WHERE pi.retired=false " + + " and billItem.retired=false " + + " and bill.retired=false "; jpql += "AND bill.billTypeAtomic in :bts "; parameters.put("bts", bts); @@ -2930,8 +2942,8 @@ private ReportTemplateRowBundle generateExternalLaboratoryWorkloadBillItems(List } if (item != null) { - jpql += "AND billItem.patientInvestigation.investigation.name = :item "; - parameters.put("item", item.getName()); + jpql += "AND billItem.item = :item "; + parameters.put("item", item); } if (institution != null) { @@ -2973,13 +2985,13 @@ private ReportTemplateRowBundle generateExternalLaboratoryWorkloadBillItems(List } if (category != null) { - jpql += "AND billItem.patientInvestigation.investigation.category.id = :cat "; + jpql += "AND billItem.item.department.id = :cat "; parameters.put("cat", category.getId()); } - if (investigationCode != null) { - jpql += "AND billItem.patientInvestigation.investigation.code = :code "; - parameters.put("code", investigationCode.getCode()); + if (investigation != null) { + jpql += "AND billItem.item = :code "; + parameters.put("code", investigation); } jpql += "AND bill.createdAt BETWEEN :fd AND :td "; @@ -3270,7 +3282,7 @@ private void groupBills() { bundle.setGroupedBillItemsByInstitution(billMap); } - + public Double calculateNetTotalByBills(List bills) { Double netTotal = 0.0; @@ -3291,7 +3303,7 @@ public Double calculateDiscountByBills(List bills) { return discount; } - + public Double calculateSubTotal() { double subTotal = 0.0; Map> billMap = bundle.getGroupedBillItemsByInstitution(); diff --git a/src/main/webapp/reports/lab/external_laboratory_workload.xhtml b/src/main/webapp/reports/lab/external_laboratory_workload.xhtml index 1c0b54711f..06e63f1da4 100644 --- a/src/main/webapp/reports/lab/external_laboratory_workload.xhtml +++ b/src/main/webapp/reports/lab/external_laboratory_workload.xhtml @@ -252,32 +252,31 @@ Name - + - + Dept - + Code - + @@ -352,7 +351,8 @@ - + - + - + @@ -406,7 +406,7 @@ - +