Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10402 external laboratory workload report #10617

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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