Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/hmislk/hmis.git into…
Browse files Browse the repository at this point in the history
… coop-test

# Conflicts:
#	src/main/java/com/divudi/bean/pharmacy/PharmacyController.java
#	src/main/webapp/resources/inward/creditCompany/inputCredit_admit.xhtml
  • Loading branch information
ChinthakaPrasad committed Feb 14, 2025
2 parents 490f8dd + 5b97487 commit a675806
Show file tree
Hide file tree
Showing 36 changed files with 1,931 additions and 150 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.divudi</groupId>
<artifactId>rh</artifactId>
<artifactId>digasiri</artifactId>
<version>3.0.0</version>
<packaging>war</packaging>
<name>rh</name>
<name>digasiri</name>

<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/divudi/bean/common/AreaController.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public String getAsString(FacesContext facesContext, UIComponent component, Obje
return getStringKey(o.getId());
} else {
throw new IllegalArgumentException("object " + object + " is of type "
+ object.getClass().getName() + "; expected type: " + AreaController.class.getName());
+ object.getClass().getName() + "; expected type: " + Area.class.getName());
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/divudi/bean/common/BillBeanController.java
Original file line number Diff line number Diff line change
Expand Up @@ -2271,6 +2271,8 @@ public void updateInwardDipositList(PatientEncounter patientEncounter, Bill bill
patientEncounter.getFinalBill().setSettledAmountByPatient(patientEncounter.getFinalBill().getSettledAmountByPatient() + bill.getNetTotal());
}else if(bill.getBillTypeAtomic()== BillTypeAtomic.INPATIENT_CREDIT_COMPANY_PAYMENT_RECEIVED){
patientEncounter.getFinalBill().setSettledAmountBySponsor(patientEncounter.getFinalBill().getSettledAmountBySponsor()+ bill.getNetTotal());
}else if(bill.getBillTypeAtomic()== BillTypeAtomic.INPATIENT_CREDIT_COMPANY_PAYMENT_CANCELLATION){
patientEncounter.getFinalBill().setSettledAmountBySponsor(patientEncounter.getFinalBill().getSettledAmountBySponsor() - Math.abs(bill.getNetTotal()));
}
getBillFacade().edit(patientEncounter.getFinalBill());
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/divudi/bean/common/BillSearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -3210,6 +3210,7 @@ public String navigateToViewSingleOpdBill() {
} else {
opdBillRefundAllowedSameDay = true;
}
findRefuendedBills(bill);
paymentMethod = bill.getPaymentMethod();
printPreview = false;
return "/opd/bill_reprint?faces-redirect=true;";
Expand All @@ -3222,7 +3223,6 @@ public String navigateToViewChannelBillSession() {
private List<Bill> refuendedBills = new ArrayList();

public void findRefuendedBills(Bill bill) {
System.out.println("findRefuendedBills");
refuendedBills = new ArrayList<>();
Map p = new HashMap();
String jpql = "SELECT b"
Expand All @@ -3234,7 +3234,6 @@ public void findRefuendedBills(Bill bill) {
p.put("refBill", bill);

refuendedBills = billFacade.findByJpql(jpql, p);
System.out.println("refuendedBills = " + refuendedBills);
}

public List<Bill> getRefuendedBills() {
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/com/divudi/bean/common/EnumController.java
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,21 @@ public BillType[] getBillTypes() {
public BillTypeAtomic[] getBillTypesAtomic() {
return BillTypeAtomic.values();
}

public List<BillTypeAtomic> getBillTypesAtomicForLabTests() {
List<BillTypeAtomic> btas= new ArrayList<>();
btas.add(BillTypeAtomic.CC_BILL);
btas.add(BillTypeAtomic.CC_BILL_CANCELLATION);
btas.add(BillTypeAtomic.CC_BILL_REFUND);
btas.add(BillTypeAtomic.OPD_BILL_WITH_PAYMENT);
btas.add(BillTypeAtomic.OPD_BILL_CANCELLATION);
btas.add(BillTypeAtomic.OPD_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION);
btas.add(BillTypeAtomic.OPD_BILL_REFUND);
btas.add(BillTypeAtomic.INWARD_SERVICE_BILL);
btas.add(BillTypeAtomic.INWARD_SERVICE_BILL_CANCELLATION);
btas.add(BillTypeAtomic.INWARD_SERVICE_BILL_REFUND);
return btas;
}

public List<BillTypeAtomic> getBillTypesAtomic(String query) {
return Arrays.stream(BillTypeAtomic.values())
Expand Down
38 changes: 20 additions & 18 deletions src/main/java/com/divudi/bean/common/ReportsController.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import java.text.SimpleDateFormat;
import java.util.stream.Collectors;
import java.text.DecimalFormat;

import org.apache.poi.xssf.usermodel.XSSFCellStyle;

/**
Expand Down Expand Up @@ -2650,7 +2651,7 @@ public void generateDebtorBalanceReport(final boolean onlyDueBills) {
}

public ReportTemplateRowBundle generateDebtorBalanceReportBills(List<BillTypeAtomic> bts, List<PaymentMethod> billPaymentMethods,
boolean onlyDueBills) {
boolean onlyDueBills) {
Map<String, Object> parameters = new HashMap<>();
String jpql = "SELECT new com.divudi.data.ReportTemplateRow(bill) "
+ "FROM Bill bill "
Expand Down Expand Up @@ -2765,7 +2766,7 @@ public ReportTemplateRowBundle generateReportBillItems(List<BillTypeAtomic> bts,
}

if (visitType != null && (visitType.equalsIgnoreCase("IP") && admissionType != null)) {
jpql += "AND bill.patientEncounter.admissionType = :type ";
jpql += "AND billItem.patientEncounter.admissionType = :type ";
parameters.put("type", admissionType);
}

Expand Down Expand Up @@ -3207,6 +3208,7 @@ public void externalLaboratoryWorkloadReport() {
opdBts.add(BillTypeAtomic.OPD_BILL_CANCELLATION);
opdBts.add(BillTypeAtomic.PACKAGE_OPD_BATCH_BILL_CANCELLATION);
opdBts.add(BillTypeAtomic.PACKAGE_OPD_BILL_CANCELLATION);
opdBts.add(BillTypeAtomic.OPD_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION);
}
if (visitType != null && visitType.equalsIgnoreCase("CC")) {
opdBts.add(BillTypeAtomic.CC_BILL);
Expand All @@ -3229,21 +3231,20 @@ public void externalLaboratoryWorkloadReport() {
private ReportTemplateRowBundle generateExternalLaboratoryWorkloadBillItems(List<BillTypeAtomic> bts) {
Map<String, Object> 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 ";
// 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 "
// + " AND bill.billTypeAtomic in :bts ";

jpql += "AND bill.billTypeAtomic in :bts ";
parameters.put("bts", bts);

if (visitType != null) {
Expand Down Expand Up @@ -3413,6 +3414,7 @@ private ReportTemplateRowBundle generateExternalLaboratoryWorkloadSummaryBillIte
System.out.println("parameters = " + parameters);

List<ReportTemplateRow> rs = (List<ReportTemplateRow>) paymentFacade.findLightsByJpql(jpql, parameters, TemporalType.TIMESTAMP);
rs.removeIf(row -> row.getRowValue() == 0.0);

ReportTemplateRowBundle b = new ReportTemplateRowBundle();
b.setReportTemplateRows(rs);
Expand Down Expand Up @@ -3593,7 +3595,7 @@ public void exportOpdAndInwardOPToPdf() {
table.setWidths(columnWidths);

String[] headers = {"S. No", "Invoice Date", "Invoice No", "Customer Reference No", "MRNO", "Patient Name",
"Gross Amt", "Disc Amt", "Net Amt", "Patient Share", "Sponsor Share", "Due Amt"};
"Gross Amt", "Disc Amt", "Net Amt", "Patient Share", "Sponsor Share", "Due Amt"};
for (String header : headers) {
PdfPCell cell = new PdfPCell(new Phrase(header, boldFont));
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
Expand Down Expand Up @@ -3816,7 +3818,7 @@ public void exportOpdAndInwardIPToPdf() {
table.setWidths(columnWidths);

String[] headers = {"S. No", "BHT No", "Invoice Date", "Invoice No", "Customer Reference No", "MRNO", "Patient Name",
"Gross Amt", "Disc Amt", "Net Amt", "Patient Share", "Sponsor Share", "Due Amt"};
"Gross Amt", "Disc Amt", "Net Amt", "Patient Share", "Sponsor Share", "Due Amt"};
for (String header : headers) {
PdfPCell cell = new PdfPCell(new Phrase(header, boldFont));
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
Expand Down Expand Up @@ -4858,8 +4860,8 @@ public void exportDetailedWeeklyOPDReportToPDF() {
}

private void addWeeklyReportSection(Document document, String sectionTitle, List<String> itemList,
List<Integer> daysOfWeek, Map<Integer, Map<String, Map<Integer, Double>>> weeklyDailyBillItemMap,
int week, com.itextpdf.text.Font headerFont, com.itextpdf.text.Font regularFont) throws DocumentException {
List<Integer> daysOfWeek, Map<Integer, Map<String, Map<Integer, Double>>> weeklyDailyBillItemMap,
int week, com.itextpdf.text.Font headerFont, com.itextpdf.text.Font regularFont) throws DocumentException {
document.add(new com.itextpdf.text.Paragraph(sectionTitle, headerFont));
document.add(com.itextpdf.text.Chunk.NEWLINE);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
package com.divudi.bean.common.analytics;

import com.divudi.entity.analytics.AggregatedRecord;
import com.divudi.facade.AggregatedRecordFacade;
import com.divudi.service.AggregatedRecordService;
import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
import java.io.Serializable;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;

/**
*
* @author Dr M H B Ariyaratne [email protected]
*
*/
@Named
@SessionScoped
public class AggregatedRecordController implements Serializable {

private static final long serialVersionUID = 1L;

// <editor-fold defaultstate="collapsed" desc="EJB">
@EJB
private AggregatedRecordFacade ejbFacade;
AggregatedRecordService aggregatedRecordService;
// </editor-fold>

// <editor-fold defaultstate="collapsed" desc="Class Variables">
private AggregatedRecord current;
private List<AggregatedRecord> items;
// </editor-fold>

// <editor-fold defaultstate="collapsed" desc="Constructors">
public AggregatedRecordController() {
}
// </editor-fold>

// <editor-fold defaultstate="collapsed" desc="Getters and Setters">
public AggregatedRecord getCurrent() {
if (current == null) {
current = new AggregatedRecord();
}
return current;
}

public void setCurrent(AggregatedRecord current) {
this.current = current;
}

public List<AggregatedRecord> getItems() {
if (items == null) {
items = getFacade().findAll();
}
return items;
}

public void setItems(List<AggregatedRecord> items) {
this.items = items;
}

private AggregatedRecordFacade getFacade() {
return ejbFacade;
}
// </editor-fold>

// <editor-fold defaultstate="collapsed" desc="Inner Classes">
@FacesConverter(forClass = AggregatedRecord.class)
public static class AggregatedRecordConverter implements Converter {

@Override
public Object getAsObject(FacesContext facesContext, UIComponent component, String value) {
if (value == null || value.length() == 0) {
return null;
}
AggregatedRecordController controller = (AggregatedRecordController) facesContext.getApplication().getELResolver().
getValue(facesContext.getELContext(), null, "aggregatedRecordController");
return controller.getFacade().find(getKey(value));
}

java.lang.Long getKey(String value) {
return Long.valueOf(value);
}

String getStringKey(java.lang.Long value) {
return value.toString();
}

@Override
public String getAsString(FacesContext facesContext, UIComponent component, Object object) {
if (object == null) {
return null;
}
if (object instanceof AggregatedRecord) {
AggregatedRecord o = (AggregatedRecord) object;
return getStringKey(o.getId());
} else {
throw new IllegalArgumentException("object " + object + " is of type "
+ object.getClass().getName() + "; expected type: " + AggregatedRecord.class.getName());
}
}
}
// </editor-fold>
}
Loading

0 comments on commit a675806

Please sign in to comment.