diff --git a/ht/src/main/java/com/ccsens/ht/service/ExportService.java b/ht/src/main/java/com/ccsens/ht/service/ExportService.java index c6003410..382fae46 100644 --- a/ht/src/main/java/com/ccsens/ht/service/ExportService.java +++ b/ht/src/main/java/com/ccsens/ht/service/ExportService.java @@ -89,7 +89,7 @@ public class ExportService implements IExportService { switch (param.getReport()) { case Constant.Ht.Report.PARENT_CODE_2: case Constant.Ht.Report.PARENT_CODE_3: - writeParentCode2(content, detail.getScores()); + writeParentCode2(param.getReport(), content, detail.getScores()); //添加初步印象和受试者合作评分 addScoreAndImpression(detail.getPatient().getInitialImpression(), content); //添加测评员和报告日期 @@ -173,9 +173,9 @@ public class ExportService implements IExportService { List scores = patientReportService.getReportScores(reportScore, param.getId()); //生成写入pdf数据 List content = new ArrayList<>(); - writeParentCode2(content, scores); + writeParentCode2(param.getCode(),content, scores); //添加初步印象和受试者合作评分 - addScoreAndImpression(reportPatient.getInitialImpression(), content); + addScoreAndImpression("", content); //添加测评员和报告日期 initLast(content, 2); //表头 @@ -183,7 +183,8 @@ public class ExportService implements IExportService { String title = String.join(" ", split); //生成pdf并返回路径 - String path = PropUtil.imgDomain + "/" + PdfUtil.createPdf(PropUtil.path, title, Constant.Ht.Report.PARENT_NAME, new PdfUtil.Margin(), reportPatient.toPdfRow(), content); + String subHead = CollectionUtil.isEmpty(scores) ? "" : "认知评估量表("+scores.get(0).getName() + ")报告单"; + String path = PropUtil.imgDomain + "/" + PdfUtil.createPdf(PropUtil.path, title, subHead, new PdfUtil.Margin(), reportPatient.toPdfRow(), content); //TODO 将路径存入报告单关联信息表 // reportRelevance.setPdfUrl(path); // reportRelevanceMapper.updateByPrimaryKeySelective(reportRelevance); @@ -239,7 +240,14 @@ public class ExportService implements IExportService { content.add(impression); } - private void writeParentCode2(List content, List scores) { + private void writeParentCode2(String code, List content, List scores) { + + if (StrUtil.isNotBlank(code) && Constant.Export.PURPOSE_MAP.containsKey(code)) { + PdfUtil.Row purpose = new PdfUtil.Row(); + purpose.addCell(new PdfUtil.Cell(Constant.Export.PURPOSE_MAP.get(code),4,1)); + content.add(purpose); + } + PdfUtil.Row title = new PdfUtil.Row(); title.addCell(new PdfUtil.Cell("项目",2,1)); // title.addCell(new PdfUtil.Cell()); @@ -250,12 +258,13 @@ public class ExportService implements IExportService { title.addCell(r); content.add(title); scores.forEach(reportScore -> { + String name = StrUtil.isEmpty(reportScore.getDescription()) ? reportScore.getName() : reportScore.getDescription(); if (CollectionUtil.isEmpty(reportScore.getSubReport())) { PdfUtil.Row row = new PdfUtil.Row(); PdfUtil.Cell cellName = new PdfUtil.Cell(); cellName.setColSpan(2); - cellName.setContent(reportScore.getName()); + cellName.setContent(name); row.addCell(cellName); PdfUtil.Cell cellScore = new PdfUtil.Cell(); @@ -275,7 +284,7 @@ public class ExportService implements IExportService { if (i == 0) { PdfUtil.Cell cellName = new PdfUtil.Cell(); cellName.setRowSpan(reportScore.getSubReport().size()); - cellName.setContent(reportScore.getName()); + cellName.setContent(name); row.addCell(cellName); } row.addCell(new PdfUtil.Cell(score.getName())); diff --git a/ht/src/main/java/com/ccsens/ht/service/ImportService.java b/ht/src/main/java/com/ccsens/ht/service/ImportService.java index 4a3e2ba2..dfaedd1d 100644 --- a/ht/src/main/java/com/ccsens/ht/service/ImportService.java +++ b/ht/src/main/java/com/ccsens/ht/service/ImportService.java @@ -482,6 +482,7 @@ public class ImportService implements IImportService { * @param questionId 试题ID * @param sort 排序 * @param optionDescList 记录其他补充 + * @param optionIds 要删除的其他记录的选项ID * @return 选项 */ private HtQuestionOption initOption(Object[] objs, Long questionId, int sort, List optionDescList, List optionIds) { @@ -525,6 +526,7 @@ public class ImportService implements IImportService { for (Object obj: descArr) { HtQuestionOptionDesc desc = JSONObject.parseObject(JSON.toJSONString(obj), HtQuestionOptionDesc.class); desc.setId(snowflake.nextId()); + desc.setOptionId(option.getId()); optionDescList.add(desc); } } diff --git a/ht/src/main/java/com/ccsens/ht/uitl/Constant.java b/ht/src/main/java/com/ccsens/ht/uitl/Constant.java index 153445aa..ec64ce25 100644 --- a/ht/src/main/java/com/ccsens/ht/uitl/Constant.java +++ b/ht/src/main/java/com/ccsens/ht/uitl/Constant.java @@ -54,6 +54,14 @@ public class Constant { } public static final String MMSE_PURPOSE = "检查目的:MMSE用于筛查痴呆患者、判断认知损害的严重程度并跟踪记录病情变化情况。涵盖了定向力、记忆力、计算及注意力、语言和视空间能力等认知域。"; public static final String MOCA_PURPOSE = "检查目的:MoCA作为总体认知功能评估的筛查量表,覆盖注意力、执行功能、记忆、语言、视空间结构、抽象思维、计算和定向力等认知域。"; + public final static Map PURPOSE_MAP = new HashMap<>(); + static { + PURPOSE_MAP.put("AVLT","检查目的:临床记忆检测(听觉词语记忆测验)用于各种认知障碍疾病记忆功能评估。包括即刻记忆、短延迟回忆、长延迟回忆、线索回忆和再认。反应学习能力、记忆保持率、辨正能力、概念记忆等。"); + PURPOSE_MAP.put("DST","检查目的:数字广度测验为注意力测试最基本的方法,包括数字广度顺序测验和数字广度倒序测验两项。"); + PURPOSE_MAP.put("TMT","检查目的:空间位置记忆广度测验(连线测验)是最常用的神经心理学测验之一,它反映注意、次序排列、心理灵活性、视觉搜索和运动功能,反映定势转移能力,同时反映手-眼协调能力、空间知觉和注意能力。"); + PURPOSE_MAP.put("BNT","检查目的:图片词汇测验(波士顿命名测验)是目前临床上最常见的检测命名障碍神经心理量表。是一种常见的视觉对偶命名测验。"); + PURPOSE_MAP.put("LFT","检查目的:立方体组合测验(积木测验)用于检测图形识别及构造功能,可评估受试者辨认空间关系能力、视觉结构分析和综合运用能力,以及视觉-运动协调性等。用于阿尔茨海默病及其他认知障碍疾病的认知功能筛查和鉴别诊断。"); + } } public static final class ReportExportTitle{ diff --git a/ht/src/main/resources/application.yml b/ht/src/main/resources/application.yml index b9b264a7..f59084b0 100644 --- a/ht/src/main/resources/application.yml +++ b/ht/src/main/resources/application.yml @@ -1,5 +1,5 @@ spring: profiles: - active: prod - include: common, util-prod + active: test + include: common, util-test