diff --git a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java index 4d18978b..67b944c5 100644 --- a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java +++ b/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.*; diff --git a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/WxQrCodeController.java b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/WxQrCodeController.java index 76450cb7..f2d2dc90 100644 --- a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/WxQrCodeController.java +++ b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/WxQrCodeController.java @@ -72,7 +72,7 @@ public class WxQrCodeController { if (dto.getPageNum() > 0) { PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); } - return JsonResponse.ok(new PageInfo<>(wxQrCodeService.queryList(dto.getParam().getTenantId()))); + return JsonResponse.ok(new PageInfo<>(wxQrCodeService.adminQueryList(dto.getParam().getTenantId()))); } @ApiOperation(value = "查询客户端筛查二维码") diff --git a/acupuncture-admin/src/main/resources/TreamtmentPgTemplate.docx b/acupuncture-admin/src/main/resources/TreamtmentPgTemplate.docx new file mode 100644 index 00000000..e370ede7 --- /dev/null +++ b/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}} + diff --git a/acupuncture-system/pom.xml b/acupuncture-system/pom.xml index ad62855a..72bd9a0e 100644 --- a/acupuncture-system/pom.xml +++ b/acupuncture-system/pom.xml @@ -80,7 +80,7 @@ com.deepoove poi-tl - 1.10.5 + 1.12.2 diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/WxQrCodeDao.java b/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/WxQrCodeDao.java index b60cfc7b..a6192b03 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/WxQrCodeDao.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/persist/dao/WxQrCodeDao.java @@ -24,7 +24,9 @@ public interface WxQrCodeDao { */ List selectScreen(@Param("hospitalId") Long hospitalId); - List selectScreenList(@Param("hospitalIdList") List hospitalIdList); + List selectScreenList(@Param("hospitalIdList") List hospitalIdList, + @Param("userId") Long userId, + @Param("tenantId") Long tenantId); @DataSource(DataSourceType.MASTER) List adminSelectScreenList(@Param("hospitalIdList") List hospitalIdList); diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsTreatmentServiceImpl.java b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsTreatmentServiceImpl.java index 081f7e08..eded34cf 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsTreatmentServiceImpl.java +++ b/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 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); diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java index 7fd645ea..32a44833 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ScreeningServiceImpl.java @@ -85,19 +85,24 @@ public class ScreeningServiceImpl implements IScreeningService { public void export(HttpServletResponse response, ScreeningDto.Query param) { ExcelWriter excelWriter = ExcelUtil.getWriter(); List headerList = CollectionUtil.newArrayList( + "单位", "姓名", "性别", "出生日期", "年龄", -// "身份证", "联系方式", - "身高", - "体重", + "身高(cm)", + "体重(kg)", "BMI", "体重自评结论", - "失眠自评(SRSS)得分", - "可接受的治疗方式", - "可接受的治疗周期", + "上床睡觉", + "入睡时间", + "睡醒时间", + "起床时间", + "睡眠效率(%)", + "疾病风险", + "疾病风险-其他", + "筛查结论", "筛查时间", "组织" ); @@ -114,28 +119,31 @@ 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()); + row += 1; + excelWriter.writeCellValue(0, row, map.get("SCWJ-DW") == null ? "" : map.get("SCWJ-DW").getAnswer()); + excelWriter.writeCellValue(1, row, detailVos.get(i).getName() + ""); + excelWriter.writeCellValue(2, row, map.get("SCWJ-SEX") == null ? "未知" : map.get("SCWJ-SEX").getAnswer()); + excelWriter.writeCellValue(3, row, map.get("SCWJ-BIRTH") == null ? "" : map.get("SCWJ-BIRTH").getAnswer()); + excelWriter.writeCellValue(4, row, map.get("SCWJ-AGE") == null ? "" : map.get("SCWJ-AGE").getAnswer()); + excelWriter.writeCellValue(5, row, map.get("SCWJ-PHONE") == null ? "" : map.get("SCWJ-PHONE").getAnswer()); + excelWriter.writeCellValue(6, row, map.get("SCWJ-HEIGHT") == null ? "" : map.get("SCWJ-HEIGHT").getAnswer()); + excelWriter.writeCellValue(7, row, map.get("SCWJ-WEIGHT") == null ? "" : map.get("SCWJ-WEIGHT").getAnswer()); + excelWriter.writeCellValue(8, row, map.get("SCWJ-BMI") == null ? "" : map.get("SCWJ-BMI").getAnswer()); + excelWriter.writeCellValue(9, row, map.get("SCWJ-JL") == null ? "" : map.get("SCWJ-JL").getAnswer()); + excelWriter.writeCellValue(10,row, map.get("SCWJ-SCSJ") == null ? "" : map.get("SCWJ-SCSJ").getAnswer()); + excelWriter.writeCellValue(11, row, map.get("SCWJ-RSSJ") == null ? "" : map.get("SCWJ-RSSJ").getAnswer()); + excelWriter.writeCellValue(12, row, map.get("SCWJ-SXSJ") == null ? "" : map.get("SCWJ-SXSJ").getAnswer()); + excelWriter.writeCellValue(13, row, map.get("SCWJ-QCSJ") == null ? "" : map.get("SCWJ-QCSJ").getAnswer()); + excelWriter.writeCellValue(14, row, map.get("SCWJ-SMXL") == null ? "" : map.get("SCWJ-SMXL").getAnswer()); + excelWriter.writeCellValue(15, row, map.get("SCWJ-XBS") == null ? "" : map.get("SCWJ-XBS").getAnswer()); + excelWriter.writeCellValue(16, row, map.get("SCWJ-XBS-QT") == null ? "" : map.get("SCWJ-XBS-QT").getAnswer()); + excelWriter.writeCellValue(17, 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(18, row, DateUtil.format(detailVos.get(i).getCreateTime(), "yyyy-MM-dd HH:mm:ss")); + excelWriter.writeCellValue(19, row, detailVos.get(i).getTenantName()); // if (record == null || StrUtil.isEmpty(record.getAnswer())) { // excelWriter.writeCellValue(6, row, "否"); @@ -185,7 +193,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"); @@ -210,25 +218,26 @@ public class ScreeningServiceImpl implements IScreeningService { public void adminExport(HttpServletResponse response, ScreeningDto.Query param) { ExcelWriter excelWriter = ExcelUtil.getWriter(); List headerList = CollectionUtil.newArrayList( + "单位", "姓名", "性别", - "年龄", - "身份证", "出生日期", - "手机号", - "有高血压,>=140/90mmHg", - "血脂异常,或不清楚", - "有糖尿病", - "心跳不规则", - "吸烟", - "明显超重或肥胖", - "缺乏运动", - "有卒中家族史", - "有既往脑卒中病史", - "有既往短暂脑缺血病史", - "筛查结果", - "数据来源", - "科室名称"); + "年龄", + "联系方式", + "身高(cm)", + "体重(kg)", + "BMI", + "体重自评结论", + "上床睡觉", + "入睡时间", + "睡醒时间", + "起床时间", + "睡眠效率(%)", + "疾病风险", + "疾病风险-其他", + "筛查结论", + "筛查时间", + "组织"); excelWriter.writeHeadRow(headerList); PageInfo page = adminQueryDetailByPage(param, -1, -1); @@ -242,62 +251,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(2, row, map.get("SCWJ-AGE") == null ? "" : map.get("SCWJ-AGE").getAnswer()); - excelWriter.writeCellValue(3, row, map.get("SCWJ-idCard") == null ? "" : map.get("SCWJ-idCard").getAnswer()); - excelWriter.writeCellValue(4, row, map.get("SCWJ-BIRTH") == null ? "" : map.get("SCWJ-BIRTH").getAnswer()); + excelWriter.writeCellValue(0, row, map.get("SCWJ-DW") == null ? "" : map.get("SCWJ-DW").getAnswer()); + excelWriter.writeCellValue(1, row, detailVos.get(i).getName() + ""); + excelWriter.writeCellValue(2, row, map.get("SCWJ-SEX") == null ? "未知" : map.get("SCWJ-SEX").getAnswer()); + excelWriter.writeCellValue(3, row, map.get("SCWJ-BIRTH") == null ? "" : map.get("SCWJ-BIRTH").getAnswer()); + excelWriter.writeCellValue(4, row, map.get("SCWJ-AGE") == null ? "" : map.get("SCWJ-AGE").getAnswer()); excelWriter.writeCellValue(5, row, map.get("SCWJ-PHONE") == null ? "" : map.get("SCWJ-PHONE").getAnswer()); - - if (record == null || StrUtil.isEmpty(record.getAnswer())) { - excelWriter.writeCellValue(6, row, "否"); - excelWriter.writeCellValue(7, row, "否"); - excelWriter.writeCellValue(8, row, "否"); - excelWriter.writeCellValue(9, row, "否"); - excelWriter.writeCellValue(10, row, "否"); - excelWriter.writeCellValue(11, row, "否"); - excelWriter.writeCellValue(12, row, "否"); - excelWriter.writeCellValue(13, row, "否"); - excelWriter.writeCellValue(14, row, "否"); - excelWriter.writeCellValue(15, row, "否"); - } else { - String answer = record.getAnswer(); - String[] split = answer.split(","); - excelWriter.writeCellValue(6, row, Arrays.asList(split).contains("01") ? "是" : "否"); - excelWriter.writeCellValue(7, row, Arrays.asList(split).contains("02") ? "是" : "否"); - excelWriter.writeCellValue(8, row, Arrays.asList(split).contains("03") ? "是" : "否"); - excelWriter.writeCellValue(9, row, Arrays.asList(split).contains("04") ? "是" : "否"); - excelWriter.writeCellValue(10, row, Arrays.asList(split).contains("05") ? "是" : "否"); - excelWriter.writeCellValue(11, row, Arrays.asList(split).contains("06") ? "是" : "否"); - excelWriter.writeCellValue(12, row, Arrays.asList(split).contains("07") ? "是" : "否"); - excelWriter.writeCellValue(13, row, Arrays.asList(split).contains("08") ? "是" : "否"); - excelWriter.writeCellValue(14, row, Arrays.asList(split).contains("09") ? "是" : "否"); - excelWriter.writeCellValue(15, row, Arrays.asList(split).contains("10") ? "是" : "否"); - } - String str = ""; - if (map.get("SCWJ-RESULT") != null && StrUtil.isNotEmpty(map.get("SCWJ-RESULT").getAnswer())) { - String answer1 = map.get("SCWJ-RESULT").getAnswer(); - if ("0".equals(answer1)) { - str = "正常"; - } - if ("1".equals(answer1)) { - str = "低危"; - } - if ("2".equals(answer1)) { - str = "中危"; - } - if ("3".equals(answer1)) { - str = "高危"; - } - } - excelWriter.writeCellValue(16, row, str); - excelWriter.writeCellValue(17, row, map.get("SCWJ-SQMC") == null ? "" : map.get("SCWJ-SQMC").getAnswer()); - excelWriter.writeCellValue(18, row, map.get("SCWJ-DEPT") == null ? "" : map.get("SCWJ-DEPT").getAnswer()); + excelWriter.writeCellValue(6, row, map.get("SCWJ-HEIGHT") == null ? "" : map.get("SCWJ-HEIGHT").getAnswer()); + excelWriter.writeCellValue(7, row, map.get("SCWJ-WEIGHT") == null ? "" : map.get("SCWJ-WEIGHT").getAnswer()); + excelWriter.writeCellValue(8, row, map.get("SCWJ-BMI") == null ? "" : map.get("SCWJ-BMI").getAnswer()); + excelWriter.writeCellValue(9, row, map.get("SCWJ-JL") == null ? "" : map.get("SCWJ-JL").getAnswer()); + excelWriter.writeCellValue(10,row, map.get("SCWJ-SCSJ") == null ? "" : map.get("SCWJ-SCSJ").getAnswer()); + excelWriter.writeCellValue(11, row, map.get("SCWJ-RSSJ") == null ? "" : map.get("SCWJ-RSSJ").getAnswer()); + excelWriter.writeCellValue(12, row, map.get("SCWJ-SXSJ") == null ? "" : map.get("SCWJ-SXSJ").getAnswer()); + excelWriter.writeCellValue(13, row, map.get("SCWJ-QCSJ") == null ? "" : map.get("SCWJ-QCSJ").getAnswer()); + excelWriter.writeCellValue(14, row, map.get("SCWJ-SMXL") == null ? "" : map.get("SCWJ-SMXL").getAnswer()); + excelWriter.writeCellValue(15, row, map.get("SCWJ-XBS") == null ? "" : map.get("SCWJ-XBS").getAnswer()); + excelWriter.writeCellValue(16, row, map.get("SCWJ-XBS-QT") == null ? "" : map.get("SCWJ-XBS-QT").getAnswer()); + excelWriter.writeCellValue(17, 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(18, row, DateUtil.format(detailVos.get(i).getCreateTime(), "yyyy-MM-dd HH:mm:ss")); + excelWriter.writeCellValue(19, row, detailVos.get(i).getTenantName()); } } } diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/WxQrCodeServiceImpl.java b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/WxQrCodeServiceImpl.java index f5129c91..165ce2fe 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/WxQrCodeServiceImpl.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/WxQrCodeServiceImpl.java @@ -203,7 +203,7 @@ public class WxQrCodeServiceImpl implements WxQrCodeService { @Override public List queryList(Long hospitalId) { - return wxQrCodeDao.selectScreenList(hospitalId == null ? null : CollectionUtil.newArrayList(hospitalId)); + return wxQrCodeDao.selectScreenList(hospitalId == null ? null : CollectionUtil.newArrayList(hospitalId), SecurityUtils.getUserId(), SecurityUtils.getTenantId()); } @Override diff --git a/acupuncture-system/src/main/resources/mapper/dao/ScreeningDetailDao.xml b/acupuncture-system/src/main/resources/mapper/dao/ScreeningDetailDao.xml index 1ebbbfac..ef479da3 100644 --- a/acupuncture-system/src/main/resources/mapper/dao/ScreeningDetailDao.xml +++ b/acupuncture-system/src/main/resources/mapper/dao/ScreeningDetailDao.xml @@ -130,10 +130,10 @@ and r.tenant_id = #{param.tenantId} - + and r.create_time >= #{param.startTime} - + and r.create_time <= #{param.endTime} diff --git a/acupuncture-system/src/main/resources/mapper/dao/SysPowerDao.xml b/acupuncture-system/src/main/resources/mapper/dao/SysPowerDao.xml index 4154f3eb..ef0da034 100644 --- a/acupuncture-system/src/main/resources/mapper/dao/SysPowerDao.xml +++ b/acupuncture-system/src/main/resources/mapper/dao/SysPowerDao.xml @@ -4,14 +4,7 @@ diff --git a/acupuncture-system/src/main/resources/mapper/dao/WxQrCodeDao.xml b/acupuncture-system/src/main/resources/mapper/dao/WxQrCodeDao.xml index 90c0985b..accdb6e0 100644 --- a/acupuncture-system/src/main/resources/mapper/dao/WxQrCodeDao.xml +++ b/acupuncture-system/src/main/resources/mapper/dao/WxQrCodeDao.xml @@ -94,6 +94,11 @@ and del_flag = 0 #{id} + + + AND c.tenant_id = #{tenantId} + + GROUP BY c.id order by c.create_time desc diff --git a/acupuncture-前台/.env.development b/acupuncture-前台/.env.development index 5726980e..14589f3a 100644 --- a/acupuncture-前台/.env.development +++ b/acupuncture-前台/.env.development @@ -1,5 +1,5 @@ # 页面标题 -VUE_APP_TITLE = 朱琏针灸联盟数据系统 +VUE_APP_TITLE = 朱琏针灸数据云系统 # 开发环境配置 ENV = 'development' diff --git a/acupuncture-前台/.env.production b/acupuncture-前台/.env.production index 01d2c94e..92804d37 100644 --- a/acupuncture-前台/.env.production +++ b/acupuncture-前台/.env.production @@ -1,5 +1,5 @@ # 页面标题 -VUE_APP_TITLE = 朱琏针灸联盟数据系统 +VUE_APP_TITLE = 朱琏针灸数据云系统 # 生产环境配置 NODE_ENV = 'production' diff --git a/acupuncture-前台/.env.staging b/acupuncture-前台/.env.staging index 384b5ca3..db72d730 100644 --- a/acupuncture-前台/.env.staging +++ b/acupuncture-前台/.env.staging @@ -1,5 +1,5 @@ # 页面标题 -VUE_APP_TITLE = 朱琏针灸联盟数据系统 +VUE_APP_TITLE = 朱琏针灸数据云系统 # 生产环境配置 NODE_ENV = 'production' diff --git a/acupuncture-前台/README.md b/acupuncture-前台/README.md index 00c0ab84..4fff3b66 100644 --- a/acupuncture-前台/README.md +++ b/acupuncture-前台/README.md @@ -27,4 +27,7 @@ npm run build:stage # 构建生产环境 npm run build:prod -``` \ No newline at end of file +``` + + + diff --git a/acupuncture-前台/dist.zip b/acupuncture-前台/dist.zip deleted file mode 100644 index 215ddd7c..00000000 Binary files a/acupuncture-前台/dist.zip and /dev/null differ diff --git a/acupuncture-前台/package.json b/acupuncture-前台/package.json index b87caae0..604bfe17 100644 --- a/acupuncture-前台/package.json +++ b/acupuncture-前台/package.json @@ -1,7 +1,7 @@ { "name": "ruoyi", "version": "3.8.9", - "description": "朱琏针灸联盟数据系统", + "description": "朱琏针灸数据云系统", "author": "若依", "license": "MIT", "scripts": { diff --git a/acupuncture-前台/src/layout/components/Navbar.vue b/acupuncture-前台/src/layout/components/Navbar.vue index f667fd9f..6641a694 100644 --- a/acupuncture-前台/src/layout/components/Navbar.vue +++ b/acupuncture-前台/src/layout/components/Navbar.vue @@ -13,7 +13,7 @@ v-if="!topNav" /> -->
- 朱琏针灸联盟数据系统({{ userInfo.tenantName }}) + 朱琏针灸数据云系统({{ userInfo.tenantName }})
diff --git a/acupuncture-前台/src/views/login.vue b/acupuncture-前台/src/views/login.vue index c7e9b3c5..2295c6c7 100644 --- a/acupuncture-前台/src/views/login.vue +++ b/acupuncture-前台/src/views/login.vue @@ -8,10 +8,10 @@ :rules="loginRules" class="login-form" > -

+

登录到
- 朱琏针灸联盟数据系统 + 朱琏针灸数据云系统

-

朱琏针灸联盟数据系统

+

朱琏针灸数据云系统

@@ -32,6 +32,12 @@ 扫描身份证
--> + + + + + + + + + + + + + + + {{ form["SCWJ-JL"] || "- - -" }} + + - +
-
体重自评
- - +
睡眠质量评估
+ + + + + - - + + - - + + - - - {{ form["SCWJ-JL"] || "- - -" }} + + + {{ form["SCWJ-SMXL"] || "- - -" }}%
+ +
+
疾病风险选择
+ + + + + + + +
-
+ +
+
筛查结论
+
+ 您的体重指数(BMI)为: + {{ form["SCWJ-BMI"] || "- - -" }} +
+
+ 您的睡眠效率为: + {{ form["SCWJ-SMXL"] || "- - -" }}% +
+
+ + {{ tips }} + + - - - +
- -
+ +
+ + 提交 +
{{ tenantName || "- - - -" }}
@@ -175,6 +282,7 @@ import { screenSubmit, queryHospitalNoToken, } from "@/api/screening.js"; + export default { name: "Notice", data() { @@ -187,7 +295,30 @@ export default { stepNum: 1, // 步骤数 uploadFileUrl: process.env.VUE_APP_BASE_URL + "/baidu/ocr/idcardInfo", // 上传的图片服务器地址 fileList: [], - + // 现病史 + medicalHistory: [ + "无", + "高脂血症", + "肝脏疾病(脂肪肝、乙型肝炎、肝硬化等)", + "胰岛素抵抗", + "高尿酸", + "多囊卵巢综合症", + "高血压", + "脑血管病", + "恶性肿瘤", + "冠心病", + "精神疾病", + "胃和十二指肠溃疡", + "肥胖症", + "骨质疏松症", + "遗传性、先天性疾病", + "糖尿病", + "慢性肺系疾病", + "过敏性疾病", + "关节炎", + "痛风", + "肾炎、肾病", + ], BMITips: [ { label: "体重过轻", @@ -213,6 +344,8 @@ export default { 超重: "3", 肥胖: "4", }, + tips: "", //结果提示 + tipsError: false, //结果提示 // 1.您觉得平时睡眠足够吗 ? // ①睡眠过多了 ②睡眠正好 ③睡眠欠一些 ④睡眠不够 ⑤睡眠时间远远不够 // 2.您在睡眠后是否已觉得充分休息过了 ? @@ -336,6 +469,7 @@ export default { }, ], // 表单参数 form: { + "SCWJ-DW": "", "SCWJ-NAME": "", "SCWJ-SEX": "男", "SCWJ-BIRTH": "", @@ -346,6 +480,13 @@ export default { "SCWJ-BMI": "", "SCWJ-JL": "", "SCWJ-ZLFS": [], + "SCWJ-SCSJ": "22:00", // 上床睡觉 + "SCWJ-RSSJ": "22:30", // 入睡时间 + "SCWJ-SXSJ": "06:30", // 睡醒时间 + "SCWJ-QCSJ": "07:00", // 起床时间 + "SCWJ-SMXL": "", // 睡眠效率 + "SCWJ-XBS": [], // 现病史 + "SCWJ-XBS-QT": "", // 现病史- 其他 // "SCWJ-NAME": "测试患者2", // "SCWJ-SEX": "男", // "SCWJ-BIRTH": "1945-01-01", @@ -359,6 +500,13 @@ export default { }, // 表单校验 rules: { + "SCWJ-DW": [ + { + required: true, + message: "单位不能为空", + trigger: "blur", + }, + ], "SCWJ-NAME": [ { required: true, @@ -396,7 +544,7 @@ export default { { pattern: /^1[3456789]\d{9}$/, message: "格式不正确", - trigger: "change", + trigger: ["blur", "change"], }, ], "SCWJ-HEIGHT": [ @@ -420,6 +568,34 @@ export default { trigger: "blur", }, ], + "SCWJ-SCSJ": [ + { + required: true, + message: "上床睡觉不能为空", + trigger: "change", + }, + ], + "SCWJ-RSSJ": [ + { + required: true, + message: "入睡时间不能为空", + trigger: "change", + }, + ], + "SCWJ-SXSJ": [ + { + required: true, + message: "睡醒时间不能为空", + trigger: "change", + }, + ], + "SCWJ-QCSJ": [ + { + required: true, + message: "起床时间不能为空", + trigger: "change", + }, + ], }, loading: false, }; @@ -429,8 +605,84 @@ export default { console.log("this.tenantId", this.tenantId); localStorage.setItem("tenantId", this.tenantId); this.getQueryHospitalNoToken(); // 组织id获取组织名称 + this.calculateSleepTime(); //计算睡眠效率 + }, + // 监听结论和睡眠效率 + watch: { + form: { + handler(newVal, oldVal) { + this.getTips(); + }, + deep: true, + }, }, methods: { + // 获取筛查结论 + getTips() { + console.log("获取筛查结论"); + + const BMI = this.form["SCWJ-BMI"]; // BMI + const sleepEfficiency = this.form["SCWJ-SMXL"]; // 睡眠效率 + if (BMI && sleepEfficiency) { + // BMI大于25或睡眠效率低于85%,{{ "建议找专业医师进一步评估" }}。 + if (BMI > 25 || sleepEfficiency < 85) { + this.tips = "建议找专业医师进一步评估"; + this.tipsError = true; + } else { + this.tips = "均属于正常范围,请继续保持"; + this.tipsError = false; + } + } + }, + // 计算睡眠效率 + // 上床睡觉时间、入睡时间、睡醒时间、起床时间,自动计算睡眠效率(睡眠时间/在床上时间) + // 睡眠时间 = 睡醒时间 - 入睡时间 + // 在床上时间 = 起床时间 - 上床时间 + // 睡眠效率 = 睡眠时间 / 在床上时间 + // 注: + // 睡醒时间 小于 入睡时间则表示是第二天的时间 + // 起床时间 小于 上床则表示是第二天的时间 + calculateSleepTime() { + // 获取时间值 + const bedTime = this.form["SCWJ-SCSJ"]; // 上床睡觉时间 + const sleepTime = this.form["SCWJ-RSSJ"]; // 入睡时间 + const wakeTime = this.form["SCWJ-SXSJ"]; // 睡醒时间 + const wakeBedTime = this.form["SCWJ-QCSJ"]; // 起床时间 + + // 如果缺少任一时间,直接返回 + if (!bedTime || !sleepTime || !wakeTime || !wakeBedTime) return; + + // 将时间字符串转换为分钟数 + const toMinutes = (timeStr) => { + const [hour, minute] = timeStr.split(":"); + return parseInt(hour) * 60 + parseInt(minute); + }; + + // 计算在床上时间和睡眠时间 + // 在床上时间 = 上床睡觉时间 - 入睡时间 + // 睡眠时间 = 入睡时间 - 起床时间 + let inBedMinutes = toMinutes(wakeBedTime) - toMinutes(bedTime); // 在床上时间 + let sleepMinutes = toMinutes(wakeTime) - toMinutes(sleepTime); // 睡眠时间 + + // 处理跨天情况 + // 如果入睡时间小于上床时间,说明跨天,加上24小时 + if (inBedMinutes < 0) { + inBedMinutes += 24 * 60; + } + + // 如果睡醒时间小于入睡时间,说明跨天,加上24小时 + if (sleepMinutes < 0) { + sleepMinutes += 24 * 60; + } + console.log("inBedMinutes", inBedMinutes); + console.log("sleepMinutes", sleepMinutes); + // 计算睡眠效率(睡眠时间 / 在床上时间) + const sleepEfficiency = (sleepMinutes / inBedMinutes) * 100; + + // 更新睡眠效率字段,保留两位小数 + this.form["SCWJ-SMXL"] = sleepEfficiency.toFixed(0); + }, + // 通过出生日期计算年龄 calculateAge() { const birthDate = new Date(this.form["SCWJ-BIRTH"]); @@ -560,48 +812,68 @@ export default { // 量表结果 async scaleSubmitForm() { try { - // ------ 量表分值计算 ------ - let score = 0; - // 计算总分, topic${i}属性不一定存在,先校验是否存在 - for (let i = 1; i <= 24; i++) { - if (this.form[`topic${i}`] !== undefined) { - score += this.form[`topic${i}`]; + this.$refs["form"].validate(async (valid) => { + if (valid) { + // ------ 量表分值计算 ------ + let score = 0; + // 计算总分, topic${i}属性不一定存在,先校验是否存在 + for (let i = 1; i <= 24; i++) { + if (this.form[`topic${i}`] !== undefined) { + score += this.form[`topic${i}`]; + } + } + // ------ 创建筛查 ------ + const params = { + param: { + type: 33, + tenantId: this.tenantId, + centerId: this.tenantId, + }, + }; + create(params).then(async (res) => { + this.loading = true; + this.detailId = res.data.detailId; + this.id = res.data.id; + // ------ 保存答案 ------ + // 基本信息 + await this.saveAnswer(this.form["SCWJ-DW"], "SCWJ-DW"); + await this.saveAnswer(this.form["SCWJ-NAME"], "SCWJ-NAME"); + await this.saveAnswer(this.form["SCWJ-SEX"], "SCWJ-SEX"); + await this.saveAnswer(this.form["SCWJ-BIRTH"], "SCWJ-BIRTH"); + await this.saveAnswer(this.form["SCWJ-AGE"], "SCWJ-AGE"); + await this.saveAnswer(this.form["SCWJ-PHONE"], "SCWJ-PHONE"); + await this.saveAnswer(this.form["SCWJ-HEIGHT"], "SCWJ-HEIGHT"); + await this.saveAnswer(this.form["SCWJ-WEIGHT"], "SCWJ-WEIGHT"); + await this.saveAnswer(this.form["SCWJ-BMI"], "SCWJ-BMI"); + await this.saveAnswer(this.form["SCWJ-JL"], "SCWJ-JL"); + await this.saveAnswer(this.form["SCWJ-SCSJ"], "SCWJ-SCSJ"); + await this.saveAnswer(this.form["SCWJ-RSSJ"], "SCWJ-RSSJ"); + await this.saveAnswer(this.form["SCWJ-SXSJ"], "SCWJ-SXSJ"); + await this.saveAnswer(this.form["SCWJ-QCSJ"], "SCWJ-QCSJ"); + await this.saveAnswer(this.form["SCWJ-SMXL"], "SCWJ-SMXL"); + await this.saveAnswer( + this.form["SCWJ-XBS"].toString(), + "SCWJ-XBS" + ); + await this.saveAnswer(this.form["SCWJ-XBS-QT"], "SCWJ-XBS-QT"); + await this.saveAnswer(this.tips, "SCREEN-JL"); + + // 筛查总分 + // await this.saveAnswer(score, "SCWJ-RESULT"); + // await this.saveAnswer( + // this.form["SCWJ-ZLFS"].toString(), + // "SCWJ-ZLFS" + // ); // 治疗方式 + // await this.saveAnswer(this.form["SCWJ-ZLZQ"], "SCWJ-ZLZQ"); // 治疗周期 + // ------ 提交筛查 ------ + const submitParams = { param: { detailId: this.detailId } }; + await screenSubmit(submitParams).then((response) => { + this.loading = false; + this.disabled = false; + this.$modal.msgSuccess("提交成功"); + }); + }); } - } - // ------ 创建筛查 ------ - const params = { - param: { - type: 33, - tenantId: this.tenantId, - centerId: this.tenantId, - }, - }; - create(params).then(async (res) => { - this.loading = true; - this.detailId = res.data.detailId; - this.id = res.data.id; - // ------ 保存答案 ------ - // 基本信息 - await this.saveAnswer(this.form["SCWJ-NAME"], "SCWJ-NAME"); - await this.saveAnswer(this.form["SCWJ-SEX"], "SCWJ-SEX"); - await this.saveAnswer(this.form["SCWJ-BIRTH"], "SCWJ-BIRTH"); - await this.saveAnswer(this.form["SCWJ-AGE"], "SCWJ-AGE"); - await this.saveAnswer(this.form["SCWJ-PHONE"], "SCWJ-PHONE"); - await this.saveAnswer(this.form["SCWJ-HEIGHT"], "SCWJ-HEIGHT"); - await this.saveAnswer(this.form["SCWJ-WEIGHT"], "SCWJ-WEIGHT"); - await this.saveAnswer(this.form["SCWJ-BMI"], "SCWJ-BMI"); - await this.saveAnswer(this.form["SCWJ-JL"], "SCWJ-JL"); - // 筛查总分 - await this.saveAnswer(score, "SCWJ-RESULT"); - await this.saveAnswer(this.form["SCWJ-ZLFS"].toString(), "SCWJ-ZLFS"); // 治疗方式 - await this.saveAnswer(this.form["SCWJ-ZLZQ"], "SCWJ-ZLZQ"); // 治疗周期 - // ------ 提交筛查 ------ - const submitParams = { param: { detailId: this.detailId } }; - await screenSubmit(submitParams).then((response) => { - this.loading = false; - this.disabled = false; - this.$modal.msgSuccess("提交成功"); - }); }); } catch (error) { this.loading = false; @@ -633,6 +905,15 @@ export default {