Browse Source

修改评估报告导出 修改筛查列表

newMaster
zzc 3 months ago
parent
commit
b8fcb3fd96
  1. 4
      acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java
  2. 96
      acupuncture-admin/src/main/resources/TreamtmentPgTemplate.docx
  3. 2
      acupuncture-system/pom.xml
  4. 67
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsTreatmentServiceImpl.java
  5. 43
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java
  6. 2
      pom.xml

4
acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java

@ -25,13 +25,9 @@ import com.acupuncture.system.domain.vo.UmsDataSourceVo;
import com.acupuncture.system.domain.vo.UplRtcfInfoVo;
import com.acupuncture.system.persist.dao.UmsDataSourceDao;
import com.acupuncture.system.service.ExternalService;
import com.mysql.cj.xdevapi.JsonArray;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jdk.nashorn.internal.runtime.logging.Logger;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.apache.regexp.RE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

96
acupuncture-admin/src/main/resources/TreamtmentPgTemplate.docx

@ -0,0 +1,96 @@
--------------------------------------------------------------------------------
{{h_name}}评估报告
基本信息
姓名:{{name}}
性别:{{sex}}
年龄:{{age}}
编号:{{visitNum}}
责任医生:{{doctor}}
检查日期:{{visitTime}}
主要诊断
{{Clinical_diagnosis}}
病情评估
--------------------------------------------------------------------------------
{{?rtcf_flag}}
人体成分分析结果
体型类型:{{PG_RTCF_TXLX}}
身体年龄:{{PG_RTCF_STNL}}
健康评分:{{PG_RTCF_JKPF}}
体重:{{PG_RTCF_TZ}}
去脂体重:{{PG_RTCF_QZTZ}}
肌肉:{{PG_RTCF_JRL}}
水分:{{PG_RTCF_TBW}}
蛋白质:{{PG_RTCF_DBZ}}
骨质:{{PG_RTCF_GZ}}
骨骼肌:{{PG_RTCF_GGJ}}
脂肪:{{PG_RTCF_ZF}}
腰臀比:{{PG_RTCF_WHR}}
体质指数:{{PG_RTCF_BMI}}
体脂百分比:{{PG_RTCF_PBF}}
内脏脂肪指数:{{PG_RTCF_NZZFSP}}
--------------------------------------------------------------------------------
{{/rtcf_flag}}
--------------------------------------------------------------------------------
{{?bsjg_flag}}
中医体质辨识结果
主要体质: {{PG_TZBS_ZYTZ}}
兼夹体质: {{PG_TZBS_JJTZ}}
{{/bsjg_flag}}
{{?ttpg_flag}}
体态评估结果
序号
量表名称
评分
1
TAPS体态自觉评估
{{score1}}
2
TRACE体态临床评估
{{score2}}
3
SRS-22问卷评估
{{score3}}
{{/ttpg_flag}}
{{?smpg_flag}}
失眠评估结果
序号
量表名称
评分
1
患者健康问卷(PHQ-9)评估
{{score4}}
2
Epworth嗜睡评估
{{score5}}
3
匹兹堡睡眠质量指数(PSQI)评估
{{score6}}
{{/smpg_flag}}
{{?jlpg_flag}}
焦虑评估结果
序号
量表名称
评分
1
汉密尔顿抑郁评估(HAMD-24)
{{score7}}
2
焦虑自评(SAS)
{{score8}}
{{/jlpg_flag}}
测评人:
审核人:
报告日期:{{report_date}}

2
acupuncture-system/pom.xml

@ -80,7 +80,7 @@
<dependency>
<groupId>com.deepoove</groupId>
<artifactId>poi-tl</artifactId>
<version>1.10.5</version>
<version>1.12.2</version>
</dependency>
</dependencies>

67
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsTreatmentServiceImpl.java

@ -30,6 +30,8 @@ import com.acupuncture.system.persist.mapper.*;
import com.acupuncture.system.service.PmsPatientService;
import com.acupuncture.system.service.PmsTreatmentService;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.data.*;
import com.deepoove.poi.data.style.BorderStyle;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@ -536,7 +538,13 @@ public class PmsTreatmentServiceImpl implements PmsTreatmentService {
if (CollectionUtil.isNotEmpty(pmsTreatmentRecords)) {
Map<String, PmsTreatmentRecord> recordMap = pmsTreatmentRecords.stream().collect(Collectors.toMap(PmsTreatmentRecord::getQuestionCode, Function.identity()));
map.put("Clinical_diagnosis", recordMap.get("JBXX_ZYZD") == null ? "" : StrUtil.split(recordMap.get("JBXX_ZYZD").getAnswer(), UserConstants.ANSWER_JOIN_STRING).stream().collect(Collectors.joining(", ")));
map.put("PG_RTCF_TXLX", recordMap.get("PG_RTCF_TXLX") == null ? "" : recordMap.get("PG_RTCF_TXLX").getAnswer());
String txlx = recordMap.get("PG_RTCF_TXLX") == null ? "" : recordMap.get("PG_RTCF_TXLX").getAnswer();
if (StrUtil.isEmpty(txlx)) {
map.put("rtcf_flag", false);
}else {
map.put("rtcf_flag", true);
}
map.put("PG_RTCF_TXLX", txlx);
map.put("PG_RTCF_STNL", recordMap.get("PG_RTCF_STNL") == null ? "" : recordMap.get("PG_RTCF_STNL").getAnswer());
map.put("PG_RTCF_JKPF", recordMap.get("PG_RTCF_JKPF") == null ? "" : recordMap.get("PG_RTCF_JKPF").getAnswer());
map.put("PG_RTCF_TZ", recordMap.get("PG_RTCF_TZ") == null ? "" : recordMap.get("PG_RTCF_TZ").getAnswer());
@ -551,17 +559,56 @@ public class PmsTreatmentServiceImpl implements PmsTreatmentService {
map.put("PG_RTCF_BMI", recordMap.get("PG_RTCF_BMI") == null ? "" : recordMap.get("PG_RTCF_BMI").getAnswer());
map.put("PG_RTCF_PBF", recordMap.get("PG_RTCF_PBF") == null ? "" : recordMap.get("PG_RTCF_PBF").getAnswer());
map.put("PG_RTCF_NZZFSP", recordMap.get("PG_RTCF_NZZFSP") == null ? "" : recordMap.get("PG_RTCF_NZZFSP").getAnswer());
map.put("PG_TZBS_ZYTZ", recordMap.get("PG_TZBS_ZYTZ") == null ? "" : recordMap.get("PG_TZBS_ZYTZ").getAnswer());
String tzbs = recordMap.get("PG_TZBS_ZYTZ") == null ? "" : recordMap.get("PG_TZBS_ZYTZ").getAnswer();
if (StrUtil.isEmpty(tzbs)) {
map.put("bsjg_flag", false);
}else {
map.put("bsjg_flag", true);
}
map.put("PG_TZBS_ZYTZ", tzbs);
map.put("PG_TZBS_JJTZ", recordMap.get("PG_TZBS_JJTZ") == null ? "" : StrUtil.split(recordMap.get("PG_TZBS_JJTZ").getAnswer(), UserConstants.ANSWER_JOIN_STRING).stream().collect(Collectors.joining(",")));
map.put("score1", recordMap.get("PG_TT_TAPS_DF") == null ? "" : recordMap.get("PG_TT_TAPS_DF").getAnswer());
map.put("score2", recordMap.get("PG_TT_TRACE_DF") == null ? "" : recordMap.get("PG_TT_TRACE_DF").getAnswer());
map.put("score3", recordMap.get("PG_TT_SRS22_DF") == null ? "" : recordMap.get("PG_TT_SRS22_DF").getAnswer());
map.put("score4", recordMap.get("PG_SM_PHQ-9_DF") == null ? "" : recordMap.get("PG_SM_PHQ-9_DF").getAnswer());
map.put("score5", recordMap.get("PG_SM_EPSW_DF") == null ? "" : recordMap.get("PG_SM_EPSW_DF").getAnswer());
map.put("score6", recordMap.get("PG_SM_PSQI_DF") == null ? "" : recordMap.get("PG_SM_PSQI_DF").getAnswer());
map.put("score7", recordMap.get("PG_JL_HAMD-24_DF") == null ? "" : recordMap.get("PG_JL_HAMD-24_DF").getAnswer());
map.put("score8", recordMap.get("PG_JL_SAS_DF") == null ? "" : recordMap.get("PG_JL_SAS_DF").getAnswer());
String score1 = recordMap.get("PG_TT_TAPS_DF") == null ? "" : recordMap.get("PG_TT_TAPS_DF").getAnswer();
String score2 = recordMap.get("PG_TT_TRACE_DF") == null ? "" : recordMap.get("PG_TT_TRACE_DF").getAnswer();
String score3 = recordMap.get("PG_TT_SRS22_DF") == null ? "" : recordMap.get("PG_TT_SRS22_DF").getAnswer();
if (StrUtil.isEmpty(score1) && StrUtil.isEmpty(score2) && StrUtil.isEmpty(score3)) {
map.put("ttpg_flag", false);
}else {
map.put("ttpg_flag", true);
}
map.put("score1", score1);
map.put("score2", score2);
map.put("score3", score3);
String score4 = recordMap.get("PG_SM_PHQ-9_DF") == null ? "" : recordMap.get("PG_SM_PHQ-9_DF").getAnswer();
String score5 = recordMap.get("PG_SM_EPSW_DF") == null ? "" : recordMap.get("PG_SM_EPSW_DF").getAnswer();
String score6 = recordMap.get("PG_SM_PSQI_DF") == null ? "" : recordMap.get("PG_SM_PSQI_DF").getAnswer();
if (StrUtil.isEmpty(score4) && StrUtil.isEmpty(score5) && StrUtil.isEmpty(score6)) {
map.put("smpg_flag", false);
}else {
map.put("smpg_flag", true);
}
map.put("table0", Tables.of(new String[][] {
new String[] { "00", "01" },
new String[] { "10", "11" }
}).border(BorderStyle.DEFAULT).create());
map.put("score4", score4);
map.put("score5", score5);
map.put("score6", score6);
String score7 = recordMap.get("PG_JL_HAMD-24_DF") == null ? "" : recordMap.get("PG_JL_HAMD-24_DF").getAnswer();
String score8 = recordMap.get("PG_JL_SAS_DF") == null ? "" : recordMap.get("PG_JL_SAS_DF").getAnswer();
if (StrUtil.isEmpty(score7) && StrUtil.isEmpty(score8)) {
map.put("jlpg_flag", false);
}else {
map.put("jlpg_flag", true);
}
map.put("score7", score7);
map.put("score8", score8);
}
//渲染
template.render(map);

43
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java

@ -89,15 +89,22 @@ public class ScreeningServiceImpl implements IScreeningService {
"性别",
"出生日期",
"年龄",
// "身份证",
"联系方式",
"身高",
"体重",
"BMI",
"体重自评结论",
"失眠自评(SRSS)得分",
"可接受的治疗方式",
"可接受的治疗周期",
"上床睡觉",
"入睡时间",
"睡醒时间",
"起床时间",
"睡眠效率",
"疾病风险",
"疾病风险-其他",
"筛查结论",
// "失眠自评(SRSS)得分",
// "可接受的治疗方式",
// "可接受的治疗周期",
"筛查时间",
"组织"
);
@ -114,28 +121,30 @@ public class ScreeningServiceImpl implements IScreeningService {
if (CollectionUtil.isNotEmpty(recordList)) {
map = recordList.stream().collect(Collectors.toMap(ScrScreenVo.ScreeningDetailVo::getQuestionCode, Function.identity()));
}
//筛查信息
ScrScreenVo.ScreeningDetailVo record = map.get("SCWJ-ILLNESS");
//筛查结果
ScrScreenVo.ScreeningDetailVo result = map.get("SCWJ-RESULT");
row += 1;
excelWriter.writeCellValue(0, row, detailVos.get(i).getName() + "");
excelWriter.writeCellValue(1, row, map.get("SCWJ-SEX") == null ? "未知" : map.get("SCWJ-SEX").getAnswer());
// excelWriter.writeCellValue(3, row, map.get("SCWJ-idCard") == null ? "" : map.get("SCWJ-idCard").getAnswer());
excelWriter.writeCellValue(2, row, map.get("SCWJ-BIRTH") == null ? "" : map.get("SCWJ-BIRTH").getAnswer());
excelWriter.writeCellValue(3, row, map.get("SCWJ-AGE") == null ? "" : map.get("SCWJ-AGE").getAnswer());
excelWriter.writeCellValue(4, row, map.get("SCWJ-PHONE") == null ? "" : map.get("SCWJ-PHONE").getAnswer());
excelWriter.writeCellValue(5, row, map.get("SCWJ-HEIGHT") == null ? "" : map.get("SCWJ-HEIGHT").getAnswer());
excelWriter.writeCellValue(6, row, map.get("SCWJ-WEIGHT") == null ? "" : map.get("SCWJ-WEIGHT").getAnswer());
excelWriter.writeCellValue(7, row, map.get("SCWJ-BMI") == null ? "" : map.get("SCWJ-BMI").getAnswer());
excelWriter.writeCellValue(8, row, map.get("SCWJ-JL") == null ? "" : map.get("SCWJ-JL").getAnswer());
excelWriter.writeCellValue(9, row, map.get("SCWJ-RESULT") == null ? "" : map.get("SCWJ-RESULT").getAnswer());
excelWriter.writeCellValue(10, row, map.get("SCWJ-ZLFS") == null ? "" : map.get("SCWJ-ZLFS").getAnswer());
excelWriter.writeCellValue(11, row, map.get("SCWJ-ZLZQ") == null ? "" : map.get("SCWJ-ZLZQ").getAnswer());
excelWriter.writeCellValue(12, row, DateUtil.format(detailVos.get(i).getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
excelWriter.writeCellValue(13, row, detailVos.get(i).getTenantName());
excelWriter.writeCellValue(9, row, map.get("SCWJ-SCSJ") == null ? "" : map.get("SCWJ-SCSJ").getAnswer());
excelWriter.writeCellValue(10, row, map.get("SCWJ-RSSJ") == null ? "" : map.get("SCWJ-RSSJ").getAnswer());
excelWriter.writeCellValue(11, row, map.get("SCWJ-SXSJ") == null ? "" : map.get("SCWJ-SXSJ").getAnswer());
excelWriter.writeCellValue(12, row, map.get("SCWJ-QCSJ") == null ? "" : map.get("SCWJ-QCSJ").getAnswer());
excelWriter.writeCellValue(13, row, map.get("SCWJ-SMXL") == null ? "" : map.get("SCWJ-SMXL").getAnswer());
excelWriter.writeCellValue(14, row, map.get("SCWJ-XBS") == null ? "" : map.get("SCWJ-XBS").getAnswer());
excelWriter.writeCellValue(15, row, map.get("SCWJ-XBS-QT") == null ? "" : map.get("SCWJ-XBS-QT").getAnswer());
excelWriter.writeCellValue(16, row, map.get("SCREEN-JL") == null ? "" : map.get("SCREEN-JL").getAnswer());
// excelWriter.writeCellValue(17, row, map.get("SCWJ-RESULT") == null ? "" : map.get("SCWJ-RESULT").getAnswer());
// excelWriter.writeCellValue(18, row, map.get("SCWJ-ZLFS") == null ? "" : map.get("SCWJ-ZLFS").getAnswer());
// excelWriter.writeCellValue(19, row, map.get("SCWJ-ZLZQ") == null ? "" : map.get("SCWJ-ZLZQ").getAnswer());
excelWriter.writeCellValue(17, row, DateUtil.format(detailVos.get(i).getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
excelWriter.writeCellValue(18, row, detailVos.get(i).getTenantName());
// if (record == null || StrUtil.isEmpty(record.getAnswer())) {
// excelWriter.writeCellValue(6, row, "否");
@ -185,7 +194,7 @@ public class ScreeningServiceImpl implements IScreeningService {
}
}
String filename = StrUtil.format("筛查-{}.xlsx", DateUtil.date().toString("yyyyMMdd"));
String filename = StrUtil.format("Screen-{}.xlsx", DateUtil.date().toString("yyyyMMdd"));
//response为HttpServletResponse对象
response.setContentType("application/vnd.ms-excel;charset=utf-8");

2
pom.xml

@ -152,7 +152,7 @@
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
<version>5.2.2</version>
</dependency>
<!-- velocity代码生成使用模板 -->

Loading…
Cancel
Save