diff --git a/nb-configuration.xml b/nb-configuration.xml
index 2c47f15239..a9524e2805 100644
--- a/nb-configuration.xml
+++ b/nb-configuration.xml
@@ -15,6 +15,7 @@ That way multiple projects can share the same settings (useful for formatting ru
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
ide
+
false
true
JSP
@@ -28,5 +29,5 @@ Any value defined here will override the pom.xml file value but is only applicab
js/libs
pfv5ee8
JDK_11
-
+
diff --git a/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java b/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java
index 4e2ba50f74..4babc16c0b 100644
--- a/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java
+++ b/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java
@@ -548,6 +548,23 @@ public ReportTemplateRowBundle generateReport(
paramStartId,
paramEndId);
break;
+ case SESSION_INSTANCE_LIST:
+ bundle = handleSessionInstanceList(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
+ break;
default:
JsfUtil.addErrorMessage("Unknown Report Type");
return null;
@@ -2092,6 +2109,127 @@ private ReportTemplateRowBundle handleItemSummaryByBill(
return bundle;
}
+ private ReportTemplateRowBundle handleSessionInstanceList(
+ List btas,
+ Date paramDate,
+ Date paramFromDate,
+ Date paramToDate,
+ Institution paramInstitution,
+ Department paramDepartment,
+ Institution paramFromInstitution,
+ Department paramFromDepartment,
+ Institution paramToInstitution,
+ Department paramToDepartment,
+ WebUser paramUser,
+ Institution paramCreditCompany,
+ Long paramStartId,
+ Long paramEndId) {
+
+ String jpql;
+ Map parameters = new HashMap<>();
+ ReportTemplateRowBundle bundle = new ReportTemplateRowBundle();
+
+ jpql = "select new com.divudi.data.ReportTemplateRow("
+ + " ss "
+ + " from SessionInstance ss "
+ + " where ss.retired<>:br ";
+ parameters.put("br", true);
+
+ if (paramDate != null) {
+ jpql += " and ss.startedAt=:bd";
+ parameters.put("bd", paramDate);
+ }
+
+ if (paramToDate != null) {
+ jpql += " and ss.startedAt < :td";
+ parameters.put("td", paramToDate);
+ }
+
+ if (paramFromDate != null) {
+ jpql += " and ss.startedAt > :fd";
+ parameters.put("fd", paramFromDate);
+ }
+
+ if (paramInstitution != null) {
+ jpql += " and ss.institution=:ins";
+ parameters.put("ins", paramInstitution);
+ }
+
+ if (paramDepartment != null) {
+ jpql += " and ss.department=:dep";
+ parameters.put("dep", paramDepartment);
+ }
+
+ if (paramUser != null) {
+ jpql += " and ss.creater=:wu";
+ parameters.put("wu", paramUser);
+ }
+
+ System.out.println("jpql = " + jpql);
+ System.out.println("parameters = " + parameters);
+
+ List rs = (List) ejbFacade.findLightsByJpql(jpql, parameters, TemporalType.DATE);
+
+ if (rs == null || rs.isEmpty()) {
+ System.out.println("No results found.");
+ return null;
+ } else {
+ System.out.println("Results found: " + rs.size());
+ }
+
+
+ long idCounter = 1;
+
+ for (ReportTemplateRow row : rs) {
+ row.setId(idCounter++);
+ if (row.getBtas() == null) {
+ row.setBtas(btas);
+ }
+ if (row.getDate() == null) {
+ row.setDate(paramDate);
+ }
+ if (row.getFromDate() == null) {
+ row.setFromDate(paramFromDate);
+ }
+ if (row.getToDate() == null) {
+ row.setToDate(paramToDate);
+ }
+ if (row.getInstitution() == null) {
+ row.setInstitution(paramInstitution);
+ }
+ if (row.getDepartment() == null) {
+ row.setDepartment(paramDepartment);
+ }
+ if (row.getFromInstitution() == null) {
+ row.setFromInstitution(paramFromInstitution);
+ }
+ if (row.getFromDepartment() == null) {
+ row.setFromDepartment(paramFromDepartment);
+ }
+ if (row.getToInstitution() == null) {
+ row.setToInstitution(paramToInstitution);
+ }
+ if (row.getToDepartment() == null) {
+ row.setToDepartment(paramToDepartment);
+ }
+ if (row.getUser() == null) {
+ row.setUser(paramUser);
+ }
+ if (row.getCreditCompany() == null) {
+ row.setCreditCompany(paramCreditCompany);
+ }
+ if (row.getStartId() == null) {
+ row.setStartId(paramStartId);
+ }
+ if (row.getEndId() == null) {
+ row.setEndId(paramEndId);
+ }
+ }
+
+ bundle.setReportTemplateRows(rs);
+ return bundle;
+ }
+
private ReportTemplateRowBundle handleToDepartmentSummaryByBillFee(
List btas,
Date paramDate,
diff --git a/src/main/java/com/divudi/bean/report/ReportController.java b/src/main/java/com/divudi/bean/report/ReportController.java
index bd653f69e2..ca35470090 100644
--- a/src/main/java/com/divudi/bean/report/ReportController.java
+++ b/src/main/java/com/divudi/bean/report/ReportController.java
@@ -159,10 +159,10 @@ public void processCollectionCenterBalance() {
collectionCenters = institutionFacade.findByJpql(jpql, m);
}
- public String navigatetoOPDLabReportByMenu(){
+ public String navigatetoOPDLabReportByMenu() {
return "/lab/report_for_opd_print?faces-redirect=true";
}
-
+
public String navigateToPrescriptionSummaryReport() {
return "/pharmacy/prescription_summary_report?faces-redirect=true";
}
@@ -312,19 +312,19 @@ public void processLabTestCount() {
// Convert the map values to a list to be used in the JSF page
reportList = new ArrayList<>(categoryReports.values());
}
-
- public void filterOpdServiceCountBySelectedService(Long selectedItemId){
+
+ public void filterOpdServiceCountBySelectedService(Long selectedItemId) {
if (selectedItemId != null) {
- item=itemController.findItem(selectedItemId);
- doctor=null;
+ item = itemController.findItem(selectedItemId);
+ doctor = null;
}
processOpdServiceCountDoctorWise();
}
-
- public void filterOpdServiceCountBySelectedDoctor(Long selectedDoctorId){
+
+ public void filterOpdServiceCountBySelectedDoctor(Long selectedDoctorId) {
if (selectedDoctorId != null) {
- doctor=doctorController.findDoctor(selectedDoctorId);
- item=null;
+ doctor = doctorController.findDoctor(selectedDoctorId);
+ item = null;
}
processOpdServiceCountDoctorWise();
}
@@ -332,7 +332,7 @@ public void filterOpdServiceCountBySelectedDoctor(Long selectedDoctorId){
public void processOpdServiceCountDoctorWise() {
List billtypes = new ArrayList<>();
billtypes.add(BillTypeAtomic.OPD_BILL_TO_COLLECT_PAYMENT_AT_CASHIER);
-
+
String jpql = "select new com.divudi.data.ItemCount(bi.bill.fromStaff.person.name, bi.bill.fromStaff.id, bi.item.name, bi.item.id, count(bi)) "
+ " from BillItem bi "
+ " where bi.bill.cancelled=:can "
@@ -352,18 +352,16 @@ public void processOpdServiceCountDoctorWise() {
jpql += " and bi.bill.fromStaff =:fs";
m.put("fs", doctor);
}
- if(item != null){
+ if (item != null) {
jpql += " and bi.item =:it";
m.put("it", item);
}
-
+
jpql += " group by bi.item, bi.bill.fromStaff ";
jpql += " order by bi.bill.fromStaff.person.name, bi.item.name";
reportOpdServiceCount = (List) billItemFacade.findLightsByJpql(jpql, m);
}
-
-
public void processCollectingCentreReportsToPrint() {
String jpql = "select bi "
+ " from BillItem bi "
@@ -425,9 +423,6 @@ public void processCollectingCentreReportsToPrint() {
billItems = billItemFacade.findByJpql(jpql, m);
}
-
-
-
public void processCollectingCentreStatementReport() {
String jpql = "select bi "
+ " from BillItem bi "
@@ -817,7 +812,7 @@ public void downloadLabTestCount() {
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment; filename=test_counts.xlsx");
- try ( ServletOutputStream outputStream = response.getOutputStream()) {
+ try (ServletOutputStream outputStream = response.getOutputStream()) {
workbook.write(outputStream);
fc.responseComplete();
} catch (IOException e) {
@@ -833,7 +828,7 @@ public void downloadPharmacySaleItemCount() {
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment; filename=Sale_Item_Count.xlsx");
- try ( ServletOutputStream outputStream = response.getOutputStream()) {
+ try (ServletOutputStream outputStream = response.getOutputStream()) {
workbook.write(outputStream);
fc.responseComplete();
} catch (IOException e) {
@@ -849,7 +844,7 @@ public void downloadOpdServiceCount() {
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment; filename=service_count.xlsx");
- try ( ServletOutputStream outputStream = response.getOutputStream()) {
+ try (ServletOutputStream outputStream = response.getOutputStream()) {
workbook.write(outputStream);
fc.responseComplete();
} catch (IOException e) {
@@ -1789,4 +1784,8 @@ public void setReportOpdServiceCount(List reportOpdServiceCount) {
this.reportOpdServiceCount = reportOpdServiceCount;
}
+ public String navigateToDynamicReportSummary() {
+ return "/reports/dynamic_reports/dynamic_report_summary?faces-redirect=true";
+ }
+
}
diff --git a/src/main/java/com/divudi/data/ReportTemplateRow.java b/src/main/java/com/divudi/data/ReportTemplateRow.java
index fef99715fb..95eb52d33f 100644
--- a/src/main/java/com/divudi/data/ReportTemplateRow.java
+++ b/src/main/java/com/divudi/data/ReportTemplateRow.java
@@ -5,6 +5,7 @@
import com.divudi.entity.Institution;
import com.divudi.entity.Item;
import com.divudi.entity.WebUser;
+import com.divudi.entity.channel.SessionInstance;
import java.util.Date;
import java.util.List;
@@ -48,8 +49,13 @@ public class ReportTemplateRow {
private WebUser user;
private Long startId;
private Long endId;
+ private SessionInstance sessionInstance;
private List btas;
+
+ public ReportTemplateRow(SessionInstance sessionInstance) {
+ this.sessionInstance = sessionInstance;
+ }
@@ -397,4 +403,12 @@ public void setBtas(List btas) {
this.btas = btas;
}
+ public SessionInstance getSessionInstance() {
+ return sessionInstance;
+ }
+
+ public void setSessionInstance(SessionInstance sessionInstance) {
+ this.sessionInstance = sessionInstance;
+ }
+
}
diff --git a/src/main/java/com/divudi/data/ReportTemplateRowBundle.java b/src/main/java/com/divudi/data/ReportTemplateRowBundle.java
index 109fb84e78..68c50855ef 100644
--- a/src/main/java/com/divudi/data/ReportTemplateRowBundle.java
+++ b/src/main/java/com/divudi/data/ReportTemplateRowBundle.java
@@ -1,6 +1,7 @@
package com.divudi.data;
import com.divudi.entity.ReportTemplate;
+import com.divudi.entity.channel.SessionInstance;
import java.util.ArrayList;
import java.util.List;
@@ -20,7 +21,7 @@ public class ReportTemplateRowBundle {
private Long count;
private String name;
private String description;
-
+ private SessionInstance sessionInstance;
@@ -108,6 +109,14 @@ public void setDescription(String description) {
this.description = description;
}
+ public SessionInstance getSessionInstance() {
+ return sessionInstance;
+ }
+
+ public void setSessionInstance(SessionInstance sessionInstance) {
+ this.sessionInstance = sessionInstance;
+ }
+
diff --git a/src/main/java/com/divudi/data/analytics/ReportTemplateType.java b/src/main/java/com/divudi/data/analytics/ReportTemplateType.java
index f430f28f64..2c41b0ec59 100644
--- a/src/main/java/com/divudi/data/analytics/ReportTemplateType.java
+++ b/src/main/java/com/divudi/data/analytics/ReportTemplateType.java
@@ -10,6 +10,7 @@ public enum ReportTemplateType {
BILL_ITEM_LIST("Bill Item List"),
BILL_FEE_LIST("Bill Fee List"),
PATIENT_LIST("Patient List"),
+ SESSION_INSTANCE_LIST("Channelling Session Instance List"),
ENCOUNTER_LIST("Encounter List"),
BILL_FEE_GROUPED_BY_TO_DEPARTMENT_AND_CATEGORY("Bill fees grouped by to departmetnt and category"),
BILL_TYPE_ATOMIC_SUMMARY_USING_BILLS("Bill Type Summary by using Bills"),
diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml
index fb6d1b099d..087a43c9fd 100644
--- a/src/main/resources/META-INF/persistence.xml
+++ b/src/main/resources/META-INF/persistence.xml
@@ -1,7 +1,7 @@
- jdbc/arogya
+ jdbc/hims
false
@@ -10,7 +10,7 @@
- jdbc/arogyaAudit
+ jdbc/himsaudit
false
diff --git a/src/main/webapp/dataAdmin/report.xhtml b/src/main/webapp/dataAdmin/report.xhtml
index d4fb765bdd..610cd83787 100644
--- a/src/main/webapp/dataAdmin/report.xhtml
+++ b/src/main/webapp/dataAdmin/report.xhtml
@@ -13,154 +13,117 @@
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
-
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
+
-
+
+
+
+
diff --git a/src/main/webapp/reports/dynamic_reports/dynamic_report_summary.xhtml b/src/main/webapp/reports/dynamic_reports/dynamic_report_summary.xhtml
new file mode 100644
index 0000000000..44886962ef
--- /dev/null
+++ b/src/main/webapp/reports/dynamic_reports/dynamic_report_summary.xhtml
@@ -0,0 +1,218 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Total
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/webapp/reports/dynamic_reports/dynamic_reports.xhtml b/src/main/webapp/reports/dynamic_reports/dynamic_reports.xhtml
new file mode 100644
index 0000000000..8c76690b27
--- /dev/null
+++ b/src/main/webapp/reports/dynamic_reports/dynamic_reports.xhtml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/webapp/resources/ezcomp/menu.xhtml b/src/main/webapp/resources/ezcomp/menu.xhtml
index d660b8d6dd..ef2c2ffcec 100644
--- a/src/main/webapp/resources/ezcomp/menu.xhtml
+++ b/src/main/webapp/resources/ezcomp/menu.xhtml
@@ -1159,7 +1159,9 @@
-
+
+