|
|
@ -1117,6 +1117,50 @@ public class PatientReportService implements IPatientReportService { |
|
|
|
return scores; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Workbook exportAnswer(PatientReportDto.Answer answer) { |
|
|
|
|
|
|
|
List<PatientReportVo.AnswerAndScore> scores = htPatientReportDao.queryAnswer(answer); |
|
|
|
|
|
|
|
List<List< PoiUtil.PoiUtilCell >> allRows = new ArrayList<>(); |
|
|
|
// 标题 表头
|
|
|
|
List<PoiUtil.PoiUtilCell> headRow = new ArrayList<>(); |
|
|
|
headRow.add(new PoiUtil.PoiUtilCell("报告单ID")); |
|
|
|
headRow.add(new PoiUtil.PoiUtilCell("患者ID")); |
|
|
|
headRow.add(new PoiUtil.PoiUtilCell("临床诊断")); |
|
|
|
headRow.add(new PoiUtil.PoiUtilCell("分数")); |
|
|
|
headRow.add(new PoiUtil.PoiUtilCell("记录")); |
|
|
|
allRows.add(headRow); |
|
|
|
|
|
|
|
|
|
|
|
String sheetName = "分数和答案"; |
|
|
|
if (CollectionUtil.isEmpty(scores)) { |
|
|
|
Workbook workbook = new XSSFWorkbook(); |
|
|
|
PoiUtil.exportWB(sheetName, allRows, workbook); |
|
|
|
return workbook; |
|
|
|
} |
|
|
|
|
|
|
|
// 填充数据
|
|
|
|
|
|
|
|
for (PatientReportVo.AnswerAndScore score: scores) { |
|
|
|
|
|
|
|
List<PoiUtil.PoiUtilCell> dataRow = new ArrayList<>(); |
|
|
|
|
|
|
|
dataRow.add(new PoiUtil.PoiUtilCell(score.getPatientReportId() + "",1,1)); |
|
|
|
dataRow.add(new PoiUtil.PoiUtilCell(score.getPatientId() + "",1,1)); |
|
|
|
dataRow.add(new PoiUtil.PoiUtilCell(score.getClinicalDiagnosis(),1,1)); |
|
|
|
dataRow.add(new PoiUtil.PoiUtilCell(score.getScore(),1,1)); |
|
|
|
dataRow.add(new PoiUtil.PoiUtilCell(score.getRecordValue(),1,1)); |
|
|
|
allRows.add(dataRow); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Workbook workbook = new XSSFWorkbook(); |
|
|
|
PoiUtil.exportWB(sheetName, allRows, workbook); |
|
|
|
return workbook; |
|
|
|
} |
|
|
|
|
|
|
|
private void initQuestionBody(int questionSpan, PatientReportVo.QuestionAndAnswer question, PdfUtil.Row row, boolean isLast, int optionSize) { |
|
|
|
addCell(row, question == null ? Constant.Ht.STRING_DEFAULT : String.valueOf(question.getSort()), 1, 1); |
|
|
|
addCell(row, question == null ? Constant.Ht.STRING_DEFAULT : question.getQuestion(), questionSpan, 1); |
|
|
|