Skip to content

Commit

Permalink
10402 external laboratory workload report (#10617)
Browse files Browse the repository at this point in the history
* external laboratory workload report issue fix

* External Laboratory workload report fix

---------

Co-authored-by: imexh <[email protected]>
  • Loading branch information
ImeshRanawellaSG and imexh authored Feb 18, 2025
1 parent d36f1c7 commit bea77b7
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 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 @@ -3247,9 +3248,12 @@ private ReportTemplateRowBundle generateExternalLaboratoryWorkloadBillItems(List
parameters.put("bts", bts);

if (visitType != null) {
if (visitType.equalsIgnoreCase("IP") || visitType.equalsIgnoreCase("OP") || visitType.equalsIgnoreCase("CC")) {
if (visitType.equalsIgnoreCase("IP") || visitType.equalsIgnoreCase("CC")) {
jpql += "AND bill.ipOpOrCc = :type ";
parameters.put("type", visitType);
} else if (visitType.equalsIgnoreCase("OP")) {
jpql += "AND (bill.ipOpOrCc = :type OR bill.ipOpOrCc IS NULL) ";
parameters.put("type", visitType);
}
}

Expand Down Expand Up @@ -3343,9 +3347,12 @@ private ReportTemplateRowBundle generateExternalLaboratoryWorkloadSummaryBillIte
+ "AND bill.createdAt BETWEEN :fd AND :td ";

if (visitType != null) {
if (visitType.equalsIgnoreCase("IP") || visitType.equalsIgnoreCase("OP") || visitType.equalsIgnoreCase("CC")) {
if (visitType.equalsIgnoreCase("IP") || visitType.equalsIgnoreCase("CC")) {
jpql += "AND bill.ipOpOrCc = :type ";
parameters.put("type", visitType);
} else if (visitType.equalsIgnoreCase("OP")) {
jpql += "AND (bill.ipOpOrCc = :type OR bill.ipOpOrCc IS NULL) ";
parameters.put("type", visitType);
}
}

Expand Down Expand Up @@ -3594,7 +3601,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 @@ -3817,7 +3824,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 @@ -4859,8 +4866,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

0 comments on commit bea77b7

Please sign in to comment.