|
|
@ -257,10 +257,10 @@ public class PatientReportService implements IPatientReportService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public PatientReportVo.ReprotDetail queryReportDetail(PatientReportDto.QueryDetail queryDetail, Long userId) { |
|
|
|
PatientReportVo.ReprotDetail detail = new PatientReportVo.ReprotDetail(); |
|
|
|
public PatientReportVo.ReportDetail queryReportDetail(PatientReportDto.QueryDetail queryDetail, Long userId) { |
|
|
|
PatientReportVo.ReportDetail detail = new PatientReportVo.ReportDetail(); |
|
|
|
//查询报告单信息和病人信息
|
|
|
|
PatientReportVo.ReprotPatient reportPatient = htPatientReportDao.queryReportResult(queryDetail.getId()); |
|
|
|
PatientReportVo.ReportPatient reportPatient = htPatientReportDao.queryReportResult(queryDetail.getId()); |
|
|
|
//查询报告单的关联信息
|
|
|
|
HtReportRelevanceExample relevanceExample = new HtReportRelevanceExample(); |
|
|
|
relevanceExample.createCriteria().andReportIdEqualTo(queryDetail.getId()).andReportCodeEqualTo(queryDetail.getReport()); |
|
|
@ -397,7 +397,7 @@ public class PatientReportService implements IPatientReportService { |
|
|
|
if (StrUtil.isNotBlank(report.getUrl())) { |
|
|
|
return report.getUrl(); |
|
|
|
} |
|
|
|
PatientReportVo.ReprotDetail detail = queryReportDetail(queryDetail, userId); |
|
|
|
PatientReportVo.ReportDetail detail = queryReportDetail(queryDetail, userId); |
|
|
|
if (detail == null) { |
|
|
|
throw new BaseException(CodeEnum.REPORT_NOT_FOUND); |
|
|
|
} |
|
|
@ -683,7 +683,7 @@ public class PatientReportService implements IPatientReportService { |
|
|
|
List<PdfUtil.Row> content = new ArrayList<>(); |
|
|
|
|
|
|
|
//查询报告单信息和病人信息
|
|
|
|
PatientReportVo.ReprotPatient reportPatient = htPatientReportDao.queryReportResult(param.getId()); |
|
|
|
PatientReportVo.ReportPatient reportPatient = htPatientReportDao.queryReportResult(param.getId()); |
|
|
|
if (reportPatient == null) { |
|
|
|
throw new BaseException(CodeEnum.PARAM_ERROR); |
|
|
|
} |
|
|
@ -831,7 +831,7 @@ public class PatientReportService implements IPatientReportService { |
|
|
|
} else if (score.getSort() >= 15 && score.getSort() <= 17) { |
|
|
|
row.get(12+score.getSort()).setValue(score.getScore().intValue() + ""); |
|
|
|
} else if (score.getSort()== 21 || score.getSort() == 22) { |
|
|
|
row.get(10+score.getSort()).setValue(score.getScore().intValue() + ""); |
|
|
|
row.get(9+score.getSort()).setValue(score.getScore().intValue() + ""); |
|
|
|
} else if (score.getSort() == 18 || score.getSort() == 19) { |
|
|
|
if (score.getScore() != null) { |
|
|
|
String value = row.get(32).getValue(); |
|
|
@ -1014,9 +1014,9 @@ public class PatientReportService implements IPatientReportService { |
|
|
|
titleRow.add(new PoiUtil.PoiUtilCell("流畅性1min")); |
|
|
|
titleRow.add(new PoiUtil.PoiUtilCell("抽象")); |
|
|
|
titleRow.add(new PoiUtil.PoiUtilCell("延迟回忆")); |
|
|
|
// 20
|
|
|
|
titleRow.add(new PoiUtil.PoiUtilCell("分类提示")); |
|
|
|
// 21
|
|
|
|
titleRow.add(new PoiUtil.PoiUtilCell("分类提示")); |
|
|
|
// 22
|
|
|
|
titleRow.add(new PoiUtil.PoiUtilCell("多选提示")); |
|
|
|
titleRow.add(new PoiUtil.PoiUtilCell("定向")); |
|
|
|
titleRow.add(new PoiUtil.PoiUtilCell("总分")); |
|
|
@ -1085,7 +1085,7 @@ public class PatientReportService implements IPatientReportService { |
|
|
|
titleRow.add(new PoiUtil.PoiUtilCell("图形重心垂直位置")); |
|
|
|
} |
|
|
|
|
|
|
|
private List<PatientReportVo.ReportScore> getReportScores(PatientReportDto.ExportCode param, List<PdfUtil.Row> content, List<PatientReportVo.ReportScore> reportScores, PatientReportVo.ReprotPatient reportPatient) { |
|
|
|
private List<PatientReportVo.ReportScore> getReportScores(PatientReportDto.ExportCode param, List<PdfUtil.Row> content, List<PatientReportVo.ReportScore> reportScores, PatientReportVo.ReportPatient reportPatient) { |
|
|
|
long reportId = param.getId(); |
|
|
|
//重新封装报告单信息
|
|
|
|
List<PatientReportVo.ReportScore> scores = getReportScores(reportScores, reportId); |
|
|
@ -1095,6 +1095,12 @@ public class PatientReportService implements IPatientReportService { |
|
|
|
|| Constant.Ht.Report.MOCA.equals(param.getCode()) ? 9 : 8; |
|
|
|
|
|
|
|
scores.forEach(reportScore -> content.addAll(reportScore.toSingleRow())); |
|
|
|
|
|
|
|
if (Constant.Ht.Report.MOCA.equalsIgnoreCase(param.getCode())){ |
|
|
|
// moca 计算moca认知域指数CDIS
|
|
|
|
fillMocaCDIS(content, param.getId()); |
|
|
|
} |
|
|
|
|
|
|
|
PdfUtil.Row row = new PdfUtil.Row(); |
|
|
|
int titleSpan = 2; |
|
|
|
PdfUtil.Cell initWordCell = addCell(row, "初步印象", titleSpan, 2); |
|
|
@ -1114,6 +1120,127 @@ public class PatientReportService implements IPatientReportService { |
|
|
|
return scores; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 添加moca认知域指数(CDIS) |
|
|
|
* @param rows 表格行 |
|
|
|
* @param patientReportId 报告单ID |
|
|
|
*/ |
|
|
|
private void fillMocaCDIS(List<PdfUtil.Row> rows, Long patientReportId) { |
|
|
|
// 查询moca的每一题的分数
|
|
|
|
List<PatientReportVo.SortScore> scores = htPatientScoreDao.querySortScore(patientReportId, "MoCA", "YCHY"); |
|
|
|
Map<Integer, BigDecimal> sortScoreMap = new HashMap<>(); |
|
|
|
if (CollectionUtil.isNotEmpty(scores)) { |
|
|
|
scores.forEach(score -> sortScoreMap.put(score.getSort(), score.getScore())); |
|
|
|
} |
|
|
|
int lianxian = 1; |
|
|
|
int lifangti = 2; |
|
|
|
int huazhong = 3; |
|
|
|
int mingming1 = 4; |
|
|
|
int mingming2 = 5; |
|
|
|
int mingming3 = 6; |
|
|
|
int fushu1 = 7; |
|
|
|
int fushu2 = 8; |
|
|
|
int shunbei = 9; |
|
|
|
int daobei = 10; |
|
|
|
int jingjuexing = 11; |
|
|
|
int jianfa = 12; |
|
|
|
int chongfu1 = 13; |
|
|
|
int chongfu2 = 14; |
|
|
|
int dongwu = 15; |
|
|
|
int xiangsixing = 16; |
|
|
|
int huiyi = 17; |
|
|
|
int shijian = 18; |
|
|
|
int didian = 19; |
|
|
|
int shizhijue = 20; |
|
|
|
int fenlei = 21; |
|
|
|
int duoxuan = 22; |
|
|
|
|
|
|
|
|
|
|
|
BigDecimal jiYi = null; |
|
|
|
BigDecimal zhiXing = null; |
|
|
|
BigDecimal kongJian = null; |
|
|
|
BigDecimal yuYan = null; |
|
|
|
BigDecimal zhuYi = null; |
|
|
|
BigDecimal dingXiang = null; |
|
|
|
BigDecimal zero = new BigDecimal(0); |
|
|
|
// 记忆指数:自由回忆*3+分类提示*2+多选提示*1 范围0-15分
|
|
|
|
if (sortScoreMap.containsKey(huiyi) || sortScoreMap.containsKey(fenlei) || sortScoreMap.containsKey(duoxuan) ) { |
|
|
|
jiYi = sortScoreMap.getOrDefault(huiyi, zero).multiply(new BigDecimal(3)) |
|
|
|
.add(sortScoreMap.getOrDefault(fenlei, zero).multiply(new BigDecimal(2))) |
|
|
|
.add(sortScoreMap.getOrDefault(duoxuan, zero)); |
|
|
|
} |
|
|
|
// 执行指数:连线测验+画钟+数字广度顺+数字广度逆+警觉性(听1敲桌子)+连续减7+词语流畅性(1分钟说动物)+抽象(词语相似性) 0-13分 1+3+1+1+1+3+1+2=13
|
|
|
|
if (sortScoreMap.containsKey(lianxian) || sortScoreMap.containsKey(huazhong) || sortScoreMap.containsKey(shunbei) |
|
|
|
||sortScoreMap.containsKey(daobei) || sortScoreMap.containsKey(jingjuexing) || sortScoreMap.containsKey(jianfa) |
|
|
|
||sortScoreMap.containsKey(dongwu) || sortScoreMap.containsKey(xiangsixing) |
|
|
|
) { |
|
|
|
zhiXing = sortScoreMap.getOrDefault(lianxian, zero).add(sortScoreMap.getOrDefault(huazhong, zero)) |
|
|
|
.add(sortScoreMap.getOrDefault(shunbei, zero)).add(sortScoreMap.getOrDefault(daobei, zero)) |
|
|
|
.add(sortScoreMap.getOrDefault(jingjuexing, zero)).add(sortScoreMap.getOrDefault(jianfa, zero)) |
|
|
|
.add(sortScoreMap.getOrDefault(dongwu, zero)).add(sortScoreMap.getOrDefault(xiangsixing, zero)); |
|
|
|
} |
|
|
|
// 视空间指数:立方体+画钟+命名 0-7分
|
|
|
|
if (sortScoreMap.containsKey(lifangti) || sortScoreMap.containsKey(huazhong) |
|
|
|
|| sortScoreMap.containsKey(mingming1) || sortScoreMap.containsKey(mingming2) || sortScoreMap.containsKey(mingming3) ) { |
|
|
|
kongJian = sortScoreMap.getOrDefault(lifangti, zero).add(sortScoreMap.getOrDefault(huazhong, zero)) |
|
|
|
.add(sortScoreMap.getOrDefault(mingming1, zero)).add(sortScoreMap.getOrDefault(mingming2, zero)).add(sortScoreMap.getOrDefault(mingming3, zero)); |
|
|
|
} |
|
|
|
// 语言指数:命名+句子复述+词语流畅性 0-6分
|
|
|
|
if (sortScoreMap.containsKey(mingming1) || sortScoreMap.containsKey(mingming2) || sortScoreMap.containsKey(mingming3) |
|
|
|
|| sortScoreMap.containsKey(fushu1) || sortScoreMap.containsKey(fushu2) || sortScoreMap.containsKey(dongwu) ) { |
|
|
|
yuYan = sortScoreMap.getOrDefault(mingming1, zero).add(sortScoreMap.getOrDefault(mingming2, zero)).add(sortScoreMap.getOrDefault(mingming3, zero)) |
|
|
|
.add(sortScoreMap.getOrDefault(fushu1, zero)).add(sortScoreMap.getOrDefault(fushu2, zero)).add(sortScoreMap.getOrDefault(dongwu, zero)); |
|
|
|
} |
|
|
|
// 注意指数:数字广度顺+数字广度逆+警觉性+连续减7+句子重复+即刻记忆2次 0-18分
|
|
|
|
if (sortScoreMap.containsKey(shunbei) || sortScoreMap.containsKey(daobei) || sortScoreMap.containsKey(jingjuexing) |
|
|
|
|| sortScoreMap.containsKey(jianfa) || sortScoreMap.containsKey(chongfu1) || sortScoreMap.containsKey(chongfu2) |
|
|
|
|| sortScoreMap.containsKey(fushu1) || sortScoreMap.containsKey(fushu2)) { |
|
|
|
zhuYi = sortScoreMap.getOrDefault(shunbei, zero).add(sortScoreMap.getOrDefault(daobei, zero)).add(sortScoreMap.getOrDefault(jingjuexing, zero)) |
|
|
|
.add(sortScoreMap.getOrDefault(jianfa, zero)).add(sortScoreMap.getOrDefault(chongfu1, zero)).add(sortScoreMap.getOrDefault(chongfu2, zero)) |
|
|
|
.add(sortScoreMap.getOrDefault(fushu1, zero)).add(sortScoreMap.getOrDefault(fushu2, zero)); |
|
|
|
} |
|
|
|
// 定向指数:定向 0-6分
|
|
|
|
if (sortScoreMap.containsKey(shijian) || sortScoreMap.containsKey(didian)) { |
|
|
|
dingXiang = sortScoreMap.getOrDefault(shijian, zero).add(sortScoreMap.getOrDefault(didian, zero)); |
|
|
|
} |
|
|
|
|
|
|
|
PdfUtil.Row titleRow = new PdfUtil.Row(); |
|
|
|
PdfUtil.Cell titleCell = new PdfUtil.Cell("MoCA认知域指数(CDIS)"); |
|
|
|
titleCell.setRowSpan(3); |
|
|
|
titleRow.addCell(titleCell); |
|
|
|
PdfUtil.Cell jiYiCell = new PdfUtil.Cell("记忆指数"); |
|
|
|
jiYiCell.setColSpan(2); |
|
|
|
titleRow.addCell(jiYiCell); |
|
|
|
titleRow.addCell(new PdfUtil.Cell("执行指数")); |
|
|
|
titleRow.addCell(new PdfUtil.Cell("空间指数")); |
|
|
|
titleRow.addCell(new PdfUtil.Cell("注意力指数")); |
|
|
|
titleRow.addCell(new PdfUtil.Cell("语言指数")); |
|
|
|
titleRow.addCell(new PdfUtil.Cell("定向指数")); |
|
|
|
rows.add(titleRow); |
|
|
|
PdfUtil.Row oneRow = new PdfUtil.Row(); |
|
|
|
PdfUtil.Cell jiYiValueCell = new PdfUtil.Cell(jiYi == null ? " / 15" : jiYi.toString() + " / 15"); |
|
|
|
jiYiValueCell.setColSpan(2); |
|
|
|
jiYiValueCell.setRowSpan(2); |
|
|
|
oneRow.addCell(jiYiValueCell); |
|
|
|
PdfUtil.Cell zhiXingValueCell = new PdfUtil.Cell(zhiXing == null ? " / 13" : zhiXing.toString() + " / 13"); |
|
|
|
zhiXingValueCell.setRowSpan(2); |
|
|
|
oneRow.addCell(zhiXingValueCell); |
|
|
|
PdfUtil.Cell kongJianValueCell = new PdfUtil.Cell(kongJian == null ? " / 7" : kongJian.toString() + " / 7"); |
|
|
|
kongJianValueCell.setRowSpan(2); |
|
|
|
oneRow.addCell(kongJianValueCell); |
|
|
|
PdfUtil.Cell zhuYiValueCell = new PdfUtil.Cell(zhuYi == null ? " / 18" : zhuYi.toString() + " / 18"); |
|
|
|
zhuYiValueCell.setRowSpan(2); |
|
|
|
oneRow.addCell(zhuYiValueCell); |
|
|
|
PdfUtil.Cell yuYanValueCell = new PdfUtil.Cell(yuYan == null ? " / 6" : yuYan.toString() + " / 6"); |
|
|
|
yuYanValueCell.setRowSpan(2); |
|
|
|
oneRow.addCell(yuYanValueCell); |
|
|
|
PdfUtil.Cell dingXiangValueCell = new PdfUtil.Cell(dingXiang == null ? " / 6" : dingXiang.toString() + " / 6"); |
|
|
|
zhuYiValueCell.setRowSpan(2); |
|
|
|
oneRow.addCell(zhuYiValueCell); |
|
|
|
rows.add(oneRow); |
|
|
|
rows.add(new PdfUtil.Row()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<PatientReportVo.ReportScore> getReportScores(List<PatientReportVo.ReportScore> reportScores, long reportId) { |
|
|
|
Map<String, PatientReportVo.ReportScore> map = new HashMap<>(32); |
|
|
|