| | |
| | | private LtkjHysqdService ltkjHysqdService; |
| | | @Autowired |
| | | private LtkjGetexamreportinfoService ltkjGetexamreportinfoService; |
| | | @Value("${path.filePath}") |
| | | private String value; |
| | | // @Value("${path.filePath}") |
| | | // private String value; |
| | | @Value("${path.reportServer}") |
| | | private String urlValue; |
| | | @Autowired |
| | |
| | | private TjOrderYcxmService ycxmService; |
| | | @Resource |
| | | private TjXdtgmdjgService xdtgmdjgService; |
| | | @Autowired |
| | | private TjReportSpecialProjectService tjReportSpecialProjectService; |
| | | |
| | | private Integer pdfPage = 0; |
| | | |
| | |
| | | String s2 = sysConfigService.selectConfigByKey("tjreport_font_size_second_page_title"); |
| | | String s3 = sysConfigService.selectConfigByKey("tjreport_font_size_result_title"); |
| | | String s4 = sysConfigService.selectConfigByKey("tjreport_font_size_zongjian"); |
| | | String value = sysConfigService.selectConfigByKey("path_filePath"); |
| | | // String hospName = sysDeptController.getdangqiandengluyuanqu().get("msg").toString(); |
| | | if (StrUtil.isNotBlank(s1) && Integer.parseInt(s1) > 10) DEFAULT_FONT_SIZE = Integer.parseInt(s1); |
| | | else DEFAULT_FONT_SIZE = 10; |
| | |
| | | } |
| | | |
| | | |
| | | LambdaQueryWrapper<TjXdtgmdjg> wqq=new LambdaQueryWrapper<>(); |
| | | wqq.eq(TjXdtgmdjg::getTjh,tjOrder.getTjNumber()); |
| | | wqq.isNotNull(TjXdtgmdjg::getUrl); |
| | | List<TjXdtgmdjg> xdtgmdjgList = xdtgmdjgService.list(wqq); |
| | | String isPdfFujianPro = sysConfigService.selectConfigByKey("is_pdf_fujian_pro"); |
| | | List<TjXdtgmdjg> xdtgmdjgList; |
| | | if (StrUtil.isNotBlank(isPdfFujianPro) && isPdfFujianPro.equalsIgnoreCase("Y")){ |
| | | xdtgmdjgList = xdtgmdjgService.xdtGlAttProByTjNum(tjOrder.getTjNumber()); |
| | | }else { |
| | | LambdaQueryWrapper<TjXdtgmdjg> wqq=new LambdaQueryWrapper<>(); |
| | | wqq.eq(TjXdtgmdjg::getTjh,tjOrder.getTjNumber()); |
| | | wqq.isNotNull(TjXdtgmdjg::getUrl); |
| | | xdtgmdjgList = xdtgmdjgService.list(wqq); |
| | | } |
| | | |
| | | int index=1; |
| | | for (TjXdtgmdjg xdtgmdjg : xdtgmdjgList) { |
| | |
| | | */ |
| | | private void savePDFFile(String outputFileName1, TjOrder tjOrder, TjCustomer customer, ByteArrayOutputStream finalOutPut) throws IOException, DocumentException, InterruptedException { |
| | | // 第一步:生成文件并保存 |
| | | String value = sysConfigService.selectConfigByKey("path_filePath"); |
| | | String outputPath1 = value + File.separator; |
| | | File file = new File(outputPath1 + outputFileName1); |
| | | BufferedOutputStream outputStream = null; |
| | |
| | | * @throws DocumentException |
| | | */ |
| | | private void notHuaYanTable(Document document1, Map<TjOrderRemark, List<TjPdfVO>> printReport, DictHosp dictHosp, String colorStr, boolean isPacs) throws DocumentException { |
| | | List<TjReportSpecialProject> tjReportSpecialProjects = tjReportSpecialProjectService.list(); |
| | | for (Map.Entry<TjOrderRemark, List<TjPdfVO>> entry : printReport.entrySet()) { |
| | | LambdaQueryWrapper<TjProject> wqqq = new LambdaQueryWrapper<>(); |
| | | wqqq.eq(TjProject::getProId, entry.getKey().getProId()); |
| | |
| | | // if (dictHosp.getHospName().equals("澄合矿务局中心医院") && !value.isEmpty()){ |
| | | if (!value.isEmpty()) { |
| | | if (value.size() > 1) { |
| | | if (value.get(0).getPid().equals("1862852701533012001")) { |
| | | Font remarkFonts = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | Paragraph ppp = new Paragraph("阳性参考值:", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | ppp = new Paragraph("DOB值: ≥ 4.0 HP-阳性", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | ppp = new Paragraph(" < 4.0 正常", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | |
| | | ppp = new Paragraph("检测结果: DOB=" + value.get(0).getProResult(), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | ppp = new Paragraph("", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | ppp = new Paragraph("", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | if (StrUtil.isNotBlank(entry.getKey().getRemark())) { |
| | | ppp = new Paragraph("结论:" + entry.getKey().getRemark().replaceAll("null",""), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | } |
| | | Long pid = Long.valueOf(value.get(0).getPid()); |
| | | Optional<TjReportSpecialProject> match = tjReportSpecialProjects.stream() |
| | | .filter(item -> item.getProId().equals(pid)) |
| | | .findFirst(); |
| | | if (match.isPresent()) { |
| | | reportSpecialProject(document1, entry, paragraph, value,match.get()); |
| | | } else { |
| | | String[] titles = {"体检项目", "体检结果", "单位"}; |
| | | Font headFont = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | |
| | | // paragraph.setLeading(5f); |
| | | // document1.add(ppp); |
| | | } else { |
| | | if (value.get(0).getPid().equals("1862852701533012001")) { |
| | | remarkFonts = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | Paragraph ppp = new Paragraph("阳性参考值:", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | ppp = new Paragraph("DOB值: ≥ 4.0 HP-阳性", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | ppp = new Paragraph(" < 4.0 正常", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | |
| | | ppp = new Paragraph("检测结果: DOB=" + value.get(0).getProResult(), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | ppp = new Paragraph("", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | ppp = new Paragraph("", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | if (StrUtil.isNotBlank(entry.getKey().getRemark())) { |
| | | ppp = new Paragraph("结论:" + entry.getKey().getRemark().replaceAll("null",""), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | } |
| | | Long pid = Long.valueOf(value.get(0).getPid()); |
| | | Optional<TjReportSpecialProject> match = tjReportSpecialProjects.stream() |
| | | .filter(item -> item.getProId().equals(pid)) |
| | | .findFirst(); |
| | | if (match.isPresent()) { |
| | | reportSpecialProject(document1, entry, paragraph, value,match.get()); |
| | | } else { |
| | | String[] titles = {"体检项目", "体检结果"}; |
| | | Font headFont = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | |
| | | // if (dictHosp.getHospName().equals("澄合矿务局中心医院") && !value.isEmpty()){ |
| | | if (!value.isEmpty()) { |
| | | if (value.size() > 1) { |
| | | if (value.get(0).getPid().equals("1862852701533012001")) { |
| | | Font remarkFonts = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | Paragraph ppp = new Paragraph("阳性参考值:", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | ppp = new Paragraph("DOB值: ≥ 4.0 HP-阳性", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | ppp = new Paragraph(" < 4.0 正常", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | |
| | | ppp = new Paragraph("检测结果: DOB=" + value.get(0).getProResult(), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | ppp = new Paragraph("", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | ppp = new Paragraph("", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | if (StrUtil.isNotBlank(entry.getKey().getRemark())) { |
| | | ppp = new Paragraph("结论:" + entry.getKey().getRemark().replaceAll("null",""), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | } |
| | | Long pid = Long.valueOf(value.get(0).getPid()); |
| | | Optional<TjReportSpecialProject> match = tjReportSpecialProjects.stream() |
| | | .filter(item -> item.getProId().equals(pid)) |
| | | .findFirst(); |
| | | if (match.isPresent()) { |
| | | reportSpecialProject(document1, entry, paragraph, value,match.get()); |
| | | } else { |
| | | String[] titles = {"体检项目", "体检结果", "单位"}; |
| | | Font headFont = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | |
| | | if (isPacs) { |
| | | Paragraph pp; |
| | | Paragraph ppp; |
| | | String key = sysConfigService.selectConfigByKey("makepdfuseorderdetailproresult"); |
| | | if (StrUtil.isNotBlank(key) && !key.equals("Y")){ |
| | | if (StrUtil.isNotBlank(value.get(0).getSj())) { |
| | | pp = PdfUtils.setParagraph(remarkFonts, "检查所见:"); |
| | | document1.add(pp); |
| | | ppp = new Paragraph(value.get(0).getSj(), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | } |
| | | }else { |
| | | if (StrUtil.isNotBlank(value.get(0).getSj()) || StrUtil.isNotBlank(value.get(0).getProResult())) { |
| | | pp = PdfUtils.setParagraph(remarkFonts, "检查所见:"); |
| | | document1.add(pp); |
| | | ppp = new Paragraph(value.get(0).getSj() != null ? value.get(0).getSj() : value.get(0).getProResult(), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | } |
| | | // String key = sysConfigService.selectConfigByKey("makepdfuseorderdetailproresult"); |
| | | // if (StrUtil.isNotBlank(key) && !key.equals("Y")){ |
| | | // if (StrUtil.isNotBlank(value.get(0).getSj())) { |
| | | // pp = PdfUtils.setParagraph(remarkFonts, "检查所见:"); |
| | | // document1.add(pp); |
| | | // ppp = new Paragraph(value.get(0).getSj(), remarkFonts); |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // paragraph.setLeading(5f); |
| | | // document1.add(ppp); |
| | | // } |
| | | // }else { |
| | | // if (StrUtil.isNotBlank(value.get(0).getSj()) || StrUtil.isNotBlank(value.get(0).getProResult())) { |
| | | // pp = PdfUtils.setParagraph(remarkFonts, "检查所见:"); |
| | | // document1.add(pp); |
| | | // ppp = new Paragraph(value.get(0).getSj() != null ? value.get(0).getSj() : value.get(0).getProResult(), remarkFonts); |
| | | // paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | // paragraph.setLeading(5f); |
| | | // document1.add(ppp); |
| | | // } |
| | | // } |
| | | |
| | | if (StrUtil.isNotBlank(value.get(0).getSj()) || StrUtil.isNotBlank(value.get(0).getProResult())) { |
| | | pp = PdfUtils.setParagraph(remarkFonts, "检查所见:"); |
| | | document1.add(pp); |
| | | ppp = new Paragraph(value.get(0).getSj() != null ? value.get(0).getSj() : value.get(0).getProResult(), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | } |
| | | |
| | | pp = PdfUtils.setParagraph(remarkFonts, "检查提示:"); |
| | | document1.add(pp); |
| | | ppp = new Paragraph((value.get(0).getTs() != null ? value.get(0).getTs() : value.get(0).getProResult()), remarkFonts); |
| | |
| | | // paragraph.setLeading(5f); |
| | | // document1.add(ppp); |
| | | } else { |
| | | if (value.get(0).getPid().equals("1862852701533012001")) { |
| | | remarkFonts = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | Paragraph ppp = new Paragraph("阳性参考值:", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | ppp = new Paragraph("DOB值: ≥ 4.0 HP-阳性", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | ppp = new Paragraph(" < 4.0 正常", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | |
| | | ppp = new Paragraph("检测结果: DOB=" + value.get(0).getProResult(), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | ppp = new Paragraph("", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | ppp = new Paragraph("", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | if (StrUtil.isNotBlank(entry.getKey().getRemark())) { |
| | | ppp = new Paragraph("结论:" + entry.getKey().getRemark().replaceAll("null",""), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | } |
| | | Long pid = Long.valueOf(value.get(0).getPid()); |
| | | Optional<TjReportSpecialProject> match = tjReportSpecialProjects.stream() |
| | | .filter(item -> item.getProId().equals(pid)) |
| | | .findFirst(); |
| | | if (match.isPresent()) { |
| | | reportSpecialProject(document1, entry, paragraph, value,match.get()); |
| | | } else { |
| | | String[] titles = {"体检项目", "体检结果"}; |
| | | Font headFont = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 目前写死 只有碳13、14 模板都是一样的只不过参考值不同 |
| | | * 凌云:{"dy":"4.0","xy":"4.0","title":"阳性参考值:","dystr":"DOB值: ≥ ${dy} HP-阳性","xystr":" < ${xy} 正常","en":"DOB"} |
| | | * 泾川县医院:{"dy":"100","xy":"100","title":"参考值(DPM):","dystr":"DPM值: ≥ ${dy} 阳性","xystr":" < ${xy} 阴性","en":"DPM"} |
| | | * @param document1 |
| | | * @param entry |
| | | * @param paragraph |
| | | * @param value |
| | | * @param tjReportSpecialProject |
| | | * @throws DocumentException |
| | | */ |
| | | private static void reportSpecialProject(Document document1, Map.Entry<TjOrderRemark, List<TjPdfVO>> entry, Paragraph paragraph, List<TjPdfVO> value,TjReportSpecialProject tjReportSpecialProject) throws DocumentException { |
| | | JSONObject entries = JSONUtil.parseObj(tjReportSpecialProject.getParams()); |
| | | Font remarkFonts = PdfUtils.setFont(DEFAULT_FONT_SIZE); |
| | | Paragraph ppp = new Paragraph(entries.getStr("title"), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | ppp = new Paragraph(entries.getStr("dystr").replace("${dy}",entries.getStr("dy")), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | ppp = new Paragraph(entries.getStr("xystr").replace("${xy}",entries.getStr("xy")), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | |
| | | ppp = new Paragraph("检测结果: "+entries.getStr("en")+"=" + value.get(0).getProResult(), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | |
| | | ppp = new Paragraph("", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | ppp = new Paragraph("", remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | if (StrUtil.isNotBlank(entry.getKey().getRemark())) { |
| | | ppp = new Paragraph("结论:" + entry.getKey().getRemark().replaceAll("null",""), remarkFonts); |
| | | paragraph.setAlignment(Element.ALIGN_LEFT); |
| | | paragraph.setLeading(5f); |
| | | document1.add(ppp); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 主见医师行显示设置 |
| | | * |
| | | * @param document1 |