|
|
@ -634,7 +634,7 @@ public class AmsReportServiceImpl implements AmsReportService { |
|
|
|
|
|
|
|
|
HashMap<String, Object> params = new HashMap<>(); |
|
|
HashMap<String, Object> params = new HashMap<>(); |
|
|
|
|
|
|
|
|
XWPFTemplate template = XWPFTemplate.compile(grPath); |
|
|
// XWPFTemplate template = XWPFTemplate.compile(grPath);
|
|
|
params.put("h_name", patientInfo.getHospitalName()); |
|
|
params.put("h_name", patientInfo.getHospitalName()); |
|
|
// params.put("qrcode_img_url", Pictures.ofLocal(reportPath + patientInfo.getQrCodeUrl()).size(130, 130).create());
|
|
|
// params.put("qrcode_img_url", Pictures.ofLocal(reportPath + patientInfo.getQrCodeUrl()).size(130, 130).create());
|
|
|
params.put("p_name", patientInfo.getPatientName()); |
|
|
params.put("p_name", patientInfo.getPatientName()); |
|
|
@ -886,6 +886,70 @@ public class AmsReportServiceImpl implements AmsReportService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
params.put("title" + i, scores.get(i).getName()); |
|
|
params.put("title" + i, scores.get(i).getName()); |
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> listMap = new ArrayList<>(); |
|
|
|
|
|
// for (int i = 0; i < exportInfos.size(); i++) {
|
|
|
|
|
|
// //遍历问题
|
|
|
|
|
|
// //生成问题表格
|
|
|
|
|
|
////
|
|
|
|
|
|
//// TextRenderData text5 = Texts.of("问题描述").bold().fontSize(12).create();
|
|
|
|
|
|
//// TextRenderData text6 = Texts.of("问题结果").bold().fontSize(12).create();
|
|
|
|
|
|
//// TextRenderData text7 = Texts.of("得 分").bold().fontSize(12).create();
|
|
|
|
|
|
////// TextRenderData text8 = Texts.of("总 分").bold().fontSize(12).create();
|
|
|
|
|
|
//// RowRenderData detailHeaderRow = Rows.of(text5, text6, text7).create();
|
|
|
|
|
|
//// Tables.TableBuilder of1 = Tables.of(detailHeaderRow);
|
|
|
|
|
|
//// RmsDto.QueryReportAnswer queryReportAnswer = new RmsDto.QueryReportAnswer();
|
|
|
|
|
|
//// queryReportAnswer.setEvaluationCode(exportInfos.get(i).getScaleCode());
|
|
|
|
|
|
//// queryReportAnswer.setId(dto.getReportId());
|
|
|
|
|
|
//// List<RmsVo.ReportDetailAnswer> reportDetailAnswerList = rmsService.queryReportAnswer(queryReportAnswer);
|
|
|
|
|
|
//// MergeCellRule detailMerge = null;
|
|
|
|
|
|
// if (CollUtil.isNotEmpty(reportDetailAnswerList)) {
|
|
|
|
|
|
// RmsVo.ReportDetailAnswer reportDetailAnswer = reportDetailAnswerList.get(0);
|
|
|
|
|
|
// List<List<RmsVo.QuestionInfo>> collect = reportDetailAnswerList.stream().map(reportDetailAnswer1 -> reportDetailAnswer1.getQuestionList()).collect(Collectors.toList());
|
|
|
|
|
|
// List<RmsVo.QuestionInfo> list = new ArrayList<>();
|
|
|
|
|
|
// for (int j = 0; j < collect.size(); j++) {
|
|
|
|
|
|
// list.addAll(collect.get(j));
|
|
|
|
|
|
// }
|
|
|
|
|
|
// Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
// List<RmsVo.QuestionTable> questionTableList = new ArrayList<>();
|
|
|
|
|
|
// for (RmsVo.QuestionInfo questionInfo : list) {
|
|
|
|
|
|
// RmsVo.QuestionTable questionTable = new RmsVo.QuestionTable();
|
|
|
|
|
|
// questionTable.setQuestion(questionInfo.getQuestionName());
|
|
|
|
|
|
// //查询患者答题得分
|
|
|
|
|
|
// BigDecimal score = new BigDecimal("0");
|
|
|
|
|
|
// AmsPatientAnswerScoreExample amsPatientAnswerScoreExample = new AmsPatientAnswerScoreExample();
|
|
|
|
|
|
// amsPatientAnswerScoreExample.createCriteria()
|
|
|
|
|
|
//// .andPatientIdEqualTo(patientInfo.getId())
|
|
|
|
|
|
// .andQuestionIdEqualTo(questionInfo.getQuestionId())
|
|
|
|
|
|
// .andEvaluationIdEqualTo(dto.getEvaluationId());
|
|
|
|
|
|
// amsPatientAnswerScoreExample.setOrderByClause("id desc");
|
|
|
|
|
|
// List<AmsPatientAnswerScore> amsPatientAnswerScores = amsPatientAnswerScoreMapper.selectByExample(amsPatientAnswerScoreExample);
|
|
|
|
|
|
// if (CollUtil.isNotEmpty(amsPatientAnswerScores)) {
|
|
|
|
|
|
// score = BigDecimal.valueOf(amsPatientAnswerScores.stream().filter(e -> e.getOptionId() != null && e.getOptionId() != 0).map(AmsPatientAnswerScore::getScore).mapToDouble(BigDecimal::doubleValue).sum());
|
|
|
|
|
|
// }
|
|
|
|
|
|
// questionTable.setScore(score + "");
|
|
|
|
|
|
// //处理答案
|
|
|
|
|
|
// String answers = "";
|
|
|
|
|
|
// for (RmsVo.Answer answer : questionInfo.getAnswers()) {
|
|
|
|
|
|
// if (StrUtil.isNotEmpty(answer.getAnswer())) {
|
|
|
|
|
|
// answers += answer.getAnswer() + ",";
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (StrUtil.isNotEmpty(answers)) {
|
|
|
|
|
|
// answers = answers.substring(0, answers.length() - 1);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// questionTable.setResult(StrUtil.isEmpty(answers) || "null".equals(answers) ? "" : answers);
|
|
|
|
|
|
// questionTableList.add(questionTable);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// map.put("questionList", questionTableList);
|
|
|
|
|
|
// map.put("title", exportInfos.get(i).getScaleName());
|
|
|
|
|
|
// if (StrUtil.isNotEmpty(exportInfos.get(i).getPlan())) {
|
|
|
|
|
|
// map.put("fzjy", exportInfos.get(i).getPlan());
|
|
|
|
|
|
// map.put("fzjyFlag", true);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// listMap.add(map);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (emsEvaluation.getVersion() != null) { |
|
|
if (emsEvaluation.getVersion() != null) { |
|
|
@ -903,9 +967,22 @@ public class AmsReportServiceImpl implements AmsReportService { |
|
|
.create(); |
|
|
.create(); |
|
|
params.put("table", tableData); |
|
|
params.put("table", tableData); |
|
|
|
|
|
|
|
|
|
|
|
// params.put("questionTables", listMap);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Long hospitalId = SecurityUtils.getDeptId();
|
|
|
|
|
|
String s = IdUtil.randomUUID(); |
|
|
String s = IdUtil.randomUUID(); |
|
|
|
|
|
|
|
|
|
|
|
// 或使用 RenderData 和 MiniTableRenderData 更高级表格渲染(后面介绍)
|
|
|
|
|
|
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy(); |
|
|
|
|
|
|
|
|
|
|
|
Configure config = Configure.builder() |
|
|
|
|
|
.bind("zdList", policy) |
|
|
|
|
|
.bind("yyList", policy) |
|
|
|
|
|
.bind("questionTables", policy) |
|
|
|
|
|
.bind("questionList", policy).build(); |
|
|
|
|
|
XWPFTemplate template = XWPFTemplate.compile(allPath, config); |
|
|
|
|
|
|
|
|
|
|
|
// Long hospitalId = SecurityUtils.getDeptId();
|
|
|
// 将表格数据放入参数中
|
|
|
// 将表格数据放入参数中
|
|
|
// params.put("table", tableDataList);
|
|
|
// params.put("table", tableDataList);
|
|
|
try { |
|
|
try { |
|
|
@ -1632,6 +1709,13 @@ public class AmsReportServiceImpl implements AmsReportService { |
|
|
return pattern.matcher(str).matches(); |
|
|
return pattern.matcher(str).matches(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static Map<String, Object> getParams(RmsDto.ExportReport1Dto dto) { |
|
|
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return params; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public AmsReportVo.Result exportAll(RmsDto.ExportReport1Dto dto) { |
|
|
public AmsReportVo.Result exportAll(RmsDto.ExportReport1Dto dto) { |
|
|
RmsReport report = rmsReportMapper.selectByPrimaryKey(dto.getReportId()); |
|
|
RmsReport report = rmsReportMapper.selectByPrimaryKey(dto.getReportId()); |
|
|
@ -1658,7 +1742,13 @@ public class AmsReportServiceImpl implements AmsReportService { |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
//查询就诊、诊断信息
|
|
|
//查询就诊、诊断信息
|
|
|
PmsPatientVo.PatientInfo patientInfoById = pmsPatientService.getPatientInfoById(emsEvaluation.getPatientId()); |
|
|
PmsPatientVo.PatientInfo patientInfoById; |
|
|
|
|
|
if (StrUtil.isNotEmpty(report.getVisitNo())) { |
|
|
|
|
|
patientInfoById = pmsPatientService.getPatientInfoById(emsEvaluation.getPatientId(), report.getVisitNo()); |
|
|
|
|
|
}else { |
|
|
|
|
|
patientInfoById = pmsPatientService.getPatientInfoById(emsEvaluation.getPatientId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询
|
|
|
//查询
|
|
|
RmsVo.ReportPatient patientInfo = detail.getPatient(); |
|
|
RmsVo.ReportPatient patientInfo = detail.getPatient(); |
|
|
|