update summrylist dan ujicoba lost memori

This commit is contained in:
ridwan 2025-12-02 12:41:06 +07:00
parent c43e7f389c
commit c8d1d80555
3 changed files with 652 additions and 434 deletions

View File

@ -18,7 +18,6 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
@ -63,9 +62,14 @@ public class ReportingController {
public void exportLabelGiziTest(@PathVariable("noregistrasi") String noregistrasi, public void exportLabelGiziTest(@PathVariable("noregistrasi") String noregistrasi,
@RequestParam(value = "jnsdiet", required = false) String jnsdiet, @RequestParam(value = "jnsdiet", required = false) String jnsdiet,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfLabelGizi(noregistrasi, jnsdiet); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.exportPdfLabelGizi(noregistrasi, jnsdiet);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
} finally {
jasperPrint = null; // Membebaskan memori setelah penggunaan
}
} }
@RequestMapping(value = {"/permintaan-makanan"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/permintaan-makanan"}, method = {RequestMethod.GET})
@ -73,9 +77,14 @@ public class ReportingController {
@RequestParam("tglAwal") String tglAwal, @RequestParam("tglAwal") String tglAwal,
@RequestParam("tglAkhir") String tglAkhir, @RequestParam("tglAkhir") String tglAkhir,
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfPermintaanMakanan(idRu, tglAwal, tglAkhir); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.exportPdfPermintaanMakanan(idRu, tglAwal, tglAkhir);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
} finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/rekap-makanan"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/rekap-makanan"}, method = {RequestMethod.GET})
@ -83,17 +92,27 @@ public class ReportingController {
@RequestParam("tglAwal") String tglAwal, @RequestParam("tglAwal") String tglAwal,
@RequestParam("tglAkhir") String tglAkhir, @RequestParam("tglAkhir") String tglAkhir,
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfRekapMakanan(idRu, tglAwal, tglAkhir); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.exportPdfRekapMakanan(idRu, tglAwal, tglAkhir);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/kartu-pasien/{nocm}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/kartu-pasien/{nocm}"}, method = {RequestMethod.GET})
public void exportKartuPasien(@PathVariable("nocm") String nocm, public void exportKartuPasien(@PathVariable("nocm") String nocm,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.printReportKartuPasien(nocm); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.printReportKartuPasien(nocm);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/resep-dokter"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/resep-dokter"}, method = {RequestMethod.GET})
@ -111,25 +130,40 @@ public class ReportingController {
@RequestMapping(value = {"/resep-pasien/{strukOrder}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/resep-pasien/{strukOrder}"}, method = {RequestMethod.GET})
public void exportResepPasien(@PathVariable("strukOrder") String strukOrder, public void exportResepPasien(@PathVariable("strukOrder") String strukOrder,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.resepService.exportPdfResepPasien(strukOrder); JasperPrint jasperPrint = null;
try {
jasperPrint = this.resepService.exportPdfResepPasien(strukOrder);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/lap-bedah"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-bedah"}, method = {RequestMethod.GET})
public void exportLapBedahPasien(@RequestParam("noregis") String noregis, public void exportLapBedahPasien(@RequestParam("noregis") String noregis,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.printReportLapBedah(noregis); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.printReportLapBedah(noregis);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/lap-konsul/{noorder}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-konsul/{noorder}"}, method = {RequestMethod.GET})
public void exportKonsulPasien(@PathVariable("noorder") String noorder, public void exportKonsulPasien(@PathVariable("noorder") String noorder,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.printReportKonsul(noorder); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.printReportKonsul(noorder);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/lap-lab/{noorder}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-lab/{noorder}"}, method = {RequestMethod.GET})
@ -163,28 +197,43 @@ public class ReportingController {
@RequestMapping(value = {"/lap-upk/{nores}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-upk/{nores}"}, method = {RequestMethod.GET})
public void exportUpk(@PathVariable("nores") String nores, public void exportUpk(@PathVariable("nores") String nores,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.printReportUpk(nores); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.printReportUpk(nores);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/lap-verifikasi-tagihan-supplier/{noverifikasifk}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-verifikasi-tagihan-supplier/{noverifikasifk}"}, method = {RequestMethod.GET})
public void exportVerifikasiTagihanSupplier( public void exportVerifikasiTagihanSupplier(
@PathVariable("noverifikasifk") String noverifikasifk, ModelAndView mv, @PathVariable("noverifikasifk") String noverifikasifk, ModelAndView mv,
HttpServletResponse response, HttpServletRequest req) throws Exception { HttpServletResponse response, HttpServletRequest req) throws Exception {
JasperPrint jasperPrint = this.verifikasiTagihanSupplierServices.generateVerifikasiTagihanPdf(noverifikasifk); JasperPrint jasperPrint = null;
try {
jasperPrint = this.verifikasiTagihanSupplierServices.generateVerifikasiTagihanPdf(noverifikasifk);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/lap-verifikasi-pembayaran-umum/{noverifikasifk}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-verifikasi-pembayaran-umum/{noverifikasifk}"}, method = {RequestMethod.GET})
public void exportVerifikasiPembayaranUmum( public void exportVerifikasiPembayaranUmum(
@PathVariable("noverifikasifk") String noverifikasifk, ModelAndView mv, @PathVariable("noverifikasifk") String noverifikasifk, ModelAndView mv,
HttpServletResponse response, HttpServletRequest req) throws Exception { HttpServletResponse response, HttpServletRequest req) throws Exception {
JasperPrint jasperPrint = this.verifikasiTagihanSupplierServices JasperPrint jasperPrint = null;
try {
jasperPrint = this.verifikasiTagihanSupplierServices
.generateVerifikasiPembayaranUmumPdf(noverifikasifk); .generateVerifikasiPembayaranUmumPdf(noverifikasifk);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/lap-rekap-harian-by-dept/{deptId}/{tglAwal}/{tglAkhir}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-rekap-harian-by-dept/{deptId}/{tglAwal}/{tglAkhir}"}, method = {RequestMethod.GET})
@ -192,9 +241,14 @@ public class ReportingController {
@PathVariable("tglAwal") String tglAwal, @PathVariable("tglAwal") String tglAwal,
@PathVariable("tglAkhir") String tglAkhir, ModelAndView mv, @PathVariable("tglAkhir") String tglAkhir, ModelAndView mv,
HttpServletResponse response, HttpServletRequest req) throws Exception { HttpServletResponse response, HttpServletRequest req) throws Exception {
JasperPrint jasperPrint = this.reportingService.printPdfLapRekapHarianByDept(deptId, tglAwal, tglAkhir); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.printPdfLapRekapHarianByDept(deptId, tglAwal, tglAkhir);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/lap-rekap-harian-by-ruangan/{deptId}/{ruangId}/{tglAwal}/{tglAkhir}"}, @RequestMapping(value = {"/lap-rekap-harian-by-ruangan/{deptId}/{ruangId}/{tglAwal}/{tglAkhir}"},
@ -204,18 +258,28 @@ public class ReportingController {
@PathVariable("tglAwal") String tglAwal, @PathVariable("tglAwal") String tglAwal,
@PathVariable("tglAkhir") String tglAkhir, ModelAndView mv, @PathVariable("tglAkhir") String tglAkhir, ModelAndView mv,
HttpServletResponse response, HttpServletRequest req) throws Exception { HttpServletResponse response, HttpServletRequest req) throws Exception {
JasperPrint jasperPrint = this.reportingService JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService
.printPdfLapRekapHarianByRuanganId(deptId, ruangId, tglAwal, tglAkhir); .printPdfLapRekapHarianByRuanganId(deptId, ruangId, tglAwal, tglAkhir);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/lap-pengkajian-awal-by-nores/{nores}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-pengkajian-awal-by-nores/{nores}"}, method = {RequestMethod.GET})
public void exportPengkajianAwalbyNoRes(@PathVariable("nores") String nores, ModelAndView mv, public void exportPengkajianAwalbyNoRes(@PathVariable("nores") String nores, ModelAndView mv,
HttpServletRequest req, HttpServletResponse response) throws Exception { HttpServletRequest req, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.printPdfPengkajianAwalByNoRes(nores); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.printPdfPengkajianAwalByNoRes(nores);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/lap-rekap-penjamin"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-rekap-penjamin"}, method = {RequestMethod.GET})
@ -224,10 +288,15 @@ public class ReportingController {
@RequestParam("idDept") int idDept, @RequestParam("idDept") int idDept,
@RequestParam("kelompokPasien") int kelompokPasien, ModelAndView mv, @RequestParam("kelompokPasien") int kelompokPasien, ModelAndView mv,
HttpServletRequest req, HttpServletResponse response) throws Exception { HttpServletRequest req, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService
.printPdfRekapPenjamin(tglAwal, tglAkhir, idDept, kelompokPasien); .printPdfRekapPenjamin(tglAwal, tglAkhir, idDept, kelompokPasien);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/lap-rekap-penjamin-by-institusi"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-rekap-penjamin-by-institusi"}, method = {RequestMethod.GET})
@ -236,10 +305,15 @@ public class ReportingController {
@RequestParam("idDept") int idDept, @RequestParam("kelompokPasien") int kelompokPasien, @RequestParam("idDept") int idDept, @RequestParam("kelompokPasien") int kelompokPasien,
@RequestParam("institusiPasien") int institusiPasien, ModelAndView mv, @RequestParam("institusiPasien") int institusiPasien, ModelAndView mv,
HttpServletRequest req, HttpServletResponse response) throws Exception { HttpServletRequest req, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService
.printPdfRekapPenjaminByInstitusiPasien(tglAwal, tglAkhir, idDept, kelompokPasien, institusiPasien); .printPdfRekapPenjaminByInstitusiPasien(tglAwal, tglAkhir, idDept, kelompokPasien, institusiPasien);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/lap-rekap-penjamin-by-ranap"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-rekap-penjamin-by-ranap"}, method = {RequestMethod.GET})
@ -248,10 +322,15 @@ public class ReportingController {
@RequestParam("idDept") int idDept, @RequestParam("idDept") int idDept,
@RequestParam("kelompokPasien") int kelompokPasien, ModelAndView mv, @RequestParam("kelompokPasien") int kelompokPasien, ModelAndView mv,
HttpServletRequest req, HttpServletResponse response) throws Exception { HttpServletRequest req, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService
.printPdfRekapPenjaminByRanap(tglAwal, tglAkhir, idDept, kelompokPasien); .printPdfRekapPenjaminByRanap(tglAwal, tglAkhir, idDept, kelompokPasien);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/lap-permintaan-makanan"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-permintaan-makanan"}, method = {RequestMethod.GET})
@ -261,9 +340,14 @@ public class ReportingController {
@RequestParam("tglLayanan") String tglLayanan, @RequestParam("tglLayanan") String tglLayanan,
@RequestParam(value = "jenisDiet", required = false, defaultValue = "") String jenisDiet, ModelAndView mv, @RequestParam(value = "jenisDiet", required = false, defaultValue = "") String jenisDiet, ModelAndView mv,
HttpServletRequest req, HttpServletResponse response) throws Exception { HttpServletRequest req, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.printPdfPermintaanMakanan(idRu, tglAwal, tglAkhir, jenisDiet, tglLayanan); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.printPdfPermintaanMakanan(idRu, tglAwal, tglAkhir, jenisDiet, tglLayanan);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/lap-rekap-makanan"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-rekap-makanan"}, method = {RequestMethod.GET})
@ -271,9 +355,14 @@ public class ReportingController {
@RequestParam("tglAwal") String tglAwal, @RequestParam("tglAwal") String tglAwal,
@RequestParam("tglAkhir") String tglAkhir, ModelAndView mv, @RequestParam("tglAkhir") String tglAkhir, ModelAndView mv,
HttpServletRequest req, HttpServletResponse response) throws Exception { HttpServletRequest req, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.printPdfRekapMakanan(idRu, tglAwal, tglAkhir); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.printPdfRekapMakanan(idRu, tglAwal, tglAkhir);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/gelang-pasien/{noregistrasi}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/gelang-pasien/{noregistrasi}"}, method = {RequestMethod.GET})
@ -299,25 +388,33 @@ public class ReportingController {
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
} }
/*
@RequestMapping(value = {"/summary-list/{nocm}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/summary-list/{nocm}"}, method = {RequestMethod.GET})
public void exportSummaryList(@PathVariable("nocm") String nocm, public void exportSummaryList(@PathVariable("nocm") String nocm,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfSummaryList(nocm); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.exportPdfSummaryList(nocm);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
*/
@RequestMapping(value = {"/lap-amprahan-tindakan"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-amprahan-tindakan"}, method = {RequestMethod.GET})
public void exportAmprahanTindakan(@RequestParam("idRu") int idRu, public void exportAmprahanTindakan(@RequestParam("idRu") int idRu,
@RequestParam("tglAwal") String tglAwal, @RequestParam("tglAwal") String tglAwal,
@RequestParam("tglAkhir") String tglAkhir, ModelAndView mv, @RequestParam("tglAkhir") String tglAkhir, ModelAndView mv,
HttpServletRequest req, HttpServletResponse response) throws Exception { HttpServletRequest req, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.printPdfAmprahanTindakan(idRu, tglAwal, tglAkhir); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.printPdfAmprahanTindakan(idRu, tglAwal, tglAkhir);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/kwitansi/{noregistrasi}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/kwitansi/{noregistrasi}"}, method = {RequestMethod.GET})
@ -326,51 +423,81 @@ public class ReportingController {
@RequestParam(value = "nama_pt", required = false) String nama_pt, @RequestParam(value = "nama_pt", required = false) String nama_pt,
@RequestParam(value = "kasir", required = false) String kasir, @RequestParam(value = "kasir", required = false) String kasir,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfKwitansi(noregistrasi, jeniskwitansi, nama_pt, kasir); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.exportPdfKwitansi(noregistrasi, jeniskwitansi, nama_pt, kasir);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/usulan/{norec}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/usulan/{norec}"}, method = {RequestMethod.GET})
public void exportMonitoringUsulan(@PathVariable("norec") String norec, public void exportMonitoringUsulan(@PathVariable("norec") String norec,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfMonitoringUsulan(norec); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.exportPdfMonitoringUsulan(norec);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/sppb/{norec}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/sppb/{norec}"}, method = {RequestMethod.GET})
public void exportSppb(@PathVariable("norec") String norec, public void exportSppb(@PathVariable("norec") String norec,
@RequestParam(value = "jnsbrg", required = false) String jnsbrg, @RequestParam(value = "jnsbrg", required = false) String jnsbrg,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfSppb(norec, jnsbrg); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.exportPdfSppb(norec, jnsbrg);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/bukti-layanan-farmasi/{norec}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/bukti-layanan-farmasi/{norec}"}, method = {RequestMethod.GET})
public void exportPdfBuktiLayanan(@PathVariable("norec") String norec, public void exportPdfBuktiLayanan(@PathVariable("norec") String norec,
@RequestParam(value = "user", required = false, defaultValue = "") String user, @RequestParam(value = "user", required = false, defaultValue = "") String user,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfBuktiLayanan(norec, user); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.exportPdfBuktiLayanan(norec, user);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/bukti-nonlayanan-farmasi/{norec}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/bukti-nonlayanan-farmasi/{norec}"}, method = {RequestMethod.GET})
public void exportPdfBuktiNoLayanFarmasi(@PathVariable("norec") String norec, public void exportPdfBuktiNoLayanFarmasi(@PathVariable("norec") String norec,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfBuktiNoLayanFarmasi(norec); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.exportPdfBuktiNoLayanFarmasi(norec);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/label-farmasi/{norec}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/label-farmasi/{norec}"}, method = {RequestMethod.GET})
public void exportPdfLabelFarmasi(@PathVariable("norec") String norec, public void exportPdfLabelFarmasi(@PathVariable("norec") String norec,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfLabelFarmasi(norec); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.exportPdfLabelFarmasi(norec);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/lap-tindakan"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-tindakan"}, method = {RequestMethod.GET})
@ -383,34 +510,52 @@ public class ReportingController {
@RequestParam(value = "statusprodukid", required = false, defaultValue = "") Integer statusprodukid, @RequestParam(value = "statusprodukid", required = false, defaultValue = "") Integer statusprodukid,
ModelAndView mv, ModelAndView mv,
HttpServletRequest req, HttpServletResponse response) throws Exception { HttpServletRequest req, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService JasperPrint jasperPrint = null;
.printPdfLaporanTindakan(ruanganid, instalasiid, kelasid, unitid, produkid, statusprodukid); try {
jasperPrint = this.reportingService.printPdfLaporanTindakan(ruanganid, instalasiid, kelasid, unitid, produkid, statusprodukid);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/dashboard-kamar"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/dashboard-kamar"}, method = {RequestMethod.GET})
public void exportPdfDKamar(ModelAndView mv, HttpServletResponse response) throws Exception { public void exportPdfDKamar(ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfDKamar(); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.exportPdfDKamar();
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/label-farmasi-nonlayanan/{norec}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/label-farmasi-nonlayanan/{norec}"}, method = {RequestMethod.GET})
public void exportPdfLabelFarmasiNo(@PathVariable("norec") String norec, public void exportPdfLabelFarmasiNo(@PathVariable("norec") String norec,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfLabelFarmasiNo(norec); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.exportPdfLabelFarmasiNo(norec);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/usulan-permintaan-barang-dan-jasa/{norec}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/usulan-permintaan-barang-dan-jasa/{norec}"}, method = {RequestMethod.GET})
public void exportPdfUsulanPermintaanBdJ(@PathVariable("norec") String norec, public void exportPdfUsulanPermintaanBdJ(@PathVariable("norec") String norec,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfUsulanPermintaanBdJ(norec); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.exportPdfUsulanPermintaanBdJ(norec);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/triase-igd/{norec}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/triase-igd/{norec}"}, method = {RequestMethod.GET})
@ -488,9 +633,14 @@ public class ReportingController {
public void exportPdfKwitansiCollectingPiutang(@PathVariable("noposting") String norec, public void exportPdfKwitansiCollectingPiutang(@PathVariable("noposting") String norec,
@RequestParam(value = "PrintBy", required = false, defaultValue = "") String PrintBy, @RequestParam(value = "PrintBy", required = false, defaultValue = "") String PrintBy,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfKwitansiCollectingPiutang(norec, PrintBy); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.exportPdfKwitansiCollectingPiutang(norec, PrintBy);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
}finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/lap-pasien-pulang"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/lap-pasien-pulang"}, method = {RequestMethod.GET})
@ -665,9 +815,10 @@ public class ReportingController {
@RequestParam(value = "mode", required = false, defaultValue = "download") String mode, @RequestParam(value = "mode", required = false, defaultValue = "download") String mode,
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy, @RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
try {
// Generate report (common for both PDF/Excel) // Generate report (common for both PDF/Excel)
JasperPrint jasperPrint = this.reportingService.exportVisit(tglAwal, tglAkhir, idDokter, idRuangan, printBy); jasperPrint = this.reportingService.exportVisit(tglAwal, tglAkhir, idDokter, idRuangan, printBy);
if ("excel".equalsIgnoreCase(format)) { if ("excel".equalsIgnoreCase(format)) {
// Handle Excel export // Handle Excel export
@ -696,6 +847,10 @@ public class ReportingController {
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream())); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
exporter.exportReport(); exporter.exportReport();
} }
} finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/waktu-rawat-jalan"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/waktu-rawat-jalan"}, method = {RequestMethod.GET})
@ -708,9 +863,11 @@ public class ReportingController {
@RequestParam(value = "mode", required = false, defaultValue = "download") String mode, @RequestParam(value = "mode", required = false, defaultValue = "download") String mode,
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy, @RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
try {
// Generate report (common for both PDF/Excel) // Generate report (common for both PDF/Excel)
JasperPrint jasperPrint = this.reportingService.exportWaktuRawatJalan(tglAwal, tglAkhir, idDokter, idRuangan, printBy); jasperPrint = this.reportingService.exportWaktuRawatJalan(tglAwal, tglAkhir, idDokter, idRuangan, printBy);
if ("excel".equalsIgnoreCase(format)) { if ("excel".equalsIgnoreCase(format)) {
// Handle Excel export // Handle Excel export
@ -739,6 +896,9 @@ public class ReportingController {
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream())); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
exporter.exportReport(); exporter.exportReport();
} }
} finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/waktu-rawat-jalan-trb"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/waktu-rawat-jalan-trb"}, method = {RequestMethod.GET})
@ -752,8 +912,11 @@ public class ReportingController {
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy, @RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
try {
// Generate report (common for both PDF/Excel) // Generate report (common for both PDF/Excel)
JasperPrint jasperPrint = this.reportingService.exportWaktuRawatJalanTRB(tglAwal, tglAkhir, idDokter, idRuangan, printBy); jasperPrint = this.reportingService.exportWaktuRawatJalanTRB(tglAwal, tglAkhir, idDokter, idRuangan, printBy);
if ("excel".equalsIgnoreCase(format)) { if ("excel".equalsIgnoreCase(format)) {
// Handle Excel export // Handle Excel export
@ -782,6 +945,9 @@ public class ReportingController {
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream())); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
exporter.exportReport(); exporter.exportReport();
} }
} finally {
jasperPrint = null;
}
} }
@ -797,8 +963,10 @@ public class ReportingController {
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy, @RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
try {
// Generate report (common for both PDF/Excel) // Generate report (common for both PDF/Excel)
JasperPrint jasperPrint = this.reportingService.exportKunjunganPasien(tglAwal, tglAkhir, idInstalasi, idUnit, idRuangan, printBy); jasperPrint = this.reportingService.exportKunjunganPasien(tglAwal, tglAkhir, idInstalasi, idUnit, idRuangan, printBy);
if ("excel".equalsIgnoreCase(format)) { if ("excel".equalsIgnoreCase(format)) {
// Handle Excel export // Handle Excel export
@ -827,6 +995,9 @@ public class ReportingController {
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream())); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
exporter.exportReport(); exporter.exportReport();
} }
} finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/laporan-pendaftaran-online"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/laporan-pendaftaran-online"}, method = {RequestMethod.GET})
@ -840,8 +1011,10 @@ public class ReportingController {
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy, @RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
try {
// Generate report (common for both PDF/Excel) // Generate report (common for both PDF/Excel)
JasperPrint jasperPrint = this.reportingService.exportLpPendaftaranOnline(tglAwal, tglAkhir, idUnit, idRuangan, printBy); jasperPrint = this.reportingService.exportLpPendaftaranOnline(tglAwal, tglAkhir, idUnit, idRuangan, printBy);
if ("excel".equalsIgnoreCase(format)) { if ("excel".equalsIgnoreCase(format)) {
// Handle Excel export // Handle Excel export
@ -870,6 +1043,9 @@ public class ReportingController {
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream())); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
exporter.exportReport(); exporter.exportReport();
} }
} finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/laporan-volume-tindakan"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/laporan-volume-tindakan"}, method = {RequestMethod.GET})
@ -887,8 +1063,10 @@ public class ReportingController {
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy, @RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
try {
// Generate report (common for both PDF/Excel) // Generate report (common for both PDF/Excel)
JasperPrint jasperPrint = this.reportingService.exportLpVolumeTindakan(tglAwal, tglAkhir, idInstalasi, idUnit, idRuangan, idProduk, idDokter, idKp, printBy); jasperPrint = this.reportingService.exportLpVolumeTindakan(tglAwal, tglAkhir, idInstalasi, idUnit, idRuangan, idProduk, idDokter, idKp, printBy);
if ("excel".equalsIgnoreCase(format)) { if ("excel".equalsIgnoreCase(format)) {
// Handle Excel export // Handle Excel export
@ -917,6 +1095,9 @@ public class ReportingController {
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream())); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
exporter.exportReport(); exporter.exportReport();
} }
} finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/laporan-resume-medis"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/laporan-resume-medis"}, method = {RequestMethod.GET})
@ -932,8 +1113,10 @@ public class ReportingController {
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy, @RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
try {
// Generate report (common for both PDF/Excel) // Generate report (common for both PDF/Excel)
JasperPrint jasperPrint = this.reportingService.exportLpResumeMedis(tglAwal, tglAkhir, idInstalasi, idUnit, idRuangan, idDokter, printBy); jasperPrint = this.reportingService.exportLpResumeMedis(tglAwal, tglAkhir, idInstalasi, idUnit, idRuangan, idDokter, printBy);
if ("excel".equalsIgnoreCase(format)) { if ("excel".equalsIgnoreCase(format)) {
// Handle Excel export // Handle Excel export
@ -962,6 +1145,9 @@ public class ReportingController {
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream())); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
exporter.exportReport(); exporter.exportReport();
} }
} finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/laporan-pasien-satusehat"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/laporan-pasien-satusehat"}, method = {RequestMethod.GET})
@ -977,8 +1163,10 @@ public class ReportingController {
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy, @RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
try {
// Generate report (common for both PDF/Excel) // Generate report (common for both PDF/Excel)
JasperPrint jasperPrint = this.reportingService.exportLpSatuSehat(tglAwal, tglAkhir, idInstalasi, idUnit, idRuangan, idDokter, printBy); jasperPrint = this.reportingService.exportLpSatuSehat(tglAwal, tglAkhir, idInstalasi, idUnit, idRuangan, idDokter, printBy);
if ("excel".equalsIgnoreCase(format)) { if ("excel".equalsIgnoreCase(format)) {
// Handle Excel export // Handle Excel export
@ -1007,6 +1195,9 @@ public class ReportingController {
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream())); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
exporter.exportReport(); exporter.exportReport();
} }
} finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/daftar-tarif-ruangan"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/daftar-tarif-ruangan"}, method = {RequestMethod.GET})
@ -1019,8 +1210,10 @@ public class ReportingController {
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy, @RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
try {
// Generate report (common for both PDF/Excel) // Generate report (common for both PDF/Excel)
JasperPrint jasperPrint = this.reportingService.exportLpTarif(idInstalasi, idProduk, idTarif, printBy); jasperPrint = this.reportingService.exportLpTarif(idInstalasi, idProduk, idTarif, printBy);
if ("excel".equalsIgnoreCase(format)) { if ("excel".equalsIgnoreCase(format)) {
// Handle Excel export // Handle Excel export
@ -1049,6 +1242,9 @@ public class ReportingController {
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream())); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
exporter.exportReport(); exporter.exportReport();
} }
} finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/laporan-rekap-tindakan"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/laporan-rekap-tindakan"}, method = {RequestMethod.GET})
@ -1064,8 +1260,10 @@ public class ReportingController {
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy, @RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
try {
// Generate report (common for both PDF/Excel) // Generate report (common for both PDF/Excel)
JasperPrint jasperPrint = this.reportingService.exportLpRekapTidakan(tglAwal, tglAkhir, idUnit, idDokter, idKp, idProduk, printBy); jasperPrint = this.reportingService.exportLpRekapTidakan(tglAwal, tglAkhir, idUnit, idDokter, idKp, idProduk, printBy);
if ("excel".equalsIgnoreCase(format)) { if ("excel".equalsIgnoreCase(format)) {
// Handle Excel export // Handle Excel export
@ -1094,15 +1292,23 @@ public class ReportingController {
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream())); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
exporter.exportReport(); exporter.exportReport();
} }
} finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/smpk/{smpk}"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/smpk/{smpk}"}, method = {RequestMethod.GET})
public void exportPdfSMPK(@PathVariable("smpk") Integer smpk, public void exportPdfSMPK(@PathVariable("smpk") Integer smpk,
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy, @RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
ModelAndView mv, HttpServletResponse response) throws Exception { ModelAndView mv, HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = this.reportingService.exportPdfSMPK(smpk,printBy); JasperPrint jasperPrint = null;
try {
jasperPrint = this.reportingService.exportPdfSMPK(smpk, printBy);
response.setContentType("application/pdf"); response.setContentType("application/pdf");
JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream()); JasperExportManager.exportReportToPdfStream(jasperPrint, response.getOutputStream());
} finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/rekap-logbook"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/rekap-logbook"}, method = {RequestMethod.GET})
@ -1116,8 +1322,10 @@ public class ReportingController {
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy, @RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
try {
// Generate report (common for both PDF/Excel) // Generate report (common for both PDF/Excel)
JasperPrint jasperPrint = this.reportingService.exportPdfRekapLogbook(tahun, bulan, ksm_id, pegawai_id, printBy); jasperPrint = this.reportingService.exportPdfRekapLogbook(tahun, bulan, ksm_id, pegawai_id, printBy);
if ("excel".equalsIgnoreCase(format)) { if ("excel".equalsIgnoreCase(format)) {
// Handle Excel export // Handle Excel export
@ -1146,6 +1354,9 @@ public class ReportingController {
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream())); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
exporter.exportReport(); exporter.exportReport();
} }
} finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/daftar-order-radiologi"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/daftar-order-radiologi"}, method = {RequestMethod.GET})
@ -1157,8 +1368,10 @@ public class ReportingController {
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy, @RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
try {
// Generate report (common for both PDF/Excel) // Generate report (common for both PDF/Excel)
JasperPrint jasperPrint = this.reportingService.exportDOrderRadiologi(tglAwal, tglAkhir, printBy); jasperPrint = this.reportingService.exportDOrderRadiologi(tglAwal, tglAkhir, printBy);
if ("excel".equalsIgnoreCase(format)) { if ("excel".equalsIgnoreCase(format)) {
// Handle Excel export // Handle Excel export
@ -1187,6 +1400,10 @@ public class ReportingController {
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream())); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
exporter.exportReport(); exporter.exportReport();
} }
} finally {
jasperPrint = null;
}
} }
@RequestMapping(value = {"/laporan-pendapatan-poli"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/laporan-pendapatan-poli"}, method = {RequestMethod.GET})
@ -1202,8 +1419,10 @@ public class ReportingController {
@RequestParam(value = "printBy", required = false, defaultValue = "") String printBy, @RequestParam(value = "printBy", required = false, defaultValue = "") String printBy,
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
JasperPrint jasperPrint = null;
try {
// Generate report (common for both PDF/Excel) // Generate report (common for both PDF/Excel)
JasperPrint jasperPrint = this.reportingService.exportLpPendapatanPoli(tglAwal, tglAkhir, IdDepartemen, IdRuangan, IdKelompokPasien, IdDokter, printBy); jasperPrint = this.reportingService.exportLpPendapatanPoli(tglAwal, tglAkhir, IdDepartemen, IdRuangan, IdKelompokPasien, IdDokter, printBy);
if ("excel".equalsIgnoreCase(format)) { if ("excel".equalsIgnoreCase(format)) {
// Handle Excel export // Handle Excel export
@ -1232,6 +1451,9 @@ public class ReportingController {
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream())); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(response.getOutputStream()));
exporter.exportReport(); exporter.exportReport();
} }
} finally {
jasperPrint = null;
}
} }
} }

View File

@ -422,7 +422,6 @@ public class ReportingDao {
} }
return null; return null;
} }
/*
public JasperPrint exportPdfSummaryList(String nocm) { public JasperPrint exportPdfSummaryList(String nocm) {
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) { try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {
@ -437,7 +436,6 @@ public class ReportingDao {
} }
return null; return null;
} }
*/
public JasperPrint exportPdfAmprahanTindakan(int idRu, Date tglAwal, Date tglAkhir) { public JasperPrint exportPdfAmprahanTindakan(int idRu, Date tglAwal, Date tglAkhir) {
try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) { try (Connection conn = this.jdbcTemplate1.getDataSource().getConnection()) {

View File

@ -145,13 +145,11 @@ public class ReportingService {
log.info("Starting exportPdfResumeMedis with norec: {}", norec); log.info("Starting exportPdfResumeMedis with norec: {}", norec);
return this.reportingDao.exportPdfResumeMedis(norec); return this.reportingDao.exportPdfResumeMedis(norec);
} }
/*
public JasperPrint exportPdfSummaryList(String nocm) { public JasperPrint exportPdfSummaryList(String nocm) {
log.info("Starting exportPdfSummaryList with nocm: {}", nocm); log.info("Starting exportPdfSummaryList with nocm: {}", nocm);
return this.reportingDao.exportPdfSummaryList(nocm); return this.reportingDao.exportPdfSummaryList(nocm);
} }
*/
public JasperPrint printPdfAmprahanTindakan(int idRu, String tglAwal, String tglAkhir) { public JasperPrint printPdfAmprahanTindakan(int idRu, String tglAwal, String tglAkhir) {
log.info("Starting printPdfAmprahanTindakan with idRu: {}, tglAwal: {}, tglAkhir: {}", idRu, tglAwal, tglAkhir); log.info("Starting printPdfAmprahanTindakan with idRu: {}, tglAwal: {}, tglAkhir: {}", idRu, tglAwal, tglAkhir);