Browse Source

合并master

hnzxyjhyy
ccsens_zhengzhichuan 1 week ago
parent
commit
f25db3c17f
  1. 473
      app_client/pages/index/index.vue
  2. 8
      ruisi_java/ruisi-cc-generator/src/main/resources/mbg.xml
  3. 3
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/EmsDto.java
  4. 28
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/PmsPatientDto.java
  5. 61
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/RmsDto.java
  6. 3
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/StatisticsDto.java
  7. 173
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleCognitiveRelevance.java
  8. 1082
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleCognitiveRelevanceExample.java
  9. 23
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleRelevance.java
  10. 121
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleRelevanceExample.java
  11. 22
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReport.java
  12. 140
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportExample.java
  13. 122
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportScaleScore.java
  14. 640
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportScaleScoreExample.java
  15. 5
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/AmsVo.java
  16. 11
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/HomeDpVo.java
  17. 20
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/PmsPatientVo.java
  18. 155
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/RmsVo.java
  19. 4
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/dao/StatisticsDao.java
  20. 30
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/mapper/EmsEvaluationScaleCognitiveRelevanceMapper.java
  21. 66
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/StatisticsServiceImpl.java
  22. 202
      ruisi_java/ruisi-system/src/main/resources/mapper/dao/StatisticsDao.xml
  23. 353
      ruisi_java/ruisi-system/src/main/resources/mapper/system/EmsEvaluationScaleCognitiveRelevanceMapper.xml
  24. 46
      ruisi_java/ruisi-system/src/main/resources/mapper/system/EmsEvaluationScaleRelevanceMapper.xml
  25. 56
      ruisi_java/ruisi-system/src/main/resources/mapper/system/RmsReportMapper.xml
  26. 200
      ruisi_java/ruisi-system/src/main/resources/mapper/system/RmsReportScaleScoreMapper.xml
  27. 55
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/ReportController.java
  28. 11
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/ReportPdfController.java
  29. 18
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/RmsController.java
  30. 42
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/AmsDao.java
  31. 3
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/HmsDao.java
  32. 52
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/RmsDao.java
  33. 36
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/AmsReportService.java
  34. 2
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IPmsPatientService.java
  35. 7
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IRmsService.java
  36. 875
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/AmsReportServiceImpl.java
  37. 328
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/PmsPatientServiceImpl.java
  38. 2
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/QmsScaleAssConfServiceImpl.java
  39. 965
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/RmsServiceImpl.java
  40. 5
      ruisi_java/ruisi-web-admin/src/main/resources/application-dev.yml
  41. 18
      ruisi_java/ruisi-web-admin/src/main/resources/application-prod.yml
  42. 15
      ruisi_java/ruisi-web-admin/src/main/resources/application-stage.yml
  43. 241
      ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/AmsDao.xml
  44. 9
      ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/HmsDao.xml
  45. 49
      ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/PmsPatientDao.xml
  46. 817
      ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/RmsDao.xml
  47. 7
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/AmsController.java
  48. 9
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/AmsReportTemplateController.java
  49. 6
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/EmsController.java
  50. 9
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/RmsController.java
  51. 6
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/scheduled/SyncHospitalData.java
  52. 23
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/persist/dao/EmsDao.java
  53. 4
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/persist/dao/RmsDao.java
  54. 1
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/AmsReportService.java
  55. 1
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IAmsService.java
  56. 3
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IEmsService.java
  57. 4
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IRmsService.java
  58. 250
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/AmsReportServiceImpl.java
  59. 246
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/AmsServiceImpl.java
  60. 12
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/IEmsServiceImpl.java
  61. 459
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/RmsServiceImpl.java
  62. 5
      ruisi_java/ruisi-web-client/src/main/resources/application-dev.yml
  63. 6
      ruisi_java/ruisi-web-client/src/main/resources/application-prod.yml
  64. 5
      ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/AmsDao.xml
  65. 98
      ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/RmsDao.xml
  66. 338
      web_admin/src/views/his/Evaluation/index.vue

473
app_client/pages/index/index.vue

@ -1,10 +1,118 @@
<template>
<view class="content">
<!-- <web-view src="https://rs.sxyfrs.com/ruisi/clienths/#/"></web-view> -->
<!-- <web-view src="https://rs.sxyfrs.com/ruisi/training/"></web-view> -->
<!-- <web-view src="https://test.tall.wiki/ruisiCga/client/#/"></web-view> -->
<!-- 罗湖医院 -->
<web-view src="http://172.16.40.155/cga/v2/api/client/#/"></web-view>
<view
v-if="type"
class="relative column align-center justify-center full-height bg-white"
>
<view class="last-time-box">
<button
class="last-time last-time1"
shape="circle"
size="mini"
:plain="true"
@click="handleFast"
>
外网快捷
</button>
<button
class="last-time"
:style="{
'pointer-events': isUps ? 'none' : '',
opacity: isUps ? 0.5 : 1,
}"
shape="circle"
size="mini"
:plain="true"
@click="openPage"
>
跳过 {{ leftTime }}
</button>
</view>
<view class="icon-setting" @click="zzcNo">
<image src="./sz.png" alt="" mode="widthFix" />
</view>
<view>
<div
style="
display: flex;
align-items: center;
justify-content: center;
width: 100vw;
height: 100vh;
"
>
<image
src="./appbg.png"
alt=""
style="width: 100%; height: 100%"
mode="widthFix"
/>
</div>
<view class="ups" v-if="isUps">
<view class="ups-box">
<view class="header"> 老年综合评估系统 </view>
<uni-forms
ref="formRef"
:modelValue="formData"
:label-width="70"
:rules="rules"
>
<uni-forms-item label="访问域名" name="APP_ACCESS_HOST">
<view class="view-item">
<view class="view-item-hz">
<uni-data-select
style="flex: 2"
v-model="value"
:localdata="range"
></uni-data-select>
</view>
<uni-easyinput
type="text"
v-model="formData.APP_ACCESS_HOST"
placeholder="请输入域名"
/>
<view class="view-item-hz view-item-hz1">
<uni-easyinput
type="text"
v-model="formData.APP_ACCESS_ROOT"
placeholder="请输入‌根路径"
/>
</view>
</view>
</uni-forms-item>
<uni-forms-item label="页面地址" name="APP_ACCESS_HOST">
<view class="view-item">
<view class="view-item-title">
{{ value }}{{ formData.APP_ACCESS_HOST
}}{{ formData.APP_ACCESS_ROOT }}</view
>
</view>
</uni-forms-item>
<view
class="btn-box"
style="display: flex; justify-content: space-between"
>
<view class="borrad">
<button type="default" style="color: #000" @click="onCancel">
取消
</button>
</view>
<view class="borrad">
<button class="bul" type="default" @click="onConfirm">
确定
</button>
</view>
</view>
</uni-forms>
</view>
</view>
</view>
</view>
<view v-if="webViewUrl">
<web-view @message="handleH5Message" :src="webViewUrl"></web-view>
</view>
</view>
</template>
@ -12,19 +120,362 @@
<script>
export default {
data() {
return {}
const HOSTROOT = (rule, value, callback) => {
if (!this.formData.APP_ACCESS_HOST) {
callback(new Error("域名不能为空"));
} else if (!this.formData.APP_ACCESS_ROOT) {
callback(new Error("根路径不能为空"));
} else {
callback();
}
};
return {
type: true,
value: "http://",
range: [
{ value: "http://", text: "http://" },
{ value: "https://", text: "https://" },
],
title: "Hello",
showCreateBtn: true,
isUps: false,
formData: {
APP_ACCESS_HOST: "",
APP_ACCESS_ROOT: "",
},
leftTime: 5,
rules: {
APP_ACCESS_HOST: {
rules: [
{
required: true,
errorMessage: "域名不能为空",
},
{
validateFunction: (rule, value, data, callback) => {
if (!this.formData.APP_ACCESS_HOST) {
callback("域名不能为空");
} else if (!this.formData.APP_ACCESS_ROOT) {
callback("根路径不能为空");
}
return true;
},
},
],
},
},
timer: null, //
timer1: null, //
state: true,
webViewUrl: null,
};
},
onShow() {},
onLoad() {
let HOST = uni.getStorageSync("APP_ACCESS_HOST") || null; //
let ROOT = uni.getStorageSync("APP_ACCESS_ROOT") || null; //
this.value = uni.getStorageSync("APP_HOST") || "http://"; //
this.isUps = true;
if (HOST && ROOT) {
this.isUps = false;
}
this.formData.APP_ACCESS_HOST = HOST;
this.formData.APP_ACCESS_ROOT = ROOT || "/cga/v2/client/#/";
//
this.init();
//
if (!HOST || !ROOT) {
this.isUps = true;
}
},
watch: {
isUps(newVal, oldVal) {
if (newVal) {
clearInterval(this.timer);
this.timer = undefined;
} else {
this.init();
}
},
},
onLoad() {},
onReady() {},
methods: {
// H5
handleH5Message(e) {
let APP_HOST = uni.getStorageSync("APP_HOST");
let APP_ACCESS_HOST = uni.getStorageSync("APP_ACCESS_HOST");
let url = `${APP_HOST}${APP_ACCESS_HOST}${e.detail.data[0].filePath}`;
this.handlexz(url);
},
created() {
//
handlexz(url) {
console.log("下载", url);
uni.downloadFile({
url: url,
success: (res) => {
console.log("下载成功", res);
if (res.statusCode === 200) {
//
uni.openDocument({
filePath: res.tempFilePath,
// fileType: "pdf",
success: function (res) {
console.log("打开文档成功");
},
onShow() {}
fail: function (err) {
console.log("打开文档失败", err);
},
});
}
},
fail: (err) => {
console.log("下载失败:", err);
uni.showToast({
title: "下载失败",
icon: "none",
});
},
});
},
//
handleFast() {
this.value = "https://";
this.formData.APP_ACCESS_HOST = "www.ylinno.com";
this.formData.APP_ACCESS_ROOT = "/cga/v2/client/#/";
},
//
onCancel() {
this.isUps = false;
},
onConfirm() {
if (!this.$refs.formRef) return;
this.$refs.formRef
.validate()
.then(async () => {
uni.setStorageSync("APP_ACCESS_HOST", this.formData.APP_ACCESS_HOST);
uni.setStorageSync("APP_HOST", this.value);
uni.setStorageSync("APP_ACCESS_ROOT", this.formData.APP_ACCESS_ROOT);
this.isUps = false;
this.openPage();
})
.catch((error) => {
console.error(error);
});
},
init() {
this.timer = setInterval(() => {
if (this.leftTime === 0) {
clearInterval(this.timer);
this.timer = undefined;
if (!this.isUps) {
this.openPage();
}
return;
}
this.leftTime -= 1;
}, 1000);
},
openPage() {
let HOST = this.formData.APP_ACCESS_HOST || null;
let ROOT = this.formData.APP_ACCESS_ROOT || null;
if (HOST && ROOT) {
this.webViewUrl = `${this.value}${HOST}${ROOT}`;
this.type = false;
} else {
this.isUps = true;
}
},
//
zzcoff() {
this.isUps = false;
},
//
zzcNo() {
clearInterval(this.timer1);
this.isUps = true;
},
},
};
</script>
<style lang="scss" scoped>
.view-item {
position: relative;
display: flex;
align-items: center;
.view-item-title {
width: 100%;
border: 1px solid #e5e5e5;
padding: 0 10px;
line-height: 35px;
border-radius: 4px;
}
.view-item-hz1 {
flex: 1;
height: 37px;
line-height: 37px;
background: #f5f7fa;
width: 80px;
text-align: center;
border-radius: 4px 0 0 4px;
border-right: none !important;
margin-left: 4px;
}
}
.btn-box {
button {
width: 160px;
height: 44px;
line-height: 44px;
border-radius: 22px;
border: none !important;
}
.bul {
background: #5cc0be;
color: #fff;
}
.fff {
border: none;
}
}
.btn {
display: block;
height: 50px;
box-sizing: border-box;
background: #5cc0be;
color: #fff;
text-align: center;
line-height: 50px;
}
.fild-cned {
width: 196 * 3rpx;
height: 215 * 3rpx;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}
.last-time-box {
position: absolute;
right: 48rpx;
top: 68rpx;
z-index: 2;
}
.last-time {
}
.last-time1 {
margin-right: 10px;
}
.loading-img {
width: 450 * 1.5px;
height: 370 * 1.5px;
margin-bottom: 50rpx;
}
// .btn-create {
// width: 560rpx;
// height: 100rpx;
// }
.icon-setting {
position: fixed;
right: 48rpx;
bottom: 68rpx;
z-index: 1;
}
.icon-setting uni-image {
width: 50px;
height: 50px;
}
/* 弹窗样式 */
.ups {
// height: 280px;
position: fixed;
top: 0;
right: 0;
left: 0;
bottom: 0;
margin: auto;
z-index: 1;
display: flex;
align-items: center;
justify-content: center;
}
.ups-box {
width: 600px;
padding: 24px 50px;
box-sizing: border-box;
background: #fff;
border-radius: 10px;
border: 1px solid #e3e3e3;
}
.ups scroll-view {
height: 97%;
box-sizing: border-box;
padding-bottom: 20px;
}
.ups >>> .checklist-text {
display: none !important;
}
>>> .uni-switch-input:before {
background-color: #a3acbf;
}
.header {
text-align: center;
font-weight: 600;
font-size: 36px;
margin: 15px 0;
margin-bottom: 30px;
}
</style>
<style scoped>
>>> .box img {
margin-left: 0;
}
>>> .is-input-border {
/* border-left: none !important; */
border-radius: 0 4px 4px 0;
}
>>> .uni-select {
height: 37px;
line-height: 37px;
background: #f5f7fa;
width: 80px;
text-align: center;
border-radius: 4px 0 0 4px;
border-right: none !important;
}
>>> .uni-icons {
display: none !important;
}
.content {
width: 100vw;
height: 100vh;
background: #5cc0be;
/* background: url("./appbg.png");
background-size: cover; */
}
uni-button {
color: #fff;
}
uni-button:after {
border: 1px solid #fff;
}
uni-button[plain] {
border: 1px solid #fff;
}
</style>

8
ruisi_java/ruisi-cc-generator/src/main/resources/mbg.xml

@ -20,9 +20,9 @@
</commentGenerator>
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/ruisi_cga_yf1?useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=GMT%2B8&amp;tinyInt1isBit=false"
connectionURL="jdbc:mysql://localhost:3306/ruisi_cga_whszxyjhyy?useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=GMT%2B8&amp;tinyInt1isBit=false"
userId="root"
password="123456">
password="q7510327">
<!--仅仅查询当前库的表,不查询其他库-->
<property name="nullCatalogMeansCurrent" value="true"/>
</jdbcConnection>
@ -60,11 +60,11 @@
<!-- <table tableName="ums_device" domainObjectName="UmsDevice"/>-->
<!-- <table tableName="ums_data_source" domainObjectName="UmsDataSource"/>-->
<table tableName="pms_patient" domainObjectName="PmsPatient"/>
<!-- <table tableName="pms_patient" domainObjectName="PmsPatient"/>-->
<!-- <table tableName="ld_patient_record" domainObjectName="LdPatientRecord"/>-->
<!-- <table tableName="pms_patient_record" domainObjectName="PmsPatientRecord"/>-->
<!-- <table tableName="pms_patient_acp" domainObjectName="PmsPatientAcp"/>-->
<!-- <table tableName="pms_patient_body" domainObjectName="PmsPatientBody"/>-->
<table tableName="pms_patient_body" domainObjectName="PmsPatientBody"/>
<!-- <table tableName="pms_patient_family_illness" domainObjectName="PmsPatientFamilyIllness"/>-->
<!-- <table tableName="pms_patient_illness_history" domainObjectName="PmsPatientIllnessHistory"/>-->
<!-- <table tableName="pms_patient_parent_illness" domainObjectName="PmsPatientParentIllness"/>-->

3
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/EmsDto.java

@ -101,6 +101,7 @@ public class EmsDto {
public static class BindScale {
@ApiModelProperty("测评id")
private Long evaluationId;
@ApiModelProperty("问题id")
private List<EvaluationScale> scaleList;
}
@ -110,6 +111,8 @@ public class EmsDto {
public static class EvaluationScale{
@ApiModelProperty("量表code")
private String scaleCode;
@ApiModelProperty("套餐ID")
private Long comboId;
@ApiModelProperty("排序")
private Integer sort;
}

28
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/PmsPatientDto.java

@ -33,9 +33,17 @@ public class PmsPatientDto {
@ApiModelProperty("结束时间")
private String endTime;
private String idcardEncrypt;
private Byte sex;
private Long deptId;
@ApiModelProperty("每个像素的毫米数")
private BigDecimal mmPerPixel = new BigDecimal("0.1");
@ApiModelProperty("受教育程度 1:文盲 2:小学 3:初中 4:高中 5:大学 6:大学以上")
private Byte educationalStatus;
@ApiModelProperty("年龄分组")
private Byte ageStatus;
}
@ApiModel("根据id查看患者详情")
@ -152,7 +160,9 @@ public class PmsPatientDto {
private String rhBloodType;
/**复制当前的对象为HtPatient*/
/**
* 复制当前的对象为HtPatient
*/
public PmsPatient copy() {
PmsPatient patient = new PmsPatient();
BeanUtils.copyProperties(this, patient);
@ -245,7 +255,9 @@ public class PmsPatientDto {
@ApiModelProperty("出生年份")
private Integer birthYear;
/**复制当前的对象为HtPatient*/
/**
* 复制当前的对象为HtPatient
*/
public PmsPatient copy() {
PmsPatient patient = new PmsPatient();
BeanUtils.copyProperties(this, patient);
@ -280,8 +292,18 @@ public class PmsPatientDto {
@Data
public class QueryPatientJz {
public static class QueryPatientJz {
@ApiModelProperty("病人id")
private Long patientId;
@ApiModelProperty("就诊类型 0门诊 1住院")
private Byte visitType;
@ApiModelProperty("开始时间")
private String beginTime;
@ApiModelProperty("结束时间")
private String endTime;
@ApiModelProperty("部门")
private Long deptId;
@ApiModelProperty("诊断编码")
private String diagnosisCode;
}
}

61
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/RmsDto.java

@ -41,6 +41,7 @@ public class RmsDto {
@ApiModelProperty("完成状态 0:未完成 1:完成 2:中止")
private Byte complateStatus;
private Byte sex;
}
@ApiModel("导出报告单-VO")
@ -77,6 +78,10 @@ public class RmsDto {
@ApiModelProperty("MoCA雷达图路径")
private String ldt;
@ApiModelProperty("测评医生(userID)")
private Long testerId;
private Long deptId;
}
@ -101,6 +106,8 @@ public class RmsDto {
private String searchValue;
@ApiModelProperty("测评师名称")
private String testerName;
@ApiModelProperty("测评师Id")
private Long testerId;
@ApiModelProperty("完成状态 0:未完成 1:完成 2:中止")
private Byte completeStatus;
@ApiModelProperty("是否筛未做题的测评 0查询全部 1只查询已做题的")
@ -110,6 +117,9 @@ public class RmsDto {
@ApiModelProperty("结束时间")
private String endTime;
private Long version;
@ApiModelProperty("测评量表CODE")
private String code;
private Byte needPlan;
@ApiModelProperty("每个像素的毫米数")
private BigDecimal mmPerPixel = new BigDecimal("0.1");
@ -200,6 +210,7 @@ public class RmsDto {
@ApiModelProperty("分数")
private List<Score> scores;
}
@ApiModel("分数")
@Data
public static class Score {
@ -262,4 +273,54 @@ public class RmsDto {
private String visitNo;
}
@ApiModel("导出历史报告单(查看详细的报告单文件)-DTO")
@Data
public static class queryPdfUrl{
@ApiModelProperty("报告单ID")
private Long reportId;
@ApiModelProperty("测评ID")
private Long evaluationId;
@ApiModelProperty("导出类型 0医生版 1个人版 2阳性版")
private String version;
@ApiModelProperty("评估医生id")
private Long assessorId;
}
@Data
public static class ReportQuery {
@ApiModelProperty("量表code")
private String code;
@ApiModelProperty("开始时间")
private String beginTime;
@ApiModelProperty("结束时间")
private String endTime;
@ApiModelProperty("部门id")
private Long deptId;
@ApiModelProperty("评估结果")
private Byte needPlan;
@ApiModelProperty("测评师Id")
private Long testerId;
@ApiModelProperty("病人名称|手机号|身份证号")
private String searchValue;
}
@ApiModel("统计四列表之报告单-DTO")
@Data
public static class QueryReportList {
@ApiModelProperty("病人名称/全拼/首字母")
private String searchValue;
@ApiModelProperty("完成状态 0:未完成 1:完成 2:中止")
private Byte completeStatus;
@ApiModelProperty("开始时间")
private String beginTime;
@ApiModelProperty("结束时间")
private String endTime;
@ApiModelProperty("测评师Id")
private Long testerId;
@ApiModelProperty("测评版本信息")
private Long version;
@ApiModelProperty("部门id")
private Long deptId;
}
}

3
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/StatisticsDto.java

@ -2,7 +2,6 @@ package com.ccsens.system.domain.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
import java.util.Date;
@ -16,7 +15,7 @@ public class StatisticsDto {
@Data
public static class Query {
@ApiModelProperty("时间类型 0周 1月 2年")
private Byte dateType;
private Byte timeType;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date beginTime;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")

173
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleCognitiveRelevance.java

@ -0,0 +1,173 @@
package com.ccsens.system.domain.po;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class EmsEvaluationScaleCognitiveRelevance implements Serializable {
private Long id;
private Long evaluationId;
private String scaleCode;
private Long parentId;
private String cognitiveCode;
private BigDecimal score;
private BigDecimal totalScore;
private Long comboId;
private Integer sort;
private String createBy;
private Date createTime;
private String updateBy;
private Date updateTime;
private Byte delFlag;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getEvaluationId() {
return evaluationId;
}
public void setEvaluationId(Long evaluationId) {
this.evaluationId = evaluationId;
}
public String getScaleCode() {
return scaleCode;
}
public void setScaleCode(String scaleCode) {
this.scaleCode = scaleCode == null ? null : scaleCode.trim();
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getCognitiveCode() {
return cognitiveCode;
}
public void setCognitiveCode(String cognitiveCode) {
this.cognitiveCode = cognitiveCode == null ? null : cognitiveCode.trim();
}
public BigDecimal getScore() {
return score;
}
public void setScore(BigDecimal score) {
this.score = score;
}
public BigDecimal getTotalScore() {
return totalScore;
}
public void setTotalScore(BigDecimal totalScore) {
this.totalScore = totalScore;
}
public Long getComboId() {
return comboId;
}
public void setComboId(Long comboId) {
this.comboId = comboId;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Byte getDelFlag() {
return delFlag;
}
public void setDelFlag(Byte delFlag) {
this.delFlag = delFlag;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", evaluationId=").append(evaluationId);
sb.append(", scaleCode=").append(scaleCode);
sb.append(", parentId=").append(parentId);
sb.append(", cognitiveCode=").append(cognitiveCode);
sb.append(", score=").append(score);
sb.append(", totalScore=").append(totalScore);
sb.append(", comboId=").append(comboId);
sb.append(", sort=").append(sort);
sb.append(", createBy=").append(createBy);
sb.append(", createTime=").append(createTime);
sb.append(", updateBy=").append(updateBy);
sb.append(", updateTime=").append(updateTime);
sb.append(", delFlag=").append(delFlag);
sb.append("]");
return sb.toString();
}
}

1082
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleCognitiveRelevanceExample.java

File diff suppressed because it is too large

23
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleRelevance.java

@ -1,6 +1,7 @@
package com.ccsens.system.domain.po;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class EmsEvaluationScaleRelevance implements Serializable {
@ -10,6 +11,10 @@ public class EmsEvaluationScaleRelevance implements Serializable {
private String scaleCode;
private Long comboId;
private BigDecimal score;
private Integer sort;
private String createBy;
@ -48,6 +53,22 @@ public class EmsEvaluationScaleRelevance implements Serializable {
this.scaleCode = scaleCode == null ? null : scaleCode.trim();
}
public Long getComboId() {
return comboId;
}
public void setComboId(Long comboId) {
this.comboId = comboId;
}
public BigDecimal getScore() {
return score;
}
public void setScore(BigDecimal score) {
this.score = score;
}
public Integer getSort() {
return sort;
}
@ -105,6 +126,8 @@ public class EmsEvaluationScaleRelevance implements Serializable {
sb.append(", id=").append(id);
sb.append(", evaluationId=").append(evaluationId);
sb.append(", scaleCode=").append(scaleCode);
sb.append(", comboId=").append(comboId);
sb.append(", score=").append(score);
sb.append(", sort=").append(sort);
sb.append(", createBy=").append(createBy);
sb.append(", createTime=").append(createTime);

121
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/EmsEvaluationScaleRelevanceExample.java

@ -1,5 +1,6 @@
package com.ccsens.system.domain.po;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -295,6 +296,126 @@ public class EmsEvaluationScaleRelevanceExample {
return (Criteria) this;
}
public Criteria andComboIdIsNull() {
addCriterion("combo_id is null");
return (Criteria) this;
}
public Criteria andComboIdIsNotNull() {
addCriterion("combo_id is not null");
return (Criteria) this;
}
public Criteria andComboIdEqualTo(Long value) {
addCriterion("combo_id =", value, "comboId");
return (Criteria) this;
}
public Criteria andComboIdNotEqualTo(Long value) {
addCriterion("combo_id <>", value, "comboId");
return (Criteria) this;
}
public Criteria andComboIdGreaterThan(Long value) {
addCriterion("combo_id >", value, "comboId");
return (Criteria) this;
}
public Criteria andComboIdGreaterThanOrEqualTo(Long value) {
addCriterion("combo_id >=", value, "comboId");
return (Criteria) this;
}
public Criteria andComboIdLessThan(Long value) {
addCriterion("combo_id <", value, "comboId");
return (Criteria) this;
}
public Criteria andComboIdLessThanOrEqualTo(Long value) {
addCriterion("combo_id <=", value, "comboId");
return (Criteria) this;
}
public Criteria andComboIdIn(List<Long> values) {
addCriterion("combo_id in", values, "comboId");
return (Criteria) this;
}
public Criteria andComboIdNotIn(List<Long> values) {
addCriterion("combo_id not in", values, "comboId");
return (Criteria) this;
}
public Criteria andComboIdBetween(Long value1, Long value2) {
addCriterion("combo_id between", value1, value2, "comboId");
return (Criteria) this;
}
public Criteria andComboIdNotBetween(Long value1, Long value2) {
addCriterion("combo_id not between", value1, value2, "comboId");
return (Criteria) this;
}
public Criteria andScoreIsNull() {
addCriterion("score is null");
return (Criteria) this;
}
public Criteria andScoreIsNotNull() {
addCriterion("score is not null");
return (Criteria) this;
}
public Criteria andScoreEqualTo(BigDecimal value) {
addCriterion("score =", value, "score");
return (Criteria) this;
}
public Criteria andScoreNotEqualTo(BigDecimal value) {
addCriterion("score <>", value, "score");
return (Criteria) this;
}
public Criteria andScoreGreaterThan(BigDecimal value) {
addCriterion("score >", value, "score");
return (Criteria) this;
}
public Criteria andScoreGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("score >=", value, "score");
return (Criteria) this;
}
public Criteria andScoreLessThan(BigDecimal value) {
addCriterion("score <", value, "score");
return (Criteria) this;
}
public Criteria andScoreLessThanOrEqualTo(BigDecimal value) {
addCriterion("score <=", value, "score");
return (Criteria) this;
}
public Criteria andScoreIn(List<BigDecimal> values) {
addCriterion("score in", values, "score");
return (Criteria) this;
}
public Criteria andScoreNotIn(List<BigDecimal> values) {
addCriterion("score not in", values, "score");
return (Criteria) this;
}
public Criteria andScoreBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("score between", value1, value2, "score");
return (Criteria) this;
}
public Criteria andScoreNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("score not between", value1, value2, "score");
return (Criteria) this;
}
public Criteria andSortIsNull() {
addCriterion("sort is null");
return (Criteria) this;

22
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReport.java

@ -28,6 +28,10 @@ public class RmsReport implements Serializable {
private String url;
private String persionUrl;
private String positiveUrl;
private String qrCodeUrl;
private String signUrl;
@ -150,6 +154,22 @@ public class RmsReport implements Serializable {
this.url = url == null ? null : url.trim();
}
public String getPersionUrl() {
return persionUrl;
}
public void setPersionUrl(String persionUrl) {
this.persionUrl = persionUrl == null ? null : persionUrl.trim();
}
public String getPositiveUrl() {
return positiveUrl;
}
public void setPositiveUrl(String positiveUrl) {
this.positiveUrl = positiveUrl == null ? null : positiveUrl.trim();
}
public String getQrCodeUrl() {
return qrCodeUrl;
}
@ -264,6 +284,8 @@ public class RmsReport implements Serializable {
sb.append(", reportTime=").append(reportTime);
sb.append(", evaluationCode=").append(evaluationCode);
sb.append(", url=").append(url);
sb.append(", persionUrl=").append(persionUrl);
sb.append(", positiveUrl=").append(positiveUrl);
sb.append(", qrCodeUrl=").append(qrCodeUrl);
sb.append(", signUrl=").append(signUrl);
sb.append(", remark=").append(remark);

140
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportExample.java

@ -895,6 +895,146 @@ public class RmsReportExample {
return (Criteria) this;
}
public Criteria andPersionUrlIsNull() {
addCriterion("persion_url is null");
return (Criteria) this;
}
public Criteria andPersionUrlIsNotNull() {
addCriterion("persion_url is not null");
return (Criteria) this;
}
public Criteria andPersionUrlEqualTo(String value) {
addCriterion("persion_url =", value, "persionUrl");
return (Criteria) this;
}
public Criteria andPersionUrlNotEqualTo(String value) {
addCriterion("persion_url <>", value, "persionUrl");
return (Criteria) this;
}
public Criteria andPersionUrlGreaterThan(String value) {
addCriterion("persion_url >", value, "persionUrl");
return (Criteria) this;
}
public Criteria andPersionUrlGreaterThanOrEqualTo(String value) {
addCriterion("persion_url >=", value, "persionUrl");
return (Criteria) this;
}
public Criteria andPersionUrlLessThan(String value) {
addCriterion("persion_url <", value, "persionUrl");
return (Criteria) this;
}
public Criteria andPersionUrlLessThanOrEqualTo(String value) {
addCriterion("persion_url <=", value, "persionUrl");
return (Criteria) this;
}
public Criteria andPersionUrlLike(String value) {
addCriterion("persion_url like", value, "persionUrl");
return (Criteria) this;
}
public Criteria andPersionUrlNotLike(String value) {
addCriterion("persion_url not like", value, "persionUrl");
return (Criteria) this;
}
public Criteria andPersionUrlIn(List<String> values) {
addCriterion("persion_url in", values, "persionUrl");
return (Criteria) this;
}
public Criteria andPersionUrlNotIn(List<String> values) {
addCriterion("persion_url not in", values, "persionUrl");
return (Criteria) this;
}
public Criteria andPersionUrlBetween(String value1, String value2) {
addCriterion("persion_url between", value1, value2, "persionUrl");
return (Criteria) this;
}
public Criteria andPersionUrlNotBetween(String value1, String value2) {
addCriterion("persion_url not between", value1, value2, "persionUrl");
return (Criteria) this;
}
public Criteria andPositiveUrlIsNull() {
addCriterion("positive_url is null");
return (Criteria) this;
}
public Criteria andPositiveUrlIsNotNull() {
addCriterion("positive_url is not null");
return (Criteria) this;
}
public Criteria andPositiveUrlEqualTo(String value) {
addCriterion("positive_url =", value, "positiveUrl");
return (Criteria) this;
}
public Criteria andPositiveUrlNotEqualTo(String value) {
addCriterion("positive_url <>", value, "positiveUrl");
return (Criteria) this;
}
public Criteria andPositiveUrlGreaterThan(String value) {
addCriterion("positive_url >", value, "positiveUrl");
return (Criteria) this;
}
public Criteria andPositiveUrlGreaterThanOrEqualTo(String value) {
addCriterion("positive_url >=", value, "positiveUrl");
return (Criteria) this;
}
public Criteria andPositiveUrlLessThan(String value) {
addCriterion("positive_url <", value, "positiveUrl");
return (Criteria) this;
}
public Criteria andPositiveUrlLessThanOrEqualTo(String value) {
addCriterion("positive_url <=", value, "positiveUrl");
return (Criteria) this;
}
public Criteria andPositiveUrlLike(String value) {
addCriterion("positive_url like", value, "positiveUrl");
return (Criteria) this;
}
public Criteria andPositiveUrlNotLike(String value) {
addCriterion("positive_url not like", value, "positiveUrl");
return (Criteria) this;
}
public Criteria andPositiveUrlIn(List<String> values) {
addCriterion("positive_url in", values, "positiveUrl");
return (Criteria) this;
}
public Criteria andPositiveUrlNotIn(List<String> values) {
addCriterion("positive_url not in", values, "positiveUrl");
return (Criteria) this;
}
public Criteria andPositiveUrlBetween(String value1, String value2) {
addCriterion("positive_url between", value1, value2, "positiveUrl");
return (Criteria) this;
}
public Criteria andPositiveUrlNotBetween(String value1, String value2) {
addCriterion("positive_url not between", value1, value2, "positiveUrl");
return (Criteria) this;
}
public Criteria andQrCodeUrlIsNull() {
addCriterion("qr_code_url is null");
return (Criteria) this;

122
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportScaleScore.java

@ -15,15 +15,7 @@ public class RmsReportScaleScore implements Serializable {
private String impression;
private Integer sort;
private Long scaleAssConf;
private String result;
private String needPlan;
private String plan;
private Long comboId;
private String createBy;
@ -35,6 +27,18 @@ public class RmsReportScaleScore implements Serializable {
private Byte delFlag;
private Long scaleAssConf;
private String result;
private String needPlan;
private String plan;
private Integer sort;
private Byte isShow;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -77,44 +81,12 @@ public class RmsReportScaleScore implements Serializable {
this.impression = impression == null ? null : impression.trim();
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
public Long getComboId() {
return comboId;
}
public Long getScaleAssConf() {
return scaleAssConf;
}
public void setScaleAssConf(Long scaleAssConf) {
this.scaleAssConf = scaleAssConf;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result == null ? null : result.trim();
}
public String getNeedPlan() {
return needPlan;
}
public void setNeedPlan(String needPlan) {
this.needPlan = needPlan == null ? null : needPlan.trim();
}
public String getPlan() {
return plan;
}
public void setPlan(String plan) {
this.plan = plan == null ? null : plan.trim();
public void setComboId(Long comboId) {
this.comboId = comboId;
}
public String getCreateBy() {
@ -157,6 +129,54 @@ public class RmsReportScaleScore implements Serializable {
this.delFlag = delFlag;
}
public Long getScaleAssConf() {
return scaleAssConf;
}
public void setScaleAssConf(Long scaleAssConf) {
this.scaleAssConf = scaleAssConf;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result == null ? null : result.trim();
}
public String getNeedPlan() {
return needPlan;
}
public void setNeedPlan(String needPlan) {
this.needPlan = needPlan == null ? null : needPlan.trim();
}
public String getPlan() {
return plan;
}
public void setPlan(String plan) {
this.plan = plan == null ? null : plan.trim();
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Byte getIsShow() {
return isShow;
}
public void setIsShow(Byte isShow) {
this.isShow = isShow;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -168,16 +188,18 @@ public class RmsReportScaleScore implements Serializable {
sb.append(", scaleCode=").append(scaleCode);
sb.append(", score=").append(score);
sb.append(", impression=").append(impression);
sb.append(", sort=").append(sort);
sb.append(", scaleAssConf=").append(scaleAssConf);
sb.append(", result=").append(result);
sb.append(", needPlan=").append(needPlan);
sb.append(", plan=").append(plan);
sb.append(", comboId=").append(comboId);
sb.append(", createBy=").append(createBy);
sb.append(", createTime=").append(createTime);
sb.append(", updateBy=").append(updateBy);
sb.append(", updateTime=").append(updateTime);
sb.append(", delFlag=").append(delFlag);
sb.append(", scaleAssConf=").append(scaleAssConf);
sb.append(", result=").append(result);
sb.append(", needPlan=").append(needPlan);
sb.append(", plan=").append(plan);
sb.append(", sort=").append(sort);
sb.append(", isShow=").append(isShow);
sb.append("]");
return sb.toString();
}

640
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/RmsReportScaleScoreExample.java

File diff suppressed because it is too large

5
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/AmsVo.java

@ -678,10 +678,15 @@ public class AmsVo {
private String scaleName;
@ApiModelProperty("分数")
private BigDecimal score;
@ApiModelProperty("量表总分")
private BigDecimal totalScore;
@ApiModelProperty("总题数")
private Integer totalNum;
@ApiModelProperty("已完成题数")
private Integer completedNum;
private Integer sort;
@ApiModelProperty("各项分数")
private List<ScoreScore> scaleScoreList;
@ApiModelProperty("试题详情")

11
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/HomeDpVo.java

@ -4,6 +4,8 @@ import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @Author zzc
* @Package com.ccsens.system.domain.vo
@ -75,6 +77,7 @@ public class HomeDpVo {
public static class Jbph {
private String icd_no;
private String name;
private String code;
private String value;
}
@ -153,6 +156,12 @@ public class HomeDpVo {
private int total;
private int mzNum;
private int zyNum;
@ApiModelProperty("单次就诊平均评估次数")
private BigDecimal avgNum;
@ApiModelProperty("单次就诊最高评估次数")
private int maxNum;
@ApiModelProperty("单次就诊最低评估次数")
private int minNum;
public int getTotal() {
return mzNum + zyNum;
@ -161,6 +170,7 @@ public class HomeDpVo {
@Data
public static class VersionStatistics {
private Long id;
private String version;
private Integer num;
}
@ -177,6 +187,7 @@ public class HomeDpVo {
private String nickName;
private String userName;
private Integer num;
private Long userId;
}
@Data

20
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/PmsPatientVo.java

@ -795,6 +795,7 @@ public class PmsPatientVo {
@Data
public static class QueryPatientJz {
private String idcard;
private String patientName;
private String sex;
@ -835,7 +836,7 @@ public class PmsPatientVo {
private String outpatientNo;
private String age;
private Integer age;
private String department;
@ -890,6 +891,23 @@ public class PmsPatientVo {
private String diagnosisDate;
private String hospitalName;
private Integer birthYear;
@ApiModelProperty("其他病史信息")
private Map<String,List<Map<String, Object>>> otherMsg;
public String getIdcard() {
if(StrUtil.isNotEmpty(idcard)){
return idcard.substring(0, 2) + "******" + idcard.substring(idcard.length() - 4, idcard.length());
}
return idcard;
}
public Integer getAge() {
if(birthYear != null){
return Calendar.getInstance().get(Calendar.YEAR) - birthYear;
}
return age;
}
}
}

155
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/RmsVo.java

@ -138,6 +138,57 @@ public class RmsVo {
// }
}
@Data
public static class Report {
private Long id;
@ApiModelProperty("测评ID")
private Long evaluationId;
private String testerName;
private Long patientId;
private String patientIdcard;
private Integer patientAge;
private Long testerId;
private String serialNumber;
private Long checkTime;
private String remark;
private String hospital;
private Byte completeStatus;
private Byte recording;
private Long duration;
private String createBy;
private Date createTime;
private String updateBy;
private Date updateTime;
private Byte delFlag;
private Byte status;
private String version;
private String visitNo;
private String scaleName;
private Byte needPlan;
private String deptName;
}
@Data
@ApiModel("PatientReportVoGenerate")
public static class Generate {
@ -224,6 +275,10 @@ public class RmsVo {
@ApiModelProperty("初步印象")
private String initialImpression;
private String testerName;
@ApiModelProperty("出生日期")
private String birthday;
public List<PdfUtil.Row> toPdfRow() {
List<PdfUtil.Row> rows = getInitRows();
//第四栏
@ -389,6 +444,8 @@ public class RmsVo {
private Integer sort;
@ApiModelProperty("认知域code")
private String parentCode;
@ApiModelProperty("认知域父级id")
private Long parentId;
@ApiModelProperty("报告单检查类型名称")
private String name;
@ApiModelProperty("量表类型名称")
@ -421,10 +478,15 @@ public class RmsVo {
@ApiModelProperty("量表用时")
private Long questionDuration;
private BigDecimal levelTotalScale;
@ApiModelProperty("最终结论")
private String result;
private String needPlan;
@ApiModelProperty("套餐Id")
private Long comboId;
@ApiModelProperty("测评量表排序")
private Integer ecrSort;
@ApiModelProperty("中医体质辨识结论")
@ -432,6 +494,7 @@ public class RmsVo {
@ApiModelProperty("中医体质辨识养生建议")
private List<TzbsRmsReportYsjy> reportYsjyList;
public void addSub(ReportScore score) {
this.subReport.add(score);
}
@ -1148,23 +1211,111 @@ public class RmsVo {
private Integer optionNum;
}
@Data
public static class ExportInfo {
@ApiModelProperty("报告单ID")
private Long reporrtId;
@ApiModelProperty("量表CODE")
private String scaleCode;
@ApiModelProperty("量表名称")
private String scaleName;
@ApiModelProperty("得分")
private BigDecimal score;
@ApiModelProperty("初步印象")
private String impression;
@ApiModelProperty("套餐ID")
private Long comboId;
@ApiModelProperty("套餐名称")
private String comboName;
@ApiModelProperty("父级套餐名称")
private String comboParentName;
@ApiModelProperty("量表分值结论配置Id")
private String scaleAssConf;
@ApiModelProperty("当前分值段结论")
private String result;
@ApiModelProperty("需要防治(1需要,0不需要)")
private Integer needPlan;
@ApiModelProperty("防治计划")
private String plan;
@ApiModelProperty("排序")
private Integer sort;
@ApiModelProperty("中医体质辨识结论")
private List<TzbsRmsReportResult> reportResultList;
@ApiModelProperty("中医体质辨识养生建议")
private List<TzbsRmsReportYsjy> reportYsjyList;
}
@ApiModel("统计四列表之报告单-DTO")
@Data
public static class QueryReportList {
@ApiModelProperty("报告单ID")
private Long evaluationId;
@ApiModelProperty("姓名")
private String name;
@ApiModelProperty("性别(0-男 1-女)")
private Integer sex;
@ApiModelProperty("就诊号")
private String outpatientNo;
@ApiModelProperty("就诊科室")
private String department;
@ApiModelProperty("就诊/主治医生")
private String doctor;
@ApiModelProperty("评估版本")
private String versionName;
@ApiModelProperty("评估师")
private String testerName;
@ApiModelProperty("评估量表")
private String scaleNames;
@ApiModelProperty("评估时间")
private String evaluationTime;
@ApiModelProperty("完成状态 0:未完成 1:完成 2:中止")
private Byte completeStatus;
}
@ApiModel("导出历史报告单(对接)-VO")
@Data
public static class ReportPDF {
@ApiModelProperty("报告单ID")
private Long reportId;
@ApiModelProperty("测评ID")
private Long evaluationId;
@ApiModelProperty("患者名称")
private String patientName;
@ApiModelProperty("性别")
private Byte sex;
@ApiModelProperty("年龄")
private int Age;
@ApiModelProperty("出生日期")
private String birthDate;
@ApiModelProperty("身份证号")
private String idCard;
@ApiModelProperty("就诊类型 0门诊 1住院")
private String visitType;
@ApiModelProperty("就诊号")
private String visitNo;
@ApiModelProperty("评估人")
@ApiModelProperty("部门")
private String department;
@ApiModelProperty("评估医生Id")
private String assessorId;
@ApiModelProperty("评估医生")
private String assessor;
@ApiModelProperty("评估医生编号")
private String assessorCode;
@ApiModelProperty("评估时间")
private String assessTime;
@ApiModelProperty("报告单文件路径")
private String url;
}
public String getAssessor() {
if (StrUtil.isNotEmpty(assessorCode)) {
return assessor + "(" + assessorCode + ")";
}else {
return assessor;
}
}
}
}

4
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/dao/StatisticsDao.java

@ -74,7 +74,9 @@ public interface StatisticsDao {
List<HomeDpVo.QualificationStatistics> qualificationStatistics(@Param("dto") StatisticsDto.Query dto);
HomeDpVo.JzStatistics JzStatistics(@Param("dto") StatisticsDto.Query dto);
HomeDpVo.JzStatistics JzStatistics(@Param("param") StatisticsDto.Query dto);
HomeDpVo.JzStatistics JzStatisticsNum(@Param("dto") StatisticsDto.Query dto);
List<HomeDpVo.ScaleStatistics> scaleStatistics(@Param("dto") StatisticsDto.Query dto);

30
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/mapper/EmsEvaluationScaleCognitiveRelevanceMapper.java

@ -0,0 +1,30 @@
package com.ccsens.system.persist.mapper;
import com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevance;
import com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevanceExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface EmsEvaluationScaleCognitiveRelevanceMapper {
long countByExample(EmsEvaluationScaleCognitiveRelevanceExample example);
int deleteByExample(EmsEvaluationScaleCognitiveRelevanceExample example);
int deleteByPrimaryKey(Long id);
int insert(EmsEvaluationScaleCognitiveRelevance record);
int insertSelective(EmsEvaluationScaleCognitiveRelevance record);
List<EmsEvaluationScaleCognitiveRelevance> selectByExample(EmsEvaluationScaleCognitiveRelevanceExample example);
EmsEvaluationScaleCognitiveRelevance selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") EmsEvaluationScaleCognitiveRelevance record, @Param("example") EmsEvaluationScaleCognitiveRelevanceExample example);
int updateByExample(@Param("record") EmsEvaluationScaleCognitiveRelevance record, @Param("example") EmsEvaluationScaleCognitiveRelevanceExample example);
int updateByPrimaryKeySelective(EmsEvaluationScaleCognitiveRelevance record);
int updateByPrimaryKey(EmsEvaluationScaleCognitiveRelevance record);
}

66
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/StatisticsServiceImpl.java

@ -1,7 +1,7 @@
package com.ccsens.system.service.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.system.domain.dto.StatisticsDto;
import com.ccsens.system.domain.vo.HomeDpVo;
import com.ccsens.system.persist.dao.StatisticsDao;
@ -27,8 +27,8 @@ public class StatisticsServiceImpl implements StatisticsService {
@Override
public HomeDpVo.Zhsjgl nntotal(StatisticsDto.Query dto) {
if (dto.getDateType() != null) {
List<Date> dateByType = getDateByType(dto.getDateType(), dto.getBeginTime());
if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1));
}
@ -37,8 +37,8 @@ public class StatisticsServiceImpl implements StatisticsService {
@Override
public HomeDpVo.Bmi nnbmihjxy(StatisticsDto.Query dto) {
if (dto.getDateType() != null) {
List<Date> dateByType = getDateByType(dto.getDateType(), dto.getBeginTime());
if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1));
}
@ -47,8 +47,8 @@ public class StatisticsServiceImpl implements StatisticsService {
@Override
public List<HomeDpVo.Pgqk> nnlast(StatisticsDto.Query dto) {
if (dto.getDateType() != null) {
List<Date> dateByType = getDateByType(dto.getDateType(), dto.getBeginTime());
if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1));
}
@ -57,8 +57,8 @@ public class StatisticsServiceImpl implements StatisticsService {
@Override
public HomeDpVo.Nlfb nnage(StatisticsDto.Query dto) {
if (dto.getDateType() != null) {
List<Date> dateByType = getDateByType(dto.getDateType(), dto.getBeginTime());
if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1));
}
@ -67,8 +67,8 @@ public class StatisticsServiceImpl implements StatisticsService {
@Override
public HomeDpVo.Tz nntgb(StatisticsDto.Query dto) {
if (dto.getDateType() != null) {
List<Date> dateByType = getDateByType(dto.getDateType(), dto.getBeginTime());
if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1));
}
@ -77,8 +77,8 @@ public class StatisticsServiceImpl implements StatisticsService {
@Override
public List<HomeDpVo.Jbph> nnicd(StatisticsDto.Query dto) {
if (dto.getDateType() != null) {
List<Date> dateByType = getDateByType(dto.getDateType(), dto.getBeginTime());
if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1));
}
@ -87,8 +87,8 @@ public class StatisticsServiceImpl implements StatisticsService {
@Override
public List<HomeDpVo.Dt> nnmap(StatisticsDto.Query dto) {
if (dto.getDateType() != null) {
List<Date> dateByType = getDateByType(dto.getDateType(), dto.getBeginTime());
if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1));
}
@ -97,8 +97,8 @@ public class StatisticsServiceImpl implements StatisticsService {
@Override
public List<HomeDpVo.Pgjg> nnscale(StatisticsDto.Query dto) {
if (dto.getDateType() != null) {
List<Date> dateByType = getDateByType(dto.getDateType(), dto.getBeginTime());
if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1));
}
@ -107,8 +107,8 @@ public class StatisticsServiceImpl implements StatisticsService {
@Override
public List<HomeDpVo.QualificationStatistics> qualificationStatistics(StatisticsDto.Query dto) {
if (dto.getDateType() != null) {
List<Date> dateByType = getDateByType(dto.getDateType(), dto.getBeginTime());
if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1));
}
@ -117,18 +117,24 @@ public class StatisticsServiceImpl implements StatisticsService {
@Override
public HomeDpVo.JzStatistics jzStatistics(StatisticsDto.Query dto) {
if (dto.getDateType() != null) {
List<Date> dateByType = getDateByType(dto.getDateType(), dto.getBeginTime());
if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1));
}
return statisticsDao.JzStatistics(dto);
// HomeDpVo.JzStatistics jzStatistics = statisticsDao.JzStatisticsNum(dto);
// if (jzStatistics!= null) {
HomeDpVo.JzStatistics jzStatistics = statisticsDao.JzStatistics(dto);
// jzStatistics.setZyNum(jzStatistics1.getZyNum());
// jzStatistics.setMzNum(jzStatistics1.getMzNum());
// }
return ObjectUtil.isNull(jzStatistics) ? new HomeDpVo.JzStatistics() : jzStatistics;
}
@Override
public List<HomeDpVo.ScaleStatistics> scaleStatistics(StatisticsDto.Query dto) {
if (dto.getDateType() != null) {
List<Date> dateByType = getDateByType(dto.getDateType(), dto.getBeginTime());
if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1));
}
@ -137,8 +143,8 @@ public class StatisticsServiceImpl implements StatisticsService {
@Override
public List<HomeDpVo.VersionStatistics> versionStatistics(StatisticsDto.Query dto) {
if (dto.getDateType() != null) {
List<Date> dateByType = getDateByType(dto.getDateType(), dto.getBeginTime());
if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1));
}
@ -147,8 +153,8 @@ public class StatisticsServiceImpl implements StatisticsService {
@Override
public List<HomeDpVo.UserStatistics> userStatistics(StatisticsDto.Query dto) {
if (dto.getDateType() != null) {
List<Date> dateByType = getDateByType(dto.getDateType(), dto.getBeginTime());
if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1));
}
@ -157,8 +163,8 @@ public class StatisticsServiceImpl implements StatisticsService {
@Override
public HomeDpVo.SexStatistics sexStatistics(StatisticsDto.Query dto) {
if (dto.getDateType() != null) {
List<Date> dateByType = getDateByType(dto.getDateType(), dto.getBeginTime());
if (dto.getTimeType() != null) {
List<Date> dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime());
dto.setBeginTime(dateByType.get(0));
dto.setEndTime(dateByType.get(1));
}

202
ruisi_java/ruisi-system/src/main/resources/mapper/dao/StatisticsDao.xml

@ -15,7 +15,7 @@
LEFT JOIN ums_user u ON e.create_by = u.user_name
where e.del_flag = 0 and e.complete_status != 0
<if test="dto.deptId != null">
AND u.dept_id = #{deptId}
AND u.dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null">
AND e.create_time >= #{dto.beginTime}
@ -31,21 +31,14 @@
SUM(CASE WHEN (pb.weight/(pb.height*pb.height/10000)) >= 18.5 AND (pb.weight/(pb.height*pb.height/10000)) &lt; 24 THEN 1 ELSE 0 END) AS bmi2,
SUM(CASE WHEN (pb. weight/(pb.height*pb.height/10000)) >= 24 AND (pb.weight/(pb.height*pb.height/10000)) &lt; 28 THEN 1 ELSE 0 END) AS bmi3,
SUM(CASE WHEN (pb.weight/(pb.height*pb.height/10000)) >= 28 AND (pb.weight/(pb.height*pb.height/10000)) &lt; 32 THEN 1 ELSE 0 END) AS bmi4,
SUM(CASE WHEN (pb.weight/(pb.height*pb.height/10000)) >= 32 THEN 1 ELSE 0 END) AS bmi5,
SUM(CASE WHEN pp.smoking_history = 1 AND pp.drink_history = 0 THEN 1 ELSE 0 END) AS onlysmoking,
SUM(CASE WHEN pp.smoking_history = 0 AND pp.drink_history = 1 THEN 1 ELSE 0 END) AS onlydrink,
SUM(CASE WHEN pp.smoking_history = 1 AND pp.drink_history = 1 THEN 1 ELSE 0 END) AS bothyes,
SUM(CASE WHEN pp.smoking_history = 0 AND pp.drink_history = 0 THEN 1 ELSE 0 END) AS bothno
SUM(CASE WHEN (pb.weight/(pb.height*pb.height/10000)) >= 32 THEN 1 ELSE 0 END) AS bmi5
FROM
pms_patient p
left JOIN
pms_patient_body pb ON p.id = pb.patient_id
left JOIN
pms_patient_personal pp ON p.id = pp.patient_id
left JOIN pms_patient_body pb ON p.id = pb.patient_id
LEFT JOIN ums_user u ON p.create_by = u.user_name
where p.del_flag
where p.del_flag = 0
<if test="dto.deptId != null">
AND u.dept_id = #{deptId}
AND u.dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null">
AND p.create_time >= #{dto.beginTime}
@ -69,7 +62,7 @@
where e.del_flag = 0
and e.patient_id != 0
<if test="dto.deptId != null">
AND u.dept_id = #{deptId}
AND u.dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null">
AND e.create_time >= #{dto.beginTime}
@ -82,14 +75,14 @@
<select id="nntgb" resultType="com.ccsens.system.domain.vo.HomeDpVo$Tz">
SELECT SUM(CASE WHEN IFNULL(p.tz,0) >= -1 THEN 1 ELSE 0 END) t1,
SUM(CASE WHEN IFNULL(p.tz,0) > -2.5 AND IFNULL(b.tz,0) &lt; -1 THEN 1 ELSE 0 END) t2,
SUM(CASE WHEN IFNULL(p.tz,0) > -2.5 AND IFNULL(p.tz,0) &lt; -1 THEN 1 ELSE 0 END) t2,
SUM(CASE WHEN IFNULL(p.tz,0) &lt;= -2.5 THEN 1 ELSE 0 END) t3
FROM
pms_patient p
LEFT JOIN ums_user u ON p.create_by = u.user_name
where p.del_flag = 0
<if test="dto.deptId != null">
AND u.dept_id = #{deptId}
AND u.dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null">
AND p.create_time >= #{dto.beginTime}
@ -110,7 +103,7 @@
WHERE
drug_name IS NOT NULL and del_flag = 0
<if test="dto.deptId != null">
AND u.dept_id = #{deptId}
AND u.dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null">
AND b.create_time >= #{dto.beginTime}
@ -127,6 +120,7 @@
<select id="nnicd" resultType="com.ccsens.system.domain.vo.HomeDpVo$Jbph">
SELECT
b.diagnosis_name AS name,
b.diagnosis_code as code,
COUNT(b.id) AS value
FROM
pms_patient_body b
@ -136,7 +130,7 @@
and diagnosis_name != ''
and b.del_flag = 0
<if test="dto.deptId != null">
AND u.dept_id = #{deptId}
AND u.dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null">
AND b.create_time >= #{dto.beginTime}
@ -152,25 +146,27 @@
<select id="nnage" resultType="com.ccsens.system.domain.vo.HomeDpVo$Nlfb">
SELECT
SUM(CASE WHEN IFNULL(p.birth_year,0) >= YEAR(CURDATE()) - 60 THEN 1 ELSE 0 END) lt60,
SUM(CASE WHEN IFNULL(p.birth_year,0) &lt;= YEAR(CURDATE()) - 60 AND IFNULL(birth_year,0) > YEAR(CURDATE()) - 69 THEN 1 ELSE 0 END) f60t69,
SUM(CASE WHEN IFNULL(p.birth_year,0) &lt;= YEAR(CURDATE()) - 70 AND IFNULL(birth_year,0) > YEAR(CURDATE()) - 79 THEN 1 ELSE 0 END) f70t79,
SUM(CASE WHEN IFNULL(p.birth_year,0) &lt;= YEAR(CURDATE()) - 80 AND IFNULL(birth_year,0) > YEAR(CURDATE()) - 89 THEN 1 ELSE 0 END) f80t89,
SUM(CASE WHEN IFNULL(p.birth_year,0) &lt;= YEAR(CURDATE()) - 90 THEN 1 ELSE 0 END) f90t
FROM
pms_patient p
LEFT JOIN ums_user u ON p.create_by = u.user_name
WHERE
p.del_flag = 0
SUM(CASE WHEN age &lt; 60 THEN 1 ELSE 0 END) lt60,
SUM(CASE WHEN age BETWEEN 60 AND 69 THEN 1 ELSE 0 END) f60t69,
SUM(CASE WHEN age BETWEEN 70 AND 79 THEN 1 ELSE 0 END) f70t79,
SUM(CASE WHEN age BETWEEN 80 AND 89 THEN 1 ELSE 0 END) f80t89,
SUM(CASE WHEN age >= 90 THEN 1 ELSE 0 END) f90t
FROM (
SELECT
TIMESTAMPDIFF(YEAR, birthday, CURDATE()) -
(DATE_FORMAT(CURDATE(), '%m%d') &lt; DATE_FORMAT(birthday, '%m%d')) AS age
FROM pms_patient
WHERE del_flag = 0
<if test="dto.deptId != null">
AND u.dept_id = #{deptId}
AND dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null">
AND p.create_time >= #{dto.beginTime}
AND create_time >= #{dto.beginTime}
</if>
<if test="dto.endTime != null">
AND p.create_time &lt;= #{dto.endTime}
AND create_time &lt;= #{dto.endTime}
</if>
) t
</select>
<select id="nnmap" resultType="com.ccsens.system.domain.vo.HomeDpVo$Dt">
@ -181,7 +177,7 @@
where del_flag = 0
and parent_id = 0
<if test="dto.deptId != null">
AND dept_id = #{deptId}
AND dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null">
AND create_time >= #{dto.beginTime}
@ -192,12 +188,18 @@
</select>
<select id="nnscale" resultType="com.ccsens.system.domain.vo.HomeDpVo$Pgjg">
SELECT scale_code as name,
SUM(CASE WHEN r.need_plan = 1 THEN 1 ELSE 0 END) as normal,
SUM(CASE WHEN r.need_plan = 0 or need_plan is null THEN 1 ELSE 0 END) as abnormal
FROM `rms_report_scale_score` r
SELECT
r.scale_code AS NAME,
r.scale_code AS scaleCode,
SUM( CASE WHEN rs.need_plan = 1 THEN 1 ELSE 0 END ) AS abnormal,
SUM( CASE WHEN rs.need_plan = 0 THEN 1 ELSE 0 END ) AS normal
FROM
ems_evaluation e
LEFT JOIN ems_evaluation_scale_relevance r ON e.id = r.evaluation_id AND e.del_flag = 0
LEFT JOIN rms_report rr ON rr.evaluation_id = e.id
LEFT JOIN rms_report_scale_score rs ON rs.report_id = rr.id and r.scale_code = rs.scale_code
LEFT JOIN ums_user u ON r.create_by = u.user_name
where r.del_flag = 0
where e.del_flag = 0
and r.scale_code in (
"DCYY-TP",
"CIRS-G",
@ -213,7 +215,7 @@
"CAM"
)
<if test="dto.deptId != null">
AND u.dept_id = #{deptId}
AND u.dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null">
AND r.create_time >= #{dto.beginTime}
@ -235,7 +237,7 @@
where
s.dict_type = 'sys_qualification'
<if test="dto.deptId != null">
AND u.dept_id = #{deptId}
AND u.dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null">
AND p.create_time >= #{dto.beginTime}
@ -251,60 +253,120 @@
<select id="JzStatistics" resultType="com.ccsens.system.domain.vo.HomeDpVo$JzStatistics">
SELECT
SUM(CASE WHEN b.visit_type = 0 THEN 1 ELSE 0 END) AS mzNum,
SUM(CASE WHEN b.visit_type = 1 THEN 1 ELSE 0 END) AS zyNum
SUM(CASE WHEN a.visit_type = 0 THEN 1 ELSE 0 END) AS mzNum,
SUM(CASE WHEN a.visit_type = 1 THEN 1 ELSE 0 END) AS zyNum,
ROUND(AVG(evaluation_count), 2) AS avgNum,
MAX(evaluation_count) AS maxNum,
MIN(evaluation_count) AS minNum
FROM
(
SELECT
b.visit_type,
count(e.id) as evaluation_count
FROM
pms_patient_body b
LEFT JOIN ums_user u ON b.create_by = u.user_name AND u.del_flag = 0
WHERE
b.del_flag = 0
left join pms_patient p on b.patient_id = p.id
left join ems_evaluation e on e.visit_no = b.outpatient_no
<where>
b.del_flag = 0 and p.del_flag = 0
<if test="param.beginTime != null and param.endTime != null">
and b.diagnosis_date between #{param.beginTime} and #{param.endTime}
</if>
<if test="param.deptId != null">
and p.dept_id = #{param.deptId}
</if>
</where>
GROUP BY b.id
)a
<!-- SELECT-->
<!-- SUM(CASE WHEN b.visit_type = 0 THEN 1 ELSE 0 END) AS mzNum,-->
<!-- SUM(CASE WHEN b.visit_type = 1 THEN 1 ELSE 0 END) AS zyNum-->
<!-- FROM-->
<!-- pms_patient_body b-->
<!-- LEFT JOIN ums_user u ON b.create_by = u.user_name AND u.del_flag = 0-->
<!-- WHERE-->
<!-- b.del_flag = 0-->
<!-- <if test="dto.deptId != null">-->
<!-- AND u.dept_id = #{dto.deptId}-->
<!-- </if>-->
<!-- <if test="dto.beginTime != null">-->
<!-- AND b.create_time >= #{dto.beginTime}-->
<!-- </if>-->
<!-- <if test="dto.endTime != null">-->
<!-- AND b.create_time &lt;= #{dto.endTime}-->
<!-- </if>-->
<!-- AND b.visit_type IN (0, 1)-->
</select>
<select id="JzStatisticsNum" resultType="com.ccsens.system.domain.vo.HomeDpVo$JzStatistics">
SELECT
ROUND(AVG(evaluation_count), 2) AS avgNum,
MAX(evaluation_count) AS maxNum,
MIN(evaluation_count) AS minNum
FROM (
SELECT
e.visit_no,
COUNT(e.id) AS evaluation_count
FROM ems_evaluation e
LEFT JOIN ums_user u ON e.create_by = u.user_name AND u.del_flag = 0
WHERE e.del_flag = 0
AND e.visit_no != '0'
AND e.visit_no IS NOT NULL
<if test="dto.deptId != null">
AND u.dept_id = #{deptId}
AND u.dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null">
AND b.create_time >= #{dto.beginTime}
AND e.create_time >= #{dto.beginTime}
</if>
<if test="dto.endTime != null">
AND b.create_time &lt;= #{dto.endTime}
AND e.create_time &lt;= #{dto.endTime}
</if>
AND b.visit_type IN (0, 1)
GROUP BY e.visit_no
) AS t;
</select>
<select id="scaleStatistics" resultType="com.ccsens.system.domain.vo.HomeDpVo$ScaleStatistics">
SELECT
qs.code AS code,
qs.name AS name,
IFNULL(COUNT(rss.id), 0) AS num
FROM qms_scale qs
LEFT JOIN rms_report_scale_score rss ON qs.code = rss.scale_code AND rss.del_flag = 0
LEFT JOIN ums_user u ON rss.create_by = u.user_name AND u.del_flag = 0
IFNULL(COUNT(ees.evaluation_id), 0) AS num
FROM
ems_evaluation e
LEFT JOIN ems_evaluation_scale_relevance ees on e.id = ees.evaluation_id AND ees.del_flag = 0
LEFT JOIN qms_scale qs ON qs.code = ees.scale_code
LEFT JOIN ums_user u ON e.create_by = u.user_name AND u.del_flag = 0
WHERE
qs.del_flag = 0
AND qs.type = 2
e.del_flag = 0
<if test="dto.deptId != null">
AND u.dept_id = #{deptId}
AND u.dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null">
AND rss.create_time >= #{dto.beginTime}
AND ees.create_time >= #{dto.beginTime}
</if>
<if test="dto.endTime != null">
AND rss.create_time &lt;= #{dto.endTime}
AND ees.create_time &lt;= #{dto.endTime}
</if>
GROUP BY qs.code, qs.name
GROUP BY ees.scale_code
ORDER BY num DESC
</select>
<select id="versionStatistics" resultType="com.ccsens.system.domain.vo.HomeDpVo$VersionStatistics">
SELECT
hv.id,
hv.version,
COUNT(ee.id) AS num
COUNT(r.id) AS num
FROM hms_version hv
LEFT JOIN ems_evaluation ee ON hv.id = ee.version AND ee.del_flag = 0
LEFT JOIN rms_report r on r.evaluation_id = ee.id
LEFT JOIN ums_user u ON ee.create_by = u.user_name AND u.del_flag = 0
WHERE hv.del_flag = 0
<if test="dto.deptId != null">
AND u.dept_id = #{deptId}
AND u.dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null">
AND ee.create_time >= #{dto.beginTime}
@ -312,30 +374,32 @@
<if test="dto.endTime != null">
AND ee.create_time &lt;= #{dto.endTime}
</if>
GROUP BY hv.id, hv.version
GROUP BY hv.id
ORDER BY num DESC
</select>
<select id="userStatistics" resultType="com.ccsens.system.domain.vo.HomeDpVo$UserStatistics">
SELECT
u.user_id as userId,
u.nick_name as nickName,
u.user_name as userName,
COUNT(e.id) as num
COUNT(r.id) as num
FROM
ums_user u
LEFT JOIN rms_report e on e.create_by = u.user_name and e.del_flag = 0
left join ems_evaluation ee on ee.create_by = u.user_name and ee.del_flag = 0
LEFT JOIN rms_report r on r.evaluation_id = ee.id
WHERE
u.del_flag = 0
<if test="dto.deptId != null">
AND u.dept_id = #{deptId}
AND u.dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null">
AND e.create_time >= #{dto.beginTime}
AND ee.create_time >= #{dto.beginTime}
</if>
<if test="dto.endTime != null">
AND e.create_time &lt;= #{dto.endTime}
AND ee.create_time &lt;= #{dto.endTime}
</if>
GROUP BY u.user_name
GROUP BY u.user_id
ORDER BY num DESC
</select>
@ -349,7 +413,7 @@
WHERE
p.del_flag = 0
<if test="dto.deptId != null">
AND u.dept_id = #{deptId}
AND u.dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null">
AND p.create_time >= #{dto.beginTime}
@ -380,7 +444,7 @@
p.del_flag = 0
AND pp.del_flag = 0
<if test="dto.deptId != null">
AND u.dept_id = #{deptId}
AND u.dept_id = #{dto.deptId}
</if>
<if test="dto.beginTime != null">
AND p.create_time >= #{dto.beginTime}

353
ruisi_java/ruisi-system/src/main/resources/mapper/system/EmsEvaluationScaleCognitiveRelevanceMapper.xml

@ -0,0 +1,353 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.system.persist.mapper.EmsEvaluationScaleCognitiveRelevanceMapper">
<resultMap id="BaseResultMap" type="com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevance">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="evaluation_id" jdbcType="BIGINT" property="evaluationId" />
<result column="scale_code" jdbcType="VARCHAR" property="scaleCode" />
<result column="parent_id" jdbcType="BIGINT" property="parentId" />
<result column="cognitive_code" jdbcType="VARCHAR" property="cognitiveCode" />
<result column="score" jdbcType="DECIMAL" property="score" />
<result column="total_score" jdbcType="DECIMAL" property="totalScore" />
<result column="combo_id" jdbcType="BIGINT" property="comboId" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="TINYINT" property="delFlag" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, evaluation_id, scale_code, parent_id, cognitive_code, score, total_score, combo_id,
sort, create_by, create_time, update_by, update_time, del_flag
</sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevanceExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from ems_evaluation_scale_cognitive_relevance
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ems_evaluation_scale_cognitive_relevance
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ems_evaluation_scale_cognitive_relevance
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevanceExample">
delete from ems_evaluation_scale_cognitive_relevance
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevance">
insert into ems_evaluation_scale_cognitive_relevance (id, evaluation_id, scale_code,
parent_id, cognitive_code, score,
total_score, combo_id, sort,
create_by, create_time, update_by,
update_time, del_flag)
values (#{id,jdbcType=BIGINT}, #{evaluationId,jdbcType=BIGINT}, #{scaleCode,jdbcType=VARCHAR},
#{parentId,jdbcType=BIGINT}, #{cognitiveCode,jdbcType=VARCHAR}, #{score,jdbcType=DECIMAL},
#{totalScore,jdbcType=DECIMAL}, #{comboId,jdbcType=BIGINT}, #{sort,jdbcType=INTEGER},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevance">
insert into ems_evaluation_scale_cognitive_relevance
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="evaluationId != null">
evaluation_id,
</if>
<if test="scaleCode != null">
scale_code,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="cognitiveCode != null">
cognitive_code,
</if>
<if test="score != null">
score,
</if>
<if test="totalScore != null">
total_score,
</if>
<if test="comboId != null">
combo_id,
</if>
<if test="sort != null">
sort,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="evaluationId != null">
#{evaluationId,jdbcType=BIGINT},
</if>
<if test="scaleCode != null">
#{scaleCode,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=BIGINT},
</if>
<if test="cognitiveCode != null">
#{cognitiveCode,jdbcType=VARCHAR},
</if>
<if test="score != null">
#{score,jdbcType=DECIMAL},
</if>
<if test="totalScore != null">
#{totalScore,jdbcType=DECIMAL},
</if>
<if test="comboId != null">
#{comboId,jdbcType=BIGINT},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevanceExample" resultType="java.lang.Long">
select count(*) from ems_evaluation_scale_cognitive_relevance
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update ems_evaluation_scale_cognitive_relevance
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.evaluationId != null">
evaluation_id = #{record.evaluationId,jdbcType=BIGINT},
</if>
<if test="record.scaleCode != null">
scale_code = #{record.scaleCode,jdbcType=VARCHAR},
</if>
<if test="record.parentId != null">
parent_id = #{record.parentId,jdbcType=BIGINT},
</if>
<if test="record.cognitiveCode != null">
cognitive_code = #{record.cognitiveCode,jdbcType=VARCHAR},
</if>
<if test="record.score != null">
score = #{record.score,jdbcType=DECIMAL},
</if>
<if test="record.totalScore != null">
total_score = #{record.totalScore,jdbcType=DECIMAL},
</if>
<if test="record.comboId != null">
combo_id = #{record.comboId,jdbcType=BIGINT},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateBy != null">
update_by = #{record.updateBy,jdbcType=VARCHAR},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.delFlag != null">
del_flag = #{record.delFlag,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update ems_evaluation_scale_cognitive_relevance
set id = #{record.id,jdbcType=BIGINT},
evaluation_id = #{record.evaluationId,jdbcType=BIGINT},
scale_code = #{record.scaleCode,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=BIGINT},
cognitive_code = #{record.cognitiveCode,jdbcType=VARCHAR},
score = #{record.score,jdbcType=DECIMAL},
total_score = #{record.totalScore,jdbcType=DECIMAL},
combo_id = #{record.comboId,jdbcType=BIGINT},
sort = #{record.sort,jdbcType=INTEGER},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
del_flag = #{record.delFlag,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevance">
update ems_evaluation_scale_cognitive_relevance
<set>
<if test="evaluationId != null">
evaluation_id = #{evaluationId,jdbcType=BIGINT},
</if>
<if test="scaleCode != null">
scale_code = #{scaleCode,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=BIGINT},
</if>
<if test="cognitiveCode != null">
cognitive_code = #{cognitiveCode,jdbcType=VARCHAR},
</if>
<if test="score != null">
score = #{score,jdbcType=DECIMAL},
</if>
<if test="totalScore != null">
total_score = #{totalScore,jdbcType=DECIMAL},
</if>
<if test="comboId != null">
combo_id = #{comboId,jdbcType=BIGINT},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevance">
update ems_evaluation_scale_cognitive_relevance
set evaluation_id = #{evaluationId,jdbcType=BIGINT},
scale_code = #{scaleCode,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=BIGINT},
cognitive_code = #{cognitiveCode,jdbcType=VARCHAR},
score = #{score,jdbcType=DECIMAL},
total_score = #{totalScore,jdbcType=DECIMAL},
combo_id = #{comboId,jdbcType=BIGINT},
sort = #{sort,jdbcType=INTEGER},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

46
ruisi_java/ruisi-system/src/main/resources/mapper/system/EmsEvaluationScaleRelevanceMapper.xml

@ -5,6 +5,8 @@
<id column="id" jdbcType="BIGINT" property="id" />
<result column="evaluation_id" jdbcType="BIGINT" property="evaluationId" />
<result column="scale_code" jdbcType="VARCHAR" property="scaleCode" />
<result column="combo_id" jdbcType="BIGINT" property="comboId" />
<result column="score" jdbcType="DECIMAL" property="score" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
@ -71,8 +73,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, evaluation_id, scale_code, sort, create_by, create_time, update_by, update_time,
del_flag
id, evaluation_id, scale_code, combo_id, score, sort, create_by, create_time, update_by,
update_time, del_flag
</sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleRelevanceExample" resultMap="BaseResultMap">
select
@ -106,13 +108,13 @@
</delete>
<insert id="insert" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleRelevance">
insert into ems_evaluation_scale_relevance (id, evaluation_id, scale_code,
sort, create_by, create_time,
update_by, update_time, del_flag
)
combo_id, score, sort,
create_by, create_time, update_by,
update_time, del_flag)
values (#{id,jdbcType=BIGINT}, #{evaluationId,jdbcType=BIGINT}, #{scaleCode,jdbcType=VARCHAR},
#{sort,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}
)
#{comboId,jdbcType=BIGINT}, #{score,jdbcType=DECIMAL}, #{sort,jdbcType=INTEGER},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleRelevance">
insert into ems_evaluation_scale_relevance
@ -126,6 +128,12 @@
<if test="scaleCode != null">
scale_code,
</if>
<if test="comboId != null">
combo_id,
</if>
<if test="score != null">
score,
</if>
<if test="sort != null">
sort,
</if>
@ -155,6 +163,12 @@
<if test="scaleCode != null">
#{scaleCode,jdbcType=VARCHAR},
</if>
<if test="comboId != null">
#{comboId,jdbcType=BIGINT},
</if>
<if test="score != null">
#{score,jdbcType=DECIMAL},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
@ -193,6 +207,12 @@
<if test="record.scaleCode != null">
scale_code = #{record.scaleCode,jdbcType=VARCHAR},
</if>
<if test="record.comboId != null">
combo_id = #{record.comboId,jdbcType=BIGINT},
</if>
<if test="record.score != null">
score = #{record.score,jdbcType=DECIMAL},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
@ -221,6 +241,8 @@
set id = #{record.id,jdbcType=BIGINT},
evaluation_id = #{record.evaluationId,jdbcType=BIGINT},
scale_code = #{record.scaleCode,jdbcType=VARCHAR},
combo_id = #{record.comboId,jdbcType=BIGINT},
score = #{record.score,jdbcType=DECIMAL},
sort = #{record.sort,jdbcType=INTEGER},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
@ -240,6 +262,12 @@
<if test="scaleCode != null">
scale_code = #{scaleCode,jdbcType=VARCHAR},
</if>
<if test="comboId != null">
combo_id = #{comboId,jdbcType=BIGINT},
</if>
<if test="score != null">
score = #{score,jdbcType=DECIMAL},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
@ -265,6 +293,8 @@
update ems_evaluation_scale_relevance
set evaluation_id = #{evaluationId,jdbcType=BIGINT},
scale_code = #{scaleCode,jdbcType=VARCHAR},
combo_id = #{comboId,jdbcType=BIGINT},
score = #{score,jdbcType=DECIMAL},
sort = #{sort,jdbcType=INTEGER},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},

56
ruisi_java/ruisi-system/src/main/resources/mapper/system/RmsReportMapper.xml

@ -14,6 +14,8 @@
<result column="report_time" jdbcType="BIGINT" property="reportTime" />
<result column="evaluation_code" jdbcType="VARCHAR" property="evaluationCode" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="persion_url" jdbcType="VARCHAR" property="persionUrl" />
<result column="positive_url" jdbcType="VARCHAR" property="positiveUrl" />
<result column="qr_code_url" jdbcType="VARCHAR" property="qrCodeUrl" />
<result column="sign_url" jdbcType="VARCHAR" property="signUrl" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
@ -87,9 +89,9 @@
</sql>
<sql id="Base_Column_List">
id, name, evaluation_id, initial_impression, clinical_diagnosis, pasi, patient_age,
department, bed_number, report_time, evaluation_code, url, qr_code_url, sign_url,
remark, show_status, hospital, working_score, create_by, create_time, update_by,
update_time, del_flag, visit_no
department, bed_number, report_time, evaluation_code, url, persion_url, positive_url,
qr_code_url, sign_url, remark, show_status, hospital, working_score, create_by, create_time,
update_by, update_time, del_flag, visit_no
</sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.RmsReportExample" resultMap="BaseResultMap">
select
@ -126,20 +128,20 @@
initial_impression, clinical_diagnosis, pasi,
patient_age, department, bed_number,
report_time, evaluation_code, url,
qr_code_url, sign_url, remark,
show_status, hospital, working_score,
create_by, create_time, update_by,
update_time, del_flag, visit_no
)
persion_url, positive_url, qr_code_url,
sign_url, remark, show_status,
hospital, working_score, create_by,
create_time, update_by, update_time,
del_flag, visit_no)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{evaluationId,jdbcType=BIGINT},
#{initialImpression,jdbcType=VARCHAR}, #{clinicalDiagnosis,jdbcType=VARCHAR}, #{pasi,jdbcType=TINYINT},
#{patientAge,jdbcType=INTEGER}, #{department,jdbcType=VARCHAR}, #{bedNumber,jdbcType=VARCHAR},
#{reportTime,jdbcType=BIGINT}, #{evaluationCode,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR},
#{qrCodeUrl,jdbcType=VARCHAR}, #{signUrl,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{showStatus,jdbcType=TINYINT}, #{hospital,jdbcType=VARCHAR}, #{workingScore,jdbcType=INTEGER},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}, #{visitNo,jdbcType=VARCHAR}
)
#{persionUrl,jdbcType=VARCHAR}, #{positiveUrl,jdbcType=VARCHAR}, #{qrCodeUrl,jdbcType=VARCHAR},
#{signUrl,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{showStatus,jdbcType=TINYINT},
#{hospital,jdbcType=VARCHAR}, #{workingScore,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=TINYINT}, #{visitNo,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.RmsReport">
insert into rms_report
@ -180,6 +182,12 @@
<if test="url != null">
url,
</if>
<if test="persionUrl != null">
persion_url,
</if>
<if test="positiveUrl != null">
positive_url,
</if>
<if test="qrCodeUrl != null">
qr_code_url,
</if>
@ -254,6 +262,12 @@
<if test="url != null">
#{url,jdbcType=VARCHAR},
</if>
<if test="persionUrl != null">
#{persionUrl,jdbcType=VARCHAR},
</if>
<if test="positiveUrl != null">
#{positiveUrl,jdbcType=VARCHAR},
</if>
<if test="qrCodeUrl != null">
#{qrCodeUrl,jdbcType=VARCHAR},
</if>
@ -337,6 +351,12 @@
<if test="record.url != null">
url = #{record.url,jdbcType=VARCHAR},
</if>
<if test="record.persionUrl != null">
persion_url = #{record.persionUrl,jdbcType=VARCHAR},
</if>
<if test="record.positiveUrl != null">
positive_url = #{record.positiveUrl,jdbcType=VARCHAR},
</if>
<if test="record.qrCodeUrl != null">
qr_code_url = #{record.qrCodeUrl,jdbcType=VARCHAR},
</if>
@ -392,6 +412,8 @@
report_time = #{record.reportTime,jdbcType=BIGINT},
evaluation_code = #{record.evaluationCode,jdbcType=VARCHAR},
url = #{record.url,jdbcType=VARCHAR},
persion_url = #{record.persionUrl,jdbcType=VARCHAR},
positive_url = #{record.positiveUrl,jdbcType=VARCHAR},
qr_code_url = #{record.qrCodeUrl,jdbcType=VARCHAR},
sign_url = #{record.signUrl,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
@ -444,6 +466,12 @@
<if test="url != null">
url = #{url,jdbcType=VARCHAR},
</if>
<if test="persionUrl != null">
persion_url = #{persionUrl,jdbcType=VARCHAR},
</if>
<if test="positiveUrl != null">
positive_url = #{positiveUrl,jdbcType=VARCHAR},
</if>
<if test="qrCodeUrl != null">
qr_code_url = #{qrCodeUrl,jdbcType=VARCHAR},
</if>
@ -496,6 +524,8 @@
report_time = #{reportTime,jdbcType=BIGINT},
evaluation_code = #{evaluationCode,jdbcType=VARCHAR},
url = #{url,jdbcType=VARCHAR},
persion_url = #{persionUrl,jdbcType=VARCHAR},
positive_url = #{positiveUrl,jdbcType=VARCHAR},
qr_code_url = #{qrCodeUrl,jdbcType=VARCHAR},
sign_url = #{signUrl,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},

200
ruisi_java/ruisi-system/src/main/resources/mapper/system/RmsReportScaleScoreMapper.xml

@ -7,16 +7,18 @@
<result column="scale_code" jdbcType="VARCHAR" property="scaleCode" />
<result column="score" jdbcType="DECIMAL" property="score" />
<result column="impression" jdbcType="VARCHAR" property="impression" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="scale_ass_conf" jdbcType="BIGINT" property="scaleAssConf" />
<result column="result" jdbcType="VARCHAR" property="result" />
<result column="need_plan" jdbcType="VARCHAR" property="needPlan" />
<result column="plan" jdbcType="VARCHAR" property="plan" />
<result column="combo_id" jdbcType="BIGINT" property="comboId" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="TINYINT" property="delFlag" />
<result column="scale_ass_conf" jdbcType="BIGINT" property="scaleAssConf" />
<result column="result" jdbcType="VARCHAR" property="result" />
<result column="need_plan" jdbcType="VARCHAR" property="needPlan" />
<result column="plan" jdbcType="VARCHAR" property="plan" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="is_show" jdbcType="TINYINT" property="isShow" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -77,8 +79,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, report_id, scale_code, score, impression, sort, scale_ass_conf, result, need_plan,
plan, create_by, create_time, update_by, update_time, del_flag
id, report_id, scale_code, score, impression, combo_id, create_by, create_time, update_by,
update_time, del_flag, scale_ass_conf, result, need_plan, plan, sort, is_show
</sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.RmsReportScaleScoreExample" resultMap="BaseResultMap">
select
@ -112,17 +114,17 @@
</delete>
<insert id="insert" parameterType="com.ccsens.system.domain.po.RmsReportScaleScore">
insert into rms_report_scale_score (id, report_id, scale_code,
score, impression, sort,
scale_ass_conf, result, need_plan,
plan, create_by, create_time,
update_by, update_time, del_flag
)
score, impression, combo_id,
create_by, create_time, update_by,
update_time, del_flag, scale_ass_conf,
result, need_plan, plan,
sort, is_show)
values (#{id,jdbcType=BIGINT}, #{reportId,jdbcType=BIGINT}, #{scaleCode,jdbcType=VARCHAR},
#{score,jdbcType=DECIMAL}, #{impression,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER},
#{scaleAssConf,jdbcType=BIGINT}, #{result,jdbcType=VARCHAR}, #{needPlan,jdbcType=VARCHAR},
#{plan,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}
)
#{score,jdbcType=DECIMAL}, #{impression,jdbcType=VARCHAR}, #{comboId,jdbcType=BIGINT},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}, #{scaleAssConf,jdbcType=BIGINT},
#{result,jdbcType=VARCHAR}, #{needPlan,jdbcType=VARCHAR}, #{plan,jdbcType=VARCHAR},
#{sort,jdbcType=INTEGER}, #{isShow,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.RmsReportScaleScore">
insert into rms_report_scale_score
@ -142,20 +144,8 @@
<if test="impression != null">
impression,
</if>
<if test="sort != null">
sort,
</if>
<if test="scaleAssConf != null">
scale_ass_conf,
</if>
<if test="result != null">
result,
</if>
<if test="needPlan != null">
need_plan,
</if>
<if test="plan != null">
plan,
<if test="comboId != null">
combo_id,
</if>
<if test="createBy != null">
create_by,
@ -172,6 +162,24 @@
<if test="delFlag != null">
del_flag,
</if>
<if test="scaleAssConf != null">
scale_ass_conf,
</if>
<if test="result != null">
result,
</if>
<if test="needPlan != null">
need_plan,
</if>
<if test="plan != null">
plan,
</if>
<if test="sort != null">
sort,
</if>
<if test="isShow != null">
is_show,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -189,20 +197,8 @@
<if test="impression != null">
#{impression,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="scaleAssConf != null">
#{scaleAssConf,jdbcType=BIGINT},
</if>
<if test="result != null">
#{result,jdbcType=VARCHAR},
</if>
<if test="needPlan != null">
#{needPlan,jdbcType=VARCHAR},
</if>
<if test="plan != null">
#{plan,jdbcType=VARCHAR},
<if test="comboId != null">
#{comboId,jdbcType=BIGINT},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
@ -219,6 +215,24 @@
<if test="delFlag != null">
#{delFlag,jdbcType=TINYINT},
</if>
<if test="scaleAssConf != null">
#{scaleAssConf,jdbcType=BIGINT},
</if>
<if test="result != null">
#{result,jdbcType=VARCHAR},
</if>
<if test="needPlan != null">
#{needPlan,jdbcType=VARCHAR},
</if>
<if test="plan != null">
#{plan,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="isShow != null">
#{isShow,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.RmsReportScaleScoreExample" resultType="java.lang.Long">
@ -245,20 +259,8 @@
<if test="record.impression != null">
impression = #{record.impression,jdbcType=VARCHAR},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
<if test="record.scaleAssConf != null">
scale_ass_conf = #{record.scaleAssConf,jdbcType=BIGINT},
</if>
<if test="record.result != null">
result = #{record.result,jdbcType=VARCHAR},
</if>
<if test="record.needPlan != null">
need_plan = #{record.needPlan,jdbcType=VARCHAR},
</if>
<if test="record.plan != null">
plan = #{record.plan,jdbcType=VARCHAR},
<if test="record.comboId != null">
combo_id = #{record.comboId,jdbcType=BIGINT},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
@ -275,6 +277,24 @@
<if test="record.delFlag != null">
del_flag = #{record.delFlag,jdbcType=TINYINT},
</if>
<if test="record.scaleAssConf != null">
scale_ass_conf = #{record.scaleAssConf,jdbcType=BIGINT},
</if>
<if test="record.result != null">
result = #{record.result,jdbcType=VARCHAR},
</if>
<if test="record.needPlan != null">
need_plan = #{record.needPlan,jdbcType=VARCHAR},
</if>
<if test="record.plan != null">
plan = #{record.plan,jdbcType=VARCHAR},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
<if test="record.isShow != null">
is_show = #{record.isShow,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -287,16 +307,18 @@
scale_code = #{record.scaleCode,jdbcType=VARCHAR},
score = #{record.score,jdbcType=DECIMAL},
impression = #{record.impression,jdbcType=VARCHAR},
sort = #{record.sort,jdbcType=INTEGER},
scale_ass_conf = #{record.scaleAssConf,jdbcType=BIGINT},
result = #{record.result,jdbcType=VARCHAR},
need_plan = #{record.needPlan,jdbcType=VARCHAR},
plan = #{record.plan,jdbcType=VARCHAR},
combo_id = #{record.comboId,jdbcType=BIGINT},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
del_flag = #{record.delFlag,jdbcType=TINYINT}
del_flag = #{record.delFlag,jdbcType=TINYINT},
scale_ass_conf = #{record.scaleAssConf,jdbcType=BIGINT},
result = #{record.result,jdbcType=VARCHAR},
need_plan = #{record.needPlan,jdbcType=VARCHAR},
plan = #{record.plan,jdbcType=VARCHAR},
sort = #{record.sort,jdbcType=INTEGER},
is_show = #{record.isShow,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -316,20 +338,8 @@
<if test="impression != null">
impression = #{impression,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="scaleAssConf != null">
scale_ass_conf = #{scaleAssConf,jdbcType=BIGINT},
</if>
<if test="result != null">
result = #{result,jdbcType=VARCHAR},
</if>
<if test="needPlan != null">
need_plan = #{needPlan,jdbcType=VARCHAR},
</if>
<if test="plan != null">
plan = #{plan,jdbcType=VARCHAR},
<if test="comboId != null">
combo_id = #{comboId,jdbcType=BIGINT},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
@ -346,6 +356,24 @@
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=TINYINT},
</if>
<if test="scaleAssConf != null">
scale_ass_conf = #{scaleAssConf,jdbcType=BIGINT},
</if>
<if test="result != null">
result = #{result,jdbcType=VARCHAR},
</if>
<if test="needPlan != null">
need_plan = #{needPlan,jdbcType=VARCHAR},
</if>
<if test="plan != null">
plan = #{plan,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="isShow != null">
is_show = #{isShow,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -355,16 +383,18 @@
scale_code = #{scaleCode,jdbcType=VARCHAR},
score = #{score,jdbcType=DECIMAL},
impression = #{impression,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
scale_ass_conf = #{scaleAssConf,jdbcType=BIGINT},
result = #{result,jdbcType=VARCHAR},
need_plan = #{needPlan,jdbcType=VARCHAR},
plan = #{plan,jdbcType=VARCHAR},
combo_id = #{comboId,jdbcType=BIGINT},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=TINYINT}
del_flag = #{delFlag,jdbcType=TINYINT},
scale_ass_conf = #{scaleAssConf,jdbcType=BIGINT},
result = #{result,jdbcType=VARCHAR},
need_plan = #{needPlan,jdbcType=VARCHAR},
plan = #{plan,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
is_show = #{isShow,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

55
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/ReportController.java

@ -0,0 +1,55 @@
package com.ccsens.admin.controller;
import com.ccsens.admin.service.AmsReportService;
import com.ccsens.common.annotation.Anonymous;
import com.ccsens.common.core.domain.JsonResponse;
import com.ccsens.system.domain.dto.RmsDto;
import com.ccsens.system.domain.vo.AmsReportVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.IOException;
/**
* @Author zzc
* @Package com.ccsens.admin.controller
* @Date 2026/2/12 17:48
* @description:
*/
@Slf4j
@Api(tags = "量表报告单模板管理")
@RestController
@RequestMapping("/report")
public class ReportController {
@Resource
private AmsReportService amsReportService;
@Anonymous
@ApiOperation("导出个人报告")
@PostMapping("/exportGr")
public JsonResponse<AmsReportVo.Result> exportGr(@RequestBody @Validated RmsDto.ExportReport1Dto dto) throws IOException {
return JsonResponse.ok(amsReportService.exportGr(dto));
}
@Anonymous
@ApiOperation("导出医生版报告")
@PostMapping("/exportYs")
public JsonResponse<AmsReportVo.Result> exportYs(@RequestBody @Validated RmsDto.ExportReport1Dto dto){
return JsonResponse.ok(amsReportService.exportYs(dto));
}
@Anonymous
@ApiOperation("导出阳性版报告")
@PostMapping("/exportYx")
public JsonResponse<AmsReportVo.Result> exportYx(@RequestBody @Validated RmsDto.ExportReport1Dto dto){
return JsonResponse.ok(amsReportService.exportYx(dto));
}
}

11
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/ReportPdfController.java

@ -39,10 +39,19 @@ public class ReportPdfController {
@Anonymous
@ApiOperation(value = "通过就诊号查询患者的评估报告单",notes = "")
@PostMapping(value="/reportPDF")
public JsonResponse<PageInfo<RmsVo.ReportPDF>> generate(@RequestBody @Validated BaseDto<RmsDto.ReportPDF> dto){
public JsonResponse<PageInfo<RmsVo.ReportPDF>> reportPDF(@RequestBody @Validated BaseDto<RmsDto.ReportPDF> dto){
log.info("通过就诊号查询患者的评估报告单:{}", dto);
startPage(dto);
List<RmsVo.ReportPDF> list = rmsService.viewReportPDF(dto.getParam());
return JsonResponse.ok(new PageInfo<>(list));
}
@Anonymous
@ApiOperation(value = "通过就诊号查询患者的评估报告单",notes = "")
@PostMapping(value="/queryPdfUrl")
public JsonResponse<String> queryPdfUrl(@RequestBody @Validated BaseDto<RmsDto.queryPdfUrl> dto){
log.info("通过就诊号查询患者的评估报告单:{}", dto);
String url = rmsService.queryPdfUrl(dto.getParam());
return JsonResponse.ok(url);
}
}

18
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/RmsController.java

@ -9,9 +9,11 @@ import com.ccsens.common.core.domain.JsonResponse;
import com.ccsens.common.core.domain.model.LoginUser;
import com.ccsens.common.utils.SecurityUtils;
import com.ccsens.system.domain.dto.AmsDto;
import com.ccsens.system.domain.dto.PmsPatientDto;
import com.ccsens.system.domain.dto.RmsDto;
import com.ccsens.system.domain.vo.AmsVo;
import com.ccsens.system.domain.vo.RmsVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
@ -60,7 +62,7 @@ public class RmsController extends BaseController {
//查询报告单列表
@ApiOperation(value = "查询报告单列表")
@PostMapping(value = "/queryReportList")
public JsonResponse<PageInfo<RmsVo.QueryReportHistoryPatient>> queryReportList(@RequestBody @Validated BaseDto<RmsDto.QueryReportHistory> dto){
public JsonResponse<PageInfo<RmsVo.QueryReportHistoryPatient>> queryReportList(@RequestBody @Validated BaseDto<RmsDto.QueryReportList> dto) {
log.info("查询报告单列表:{}", dto);
//获取用户的权限
@ -160,5 +162,19 @@ public class RmsController extends BaseController {
workbook.write(response.getOutputStream());
}
@ApiOperation(value = "查询测评列表", notes = "管理员查询测评列表")
@PostMapping("/queryReport")
public JsonResponse<PageInfo<RmsVo.Report>> queryReport(@RequestBody @ApiParam @Valid BaseDto<RmsDto.ReportQuery> param) {
if (param.getPageNum() > 0) {
PageHelper.startPage(param.getPageNum(), param.getPageSize());
}
return JsonResponse.ok(new PageInfo<>(rmsService.queryReportList(param.getParam(), SecurityUtils.getUserId())));
}
@ApiOperation("导出患者测评列表")
@PostMapping("/exportEvaluation")
public void exportEvaluation(HttpServletResponse response, @RequestBody @Validated BaseDto<RmsDto.ReportQuery> dto) throws IOException {
rmsService.exportEvaluation(dto.getParam(), response);
}
}

42
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/AmsDao.java

@ -0,0 +1,42 @@
package com.ccsens.admin.persist.dao;
import com.ccsens.system.domain.po.AmsPatientAnswerScore;
import com.ccsens.system.domain.po.QmsScaleAssConf;
import com.ccsens.system.domain.vo.AmsVo;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
/**
* @author:
*/
public interface AmsDao {
List<AmsVo.EvaluationStep> queryEvaluationStep(Long evaluationId);
List<AmsVo.ScaleAchievement> getScaleAchievement(@Param("evaluationId") Long evaluationId,
@Param("scaleCode") String scaleCode,
@Param("sex")Byte sex);
List<AmsVo.ScaleQuestionAchievement> getScaleQuestionAchievement(@Param("evaluationId") Long evaluationId,
@Param("scaleCode") String scaleCode,
@Param("sex")Byte sex);
List<AmsVo.Option> queryOption(@Param("questionId")Long questionId, @Param("evaluationId")Long evaluationId);
BigDecimal getTotalScoreByNPI(@Param("evaluationId")Long evaluationId);
void delZmsAnswerScores(@Param("list")List<AmsPatientAnswerScore> amsPatientAnswerScores);
String queryTemplate(@Param("code")String code);
String queryScaleTypeName(@Param("code") String code);
AmsVo.ComboVo queryComboName(@Param("code") String code, @Param("version") String version);
QmsScaleAssConf queryScaleAssConf(@Param("scaleCode") String scaleCode, @Param("score") BigDecimal score);
QmsScaleAssConf queryScaleAssConf1(@Param("scaleCode") String scaleCode, @Param("score") BigDecimal score, @Param("needPlan")Byte needPlan);
List<String> queryYsfaList(@Param("scaleCode") String scaleCode);
}

3
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/HmsDao.java

@ -23,4 +23,7 @@ public interface HmsDao {
List<HmsVo.HmsReportConfigVo> query(@Param("hospitalId") Long hospitalId,
@Param("name") String name,
@Param("code") String code);
List<HmsVo.DoctorName> queryDoctorName(Long hospitalId);
}

52
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/RmsDao.java

@ -1,7 +1,9 @@
package com.ccsens.admin.persist.dao;
import com.ccsens.system.domain.dto.RmsDto;
import com.ccsens.system.domain.po.AmsPatientQuestionRecordDesc;
import com.ccsens.system.domain.po.LdPatientRecord;
import com.ccsens.system.domain.po.QmsScaleAssConf;
import com.ccsens.system.domain.vo.*;
import org.apache.ibatis.annotations.Param;
@ -75,7 +77,7 @@ public interface RmsDao {
@Param("username")String username,
@Param("dataScope")String dataScope);
List<RmsVo.QueryReportHistoryPatient> queryReportListCopyClient(@Param("dto")RmsDto.QueryReportHistory dto,
List<RmsVo.QueryReportHistoryPatient> queryReportListCopyClient(@Param("dto")RmsDto.QueryReportList dto,
@Param("userId")Long userId,
@Param("username")String username,
@Param("dataScope")String dataScope);
@ -89,6 +91,54 @@ public interface RmsDao {
*/
List<AmsVo.QuestionRecordDto> queryRecord(@Param("evaluationId")Long evaluationId, @Param("questionId")Long questionId);
List<RmsVo.ReportScore> queryReportScore1(@Param("evaluationId") Long evaluationId,
@Param("scaleCode") String scaleCode,
@Param("sex") Byte sex);
List<RmsVo.ReportScore> queryReportScore3(@Param("evaluationId") Long evaluationId,
@Param("scaleCode") String scaleCode,
@Param("sex") Byte sex);
/**
* 查询报告单
*
* @param evaId
* @return
*/
ClientEvaVo.ReportView getTzbsResult(@Param("evaId") Long evaId,
@Param("code") String code);
QmsScaleAssConf queryScaleAssConf(@Param("scaleCode") String scaleCode, @Param("score") BigDecimal score);
List<AmsVo.ScaleAchievement> getScaleAchievement(@Param("evaluationId") Long evaluationId,
@Param("scaleCode") String scaleCode,
@Param("sex")Byte sex);
AmsPatientQuestionRecordDesc queryCTTRecordDesc(@Param("evaluationId")Long evaluationId, @Param("cognitiveCode")String cognitiveCode, @Param("showTitle")String showTitle);
/**
* 查询养生建议
*
* @param constiCode
* @param deptId
* @return
*/
String queryYsjy(@Param("constiCode") String constiCode);
/**
* 查询测评分数
*
* @param evaId
* @return
*/
List<ReportVo.EvaResult> countReportResult(@Param("evaId") Long evaId,
@Param("code") String scaleCode);
List<RmsVo.Report> queryReport(@Param("dto") RmsDto.ReportQuery dto);
List<RmsVo.ReportScore> queryEmsScaleScore(@Param("evaId") Long evaId,
@Param("scaleCodeList") List<String> scaleCodeList);
List<RmsVo.ReportPDF> viewReportPdfByVisitNo(@Param("visitNo")String visitNo);
List<RmsVo.ReportPDF> viewReportPdfByPatientNo(@Param("patientNo")String patientNo);

36
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/AmsReportService.java

@ -0,0 +1,36 @@
package com.ccsens.admin.service;
import com.ccsens.system.domain.dto.RmsDto;
import com.ccsens.system.domain.vo.AmsReportVo;
import java.io.IOException;
/**
* 报告单模板 服务层
*
* @author zzc
*/
public interface AmsReportService {
/**
* 导出个人报告
* @param dto
* @return
* @throws IOException
*/
AmsReportVo.Result exportGr(RmsDto.ExportReport1Dto dto) throws IOException;
/**
* 导出医生报告
* @param dto
* @return
*/
AmsReportVo.Result exportYs(RmsDto.ExportReport1Dto dto);
/**
* 导出阳性报告
* @param dto
* @return
*/
AmsReportVo.Result exportYx(RmsDto.ExportReport1Dto dto);
}

2
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IPmsPatientService.java

@ -64,4 +64,6 @@ public interface IPmsPatientService {
String userName);
void exportPatientJz(HttpServletResponse response, PmsPatientDto.QueryPatientJz param, String dataScope, Long userId, String userName) throws IOException;
}

7
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IRmsService.java

@ -6,6 +6,7 @@ import com.ccsens.admin.domain.vo.LdPatientExportVo;
import com.ccsens.system.domain.vo.RmsVo;
import org.apache.poi.ss.usermodel.Workbook;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@ -20,7 +21,7 @@ public interface IRmsService {
List<RmsVo.QueryReportHistory> queryReportListByTime(RmsDto.QueryReportHistory dto, Long userId, String dataScope);
List<RmsVo.QueryReportHistoryPatient> queryReportList(RmsDto.QueryReportHistory dto, Long userId, String dataScope);
List<RmsVo.QueryReportHistoryPatient> queryReportListCopyClient(RmsDto.QueryReportHistory dto, Long userId, String dataScope);
List<RmsVo.QueryReportHistoryPatient> queryReportListCopyClient(RmsDto.QueryReportList dto, Long userId, String dataScope);
Integer updateReportBasic(RmsDto.UpdateReportBasic dto);
@ -40,5 +41,9 @@ public interface IRmsService {
List<RmsVo.ReportPDF> viewReportPDF(RmsDto.ReportPDF dto);
List<RmsVo.Report> queryReportList(RmsDto.ReportQuery param, Long userId);
String queryPdfUrl(RmsDto.queryPdfUrl param);
void exportEvaluation(RmsDto.ReportQuery param, HttpServletResponse response) throws IOException;
}

875
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/AmsReportServiceImpl.java

@ -0,0 +1,875 @@
package com.ccsens.admin.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HtmlUtil;
import com.ccsens.admin.persist.dao.AmsDao;
import com.ccsens.admin.persist.dao.HmsDao;
import com.ccsens.admin.service.AmsReportService;
import com.ccsens.admin.service.IReportInfoService;
import com.ccsens.admin.service.IRmsService;
import com.ccsens.common.constant.CultureEnum;
import com.ccsens.common.constant.JobEnum;
import com.ccsens.common.enums.BaseEnum;
import com.ccsens.common.utils.AsposeUtils;
import com.ccsens.common.utils.SecurityUtils;
import com.ccsens.common.utils.StringUtils;
import com.ccsens.system.domain.dto.RmsDto;
import com.ccsens.system.domain.po.*;
import com.ccsens.system.domain.vo.*;
import com.ccsens.system.persist.mapper.*;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.data.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static com.ccsens.common.utils.PropUtil.path;
import static com.ccsens.common.utils.PropUtil.reportDomain;
@Slf4j
@Service
public class AmsReportServiceImpl implements AmsReportService {
@Resource
private IReportInfoService reportInfoService;
@Resource
private AmsDao amsDao;
@Value("${informed.prefixWord}")
private String prefixWord;
@Value("${file.reportPath}")
private String reportPath;
@Resource
private HmsReportConfigMapper hmsReportConfigMapper;
@Resource
private IRmsService rmsService;
@Resource
private RmsReportMapper rmsReportMapper;
@Resource
private QmsScaleMapper qmsScaleMapper;
@Resource
private QmsScaleTypeMapper qmsScaleTypeMapper;
@Resource
private EmsEvaluationMapper emsEvaluationMapper;
@Resource
private AmsPatientAnswerScoreMapper amsPatientAnswerScoreMapper;
@Resource
private HmsDoctorSignMapper hmsDoctorSignMapper;
@Resource
private HmsDao hmsDoctorDao;
@Resource
private HmsVersionMapper hmsVersionMapper;
@Value("${file.grPath}")
private String grPath;
@Value("${file.ysPath}")
private String ysPath;
@Override
public AmsReportVo.Result exportGr(RmsDto.ExportReport1Dto dto) throws IOException {
RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail();
queryDetail.setEvaluationId(dto.getEvaluationId());
RmsVo.ReportDetail detail = rmsService.queryReportDetail(queryDetail, SecurityUtils.getUserId());
if (detail == null) {
return null;
}
EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId());
List<RmsVo.ReportScore> scores = detail.getScores();
RmsVo.ReportPatient patientInfo = detail.getPatient();
HashMap<String, Object> params = new HashMap<>();
XWPFTemplate template = XWPFTemplate.compile(grPath);
params.put("h_name", patientInfo.getHospitalName());
// params.put("qrcode_img_url", Pictures.ofLocal(reportPath + patientInfo.getQrCodeUrl()).size(130, 130).create());
params.put("p_name", patientInfo.getPatientName());
params.put("p_sex", patientInfo.getSex() == 0 ? "男" : "女");
params.put("p_age", patientInfo.getPatientAge());
CultureEnum cultureEnum = null;
// BodyContainer bodyContainer = BodyContainerFactory.getBodyContainer(run);
try {
cultureEnum = BaseEnum.codeOf(CultureEnum.class, patientInfo.getEducationalStatus().intValue());
} catch (Exception e) {
//处理educationStatus为null的情况,后台导入的数据educationStatus为null
//默认为初中
cultureEnum = CultureEnum.YW;
}
if (cultureEnum != null) {
params.put("p_grade", cultureEnum.getDesc());
}
if (patientInfo.getCareer() != null) {
JobEnum jobEnum = BaseEnum.codeOf(JobEnum.class, patientInfo.getCareer().intValue());
// params.put("p_no", patientInfo.getSerialNumber());
if (jobEnum != null) {
params.put("p_Career", jobEnum.getDesc());
}
}
params.put("p_dept", patientInfo.getDepartment());
params.put("p_bedno", patientInfo.getBedNumber());
params.put("p_Patient_number", patientInfo.getHospitalNumber());
params.put("p_Clinical_diagnosis", patientInfo.getClinicalDiagnosis());
params.put("p_Inspection_date", DateUtil.format(new Date(patientInfo.getReportTime()), "yyyy-MM-dd"));
// params.put("score", detail.getScore());
//AD8
// if (dto.getSignId() != null) {
// HmsDoctorSign emsEvaluationInformedConsent = hmsDoctorDao.querySign(dto.getSignId());
// if (emsEvaluationInformedConsent != null) {
// params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create());
// }
// }
if (dto.getSignId() != null) {
HmsDoctorSign emsEvaluationInformedConsent = hmsDoctorSignMapper.selectByPrimaryKey(dto.getSignId());
if (emsEvaluationInformedConsent != null) {
params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create());
}
}else {
//签名信息
Long userId = SecurityUtils.getUserId();
List<HmsVo.QuerySign> querySigns = hmsDoctorDao.querySign(userId);
if (CollUtil.isNotEmpty(querySigns)) {
HmsVo.QuerySign querySign = querySigns.get(0);
if (ObjectUtil.isNotNull(querySign) && StrUtil.isNotEmpty(querySign.getSignUrl())) {
params.put("cpy_img_url", Pictures.ofLocal(prefixWord + querySign.getSignUrl()).size(80, 40).create());
}
}
}
params.put("report_date", DateUtil.date(patientInfo.getReportTime()));
//生成表格
// 创建带有样式的文本
TextRenderData text1 = Texts.of("评估结论").bold().fontSize(12).create();
TextRenderData text2 = Texts.of("评估结论").bold().fontSize(12).create();
TextRenderData text3 = Texts.of("评估结论").bold().fontSize(12).create();
RowRenderData headerRow = Rows.of(text1, text2, text3).create();
RowRenderData titleRow = Rows.of("项目名称", "得分", "结论").create();
Tables.TableBuilder of = Tables.of(headerRow, titleRow);
//肌少套餐结论
String jsResult = addJs(scores);
Integer jsCount = 0, jshs = 0;
for (int i = 0; i < scores.size(); i++) {
//判断肌少量表数量
if ("5CZLSY".equals(scores.get(i).getCode()) || "SZGGJ".equals(scores.get(i).getCode()) || "WLCD".equals(scores.get(i).getCode()) || "LMBS".equals(scores.get(i).getCode())) {
jsCount += 1;
}
//查询类型
AmsVo.ComboVo comboVo = amsDao.queryComboName(scores.get(i).getCode(), emsEvaluation.getVersion());
String comboName = "", parentName = "";
String str = "";
if (comboVo != null) {
if (StrUtil.isNotEmpty(comboVo.getParentName())) {
str = comboVo.getParentName();
params.put("yjzb", comboVo.getParentName());
}
if (StrUtil.isNotBlank(comboVo.getName())) {
if (StrUtil.isNotBlank(str)) {
str += "/" + comboVo.getName();
} else {
str = comboVo.getName();
}
params.put("ejzb", comboVo.getName());
}
}
String impression = "";
Byte needPlan = null;
if (scores.get(i).getScore() != null && "MMSE".equals(scores.get(i).getCode())) {
//1、认知检查结果在正常范围。/认知功能受损。
//依据不同教育程度制定划界分:文盲组≤19分,小学组≤22分,中学或以上组≤26分,低于划界分为认知功能受损。
if (cultureEnum.getCode() == 1 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(19)) <= 0) {
impression = "认知功能受损";
needPlan = 1;
} else if (cultureEnum.getCode() == 2 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(22)) <= 0) {
impression = "认知功能受损";
needPlan = 1;
} else if (cultureEnum.getCode() >= 3 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(26)) <= 0) {
impression = "认知功能受损";
needPlan = 1;
} else {
impression = "认知检查结果在正常范围";
needPlan = 0;
}
}
//判断是否阳性 查询防治计划
QmsScaleAssConf qmsScaleAssConf = amsDao.queryScaleAssConf1(scores.get(i).getCode(), scores.get(i).getScore(), needPlan);
RowRenderData row1;
if (qmsScaleAssConf != null && "1".equals(qmsScaleAssConf.getNeedPlan())) {
//需要防治
TextRenderData textName = Texts.of(scores.get(i).getName()).bold().color("FF0000").create();
TextRenderData textScore = Texts.of(scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "").bold().color("FF0000").create();
TextRenderData textImpression = Texts.of(StrUtil.isEmpty(impression) ? qmsScaleAssConf.getResult() : impression).bold().color("FF0000").create();
row1 = Rows.of(
textName,
textScore,
textImpression
).create();
} else {
row1 = Rows.of(
scores.get(i).getName(),
scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "",
StrUtil.isEmpty(impression) ? qmsScaleAssConf == null ? StrUtil.isEmpty(scores.get(i).getImpression()) ? null : scores.get(i).getImpression() : qmsScaleAssConf.getResult() : impression
).create();
}
//查询类型
String typeName = amsDao.queryScaleTypeName(scores.get(i).getCode());
// RowRenderData row1 = Rows.of(
// scores.get(i).getName(),
// scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "",
// scores.get(i).getImpression()
// ).create();
if (StrUtil.isNotEmpty(typeName)) {
of.mergeRule(MergeCellRule.builder().map(MergeCellRule.Grid.of(i + 1, i + 1), MergeCellRule.Grid.of(0, 1)).build());
}
of.addRow(row1);
//添加肌少套餐结论
if (StrUtil.isNotEmpty(jsResult) && jsCount == 4) {
//判断结论
RowRenderData rowRenderData = Rows.of(
"肌少总结论:",
jsResult,
jsResult
).create();
jshs = i + 3;
of.addRow(rowRenderData);
jsResult = "";
}
//生成问题表格
TextRenderData text5 = Texts.of("问题描述").bold().fontSize(12).create();
TextRenderData text6 = Texts.of("问题结果").bold().fontSize(12).create();
TextRenderData text7 = Texts.of("得 分").bold().fontSize(12).create();
// TextRenderData text8 = Texts.of("总 分").bold().fontSize(12).create();
RowRenderData detailHeaderRow = Rows.of(text5, text6, text7).create();
Tables.TableBuilder of1 = Tables.of(detailHeaderRow);
//遍历问题
RmsDto.QueryReportAnswer queryReportAnswer = new RmsDto.QueryReportAnswer();
queryReportAnswer.setEvaluationCode(scores.get(i).getCode());
queryReportAnswer.setId(dto.getReportId());
List<RmsVo.ReportDetailAnswer> reportDetailAnswerList = rmsService.queryReportAnswer(queryReportAnswer, SecurityUtils.getUserId());
MergeCellRule detailMerge = null;
if (CollUtil.isNotEmpty(reportDetailAnswerList)) {
RmsVo.ReportDetailAnswer reportDetailAnswer = reportDetailAnswerList.get(0);
List<List<RmsVo.QuestionInfo>> collect = reportDetailAnswerList.stream().map(reportDetailAnswer1 -> reportDetailAnswer1.getQuestionList()).collect(Collectors.toList());
List<RmsVo.QuestionInfo> list = new ArrayList<>();
for (int j = 0; j < collect.size(); j++) {
list.addAll(collect.get(j));
}
for (RmsVo.QuestionInfo questionInfo : list) {
//查询患者答题得分
BigDecimal score = new BigDecimal("0");
AmsPatientAnswerScoreExample amsPatientAnswerScoreExample = new AmsPatientAnswerScoreExample();
amsPatientAnswerScoreExample.createCriteria()
// .andPatientIdEqualTo(patientInfo.getId())
.andQuestionIdEqualTo(questionInfo.getQuestionId())
.andEvaluationIdEqualTo(dto.getEvaluationId());
amsPatientAnswerScoreExample.setOrderByClause("id desc");
List<AmsPatientAnswerScore> amsPatientAnswerScores = amsPatientAnswerScoreMapper.selectByExample(amsPatientAnswerScoreExample);
if (CollUtil.isNotEmpty(amsPatientAnswerScores)) {
score = BigDecimal.valueOf(amsPatientAnswerScores.stream().filter(e -> e.getOptionId() != null && e.getOptionId() != 0).map(AmsPatientAnswerScore::getScore).mapToDouble(BigDecimal::doubleValue).sum());
}
//处理答案
String answers = "";
for (RmsVo.Answer answer : questionInfo.getAnswers()) {
if (StrUtil.isNotEmpty(answer.getAnswer())) {
answers += answer.getAnswer() + ",";
}
}
if (StrUtil.isNotEmpty(answers)) {
answers = answers.substring(0, answers.length() - 1);
}
of1.addRow(Rows.of(questionInfo.getQuestionName(),
StrUtil.isEmpty(answers) || "null".equals(answers) ? "" : answers,
score + "").create());
//处理指标
if (comboVo != null) {
if (StrUtil.isNotBlank(comboVo.getName())) {
params.put("yjzb", comboVo.getName());
}
if (StrUtil.isNotEmpty(comboVo.getParentName())) {
params.put("ejzb", comboVo.getParentName());
}
}
}
TableRenderData tableData = of1
.create();
if (CollUtil.isNotEmpty(reportDetailAnswer.getQuestionList()) && reportDetailAnswer.getQuestionList().size() > 1) {
detailMerge = MergeCellRule.builder().map(MergeCellRule.Grid.of(1, 3), MergeCellRule.Grid.of(reportDetailAnswer.getQuestionList().size(), 3)).build();
// of1.mergeRule(detailMerge);
}
if (qmsScaleAssConf != null) {
params.put("pgjg", qmsScaleAssConf.getResult());
params.put("fzjy_" + i, qmsScaleAssConf.getPlan());
if (StrUtil.isNotEmpty(qmsScaleAssConf.getPlan())) {
params.put("fzjyFlag" + i, false);
}
}
//添加中医体质辨识防治建议
if ("TZBS_BZ".equals(scores.get(i).getCode()) || "TZBS_LN".equals(scores.get(i).getCode())) {
//查询防治建议
List<String> list1 = amsDao.queryYsfaList(scores.get(i).getCode());
if (CollUtil.isNotEmpty(list1)) {
String ysfas = list1.get(0);
for (String ysfa : list1) {
ysfas += HtmlUtil.unescape(ysfa);
}
params.put("fzjy_" + i, ysfas);
params.put("fzjyFlag" + i, false);
}
}
params.put("table_" + i, tableData);
params.put("flag" + i, true);
}
params.put("title" + i, scores.get(i).getName());
}
if (emsEvaluation.getVersion() != null) {
HmsVersion hmsVersion = hmsVersionMapper.selectByPrimaryKey(Long.parseLong(emsEvaluation.getVersion()));
if (hmsVersion != null) {
params.put("type", hmsVersion.getVersion() + "评估报告");
}
}
MergeCellRule.MergeCellRuleBuilder map = MergeCellRule.builder().map(MergeCellRule.Grid.of(0, 0), MergeCellRule.Grid.of(0, 2));
if (jshs > 0) {
map.map(MergeCellRule.Grid.of(jshs, 1), MergeCellRule.Grid.of(jshs, 2)).build();
}
TableRenderData tableData = of
.mergeRule(map.build())
.create();
params.put("table", tableData);
// Long hospitalId = SecurityUtils.getDeptId();
String s = IdUtil.randomUUID();
// 将表格数据放入参数中
// params.put("table", tableDataList);
try {
template.render(params);
} catch (Exception e) {
e.printStackTrace(); // 输出详细的异常信息
}
String filePath = "/profile/" + "/report/" + "老年综合评估_" + s + ".docx";
String pdfPath = "/profile/" + "/report/" + "老年综合评估_" + s + ".pdf";
String aPath = path + "/" + "/report/" + "老年综合评估_" + s + ".docx";
String pPath = path + "/" + "/report/" + "老年综合评估_" + s + ".pdf";
try {
template.writeAndClose(Files.newOutputStream(Paths.get(reportDomain + "/" + "/report/" + "老年综合评估_" + s + ".docx")));
AsposeUtils.doc2pdf(aPath, pPath);
} catch (Exception e) {
e.printStackTrace();
}
AmsReportVo.Result result = new AmsReportVo.Result();
result.setWord(filePath);
result.setPath(pdfPath);
return result;
}
/**
* 判断是否添加肌少总结论
* 如果四项测试有一项没做则跳过
*
* @param scores
* @return
*/
//
//
private String addJs(List<RmsVo.ReportScore> scores) {
List<RmsVo.ReportScore> wczl = scores.stream().filter(
score -> score.getCode().equals("5CZLSY")
).collect(Collectors.toList());
List<RmsVo.ReportScore> szggj = scores.stream().filter(
score -> score.getCode().equals("SZGGJ")
).collect(Collectors.toList());
List<RmsVo.ReportScore> wlcd = scores.stream().filter(
score -> score.getCode().equals("WLCD")
).collect(Collectors.toList());
List<RmsVo.ReportScore> lmbs = scores.stream().filter(
score -> score.getCode().equals("LMBS")
).collect(Collectors.toList());
if (CollUtil.isEmpty(wczl) || CollUtil.isEmpty(szggj) || CollUtil.isEmpty(wlcd) || CollUtil.isEmpty(lmbs)) {
return null;
}
QmsScaleAssConf wczlConf = amsDao.queryScaleAssConf1(wczl.get(0).getCode(), wczl.get(0).getScore(), null);
QmsScaleAssConf szggjConf = amsDao.queryScaleAssConf1(szggj.get(0).getCode(), szggj.get(0).getScore(), null);
QmsScaleAssConf wlcdConf = amsDao.queryScaleAssConf1(wlcd.get(0).getCode(), wlcd.get(0).getScore(), null);
QmsScaleAssConf lmbsConf = amsDao.queryScaleAssConf1(lmbs.get(0).getCode(), lmbs.get(0).getScore(), null);
if (wczlConf != null && szggjConf != null && wlcdConf != null && lmbsConf != null) {
// *四项测试结果都正常,说明没有肌少症风险
// *如果四肢骨骼肌身高质量指数(ASMI)正常,肌肉力量或(及)躯体功能下降,则有肌少症风险;
// *如果四项测试值全部低于标准值,则诊断为严重肌少症。
// *如果四肢骨骼肌身高质量指数(ASMI)低于标准值,肌肉力量或躯体功能其中有一项低于标准值,则诊断为肌少症;
// *否则有肌少症风险
if (!"1".equals(wczlConf.getNeedPlan()) && !"1".equals(szggjConf.getNeedPlan()) && !"1".equals(wlcdConf.getNeedPlan()) && !"1".equals(lmbsConf.getNeedPlan())) {
//没有肌少症风险
return "没有肌少症风险";
} else if (!"1".equals(szggjConf.getNeedPlan()) && "1".equals(wlcdConf.getNeedPlan()) && "1".equals(lmbsConf.getNeedPlan()) && "1".equals(wczlConf.getNeedPlan())) {
return "有肌少症风险";
} else if ("1".equals(wczlConf.getNeedPlan()) && "1".equals(wlcdConf.getNeedPlan()) && "1".equals(lmbsConf.getNeedPlan()) && "1".equals(szggjConf.getNeedPlan())) {
return "严重肌少症";
} else if ("1".equals(szggjConf.getNeedPlan()) && ("1".equals(wlcdConf.getNeedPlan()) || "1".equals(lmbsConf.getNeedPlan()) || "1".equals(wczlConf.getNeedPlan()))) {
return "肌少症";
} else {
return "有肌少症风险";
}
}
return null;
}
@Override
public AmsReportVo.Result exportYs(RmsDto.ExportReport1Dto dto) {
Long userId = dto.getTesterId();
try {
userId = SecurityUtils.getUserId();
}catch (Exception e){
log.error("获取用户ID失败",e);
}
RmsReport report = rmsReportMapper.selectByPrimaryKey(dto.getReportId());
if (ObjectUtil.isNotNull(report) && StrUtil.isNotBlank(report.getUrl())) {
AmsReportVo.Result result = new AmsReportVo.Result();
result.setPath(report.getUrl());
return result;
}
RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail();
queryDetail.setEvaluationId(dto.getEvaluationId());
RmsVo.ReportDetail detail = rmsService.queryReportDetail(queryDetail, userId);
if (detail == null) {
return null;
}
EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId());
if (emsEvaluation == null) {
return null;
}
List<RmsVo.ReportScore> scores = detail.getScores();
RmsVo.ReportPatient patientInfo = detail.getPatient();
HashMap<String, Object> params = new HashMap<>();
XWPFTemplate template = XWPFTemplate.compile(ysPath);
params.put("h_name", patientInfo.getHospitalName());
// params.put("qrcode_img_url", Pictures.ofLocal(reportPath + patientInfo.getQrCodeUrl()).size(130, 130).create());
params.put("p_name", patientInfo.getPatientName());
params.put("p_sex", patientInfo.getSex() == 0 ? "男" : "女");
params.put("p_age", patientInfo.getPatientAge());
CultureEnum cultureEnum = null;
// EmsEvaluationInformedConsentExample emsEvaluationInformedConsentExample = new EmsEvaluationInformedConsentExample();
// emsEvaluationInformedConsentExample.createCriteria().andEvaluationIdEqualTo(dto.getEvaluationId());
// emsEvaluationInformedConsentExample.setOrderByClause("id desc");
// List<EmsEvaluationInformedConsent> emsEvaluationInformedConsents = emsEvaluationInformedConsentMapper.selectByExample(emsEvaluationInformedConsentExample);
if (dto.getSignId() != null) {
HmsDoctorSign emsEvaluationInformedConsent = hmsDoctorSignMapper.selectByPrimaryKey(dto.getSignId());
if (emsEvaluationInformedConsent != null) {
params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create());
}
}else {
//签名信息
List<HmsVo.QuerySign> querySigns = hmsDoctorDao.querySign(userId);
if (CollUtil.isNotEmpty(querySigns)) {
HmsVo.QuerySign querySign = querySigns.get(0);
if (ObjectUtil.isNotNull(querySign) && StrUtil.isNotEmpty(querySign.getSignUrl())) {
params.put("cpy_img_url", Pictures.ofLocal(prefixWord + querySign.getSignUrl()).size(80, 40).create());
}
}
}
try {
cultureEnum = BaseEnum.codeOf(CultureEnum.class, patientInfo.getEducationalStatus().intValue());
} catch (Exception e) {
//处理educationStatus为null的情况,后台导入的数据educationStatus为null
//默认为初中
cultureEnum = CultureEnum.YW;
}
if (cultureEnum != null) {
params.put("p_grade", cultureEnum.getDesc());
}
if (patientInfo.getCareer() != null) {
JobEnum jobEnum = BaseEnum.codeOf(JobEnum.class, patientInfo.getCareer().intValue());
// params.put("p_no", patientInfo.getSerialNumber());
if (jobEnum != null) {
params.put("p_Career", jobEnum.getDesc());
}
}
params.put("p_dept", patientInfo.getDepartment());
params.put("p_bedno", patientInfo.getBedNumber());
params.put("p_Patient_number", patientInfo.getHospitalNumber());
params.put("p_Clinical_diagnosis", patientInfo.getClinicalDiagnosis());
params.put("p_Inspection_date", DateUtil.format(new Date(patientInfo.getReportTime()), "yyyy-MM-dd"));
// params.put("score", detail.getScore());
//AD8
// params.put("cpy_img_url", patientInfo.getName());
params.put("report_date", DateUtil.date(patientInfo.getReportTime()));
//生成表格
// 创建带有样式的文本
TextRenderData text1 = Texts.of("评估结论").bold().fontSize(12).create();
TextRenderData text2 = Texts.of("评估结论").bold().fontSize(12).create();
TextRenderData text3 = Texts.of("评估结论").bold().fontSize(12).create();
TextRenderData text4 = Texts.of("评估结论").bold().fontSize(12).create();
// TextRenderData text5 = Texts.of("评估结论").bold().fontSize(12).create();
RowRenderData headerRow = Rows.of(text1, text2, text3, text4).create();
//肌少套餐结论
String jsResult = addJs(scores);
Integer jsCount = 0, jshs = 0;
String typeName = "";
RowRenderData titleRow = Rows.of("一级指标/二级指标", "量表名称", "得分", "结论").create();
Tables.TableBuilder of = Tables.of(headerRow, titleRow);
for (int i = 0; i < scores.size(); i++) {
//判断肌少量表数量
if ("5CZLSY".equals(scores.get(i).getCode()) || "SZGGJ".equals(scores.get(i).getCode()) || "WLCD".equals(scores.get(i).getCode()) || "LMBS".equals(scores.get(i).getCode())) {
jsCount += 1;
}
//查询类型
AmsVo.ComboVo comboVo = amsDao.queryComboName(scores.get(i).getCode(), emsEvaluation.getVersion());
String comboName = "", parentName = "";
String str = "";
if (comboVo != null) {
typeName = comboVo.getParentName();
if (StrUtil.isNotEmpty(comboVo.getParentName())) {
str = comboVo.getParentName();
params.put("yjzb", comboVo.getParentName());
}
if (StrUtil.isNotBlank(comboVo.getName())) {
if (StrUtil.isNotBlank(str)) {
str += "/" + comboVo.getName();
} else {
str = comboVo.getName();
}
params.put("ejzb", comboVo.getName());
}
}
String impression = "";
if (scores.get(i).getScore() != null && "MMSE".equals(scores.get(i).getCode())) {
//1、认知检查结果在正常范围。/认知功能受损。
//依据不同教育程度制定划界分:文盲组≤19分,小学组≤22分,中学或以上组≤26分,低于划界分为认知功能受损。
if (cultureEnum.getCode() == 1 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(19)) <= 0) {
impression = "认知功能受损";
} else if (cultureEnum.getCode() == 2 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(22)) <= 0) {
impression = "认知功能受损";
} else if (cultureEnum.getCode() >= 3 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(26)) <= 0) {
impression = "认知功能受损";
} else {
impression = "认知检查结果在正常范围";
}
}
//判断是否阳性 查询防治计划
QmsScaleAssConf qmsScaleAssConf = amsDao.queryScaleAssConf(scores.get(i).getCode(), scores.get(i).getScore());
if (qmsScaleAssConf != null && "1".equals(qmsScaleAssConf.getNeedPlan())) {
//需要防治
TextRenderData textStr = Texts.of(str).bold().color("FF0000").create();
TextRenderData textName = Texts.of(scores.get(i).getName()).bold().color("FF0000").create();
TextRenderData textScore = Texts.of(scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "").bold().color("FF0000").create();
TextRenderData textImpression = Texts.of(StrUtil.isEmpty(impression) ? qmsScaleAssConf.getResult() : impression).bold().color("FF0000").create();
// TextRenderData textDescription = Texts.of(scores.get(i).getDescription()).bold().color("FF0000").create();
//查询一二级套餐
RowRenderData row1 = Rows.of(
textStr,
textName,
textScore,
textImpression
).create();
if (StrUtil.isNotEmpty(comboName + "/" + parentName)) {
of.mergeRule(MergeCellRule.builder().map(MergeCellRule.Grid.of(i + 1, i + 1), MergeCellRule.Grid.of(0, 1)).build());
}
of.addRow(row1);
} else {
TextRenderData textStr = Texts.of(str).bold().create();
TextRenderData textName = Texts.of(scores.get(i).getName()).bold().create();
TextRenderData textScore = Texts.of(scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "").bold().create();
//中医体质辨识添加结论 结论为初步印象
TextRenderData textImpression = Texts.of(qmsScaleAssConf == null ? "TZBS_LN".equals(scores.get(i).getCode()) || "TZBS_BZ".equals(scores.get(i).getCode()) ? scores.get(i).getImpression() : null : qmsScaleAssConf.getResult()).bold().create();
//查询一二级套餐
RowRenderData row1 = Rows.of(
textStr,
textName,
textScore,
textImpression
).create();
if (StrUtil.isNotEmpty(comboName + "/" + parentName)) {
of.mergeRule(MergeCellRule.builder().map(MergeCellRule.Grid.of(i + 1, i + 1), MergeCellRule.Grid.of(0, 1)).build());
}
of.addRow(row1);
}
//添加肌少套餐结论
if (StrUtil.isNotEmpty(jsResult) && jsCount == 4) {
//判断结论
RowRenderData rowRenderData = Rows.of(
"肌少总结论:",
jsResult,
jsResult,
jsResult
).create();
jshs = i + 3;
of.addRow(rowRenderData);
jsResult = "";
}
}
if (emsEvaluation.getVersion() != null) {
HmsVersion hmsVersion = hmsVersionMapper.selectByPrimaryKey(Long.parseLong(emsEvaluation.getVersion()));
if (hmsVersion != null) {
params.put("type", hmsVersion.getVersion() + "评估报告");
}
}
MergeCellRule.MergeCellRuleBuilder map = MergeCellRule.builder().map(MergeCellRule.Grid.of(0, 0), MergeCellRule.Grid.of(0, 3));
if (jshs > 0) {
map.map(MergeCellRule.Grid.of(jshs, 1), MergeCellRule.Grid.of(jshs, 3));
}
TableRenderData tableData = of
.mergeRule(map.build())
// 居中对齐
.create();
params.put("table", tableData);
// Long hospitalId = SecurityUtils.getDeptId();
String s = IdUtil.randomUUID();
// 将表格数据放入参数中
// params.put("table", tableDataList);
try {
template.render(params);
} catch (Exception e) {
e.printStackTrace(); // 输出详细的异常信息
}
String filePath = "/profile/" + "/report/" + "老年综合评估_" + s + ".docx";
String pdfPath = "/profile/" + "/report/" + "老年综合评估_" + s + ".pdf";
String aPath = path + "/" + "/report/" + "老年综合评估_" + s + ".docx";
String pPath = path + "/" + "/report/" + "老年综合评估_" + s + ".pdf";
try {
template.writeAndClose(Files.newOutputStream(Paths.get(reportDomain + "/" + "/report/" + "老年综合评估_" + s + ".docx")));
AsposeUtils.doc2pdf(aPath, pPath);
} catch (Exception e) {
e.printStackTrace();
}
AmsReportVo.Result result = new AmsReportVo.Result();
result.setWord(filePath);
result.setPath(pdfPath);
//将生成的文件路径保存到报告单内
if(ObjectUtil.isNotNull(report)){
report.setUrl(pdfPath);
rmsReportMapper.updateByPrimaryKeySelective(report);
}
return result;
}
@Override
public AmsReportVo.Result exportYx(RmsDto.ExportReport1Dto dto) {
RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail();
queryDetail.setEvaluationId(dto.getEvaluationId());
RmsVo.ReportDetail detail = rmsService.queryReportDetail(queryDetail, SecurityUtils.getUserId());
if (detail == null) {
return null;
}
EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId());
if (emsEvaluation == null) {
return null;
}
List<RmsVo.ReportScore> scores = detail.getScores();
RmsVo.ReportPatient patientInfo = detail.getPatient();
HashMap<String, Object> params = new HashMap<>();
XWPFTemplate template = XWPFTemplate.compile(ysPath);
params.put("h_name", patientInfo.getHospitalName());
// params.put("qrcode_img_url", Pictures.ofLocal(reportPath + patientInfo.getQrCodeUrl()).size(130, 130).create());
params.put("p_name", patientInfo.getPatientName());
params.put("p_sex", patientInfo.getSex() == 0 ? "男" : "女");
params.put("p_age", patientInfo.getPatientAge());
CultureEnum cultureEnum = null;
// BodyContainer bodyContainer = BodyContainerFactory.getBodyContainer(run);
try {
cultureEnum = BaseEnum.codeOf(CultureEnum.class, patientInfo.getEducationalStatus().intValue());
} catch (Exception e) {
//处理educationStatus为null的情况,后台导入的数据educationStatus为null
//默认为初中
cultureEnum = CultureEnum.YW;
}
if (cultureEnum != null) {
params.put("p_grade", cultureEnum.getDesc());
}
if (patientInfo.getCareer() != null) {
JobEnum jobEnum = BaseEnum.codeOf(JobEnum.class, patientInfo.getCareer().intValue());
// params.put("p_no", patientInfo.getSerialNumber());
if (jobEnum != null) {
params.put("p_Career", jobEnum.getDesc());
}
}
params.put("p_dept", patientInfo.getDepartment());
params.put("p_bedno", patientInfo.getBedNumber());
params.put("p_Patient_number", patientInfo.getHospitalNumber());
params.put("p_Clinical_diagnosis", patientInfo.getClinicalDiagnosis());
params.put("p_Inspection_date", DateUtil.format(new Date(patientInfo.getReportTime()), "yyyy-MM-dd"));
// params.put("score", detail.getScore());
if (dto.getSignId() != null) {
HmsDoctorSign emsEvaluationInformedConsent = hmsDoctorSignMapper.selectByPrimaryKey(dto.getSignId());
if (emsEvaluationInformedConsent != null) {
params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create());
}
}else {
//签名信息
Long userId = SecurityUtils.getUserId();
List<HmsVo.QuerySign> querySigns = hmsDoctorDao.querySign(userId);
if (CollUtil.isNotEmpty(querySigns)) {
HmsVo.QuerySign querySign = querySigns.get(0);
if (ObjectUtil.isNotNull(querySign) && StrUtil.isNotEmpty(querySign.getSignUrl())) {
params.put("cpy_img_url", Pictures.ofLocal(prefixWord + querySign.getSignUrl()).size(80, 40).create());
}
}
}
// params.put("cpy_img_url", patientInfo.getName());
params.put("report_date", DateUtil.date(patientInfo.getReportTime()));
//生成表格
// 创建带有样式的文本
TextRenderData text1 = Texts.of("评估结论").bold().fontSize(12).create();
TextRenderData text2 = Texts.of("评估结论").bold().fontSize(12).create();
TextRenderData text3 = Texts.of("评估结论").bold().fontSize(12).create();
TextRenderData text4 = Texts.of("评估结论").bold().fontSize(12).create();
// TextRenderData text5 = Texts.of("评估结论").bold().fontSize(12).create();
RowRenderData headerRow = Rows.of(text1, text2, text3, text4).create();
String typeName = "";
RowRenderData titleRow = Rows.of("一级指标/二级指标", "量表名称", "得分", "结论").create();
Tables.TableBuilder of = Tables.of(headerRow, titleRow);
for (int i = 0; i < scores.size(); i++) {
//查询类型
AmsVo.ComboVo comboVo = amsDao.queryComboName(scores.get(i).getCode(), emsEvaluation.getVersion());
String comboName = "", parentName = "";
String str = "";
if (comboVo != null) {
if (StrUtil.isNotEmpty(comboVo.getParentName())) {
str = comboVo.getParentName();
params.put("yjzb", comboVo.getParentName());
}
if (StrUtil.isNotBlank(comboVo.getName())) {
if (StrUtil.isNotBlank(str)) {
str += "/" + comboVo.getName();
} else {
str = comboVo.getName();
}
params.put("ejzb", comboVo.getName());
}
}
String impression = "";
if (scores.get(i).getScore() != null && "MMSE".equals(scores.get(i).getCode())) {
//1、认知检查结果在正常范围。/认知功能受损。
//依据不同教育程度制定划界分:文盲组≤19分,小学组≤22分,中学或以上组≤26分,低于划界分为认知功能受损。
if (cultureEnum.getCode() == 1 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(19)) <= 0) {
impression = "认知功能受损";
} else if (cultureEnum.getCode() == 2 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(22)) <= 0) {
impression = "认知功能受损";
} else if (cultureEnum.getCode() >= 3 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(26)) <= 0) {
impression = "认知功能受损";
} else {
impression = "认知检查结果在正常范围";
}
}
//判断是否阳性 查询防治计划
QmsScaleAssConf qmsScaleAssConf = amsDao.queryScaleAssConf(scores.get(i).getCode(), scores.get(i).getScore());
if (qmsScaleAssConf != null && "1".equals(qmsScaleAssConf.getNeedPlan())) {
//需要防治
TextRenderData textStr = Texts.of(str).bold().color("FF0000").create();
TextRenderData textName = Texts.of(scores.get(i).getName()).bold().color("FF0000").create();
TextRenderData textScore = Texts.of(scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "").bold().color("FF0000").create();
TextRenderData textImpression = Texts.of(StrUtil.isEmpty(impression) ? qmsScaleAssConf.getResult() : impression).bold().color("FF0000").create();
// TextRenderData textDescription = Texts.of(scores.get(i).getDescription()).bold().color("FF0000").create();
//查询一二级套餐
RowRenderData row1 = Rows.of(
textStr,
textName,
textScore,
textImpression
).create();
if (StrUtil.isNotEmpty(comboName + "/" + parentName)) {
of.mergeRule(MergeCellRule.builder().map(MergeCellRule.Grid.of(i + 1, i + 1), MergeCellRule.Grid.of(0, 1)).build());
}
of.addRow(row1);
}
}
if (emsEvaluation.getVersion() != null) {
HmsVersion hmsVersion = hmsVersionMapper.selectByPrimaryKey(Long.parseLong(emsEvaluation.getVersion()));
if (hmsVersion != null) {
params.put("type", hmsVersion.getVersion() + "评估报告");
}
}
MergeCellRule mergeRule = MergeCellRule.builder().map(MergeCellRule.Grid.of(0, 0), MergeCellRule.Grid.of(0, 3)).build();
TableRenderData tableData = of
.mergeRule(mergeRule)
// 居中对齐
.create();
params.put("table", tableData);
// Long hospitalId = SecurityUtils.getDeptId();
String s = IdUtil.randomUUID();
// 将表格数据放入参数中
// params.put("table", tableDataList);
try {
template.render(params);
} catch (Exception e) {
e.printStackTrace(); // 输出详细的异常信息
}
String filePath = "/profile/" + "/report/" + "老年综合评估_" + s + ".docx";
String pdfPath = "/profile/" + "/report/" + "老年综合评估_" + s + ".pdf";
String aPath = path + "/" + "/report/" + "老年综合评估_" + s + ".docx";
String pPath = path + "/" + "/report/" + "老年综合评估_" + s + ".pdf";
try {
template.writeAndClose(Files.newOutputStream(Paths.get(reportDomain + "/" + "/report/" + "老年综合评估_" + s + ".docx")));
AsposeUtils.doc2pdf(aPath, pPath);
} catch (Exception e) {
e.printStackTrace();
}
AmsReportVo.Result result = new AmsReportVo.Result();
result.setWord(filePath);
result.setPath(pdfPath);
return result;
}
public static boolean isInteger(String str) {
Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
return pattern.matcher(str).matches();
}
}

328
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/PmsPatientServiceImpl.java

@ -201,155 +201,147 @@ public class PmsPatientServiceImpl implements IPmsPatientService {
@Override
public Long editPatientOtherMsg(PmsPatientDto.EditOtherMsg param) {
JSONObject jsonObject = null;
Object model = param.getModel();
// 处理model参数
if (model instanceof List) {
// List转JSONArray
com.alibaba.fastjson2.JSONArray array = (com.alibaba.fastjson2.JSONArray) JSON.toJSON(model);
jsonObject = array.getJSONObject(0);
} else if (model instanceof Map) {
// Map转JSONObject
jsonObject = (JSONObject) JSON.toJSON(model);
}
// JSONObject jsonObject = null;
// if (param.getModel() instanceof JSONArray) {
// JSONArray array = (JSONArray) param.getModel();
// Object model = param.getModel();
//
// // 处理model参数
// if (model instanceof List) {
// // List转JSONArray
// com.alibaba.fastjson2.JSONArray array = (com.alibaba.fastjson2.JSONArray) JSON.toJSON(model);
// jsonObject = array.getJSONObject(0);
// } else if (param.getModel() instanceof JSONObject) {
// jsonObject = (JSONObject) param.getModel();
// } else if (model instanceof Map) {
// // Map转JSONObject
// jsonObject = (JSONObject) JSON.toJSON(model);
// }
//
// //验证就诊号是否为空
// String visitNo = jsonObject.getString("outpatientNo");
// if (StrUtil.isEmpty(visitNo)) {
// visitNo = jsonObject.getString("visitNo");
// if (StrUtil.isEmpty(visitNo)) {
// throw new ServiceException("就诊号不能为空");
// }
// }
// //验证患者id是否为空
// Long patientId = jsonObject.getLong("patientId");
// if (patientId == null) {
// throw new ServiceException("患者id不能为空");
// }
//
//
// //如果是就诊信息(PmsPatientBody)
// if ("PmsPatientBody".equals(param.getEditType())) {
// //就诊信息默认是单个信息,直接用jsonObject
// PmsPatientBody pmsPatientBody = JSONObject.parseObject(jsonObject.toJSONString(), PmsPatientBody.class);
// //根据就诊号和患者id查询就诊信息是否存在
// PmsPatientBodyExample patientBodyExample = new PmsPatientBodyExample();
// patientBodyExample.createCriteria().andOutpatientNoEqualTo(visitNo).andPatientIdEqualTo(patientId)
// .andDelFlagEqualTo((byte) 0);
// List<PmsPatientBody> pmsPatientBodies = pmsPatientBodyMapper.selectByExample(patientBodyExample);
// if (CollUtil.isNotEmpty(pmsPatientBodies)) {
// //存在则修改
// PmsPatientBody oldPatientBody = pmsPatientBodies.get(0);
// pmsPatientBody.setId(oldPatientBody.getId());
// pmsPatientBodyMapper.updateByPrimaryKeySelective(pmsPatientBody);
// } else {
// //不存在则添加
// pmsPatientBody.setId(IDGenerator.nextSnowflakeId());
// pmsPatientBodyMapper.insertSelective(pmsPatientBody);
// }
// } else if ("PmsPatientPersonal".equals(param.getEditType())) {
// //烟酒史默认是单个信息,直接用jsonObject
// //烟酒史
// PmsPatientPersonal pmsPatientPersonal = JSONObject.parseObject(jsonObject.toJSONString(), PmsPatientPersonal.class);
// //根据就诊号和患者id查询就诊信息是否存在
// PmsPatientPersonalExample patientPersonalExample = new PmsPatientPersonalExample();
// patientPersonalExample.createCriteria().andVisitNoEqualTo(visitNo).andPatientIdEqualTo(patientId)
// .andDelFlagEqualTo((byte) 0);
// List<PmsPatientPersonal> pmsPatientPersonals = pmsPatientPersonalMapper.selectByExample(patientPersonalExample);
// if (CollUtil.isNotEmpty(pmsPatientPersonals)) {
// //存在则修改
// PmsPatientPersonal oldPatientPersonal = pmsPatientPersonals.get(0);
// pmsPatientPersonal.setId(oldPatientPersonal.getId());
// pmsPatientPersonalMapper.updateByPrimaryKeySelective(pmsPatientPersonal);
// } else {
// //不存在则添加
// pmsPatientPersonal.setId(IDGenerator.nextSnowflakeId());
// pmsPatientPersonalMapper.insertSelective(pmsPatientPersonal);
// }
// }else if ("PmsPatientParentIllness".equals(param.getEditType())) {
// //根据就诊号和患者id删除旧的用药信息(修改删除状态)
// PmsPatientParentIllnessExample patientParentIllnessExample = new PmsPatientParentIllnessExample();
// patientParentIllnessExample.createCriteria().andVisitNoEqualTo(visitNo).andPatientIdEqualTo(patientId)
// .andDelFlagEqualTo((byte) 0);
// PmsPatientParentIllness illness = new PmsPatientParentIllness();
// illness.setDelFlag((byte) 1);
// pmsPatientParentIllnessMapper.updateByExampleSelective(illness, patientParentIllnessExample);
// //诊断用药为多个
// com.alibaba.fastjson2.JSONArray array = (com.alibaba.fastjson2.JSONArray) JSON.toJSON(model);
// for (int i = 0; i < array.size(); i++) {
// PmsPatientParentIllness pmsPatientParentIllness = JSONObject.parseObject(array.getJSONObject(i).toJSONString(), PmsPatientParentIllness.class);
// pmsPatientParentIllness.setId(IDGenerator.nextSnowflakeId());
// pmsPatientParentIllnessMapper.insertSelective(pmsPatientParentIllness);
// }
// }else if ("PmsPatientDiagnosis".equals(param.getEditType())) {
// //删除旧的诊断信息(修改删除状态)
// PmsPatientDiagnosisExample patientDiagnosisExample = new PmsPatientDiagnosisExample();
// patientDiagnosisExample.createCriteria().andVisitNoEqualTo(visitNo).andPatientIdEqualTo(patientId)
// .andDelFlagEqualTo((byte) 0);
// PmsPatientDiagnosis diagnosis = new PmsPatientDiagnosis();
// diagnosis.setDelFlag((byte) 1);
// pmsPatientDiagnosisMapper.updateByExampleSelective(diagnosis, patientDiagnosisExample);
// //诊断默认是多个信息,用jsonArray
// com.alibaba.fastjson2.JSONArray array = (com.alibaba.fastjson2.JSONArray) JSON.toJSON(model);
// for (int i = 0; i < array.size(); i++) {
// PmsPatientDiagnosis pmsPatientDiagnosis = JSONObject.parseObject(array.getJSONObject(i).toJSONString(), PmsPatientDiagnosis.class);
// pmsPatientDiagnosis.setId(IDGenerator.nextSnowflakeId());
// pmsPatientDiagnosisMapper.insertSelective(pmsPatientDiagnosis);
// }
// }
//验证就诊号是否为空
String visitNo = jsonObject.getString("outpatientNo");
if (StrUtil.isEmpty(visitNo)) {
visitNo = jsonObject.getString("visitNo");
if (StrUtil.isEmpty(visitNo)) {
throw new ServiceException("就诊号不能为空");
}
}
//验证患者id是否为空
Long patientId = jsonObject.getLong("patientId");
if (patientId == null) {
throw new ServiceException("患者id不能为空");
}
//如果是就诊信息(PmsPatientBody)
if ("PmsPatientBody".equals(param.getEditType())) {
//就诊信息默认是单个信息,直接用jsonObject
PmsPatientBody pmsPatientBody = JSONObject.parseObject(jsonObject.toJSONString(), PmsPatientBody.class);
//根据就诊号和患者id查询就诊信息是否存在
PmsPatientBodyExample patientBodyExample = new PmsPatientBodyExample();
patientBodyExample.createCriteria().andOutpatientNoEqualTo(visitNo).andPatientIdEqualTo(patientId)
.andDelFlagEqualTo((byte) 0);
List<PmsPatientBody> pmsPatientBodies = pmsPatientBodyMapper.selectByExample(patientBodyExample);
if (CollUtil.isNotEmpty(pmsPatientBodies)) {
//存在则修改
PmsPatientBody oldPatientBody = pmsPatientBodies.get(0);
pmsPatientBody.setId(oldPatientBody.getId());
pmsPatientBodyMapper.updateByPrimaryKeySelective(pmsPatientBody);
} else {
//不存在则添加
pmsPatientBody.setId(IDGenerator.nextSnowflakeId());
pmsPatientBodyMapper.insertSelective(pmsPatientBody);
}
} else if ("PmsPatientPersonal".equals(param.getEditType())) {
//烟酒史默认是单个信息,直接用jsonObject
//烟酒史
PmsPatientPersonal pmsPatientPersonal = JSONObject.parseObject(jsonObject.toJSONString(), PmsPatientPersonal.class);
//根据就诊号和患者id查询就诊信息是否存在
PmsPatientPersonalExample patientPersonalExample = new PmsPatientPersonalExample();
patientPersonalExample.createCriteria().andVisitNoEqualTo(visitNo).andPatientIdEqualTo(patientId)
.andDelFlagEqualTo((byte) 0);
List<PmsPatientPersonal> pmsPatientPersonals = pmsPatientPersonalMapper.selectByExample(patientPersonalExample);
if (CollUtil.isNotEmpty(pmsPatientPersonals)) {
//存在则修改
PmsPatientPersonal oldPatientPersonal = pmsPatientPersonals.get(0);
pmsPatientPersonal.setId(oldPatientPersonal.getId());
pmsPatientPersonalMapper.updateByPrimaryKeySelective(pmsPatientPersonal);
try {
String type = param.getEditType();
JSONObject json = (JSONObject) JSON.toJSON(param.getModel());
Object bean = SpringContextUtils.getBean(type.substring(0, 1).toLowerCase() + type.substring(1) + "Mapper");
//有id则修改,无则添加
String methodName;
String id = "id";
String createBy = "createBy";
String updateBy = "updateBy";
String recorder = "recorder";
if (json.getLong(id) == null || json.getLong(id) == 0) {
methodName = "insertSelective";
json.put(id, IDGenerator.nextSnowflakeId());
json.put(createBy, SecurityUtils.getUsername());
json.put(recorder, SecurityUtils.getUserId());
} else {
//不存在则添加
pmsPatientPersonal.setId(IDGenerator.nextSnowflakeId());
pmsPatientPersonalMapper.insertSelective(pmsPatientPersonal);
methodName = "updateByPrimaryKeySelective";
json.put(updateBy, SecurityUtils.getUsername());
}
log.info("{}:{}", methodName, json);
//请求参数
Class<?> modelClass = Class.forName("com.ccsens.system.domain.po." + type);
Object model = json.toJavaObject(modelClass);
//方法
Method method = bean.getClass().getMethod(methodName, modelClass);
log.info("method:{}", method);
//方法调用(保存/修改)
method.invoke(bean, model);
return json.getLong("id");
} catch (ClassNotFoundException e) {
log.error("编辑病人其他信息反射异常", e);
throw new BaseException(ErrorConstant.PARAM_ERROR);
} catch (NoSuchMethodException e) {
log.error("编辑病人其他信息反射异常", e);
throw new BaseException(ErrorConstant.PARAM_ERROR);
} catch (IllegalAccessException e) {
log.error("编辑病人其他信息反射异常", e);
throw new BaseException(ErrorConstant.PARAM_ERROR);
} catch (InvocationTargetException e) {
log.error("编辑病人其他信息反射异常", e);
throw new BaseException(ErrorConstant.PARAM_ERROR);
}
}else if ("PmsPatientParentIllness".equals(param.getEditType())) {
//根据就诊号和患者id删除旧的用药信息(修改删除状态)
PmsPatientParentIllnessExample patientParentIllnessExample = new PmsPatientParentIllnessExample();
patientParentIllnessExample.createCriteria().andVisitNoEqualTo(visitNo).andPatientIdEqualTo(patientId)
.andDelFlagEqualTo((byte) 0);
PmsPatientParentIllness illness = new PmsPatientParentIllness();
illness.setDelFlag((byte) 1);
pmsPatientParentIllnessMapper.updateByExampleSelective(illness, patientParentIllnessExample);
//诊断用药为多个
com.alibaba.fastjson2.JSONArray array = (com.alibaba.fastjson2.JSONArray) JSON.toJSON(model);
for (int i = 0; i < array.size(); i++) {
PmsPatientParentIllness pmsPatientParentIllness = JSONObject.parseObject(array.getJSONObject(i).toJSONString(), PmsPatientParentIllness.class);
pmsPatientParentIllness.setId(IDGenerator.nextSnowflakeId());
pmsPatientParentIllnessMapper.insertSelective(pmsPatientParentIllness);
}
}else if ("PmsPatientDiagnosis".equals(param.getEditType())) {
//删除旧的诊断信息(修改删除状态)
PmsPatientDiagnosisExample patientDiagnosisExample = new PmsPatientDiagnosisExample();
patientDiagnosisExample.createCriteria().andVisitNoEqualTo(visitNo).andPatientIdEqualTo(patientId)
.andDelFlagEqualTo((byte) 0);
PmsPatientDiagnosis diagnosis = new PmsPatientDiagnosis();
diagnosis.setDelFlag((byte) 1);
pmsPatientDiagnosisMapper.updateByExampleSelective(diagnosis, patientDiagnosisExample);
//诊断默认是多个信息,用jsonArray
com.alibaba.fastjson2.JSONArray array = (com.alibaba.fastjson2.JSONArray) JSON.toJSON(model);
for (int i = 0; i < array.size(); i++) {
PmsPatientDiagnosis pmsPatientDiagnosis = JSONObject.parseObject(array.getJSONObject(i).toJSONString(), PmsPatientDiagnosis.class);
pmsPatientDiagnosis.setId(IDGenerator.nextSnowflakeId());
pmsPatientDiagnosisMapper.insertSelective(pmsPatientDiagnosis);
}
}
// try {
// String type = param.getEditType();
// JSONObject json = param.getModel();
// Object bean = SpringContextUtils.getBean(type.substring(0, 1).toLowerCase() + type.substring(1) + "Mapper");
// //有id则修改,无则添加
// String methodName;
// String id = "id";
// String createBy = "createBy";
// String updateBy = "updateBy";
// String recorder = "recorder";
// if (json.getLong(id) == null || json.getLong(id) == 0) {
// methodName = "insertSelective";
// json.put(id, IDGenerator.nextSnowflakeId());
// json.put(createBy, SecurityUtils.getUsername());
// json.put(recorder, SecurityUtils.getUserId());
// } else {
// methodName = "updateByPrimaryKeySelective";
// json.put(updateBy, SecurityUtils.getUsername());
// }
// log.info("{}:{}", methodName, json);
// //请求参数
// Class<?> modelClass = Class.forName("com.ccsens.system.domain.po." + type);
// Object model = json.toJavaObject(modelClass);
// //方法
// Method method = bean.getClass().getMethod(methodName, modelClass);
// log.info("method:{}", method);
// //方法调用(保存/修改)
// method.invoke(bean, model);
// return json.getLong("id");
// } catch (ClassNotFoundException e) {
// log.error("编辑病人其他信息反射异常", e);
// throw new BaseException(ErrorConstant.PARAM_ERROR);
// } catch (NoSuchMethodException e) {
// log.error("编辑病人其他信息反射异常", e);
// throw new BaseException(ErrorConstant.PARAM_ERROR);
// } catch (IllegalAccessException e) {
// log.error("编辑病人其他信息反射异常", e);
// throw new BaseException(ErrorConstant.PARAM_ERROR);
// } catch (InvocationTargetException e) {
// log.error("编辑病人其他信息反射异常", e);
// throw new BaseException(ErrorConstant.PARAM_ERROR);
// }
return null;
}
@Override
@ -2158,7 +2150,57 @@ public class PmsPatientServiceImpl implements IPmsPatientService {
@Override
public List<PmsPatientVo.QueryPatientJz> queryPatientJzList(PmsPatientDto.QueryPatientJz param, String dataScope, Long userId, String userName) {
return patientDao.queryPatientJzList(param, dataScope, userId, userName);
List<PmsPatientVo.QueryPatientJz> queryPatientJzs = patientDao.queryPatientJzList(param, dataScope, userId, userName);
if (CollUtil.isNotEmpty(queryPatientJzs)) {
for (PmsPatientVo.QueryPatientJz queryPatientJz : queryPatientJzs) {
//查询就诊
//查询其他疾病史信息
Map<String, List<Map<String, Object>>> patientOtherMsg = new HashMap<>();
//先查询就诊信息(PmsPatientBody)
//根据就诊号和患者id查询就诊信息是否存在
String visitNo = queryPatientJz.getOutpatientNo();
List<Map<String, Object>> pmsPatientBodyReturn = new ArrayList<>();
pmsPatientBodyReturn.add(JSON.parseObject(JSON.toJSONString(queryPatientJz), Map.class));
patientOtherMsg.put("pmsPatientBody", pmsPatientBodyReturn);
if (visitNo != null) {
//烟酒史
PmsPatientPersonalExample patientPersonalExample = new PmsPatientPersonalExample();
patientPersonalExample.createCriteria().andVisitNoEqualTo(visitNo)
.andDelFlagEqualTo((byte) 0);
List<PmsPatientPersonal> pmsPatientPersonals = pmsPatientPersonalMapper.selectByExample(patientPersonalExample);
if (CollUtil.isNotEmpty(pmsPatientPersonals)) {
String jsonStr = JSON.toJSONString(pmsPatientPersonals);
List<Map<String, Object>> allList = JSON.parseObject(jsonStr, List.class);
List<Map<String, Object>> singleItemList = new ArrayList<>();
if (!allList.isEmpty()) {
singleItemList.add(allList.get(0));
}
patientOtherMsg.put("pmsPatientPersonal", singleItemList);
}
//用药信息
PmsPatientParentIllnessExample patientParentIllnessExample = new PmsPatientParentIllnessExample();
patientParentIllnessExample.createCriteria().andVisitNoEqualTo(visitNo)
.andDelFlagEqualTo((byte) 0);
List<PmsPatientParentIllness> pmsPatientParentIllnesses = pmsPatientParentIllnessMapper.selectByExample(patientParentIllnessExample);
if (CollUtil.isNotEmpty(pmsPatientParentIllnesses)) {
String jsonStr = JSON.toJSONString(pmsPatientParentIllnesses);
patientOtherMsg.put("pmsPatientParentIllness", JSON.parseObject(jsonStr, List.class));
}
//诊断信息
PmsPatientDiagnosisExample patientDiagnosisExample = new PmsPatientDiagnosisExample();
patientDiagnosisExample.createCriteria().andVisitNoEqualTo(visitNo)
.andDelFlagEqualTo((byte) 0);
List<PmsPatientDiagnosis> pmsPatientDiagnoses = pmsPatientDiagnosisMapper.selectByExample(patientDiagnosisExample);
if (CollUtil.isNotEmpty(pmsPatientDiagnoses)) {
String jsonStr = JSON.toJSONString(pmsPatientDiagnoses);
patientOtherMsg.put("pmsPatientDiagnosis", JSON.parseObject(jsonStr, List.class));
}
}
queryPatientJz.setOtherMsg(patientOtherMsg);
}
}
return queryPatientJzs;
}
@Override

2
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/QmsScaleAssConfServiceImpl.java

@ -37,6 +37,8 @@ public class QmsScaleAssConfServiceImpl implements QmsScaleAssConfService {
qmsScaleAssConf.setId(IdUtil.getSnowflake(1L, 1L).nextId());
qmsScaleAssConf.setCreateBy(SecurityUtils.getUsername());
qmsScaleAssConf.setCreateTime(new Date());
qmsScaleAssConf.setNeedPlan("1".equals(dto.getNeedPlan()) ? "1" : "0");
qmsScaleAssConfMapper.insertSelective(qmsScaleAssConf);
}else {
qmsScaleAssConf.setUpdateBy(SecurityUtils.getUsername());

965
ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/RmsServiceImpl.java

File diff suppressed because it is too large

5
ruisi_java/ruisi-web-admin/src/main/resources/application-dev.yml

@ -8,7 +8,7 @@ spring:
master:
url: jdbc:mysql://localhost:3306/ruisi_cga?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: q7510327
password: 123456
# url: jdbc:mysql://localhost:3306/htage2023?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root
# password: 123456
@ -112,6 +112,9 @@ file:
ldExportDir: D:\\home\\ruisi\\server\\profile\\ldExport
ldZQTYDir: D:\\home\\ruisi\\server\\profile\\ldZQTYExport
ldZQTYTemplate: D:\\home\\ruisi\\server\\profile\\upload\\2024年河津流调知情同意书模板-V1.docx
grPath: /data/cgav2/server/profile/grReportTemplate.docx
ysPath: /data/cgav2/server/profile/ysReportTemplate.docx
informed:
studySign: /home/ruisi/server/profile/studySign.png
template: /home/ruisi/server/profile/知情同意模板.docx

18
ruisi_java/ruisi-web-admin/src/main/resources/application-prod.yml

@ -102,13 +102,17 @@ file:
path: /data/cgav2/profile/
#domain: https://api.ccsens.com/test/
domain: http://116.204.40.58/ruisiClient
imgDomain: https://test.tall.wiki/htageClient/profile
reportPath: /data/cgav2
ldTemplate: /data/cgav2/profile/upload/dTemplate.xlsx
ldTjbgDir: /data/cgav2/profile/tjbg/
ldExportDir: /data/cgav2/profile/ldExport
ldZQTYDir: /data/cgav2/profile/ldZQTYExport
ldZQTYTemplate: /data/cgav2/profile/upload/2024年河津流调知情同意书模板-V1.docx
imgDomain: http://116.204.40.58/ruisiClient/profile
reportDomain: /data/cgav2/server/profile
reportPath: /data/cgav2/server/profile
ldTemplate: /data/cgav2/server/profile/upload/dTemplate.xlsx
ldTjbgDir: /data/cgav2/server/profile/tjbg/
ldExportDir: /data/cgav2/server/profile/ldExport
ldZQTYDir: /data/cgav2/server/profile/ldZQTYExport
ldZQTYTemplate: /data/cgav2/server/profile/upload/2024年河津流调知情同意书模板-V1.docx
grPath: /data/cgav2/server/profile/grReportTemplate.docx
ysPath: /data/cgav2/server/profile/ysReportTemplate.docx
informed:
studySign: /data/cgav2/profile/studySign.png
template: /data/cgav2/profile/知情同意模板.docx

15
ruisi_java/ruisi-web-admin/src/main/resources/application-stage.yml

@ -98,16 +98,21 @@ ht:
patientUrl: https://test.tall.wiki/ruisi/client/#
name: 认知功能评测云平台系统
file:
path: /home/cloud/ht/uploads/
#domain: https://api.ccsens.com/test/
domain: https://test.tall.wiki/ruisiClient
imgDomain: https://test.tall.wiki/htageClient/profile
reportPath: /home/ruisiCga/server
ldTemplate: /home/ruisiCga/server/profile/upload/dTemplate.xlsx
ldTjbgDir: /home/ruisiCga/server/profile/tjbg/
ldExportDir: /home/ruisiCga/server/profile/ldExport
ldZQTYDir: /home/ruisiCga/server/profile/ldZQTYExport
ldZQTYTemplate: /home/ruisiCga/server/profile/upload/2024年河津流调知情同意书模板-V1.docx
path: D:/Projects/ruisi_cga/server/profile/
webPath: https://test.tall.wiki/ruisi/client/#
#domain: https://api.ccsens.com/test/
domain: https://test.tall.wiki/ruisiClient
imgDomain: https://test.tall.wiki/ruisiClient/profile
reportDomain: D:/Projects/ruisi_cga/server/profile
reportPath: D:/Projects/ruisi_cga/server/profile
grPath: D:/Projects/ruisi_cga/server/profile/grReportTemplate.docx
ysPath: D:/Projects/ruisi_cga/server/profile/ysReportTemplate.docx
informed:
studySign: /home/ruisi/server/profile/studySign.png
template: /home/ruisi/server/profile/知情同意模板.docx

241
ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/AmsDao.xml

@ -0,0 +1,241 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.ccsens.admin.persist.dao.AmsDao">
<update id="delZmsAnswerScores">
update
ams_patient_answer_score
set
del_flag = 1
where id in
<foreach collection="list" item="score" separator="," open="(" close=")">
#{score.id}
</foreach>
</update>
<select id="queryEvaluationStep" resultType="com.ccsens.system.domain.vo.AmsVo$EvaluationStep">
select
s.finish_key as scaleCode,
qs.`name` as scaleName,
s.finish_status as finishStatus,
s.sort as sort
from ems_evaluation_step s
left join qms_scale qs on s.finish_key = qs.`code` and qs.del_flag = 0
where s.evaluation_id = #{evaluationId}
order by s.sort
</select>
<select id="getScaleAchievement" resultType="com.ccsens.system.domain.vo.AmsVo$ScaleAchievement">
SELECT
qs.`code` AS scaleCode,
qs.`name` AS scaleName,
sum(q.score) as score,
count( DISTINCT q.questionId ) AS totalNum,
count( DISTINCT q.answerQuestionId ) AS completedNum
FROM
ems_evaluation_scale_relevance esr
LEFT JOIN qms_scale qs ON esr.scale_code = qs.`code`
LEFT JOIN(
SELECT
if(pas.question_id is not null and pas.question_id != qq.id,qq.id,pas.question_id) as answerQuestionId,
qq.id as questionId,
qq.scale_code,
pas.evaluation_id,
if((qcd.total_score = - 1 AND qcd.type = 4) or score.cognitive_code = 'SZJ', 0, pas.score) as score
FROM
(
SELECT
eqv.id as qvId,
Max(vq.version) as maxVersion,
q.id,
q.scale_code,
GROUP_CONCAT(sq.id SEPARATOR ',') as subList
FROM
qms_question q
LEFT JOIN qms_question vq on q.scale_code = vq.scale_code and q.sort = vq.sort and vq.del_flag = 0
LEFT JOIN ems_evaluation_question_version eqv on eqv.scale_code = q.scale_code and eqv.sort = q.sort and eqv.version = q.version and eqv.evaluation_id = #{evaluationId}
LEFT JOIN qms_question sq on sq.relation_id = q.id and sq.del_flag = 0
WHERE
q.del_flag = 0
AND q.relation_id = 0
AND q.del_flag = 0
<if test="sex != null">
and q.sex = #{sex} or q.sex is null
</if>
GROUP BY q.id
)qq
LEFT JOIN ams_patient_answer_score pas on (pas.question_id = qq.id or FIND_IN_SET(pas.question_id, qq.subList))
and pas.type IN ( 0, 2 ) and pas.del_flag = 0 and pas.evaluation_id = #{evaluationId}
LEFT JOIN qms_question score on pas.question_id = score.id and score.del_flag = 0
LEFT JOIN qms_cognitive_domain qcd on score.cognitive_code = qcd.`code` and qcd.del_flag = 0 and qcd.type = 4
WHERE
((qq.maxVersion = 1 and qq.qvId is null) or (qq.maxVersion > 1 and qq.qvId is not null))
) q on q.scale_code = esr.scale_code
<where>
<if test="scaleCode != null and scaleCode != ''">
and esr.scale_code = #{scaleCode}
</if>
AND esr.evaluation_id = #{evaluationId}
</where>
GROUP BY esr.sort, esr.scale_code
</select>
<select id="getScaleQuestionAchievement"
resultType="com.ccsens.system.domain.vo.AmsVo$ScaleQuestionAchievement">
SELECT
qq.sort AS num,
<!--IF( pas.id IS NULL, FALSE, TRUE ) AS complete,-->
if(count(DISTINCT pas.id) > 0,TRUE, FALSE ) AS complete,
pas.question_id
FROM
(
SELECT
q.id,
q.scale_code,
q.sort,
q.relation_id,
GROUP_CONCAT(sq.id SEPARATOR ',') as subList
FROM
qms_question q
LEFT JOIN qms_question sq on sq.relation_id = q.id and sq.del_flag = 0
WHERE
q.del_flag = 0
AND q.relation_id = 0
<if test="sex != null">
and (q.sex = #{sex} or q.sex is null)
</if>
GROUP BY q.id
)qq
LEFT JOIN ams_patient_answer_score pas on (pas.question_id = qq.id or FIND_IN_SET(pas.question_id, qq.subList))
and pas.type IN ( 0, 2 ) and pas.del_flag = 0 and pas.evaluation_id = #{evaluationId}
WHERE
qq.scale_code = #{scaleCode}
AND qq.relation_id = 0
GROUP BY
qq.sort
ORDER BY
qq.sort;
</select>
<select id="queryOption" resultType="com.ccsens.system.domain.vo.AmsVo$Option">
select t1.id, t1.type, t1.question_id, t1.name, t1.score, t1.display,
case when t1.type = 'hidden' then 0 when t2.id is null then 0 else 1 end as choose ,
if(t2.type = 3, null, t2.answer) as answer,
t2.score AS t2content,
t3.id as descId, t3.type as descType, t3.content
from qms_question_option t1 left join ams_patient_answer_score t2 on t1.id = t2.option_id and (t2.id is null or (t2.evaluation_id = #{evaluationId} and t2.del_flag = 0))
left join (select * from qms_question_option_desc where del_flag = 0) t3 on t1.id = t3.option_id
where t1.question_id = #{questionId}
and t1.del_flag = 0
group by t1.id
order by t1.sort, t3.sort
</select>
<select id="getTotalScoreByNPI" resultType="java.math.BigDecimal">
SELECT
sum( score ) AS score
FROM
ams_patient_answer_score
WHERE
evaluation_id = #{evaluationId}
and
question_parent_code = 'NPI'
AND option_name IN ( 'carer', 'result' )
AND del_flag = 0
</select>
<select id="queryTemplate" resultType="java.lang.String">
select url from ams_report_template where code = #{code} and del_flag = 0 ORDER BY create_time desc limit 1
</select>
<select id="queryScaleTypeName" resultType="java.lang.String">
select t.name
from
qms_scale_type t
left join qms_scale t1 on t.id = t1.type_id
where t1.code = #{code} and t1.del_flag = 0 and t.del_flag = 0
</select>
<select id="queryComboName" resultType="com.ccsens.system.domain.vo.AmsVo$ComboVo">
SELECT
c.name,
c1.name as parentName
FROM
hms_combo c
LEFT JOIN
hms_combo_scale_relevance r on c.id = r.combo_id
LEFT JOIN
hms_combo c1 on c1.id = c.parent_id
WHERE
r.scale_code = #{code} and c.version = #{version}
limit 1
</select>
<select id="queryScaleAssConf" resultType="com.ccsens.system.domain.po.QmsScaleAssConf">
select
c.id,
c.scale_id as scaleId,
c.start_score as startScore,
c.end_score as endScore,
c.state,
c.sort,
c.score_type as scoreType,
c.result,
c.og_result as ogResult,
c.rule_type as ruleType,
c.need_plan as needPlan,
c.plan,
c.remark
from
qms_scale_ass_conf c
left join qms_scale q on q.id = c.scale_id and q.del_flag = 0
where
c.start_score &lt;= #{score} and c.end_score &gt;= #{score}
and c.state = '1' and c.del_flag = 0
and q.code = #{scaleCode}
group by c.id
limit 1
</select>
<select id="queryScaleAssConf1" resultType="com.ccsens.system.domain.po.QmsScaleAssConf">
select
c.id,
c.scale_id as scaleId,
c.start_score as startScore,
c.end_score as endScore,
c.state,
c.sort,
c.score_type as scoreType,
c.result,
c.og_result as ogResult,
c.rule_type as ruleType,
c.need_plan as needPlan,
c.plan,
c.remark
from
qms_scale_ass_conf c
left join qms_scale q on q.id = c.scale_id and q.del_flag = 0
where
c.state = '1'
and c.del_flag = 0
<if test="needPlan != null">
and c.need_plan = #{needPlan}
</if>
<if test="needPlan == null">
and c.start_score &lt;= #{score} and c.end_score &gt;= #{score}
</if>
and q.code = #{scaleCode}
group by c.id
limit 1
</select>
<select id="queryYsfaList" resultType="java.lang.String">
select
y.consti_ysfa_template
from
tzbs_qms_scale_consti c
left join tzbs_qms_scale_consti_ysfa y on c.consti_code = y.consti_code and y.del_flag = 0
where
c.scale_code = #{scaleCode}
</select>
</mapper>

9
ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/HmsDao.xml

@ -21,6 +21,7 @@
FROM
ums_dept ud
LEFT JOIN hms_hospital_config hc ON ud.dept_id = hc.hospital_id
LEFT JOIN ums_user uu ON uu.dept_id = ud.dept_id
WHERE
ud.del_flag = 0
and ud.parent_id = 0
@ -114,4 +115,12 @@
</if>
order by c.hospital_id,c.create_time desc
</select>
<select id="queryDoctorName" resultType="com.ccsens.system.domain.vo.HmsVo$DoctorName">
select
name
from hms_doctor
where del_flag = 0
and hospital_id = #{hospitalId}
</select>
</mapper>

49
ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/PmsPatientDao.xml

@ -121,6 +121,39 @@
</if>
<if test="param.hospitalId != null">
and pp.hospital_id = #{param.hospitalId}
</if>
<if test="param.sex != null">
and pp.sex = #{param.sex}
</if>
<if test="param.deptId != null">
and pp.hospital_id = #{param.deptId}
</if>
<if test="param.educationalStatus != null">
and pp.educational_status = #{param.educationalStatus}
</if>
<if test="param.ageStatus != null">
<choose>
<when test="param.ageStatus == 0">
and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) -
(DATE_FORMAT(CURDATE(), '%m%d') &lt; DATE_FORMAT(pp.birthday, '%m%d'))) &lt; 60
</when>
<when test="param.ageStatus == 1">
and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) -
(DATE_FORMAT(CURDATE(), '%m%d') &lt; DATE_FORMAT(pp.birthday, '%m%d'))) BETWEEN 60 AND 69
</when>
<when test="param.ageStatus == 2">
and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) -
(DATE_FORMAT(CURDATE(), '%m%d') &lt; DATE_FORMAT(pp.birthday, '%m%d'))) BETWEEN 70 AND 79
</when>
<when test="param.ageStatus == 3">
and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) -
(DATE_FORMAT(CURDATE(), '%m%d') &lt; DATE_FORMAT(pp.birthday, '%m%d'))) BETWEEN 80 AND 89
</when>
<when test="param.ageStatus == 4">
and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) -
(DATE_FORMAT(CURDATE(), '%m%d') &lt; DATE_FORMAT(pp.birthday, '%m%d'))) >= 90
</when>
</choose>
</if>
<choose>
<when test="dataScope == 5">
@ -233,6 +266,22 @@
left join pms_patient p on b.patient_id = p.id
<where>
b.del_flag = 0 and p.del_flag = 0
<if test="param.visitType != null">
and b.visit_type = #{param.visitType}
</if>
<if test="param.patientId != null">
and b.patient_id = #{param.patientId}
</if>
<if test="param.beginTime != null and param.endTime != null">
and b.diagnosis_date between #{param.beginTime} and #{param.endTime}
</if>
<if test="param.deptId != null">
and p.dept_id = #{param.deptId}
</if>
<if test="param.diagnosisCode != null and param.diagnosisCode != ''">
and b.diagnosis_code like concat('%',#{param.diagnosisCode},'%')
</if>
</where>
order by b.id desc
</select>
</mapper>

817
ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/RmsDao.xml

File diff suppressed because it is too large

7
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/AmsController.java

@ -143,6 +143,13 @@ public class AmsController extends BaseController {
return JsonResponse.ok(scaleAchievement);
}
//查询测评下某个量表的完成情况
@ApiOperation(value = "测评结论", notes = "测评结论 (计算分数)")
@PostMapping("/queryConclusion")
public JsonResponse<List<AmsVo.ScaleAchievement>> queryConclusion(@RequestBody @ApiParam @Valid AmsDto.ScaleAchievement queryDto) {
List<AmsVo.ScaleAchievement> scaleAchievement = amsService.queryConclusion(queryDto);
return JsonResponse.ok(scaleAchievement);
}
@ApiOperation(value = "删除画图轨迹",notes = "zy:删除画图的轨迹,可以一次删除多条")
@RequestMapping(value="/delCanvas", method = RequestMethod.POST)

9
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/AmsReportTemplateController.java

@ -56,11 +56,18 @@ public class AmsReportTemplateController {
@Anonymous
@ApiOperation("导出医生版报告")
@PostMapping("/exportYs")
@PostMapping("/exportYs1")
public JsonResponse<AmsReportVo.Result> exportYs(@RequestBody @Validated RmsDto.ExportReport1Dto dto){
return JsonResponse.ok(amsReportService.exportYs(dto));
}
@Anonymous
@ApiOperation("导出医生版报告")
@PostMapping("/exportYs")
public JsonResponse<AmsReportVo.Result> exportYs1(@RequestBody @Validated RmsDto.ExportReport1Dto dto){
return JsonResponse.ok(amsReportService.exportYs1(dto));
}
@Anonymous
@ApiOperation("导出阳性版报告")
@PostMapping("/exportYx")

6
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/EmsController.java

@ -129,4 +129,10 @@ public class EmsController extends BaseController {
public JsonResponse<Integer> delete(@RequestBody @ApiParam @Valid EmsDto.Delete dto){
return JsonResponse.ok(emsService.delete(dto.getIdList()));
}
@ApiOperation(value = "撤回测评")
@PostMapping("/revoke")
public JsonResponse<Integer> revoke(@RequestBody @ApiParam @Valid EmsDto.Complate dto){
return JsonResponse.ok(emsService.revoke(dto.getEvaluationId()));
}
}

9
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/RmsController.java

@ -57,6 +57,15 @@ public class RmsController extends BaseController {
return JsonResponse.ok(detail);
}
@Anonymous
@ApiOperation(value = "查询报告单详情",notes = "根据测评ID查询报告单详情")
@PostMapping(value="/queryReport")
public JsonResponse<RmsVo.ReportDetail> queryReport(@RequestBody @ApiParam @Valid RmsDto.QueryDetail dto){
log.info("生成报告单请求参数:{}", dto);
RmsVo.ReportDetail detail = rmsService.queryReport(dto);
return JsonResponse.ok(detail);
}
//查询报告单列表
@ApiOperation(value = "查询报告单列表(按日期)",notes = "根据测评ID查询报告单列表")
@PostMapping(value="/queryReportListByTime")

6
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/scheduled/SyncHospitalData.java

@ -24,13 +24,13 @@ public class SyncHospitalData {
private DockService dockService;
@DataSource(value = DataSourceType.SLAVE)
@Scheduled(cron = "0 */1 * * * ?")
// @Scheduled(cron = "0 */1 * * * ?")
public void syncHospitalData() {
dockService.syncHospitalData();
}
@DataSource(value = DataSourceType.SLAVE)
@Scheduled(cron = "0 */1 * * * ?")
// @Scheduled(cron = "0 */1 * * * ?")
public void syncDeptData() {
try {
List<SysDept> sysDepts = dockService.syncUmsDeptSlave();
@ -48,7 +48,7 @@ public class SyncHospitalData {
@DataSource(value = DataSourceType.SLAVE)
@Scheduled(cron = "0 */1 * * * ?")
// @Scheduled(cron = "0 */1 * * * ?")
public void syncUserData() {
try {
List<SysUser> sysUsers = dockService.syncUmsUserSlave();

23
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/persist/dao/EmsDao.java

@ -0,0 +1,23 @@
package com.ccsens.client.persist.dao;
import com.ccsens.system.domain.vo.RmsVo;
import java.util.List;
/**
* @Author zzc
* @Package com.ccsens.client.persist.dao
* @Date 2026/2/28 9:30
* @description:
*/
public interface EmsDao {
/**
* 查询报告分数
* @param reportScores
* @param evaluation
* @return
*/
List<RmsVo.ReportScore> queryReportScore(List<RmsVo.ReportScore> reportScores, long evaluation);
}

4
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/persist/dao/RmsDao.java

@ -133,4 +133,8 @@ public interface RmsDao {
List<String> queryCodeByScCode(@Param("list")List<String> list);
List<RmsVo.ReportScore> queryEmsScaleScore(@Param("evaluationId") Long evaluationId,
@Param("scaleCodeList") List<String> scaleCodeList);
List<RmsVo.ExportInfo> queryReportExportInfo(@Param("evaluationId") Long evaluationId);
}

1
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/AmsReportService.java

@ -29,6 +29,7 @@ public interface AmsReportService {
*/
AmsReportVo.Result exportYs(RmsDto.ExportReport1Dto dto);
AmsReportVo.Result exportYs1(RmsDto.ExportReport1Dto dto);
/**
* 导出阳性报告
* @param dto

1
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IAmsService.java

@ -35,6 +35,7 @@ public interface IAmsService {
List<AmsVo.ScaleAchievement> getScaleAchievement(AmsDto.ScaleAchievement queryDto);
List<AmsVo.ScaleAchievement> queryConclusion(AmsDto.ScaleAchievement queryDto);
Integer deleteRedis(Long questionId, Long evaluationId);
List<AmsVo.OptionJson> queryOptionJson(AmsDto.QueryPatientCanvas queryDto);

3
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IEmsService.java

@ -38,4 +38,7 @@ public interface IEmsService {
Integer complate(Long evaluationId, Byte complateStatus);
Integer delete(List<Long> idList);
Integer revoke(Long evaluationId);
}

4
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/IRmsService.java

@ -15,6 +15,10 @@ import java.util.List;
public interface IRmsService {
RmsVo.ReportDetail queryReportDetail(RmsDto.QueryDetail dto);
RmsVo.ReportDetail queryReport(RmsDto.QueryDetail dto);
List<RmsVo.ReportScore> buildReportScoreTree(List<RmsVo.ReportScore> allReportScores, Long rootParentId);
/**
* 查看报告单
* @param param

250
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/AmsReportServiceImpl.java

@ -10,6 +10,7 @@ import cn.hutool.http.HtmlUtil;
import com.ccsens.client.persist.dao.AmsDao;
import com.ccsens.client.persist.dao.ClientEvaDao;
import com.ccsens.client.persist.dao.HmsDoctorDao;
import com.ccsens.client.persist.dao.RmsDao;
import com.ccsens.client.service.AmsReportService;
import com.ccsens.client.service.IReportInfoService;
import com.ccsens.client.service.IRmsService;
@ -63,6 +64,8 @@ public class AmsReportServiceImpl implements AmsReportService {
@Resource
private IRmsService rmsService;
@Resource
private RmsDao rmsDao;
@Resource
private RmsReportMapper rmsReportMapper;
@Resource
private QmsScaleMapper qmsScaleMapper;
@ -605,9 +608,16 @@ public class AmsReportServiceImpl implements AmsReportService {
@Override
public AmsReportVo.Result exportGr(RmsDto.ExportReport1Dto dto) throws IOException {
RmsReport report = rmsReportMapper.selectByPrimaryKey(dto.getReportId());
if (ObjectUtil.isNotNull(report) && StrUtil.isNotBlank(report.getPersionUrl())) {
AmsReportVo.Result result = new AmsReportVo.Result();
result.setPath(report.getPersionUrl());
return result;
}
RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail();
queryDetail.setEvaluationId(dto.getEvaluationId());
RmsVo.ReportDetail detail = rmsService.queryReportDetail(queryDetail);
RmsVo.ReportDetail detail = rmsService.queryReport(queryDetail);
if (detail == null) {
return null;
}
@ -689,7 +699,7 @@ public class AmsReportServiceImpl implements AmsReportService {
if ("5CZLSY".equals(scores.get(i).getCode()) || "SZGGJ".equals(scores.get(i).getCode()) || "WLCD".equals(scores.get(i).getCode()) || "LMBS".equals(scores.get(i).getCode())) {
jsCount += 1;
}
//查询类型
//查询类型 // TODO
AmsVo.ComboVo comboVo = amsDao.queryComboName(scores.get(i).getCode(), emsEvaluation.getVersion());
String comboName = "", parentName = "";
String str = "";
@ -907,7 +917,11 @@ public class AmsReportServiceImpl implements AmsReportService {
} catch (Exception e) {
e.printStackTrace();
}
//将生成的文件路径保存到报告单内
if (ObjectUtil.isNotNull(report)) {
report.setPersionUrl(pdfPath);
rmsReportMapper.updateByPrimaryKeySelective(report);
}
AmsReportVo.Result result = new AmsReportVo.Result();
result.setWord(filePath);
result.setPath(pdfPath);
@ -974,10 +988,15 @@ public class AmsReportServiceImpl implements AmsReportService {
return result;
}
RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail();
queryDetail.setEvaluationId(dto.getEvaluationId());
RmsVo.ReportDetail detail = rmsService.queryReportDetail(queryDetail);
//查询测评量表
List<RmsVo.ReportScore> scores = rmsDao.queryEmsScaleScore(dto.getEvaluationId(), CollectionUtil.newArrayList());
if (CollUtil.isNotEmpty(scores)) {
//组装成父子级关系
scores = rmsService.buildReportScoreTree(scores, 0L);
}
if (detail == null) {
return null;
}
@ -985,7 +1004,6 @@ public class AmsReportServiceImpl implements AmsReportService {
if (emsEvaluation == null) {
return null;
}
List<RmsVo.ReportScore> scores = detail.getScores();
RmsVo.ReportPatient patientInfo = detail.getPatient();
HashMap<String, Object> params = new HashMap<>();
@ -1204,11 +1222,225 @@ public class AmsReportServiceImpl implements AmsReportService {
return result;
}
@Override
public AmsReportVo.Result exportYs1(RmsDto.ExportReport1Dto dto) {
RmsReport report = rmsReportMapper.selectByPrimaryKey(dto.getReportId());
if (ObjectUtil.isNotNull(report) && StrUtil.isNotBlank(report.getUrl())) {
AmsReportVo.Result result = new AmsReportVo.Result();
result.setPath(report.getUrl());
// return result;
}
RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail();
queryDetail.setEvaluationId(dto.getEvaluationId());
RmsVo.ReportDetail detail = rmsService.queryReport(queryDetail);
//查询测评量表
List<RmsVo.ReportScore> scores = rmsDao.queryEmsScaleScore(dto.getEvaluationId(), CollectionUtil.newArrayList());
if (CollUtil.isNotEmpty(scores)) {
//组装成父子级关系
scores = rmsService.buildReportScoreTree(scores, 0L);
}
if (detail == null) {
return null;
}
EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId());
if (emsEvaluation == null) {
return null;
}
//查询
RmsVo.ReportPatient patientInfo = detail.getPatient();
HashMap<String, Object> params = new HashMap<>();
XWPFTemplate template = XWPFTemplate.compile(ysPath);
params.put("h_name", patientInfo.getHospitalName());
// params.put("qrcode_img_url", Pictures.ofLocal(reportPath + patientInfo.getQrCodeUrl()).size(130, 130).create());
params.put("p_name", patientInfo.getPatientName());
params.put("p_sex", patientInfo.getSex() == 0 ? "男" : "女");
params.put("p_age", patientInfo.getPatientAge());
CultureEnum cultureEnum = null;
if (dto.getSignId() != null) {
HmsDoctorSign emsEvaluationInformedConsent = hmsDoctorSignMapper.selectByPrimaryKey(dto.getSignId());
if (emsEvaluationInformedConsent != null) {
params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create());
}
} else {
//签名信息
Long userId = SecurityUtils.getUserId();
List<HmsVo.QuerySign> querySigns = hmsDoctorDao.querySign(userId);
if (CollUtil.isNotEmpty(querySigns)) {
HmsVo.QuerySign querySign = querySigns.get(0);
if (ObjectUtil.isNotNull(querySign) && StrUtil.isNotEmpty(querySign.getSignUrl())) {
params.put("cpy_img_url", Pictures.ofLocal(prefixWord + querySign.getSignUrl()).size(80, 40).create());
}
}
}
try {
cultureEnum = BaseEnum.codeOf(CultureEnum.class, patientInfo.getEducationalStatus().intValue());
} catch (Exception e) {
//处理educationStatus为null的情况,后台导入的数据educationStatus为null
//默认为初中
cultureEnum = CultureEnum.YW;
}
if (cultureEnum != null) {
params.put("p_grade", cultureEnum.getDesc());
}
if (patientInfo.getCareer() != null) {
JobEnum jobEnum = BaseEnum.codeOf(JobEnum.class, patientInfo.getCareer().intValue());
// params.put("p_no", patientInfo.getSerialNumber());
if (jobEnum != null) {
params.put("p_Career", jobEnum.getDesc());
}
}
params.put("p_dept", patientInfo.getDepartment());
params.put("p_bedno", patientInfo.getBedNumber());
params.put("p_Patient_number", patientInfo.getHospitalNumber());
params.put("p_Clinical_diagnosis", patientInfo.getClinicalDiagnosis());
params.put("p_Inspection_date", DateUtil.format(new Date(patientInfo.getReportTime()), "yyyy-MM-dd"));
// params.put("score", detail.getScore());
//AD8
// params.put("cpy_img_url", patientInfo.getName());
params.put("report_date", DateUtil.date(patientInfo.getReportTime()));
//生成表格
// 创建带有样式的文本
TextRenderData text1 = Texts.of("评估结论").bold().fontSize(12).create();
TextRenderData text2 = Texts.of("评估结论").bold().fontSize(12).create();
TextRenderData text3 = Texts.of("评估结论").bold().fontSize(12).create();
TextRenderData text4 = Texts.of("评估结论").bold().fontSize(12).create();
// TextRenderData text5 = Texts.of("评估结论").bold().fontSize(12).create();
RowRenderData headerRow = Rows.of(text1, text2, text3, text4).create();
//查询
List<RmsVo.ExportInfo> exportInfos = rmsDao.queryReportExportInfo(dto.getEvaluationId());
if (CollUtil.isEmpty(exportInfos)) {
return null;
}
RowRenderData titleRow = Rows.of("一级指标/二级指标", "量表名称", "得分", "结论").create();
Tables.TableBuilder of = Tables.of(headerRow, titleRow);
for (int i = 0; i < exportInfos.size(); i++) {
params.put("yjzb", exportInfos.get(i).getComboParentName());
params.put("ejzb", exportInfos.get(i).getComboName());
if (exportInfos.get(i).getNeedPlan() != null && exportInfos.get(i).getNeedPlan() == 1) {
TextRenderData textStr = Texts.of(StrUtil.isEmpty(exportInfos.get(i).getComboParentName()) ? "" : exportInfos.get(i).getComboParentName() + "/" + exportInfos.get(i).getComboName()).bold().color("FF0000").create();
TextRenderData textName = Texts.of(scores.get(i).getName()).bold().color("FF0000").create();
TextRenderData textScore = Texts.of(scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "").bold().color("FF0000").create();
TextRenderData textImpression = Texts.of(StrUtil.isEmpty(exportInfos.get(i).getImpression()) ? exportInfos.get(i).getResult() : exportInfos.get(i).getImpression()).bold().color("FF0000").create();
//查询一二级套餐
RowRenderData row1 = Rows.of(
textStr,
textName,
textScore,
textImpression
).create();
// if (StrUtil.isNotEmpty(exportInfos.get(i).getComboName() + "/" + exportInfos.get(i).getComboParentName())) {
// of.mergeRule(MergeCellRule.builder().map(MergeCellRule.Grid.of(i + 1, i + 1), MergeCellRule.Grid.of(0, 1)).build());
// }
of.addRow(row1);
} else {
if (!"JI_SHAO".equals(exportInfos.get(i).getScaleCode())) {
TextRenderData textStr = Texts.of(StrUtil.isEmpty(exportInfos.get(i).getComboParentName()) ? "" : exportInfos.get(i).getComboParentName() + "/" + exportInfos.get(i).getComboName()).bold().create();
TextRenderData textName = Texts.of("JI_SHAO".equals(exportInfos.get(i).getScaleCode()) ? "肌少总结论" : exportInfos.get(i).getScaleName()).bold().create();
TextRenderData textScore = Texts.of(exportInfos.get(i).getScore() == null ? "" : exportInfos.get(i).getScore() + "").bold().create();
//中医体质辨识添加结论 结论为初步印象
TextRenderData textImpression = Texts.of(
StrUtil.isEmpty(exportInfos.get(i).getImpression()) ? exportInfos.get(i).getResult() : exportInfos.get(i).getImpression()).bold().create();
//查询一二级套餐
RowRenderData row1 = Rows.of(
textStr,
textName,
textScore,
textImpression
).create();
of.addRow(row1);
} else {
TextRenderData textStr = Texts.of(exportInfos.get(i).getImpression().contains("\n") ? "量表结论" + "\n" + "肌少总结论" : "肌少总结论").bold().create();
TextRenderData textName = Texts.of("").bold().create();
TextRenderData textScore = Texts.of(exportInfos.get(i).getScore() == null ? "" : exportInfos.get(i).getScore() + "").bold().create();
//中医体质辨识添加结论 结论为初步印象
TextRenderData textImpression = Texts.of(
exportInfos.get(i).getImpression() == null ? exportInfos.get(i).getResult() : exportInfos.get(i).getImpression()).bold().create();
//查询一二级套餐
RowRenderData row1 = Rows.of(
textStr,
textName,
textImpression,
textScore
).create();
if (StrUtil.isNotEmpty(exportInfos.get(i).getComboName() + "/" + exportInfos.get(i).getComboParentName())) {
of.mergeRule(
MergeCellRule.builder().map(
MergeCellRule.Grid.of(i + 2, 0), MergeCellRule.Grid.of(i + 2, 1))
.map(MergeCellRule.Grid.of(i + 2, 2), MergeCellRule.Grid.of(i + 2, 3)
).build()
);
}
of.addRow(row1);
}
}
}
if (emsEvaluation.getVersion() != null) {
HmsVersion hmsVersion = hmsVersionMapper.selectByPrimaryKey(Long.parseLong(emsEvaluation.getVersion()));
if (hmsVersion != null) {
params.put("type", hmsVersion.getVersion() + "评估报告");
}
}
TableRenderData tableData = of
.create();
params.put("table", tableData);
String s = IdUtil.randomUUID();
try {
template.render(params);
} catch (
Exception e) {
e.printStackTrace(); // 输出详细的异常信息
}
String filePath = "/profile/" + "/report/" + "老年综合评估_" + s + ".docx";
String pdfPath = "/profile/" + "/report/" + "老年综合评估_" + s + ".pdf";
String aPath = path + "/" + "/report/" + "老年综合评估_" + s + ".docx";
String pPath = path + "/" + "/report/" + "老年综合评估_" + s + ".pdf";
try {
template.writeAndClose(Files.newOutputStream(Paths.get(reportDomain + "/" + "/report/" + "老年综合评估_" + s + ".docx")));
AsposeUtils.doc2pdf(aPath, pPath);
} catch (
Exception e) {
e.printStackTrace();
}
AmsReportVo.Result result = new AmsReportVo.Result();
result.setWord(filePath);
result.setPath(pdfPath);
//将生成的文件路径保存到报告单内
if (ObjectUtil.isNotNull(report)) {
report.setUrl(pdfPath);
rmsReportMapper.updateByPrimaryKeySelective(report);
}
return result;
}
@Override
public AmsReportVo.Result exportYx(RmsDto.ExportReport1Dto dto) {
RmsReport report = rmsReportMapper.selectByPrimaryKey(dto.getReportId());
if (ObjectUtil.isNotNull(report) && StrUtil.isNotBlank(report.getPositiveUrl())) {
AmsReportVo.Result result = new AmsReportVo.Result();
result.setPath(report.getPositiveUrl());
// return result;
}
RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail();
queryDetail.setEvaluationId(dto.getEvaluationId());
RmsVo.ReportDetail detail = rmsService.queryReportDetail(queryDetail);
RmsVo.ReportDetail detail = rmsService.queryReport(queryDetail);
if (detail == null) {
return null;
}
@ -1377,7 +1609,11 @@ public class AmsReportServiceImpl implements AmsReportService {
} catch (Exception e) {
e.printStackTrace();
}
//将生成的文件路径保存到报告单内
if (ObjectUtil.isNotNull(report)) {
report.setPositiveUrl(pdfPath);
rmsReportMapper.updateByPrimaryKeySelective(report);
}
AmsReportVo.Result result = new AmsReportVo.Result();
result.setWord(filePath);
result.setPath(pdfPath);

246
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/AmsServiceImpl.java

@ -88,6 +88,8 @@ public class AmsServiceImpl implements IAmsService {
private EmsEvaluationQuestionDurationMapper emsEvaluationQuestionDurationMapper;
@Resource
private IEmsService emsService;
@Resource
private EmsEvaluationScaleCognitiveRelevanceMapper emsEvaluationScaleCognitiveRelevanceMapper;
@Autowired
private RedisCache redisUtil;
@ -450,11 +452,6 @@ public class AmsServiceImpl implements IAmsService {
resultVo.setCodeEnum(ErrorConstant.PARAM_ERROR);
return resultVo;
}
// if (CollectionUtil.isEmpty(dto.getOptions())) {
// //没有选项 返回报错 修改于 2023-07-27
// resultVo.setCodeEnum(ErrorConstant.QUESTION_SAVE_ERROR);
// return resultVo;
//
if (CollectionUtil.isEmpty(dto.getOptions()) && CollectionUtil.isEmpty(dto.getPaths())) {
List<AmsPatientAnswerScore> scores = new ArrayList<>();
@ -474,13 +471,13 @@ public class AmsServiceImpl implements IAmsService {
//保存现在的答案
// 选项为空,默认0分
AmsPatientAnswerScore zeroScore = getHtPatientScore(dto, question.getCognitiveCode(), report, BigDecimal.valueOf(0));
// 2026年3月2日09:51:09修改 CGAV2 不选默认为空
AmsPatientAnswerScore zeroScore = getHtPatientScore(dto, question.getCognitiveCode(), report, null);
scores.add(zeroScore);
amsPatientAnswerScoreDao.insertBatch(scores);
//没有选项和画图录音等,不进行保存
resultVo.setCodeEnum(ErrorConstant.SUCCESS);
} else {
// String parentCode = question.getCognitiveCode().contains("-") ? question.getCognitiveCode().split("-")[0] : question.getCognitiveCode();
String parentCode = question.getCognitiveCode();
//查询报告单
EmsEvaluation report = emsEvaluationMapper.selectByPrimaryKey(dto.getPatientReportId());
@ -549,21 +546,9 @@ public class AmsServiceImpl implements IAmsService {
// 保存答案
saveAnswerRecord(dto, question);
//修改报告单是否完成一次测评
changeShowStatus(report, question);
// //保存自动录音文件
// if (StrUtil.isNotEmpty(dto.getPath())) {
// //自动录音
// QmsQuestionRecording htQuestionRecording = new QmsQuestionRecording();
// htQuestionRecording.setQuestionId(question.getId());
// htQuestionRecording.setReportId(report.getId());
// htQuestionRecording.setDelFlag(GenConstants.Ht.NO_DEL);
// htQuestionRecording.setId(IDGenerator.nextSnowflakeId());
// htQuestionRecording.setPath(score.getPath());
// htQuestionRecording.setPatientId(scores.get(0).getPatientId());
// questionRecordingMapper.insertSelective(htQuestionRecording);
// }
// //修改报告单是否完成一次测评
// changeShowStatus(report, question);
}
//进入延迟回忆,先删除已存在的倒计时
@ -596,7 +581,6 @@ public class AmsServiceImpl implements IAmsService {
}
if (!(dto.getStatus() != null && (dto.getStatus() == 1 || dto.getStatus() == 2))) {
//由MQ变为Redis
if (CollectionUtil.isNotEmpty(shows)
// && dto.getIsSubmit() == 1
) {
@ -658,68 +642,6 @@ public class AmsServiceImpl implements IAmsService {
resultVo.setRecallQuestion(0);
}
}
//最后一题判断量表是否已全部完成
if (ObjectUtil.isNotEmpty(dto.getLast())) {
if (dto.getLast()) {
switch (question.getScaleCode()) {
case "AD8":
BigDecimal ad8Score = getRealFinish(dto.getPatientReportId(), "AD8");
resultVo.setRealFinish(ad8Score.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "PJS":
BigDecimal pjsScore = getRealFinish(dto.getPatientReportId(), "PJS");
resultVo.setRealFinish(pjsScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "MINIC":
BigDecimal minicScore = getMinicScore(dto.getPatientReportId());
resultVo.setRealFinish(minicScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "NP":
BigDecimal npScore = getRealFinish(dto.getPatientReportId(), "NP");
resultVo.setRealFinish(npScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "HIS":
BigDecimal hisScore = getRealFinish(dto.getPatientReportId(), "HIS");
resultVo.setRealFinish(hisScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "GDS":
BigDecimal gdsScore = getRealFinish(dto.getPatientReportId(), "GDS");
resultVo.setRealFinish(gdsScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "MMSE":
BigDecimal mmseScore = getMmseScore(dto.getPatientReportId(), "MMSE");
resultVo.setRealFinish(mmseScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "ADL":
BigDecimal adlScore = getRealFinish(dto.getPatientReportId(), "ADL");
resultVo.setRealFinish(adlScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "CDR":
BigDecimal cdrScore = getRealFinish(dto.getPatientReportId(), "CDR");
resultVo.setRealFinish(cdrScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "SCD":
BigDecimal scdScore = getRealFinish(dto.getPatientReportId(), "SCD");
resultVo.setRealFinish(scdScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "WEBSTER":
BigDecimal websterScore = getRealFinish(dto.getPatientReportId(), "WEBSTER");
resultVo.setRealFinish(websterScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "SE":
BigDecimal seScore = getRealFinish(dto.getPatientReportId(), "SE");
resultVo.setRealFinish(seScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
case "NMSA":
BigDecimal nmsaScore = getMmseScore(dto.getPatientReportId(), "NMSA");
resultVo.setRealFinish(nmsaScore.compareTo(new BigDecimal(-1)) == 0 ? 0 : 1);
break;
default:
resultVo.setRealFinish(1);
}
}
}
return resultVo;
}
@ -966,26 +888,26 @@ public class AmsServiceImpl implements IAmsService {
});
}
/**
* 修改报告单显示状态
*/
private void changeShowStatus(EmsEvaluation evaluation, QmsQuestion question) {
//根据测评id查找报告单信息
RmsReportExample rmsReportExample = new RmsReportExample();
rmsReportExample.createCriteria().andEvaluationIdEqualTo(evaluation.getId());
List<RmsReport> rmsReports = rmsReportMapper.selectByExample(rmsReportExample);
if (CollUtil.isNotEmpty(rmsReports)) {
RmsReport report = rmsReports.get(0);
if (report.getShowStatus() != null && report.getShowStatus() == GenConstants.Ht.Report.SHOW_HISTORY) {
return;
}
Integer maxSort = questionDao.selectMaxSort(question.getScaleCode());
if (question.getSort() != null && maxSort != null && question.getSort() >= maxSort) {
report.setShowStatus(GenConstants.Ht.Report.SHOW_HISTORY);
rmsReportMapper.updateByPrimaryKeySelective(report);
}
}
}
// /**
// * 修改报告单显示状态
// */
// private void changeShowStatus(EmsEvaluation evaluation, QmsQuestion question) {
// //根据测评id查找报告单信息
// RmsReportExample rmsReportExample = new RmsReportExample();
// rmsReportExample.createCriteria().andEvaluationIdEqualTo(evaluation.getId());
// List<RmsReport> rmsReports = rmsReportMapper.selectByExample(rmsReportExample);
// if (CollUtil.isNotEmpty(rmsReports)) {
// RmsReport report = rmsReports.get(0);
// if (report.getShowStatus() != null && report.getShowStatus() == GenConstants.Ht.Report.SHOW_HISTORY) {
// return;
// }
// Integer maxSort = questionDao.selectMaxSort(question.getScaleCode());
// if (question.getSort() != null && maxSort != null && question.getSort() >= maxSort) {
// report.setShowStatus(GenConstants.Ht.Report.SHOW_HISTORY);
// rmsReportMapper.updateByPrimaryKeySelective(report);
// }
// }
// }
@Override
public BigDecimal getRealFinish(Long reportId, String code) {
@ -1154,46 +1076,120 @@ public class AmsServiceImpl implements IAmsService {
public List<AmsVo.ScaleAchievement> getScaleAchievement(AmsDto.ScaleAchievement queryDto) {
//查询量表信息
List<AmsVo.ScaleAchievement> scaleAchievementList = amsDao.getScaleAchievement(queryDto.getEvaluationId(), queryDto.getScaleCode(), queryDto.getSex());
if (CollUtil.isNotEmpty(scaleAchievementList)) {
scaleAchievementList.forEach(scaleAchievement -> {
//查找量表下每道题的完成情况
List<AmsVo.ScaleQuestionAchievement> scaleQuestionAchievementList = amsDao.getScaleQuestionAchievement(queryDto.getEvaluationId(), scaleAchievement.getScaleCode(), queryDto.getSex());
scaleAchievement.setQuestionDetail(scaleQuestionAchievementList);
});
}
return scaleAchievementList;
}
@Override
public List<AmsVo.ScaleAchievement> queryConclusion(AmsDto.ScaleAchievement queryDto) {
//查询量表信息
List<AmsVo.ScaleAchievement> scaleAchievementList = amsDao.getScaleAchievement(queryDto.getEvaluationId(), queryDto.getScaleCode(), queryDto.getSex());
if (CollUtil.isNotEmpty(scaleAchievementList)) {
//删除已有分数
EmsEvaluationScaleCognitiveRelevanceExample emsEvaluationScaleCognitiveRelevanceExample = new EmsEvaluationScaleCognitiveRelevanceExample();
emsEvaluationScaleCognitiveRelevanceExample.createCriteria().andEvaluationIdEqualTo(queryDto.getEvaluationId());
EmsEvaluationScaleCognitiveRelevance emsEvaluationScaleCognitiveRelevance2 = new EmsEvaluationScaleCognitiveRelevance();
emsEvaluationScaleCognitiveRelevance2.setDelFlag(GenConstants.Ht.IS_DEL);
emsEvaluationScaleCognitiveRelevanceMapper.updateByExampleSelective(emsEvaluationScaleCognitiveRelevance2, emsEvaluationScaleCognitiveRelevanceExample);
int i = 0;
scaleAchievementList.forEach(scaleAchievement -> {
//查询报告单分数
//查询测评量表分数
List<RmsVo.ReportScore> reportScore = rmsDao.queryReportScore(queryDto.getEvaluationId(), scaleAchievement.getScaleCode());
//重新封装报告单信息
List<RmsVo.ReportScore> reportScores = rmsService.getReportScores(reportScore, queryDto.getEvaluationId());
if (CollUtil.isNotEmpty(reportScores)) {
reportScores.forEach(score -> {
if (score.getCode().equals(scaleAchievement.getScaleCode())) {
List<AmsVo.ScoreScore> scoreScoreList = new ArrayList<>();
//保存测评量表分数
EmsEvaluationScaleCognitiveRelevance evaluationScaleCognitiveRelevance = new EmsEvaluationScaleCognitiveRelevance();
evaluationScaleCognitiveRelevance.setEvaluationId(queryDto.getEvaluationId());
evaluationScaleCognitiveRelevance.setDelFlag(GenConstants.Ht.NO_DEL);
evaluationScaleCognitiveRelevance.setScaleCode(scaleAchievement.getScaleCode());
evaluationScaleCognitiveRelevance.setScore(score.getScore());
evaluationScaleCognitiveRelevance.setParentId(0L);
evaluationScaleCognitiveRelevance.setTotalScore(scaleAchievement.getTotalScore());
evaluationScaleCognitiveRelevance.setSort(scaleAchievement.getSort());
evaluationScaleCognitiveRelevance.setCreateTime(new Date());
evaluationScaleCognitiveRelevance.setId(IdUtil.getSnowflake().nextId());
evaluationScaleCognitiveRelevance.setComboId(score.getComboId());
evaluationScaleCognitiveRelevance.setCreateBy(SecurityUtils.getUsername());
emsEvaluationScaleCognitiveRelevanceMapper.insert(evaluationScaleCognitiveRelevance);
//保存认知域得分
if (CollectionUtil.isNotEmpty(score.getSubReport())) {
//保存测评量表认知域分数
score.getSubReport().forEach(subReport -> {
AmsVo.ScoreScore scoreScore = new AmsVo.ScoreScore();
scoreScore.setScore(subReport.getScore());
scoreScore.setName(subReport.getName());
scoreScore.setCode(subReport.getCode());
scoreScoreList.add(scoreScore);
EmsEvaluationScaleCognitiveRelevance emsEvaluationScaleCognitiveRelevance = new EmsEvaluationScaleCognitiveRelevance();
emsEvaluationScaleCognitiveRelevance.setEvaluationId(queryDto.getEvaluationId());
emsEvaluationScaleCognitiveRelevance.setScaleCode(scaleAchievement.getScaleCode());
emsEvaluationScaleCognitiveRelevance.setCognitiveCode(subReport.getCode());
emsEvaluationScaleCognitiveRelevance.setScore(subReport.getScore());
emsEvaluationScaleCognitiveRelevance.setParentId(evaluationScaleCognitiveRelevance.getId());
emsEvaluationScaleCognitiveRelevance.setTotalScore(scaleAchievement.getTotalScore());
emsEvaluationScaleCognitiveRelevance.setCreateTime(new Date());
emsEvaluationScaleCognitiveRelevance.setComboId(score.getComboId());
emsEvaluationScaleCognitiveRelevance.setDelFlag(GenConstants.Ht.NO_DEL);
emsEvaluationScaleCognitiveRelevance.setSort(subReport.getSort());
emsEvaluationScaleCognitiveRelevance.setTotalScore(new BigDecimal(subReport.getTotalScore()));
emsEvaluationScaleCognitiveRelevance.setId(IdUtil.getSnowflake().nextId());
emsEvaluationScaleCognitiveRelevance.setCreateBy(SecurityUtils.getUsername());
emsEvaluationScaleCognitiveRelevanceMapper.insert(emsEvaluationScaleCognitiveRelevance);
if (CollectionUtil.isNotEmpty(subReport.getSubReport())) {
subReport.getSubReport().forEach(subSubReport -> {
EmsEvaluationScaleCognitiveRelevance emsEvaluationScaleCognitiveRelevance1 = new EmsEvaluationScaleCognitiveRelevance();
emsEvaluationScaleCognitiveRelevance1.setEvaluationId(queryDto.getEvaluationId());
emsEvaluationScaleCognitiveRelevance1.setScaleCode(scaleAchievement.getScaleCode());
emsEvaluationScaleCognitiveRelevance1.setCognitiveCode(subSubReport.getCode());
emsEvaluationScaleCognitiveRelevance1.setScore(subSubReport.getScore());
emsEvaluationScaleCognitiveRelevance1.setCreateTime(new Date());
emsEvaluationScaleCognitiveRelevance1.setTotalScore(new BigDecimal(subReport.getTotalScore()));
emsEvaluationScaleCognitiveRelevance1.setParentId(emsEvaluationScaleCognitiveRelevance.getId());
emsEvaluationScaleCognitiveRelevance1.setId(IdUtil.getSnowflake().nextId());
emsEvaluationScaleCognitiveRelevance1.setDelFlag(GenConstants.Ht.NO_DEL);
emsEvaluationScaleCognitiveRelevance1.setCreateBy(SecurityUtils.getUsername());
emsEvaluationScaleCognitiveRelevanceMapper.insert(emsEvaluationScaleCognitiveRelevance1);
});
}
});
scaleAchievement.setScore(score.getScore());
scaleAchievement.setScaleScoreList(scoreScoreList);
}
});
}
//查找量表下每道题的完成情况
List<AmsVo.ScaleQuestionAchievement> scaleQuestionAchievementList = amsDao.getScaleQuestionAchievement(queryDto.getEvaluationId(), scaleAchievement.getScaleCode(), queryDto.getSex());
scaleAchievement.setQuestionDetail(scaleQuestionAchievementList);
//NPI特殊处理总分
if ("NPI".equals(scaleAchievement.getScaleCode())) {
scaleAchievement.setScore(amsDao.getTotalScoreByNPI(queryDto.getEvaluationId()));
//CGA内没有NPI和CTT量表
// //NPI特殊处理总分
// if ("NPI".equals(scaleAchievement.getScaleCode())) {
// scaleAchievement.setScore(amsDao.getTotalScoreByNPI(queryDto.getEvaluationId()));
// }
// //CTT不返回分数信息
// if ("CTT".equals(scaleAchievement.getScaleCode())) {
// scaleAchievement.setScore(null);
// }
});
}
//CTT不返回分数信息
if ("CTT".equals(scaleAchievement.getScaleCode())) {
scaleAchievement.setScore(null);
//删除延迟回忆
Object objects = redisUtil.get("message_" + queryDto.getEvaluationId());
if (objects != null) {
Set<MessageDto.QuestionInform> set = (Set<MessageDto.QuestionInform>) objects;
if (CollectionUtil.isNotEmpty(set)) {
MessageDto.QuestionInform questionInform = new MessageDto.QuestionInform();
questionInform.setQuestionId(0L);
set.remove(questionInform);
}
});
redisUtil.deleteObject("message_" + queryDto.getEvaluationId());
}
return scaleAchievementList;
}
@Override
public Integer deleteRedis(Long questionId, Long evaluationId) {
Object objects = redisUtil.get("message_" + evaluationId);

12
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/IEmsServiceImpl.java

@ -232,6 +232,17 @@ public class IEmsServiceImpl implements IEmsService {
return evaluationMapper.updateByExampleSelective(emsEvaluation, emsEvaluationExample);
}
@Override
public Integer revoke(Long evaluationId) {
EmsEvaluation emsEvaluation = evaluationMapper.selectByPrimaryKey(evaluationId);
if (emsEvaluation == null) {
throw new BaseException(ErrorConstant.PATIENT_REPORT_NOT_FOUND);
}
emsEvaluation.setCompleteStatus((byte) 0);
emsEvaluation.setUpdateTime(new Date());
return evaluationMapper.updateByPrimaryKeySelective(emsEvaluation);
}
@Override
public Integer bindPatient(EmsDto.BindPatient dto) {
LoginUser loginUser = getLoginUser();
@ -323,6 +334,7 @@ public class IEmsServiceImpl implements IEmsService {
evaluationScaleRelevance.setId(IDGenerator.nextSnowflakeId());
evaluationScaleRelevance.setEvaluationId(dto.getEvaluationId());
evaluationScaleRelevance.setScaleCode(evaluationScale.getScaleCode());
evaluationScaleRelevance.setComboId(evaluationScale.getComboId());
evaluationScaleRelevance.setSort(sort1++);
evaluationScaleRelevance.setCreateBy(loginUser.getUsername());
evaluationScaleRelevanceMapper.insertSelective(evaluationScaleRelevance);

459
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/service/impl/RmsServiceImpl.java

@ -50,7 +50,9 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.Period;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
@ -102,58 +104,170 @@ public class RmsServiceImpl implements IRmsService {
@Resource
private TzbsRmsReportYsjyMapper rmsReportYsjyMapper;
public int getAge(PmsPatient pmsPatient) {
// if (pmsPatient.getBirthYear() != null) {
// Calendar instance = Calendar.getInstance();
// return instance.get(Calendar.YEAR) - pmsPatient.getBirthYear();
// } else
if (pmsPatient.getBirthday() != null) {
Calendar instance = Calendar.getInstance();
return instance.get(Calendar.YEAR) - DateUtil.parse(pmsPatient.getBirthday(), "yyyy-MM-dd").getYear();
public int getAge(String birthday) {
if (birthday == null || birthday.trim().isEmpty()) {
return 0;
}
try {
LocalDate birthDate = LocalDate.parse(birthday);
return Period.between(birthDate, LocalDate.now()).getYears();
} catch (Exception e) {
log.error("计算年龄失败", e);
return 0;
}
}
/**
* 递归组装ReportScore的父子级树形结构
*
* @param allReportScores 所有未组装的ReportScore列表
* @param rootParentId 根节点的parentId比如0或null根据业务定义
* @return 组装好的树形结构根节点列表
*/
@Override
public List<RmsVo.ReportScore> buildReportScoreTree(List<RmsVo.ReportScore> allReportScores, Long rootParentId) {
// 1. 预处理:将所有节点放入Map,key=scaleId,方便快速查找
Map<String, RmsVo.ReportScore> scoreMap = new HashMap<>();
for (RmsVo.ReportScore score : allReportScores) {
scoreMap.put(score.getScaleId(), score);
// 初始化子列表(避免空指针)
if (score.getSubReport() == null) {
score.setSubReport(new ArrayList<>());
}
}
// 2. 筛选根节点(parentId等于rootParentId的节点)
List<RmsVo.ReportScore> rootNodes = new ArrayList<>();
for (RmsVo.ReportScore score : allReportScores) {
Long parentId = score.getParentId();
// 判断是否为根节点(适配parentId=null或0的情况)
boolean isRoot = (rootParentId == null && parentId == null)
|| (rootParentId != null && rootParentId.equals(parentId));
if (isRoot) {
rootNodes.add(score);
// 递归组装子节点
buildChildren(score, scoreMap);
}
}
// 3. 按sort/ecrSort排序(可选,根据业务需求)
sortReportScoreTree(rootNodes);
return rootNodes;
}
/**
* 递归为单个节点组装子节点
*
* @param parentNode 父节点
* @param scoreMap 所有节点的Mapkey=scaleId
*/
private static void buildChildren(RmsVo.ReportScore parentNode, Map<String, RmsVo.ReportScore> scoreMap) {
// 遍历所有节点,找到当前父节点的子节点(子节点的parentId=父节点的scaleId转Long)
for (RmsVo.ReportScore childNode : scoreMap.values()) {
Long childParentId = childNode.getParentId();
String parentScaleId = parentNode.getScaleId();
// 避免空指针,先判断parentScaleId是否能转Long(根据业务,scaleId应为数字字符串)
if (childParentId == null || parentScaleId == null) {
continue;
}
// 匹配子节点:子节点的parentId = 父节点的scaleId(转Long)
try {
Long parentIdLong = Long.parseLong(parentScaleId);
if (childParentId.equals(parentIdLong)) {
// 加入子列表
parentNode.getSubReport().add(childNode);
// 递归组装子节点的子节点
buildChildren(childNode, scoreMap);
}
} catch (NumberFormatException e) {
// 若scaleId非数字,根据业务处理(此处打印日志,跳过)
System.err.println("scaleId转换Long失败:" + parentScaleId + ",原因:" + e.getMessage());
continue;
}
}
// 子节点排序(可选)
if (CollectionUtil.isNotEmpty(parentNode.getSubReport())) {
sortReportScoreTree(parentNode.getSubReport());
}
}
/**
* 对ReportScore列表按排序字段排序优先sort其次ecrSort
*
* @param reportScores 待排序的列表
*/
private static void sortReportScoreTree(List<RmsVo.ReportScore> reportScores) {
reportScores.sort((o1, o2) -> {
// 先按sort排序
if (o1.getSort() != null && o2.getSort() != null) {
return o1.getSort().compareTo(o2.getSort());
}
// sort为空则按ecrSort排序
if (o1.getEcrSort() != null && o2.getEcrSort() != null) {
return o1.getEcrSort().compareTo(o2.getEcrSort());
}
// 都为空则按scaleId排序
return o1.getScaleId().compareTo(o2.getScaleId());
});
}
@Override
public RmsVo.ReportDetail queryReportDetail(RmsDto.QueryDetail dto) {
//查找测评信息
EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId());
if(ObjectUtil.isNull(emsEvaluation)){
throw new RuntimeException("未找到测评信息");
}
//查找患者信息
PmsPatient pmsPatient = pmsPatientMapper.selectByPrimaryKey(emsEvaluation.getPatientId());
if(ObjectUtil.isNull(pmsPatient)){
throw new RuntimeException("未找到患者信息");
}
//根据测评id查找报告单
RmsReportExample reportExample = new RmsReportExample();
reportExample.createCriteria().andEvaluationIdEqualTo(dto.getEvaluationId()).andDelFlagEqualTo((byte) 0);
List<RmsReport> rmsReports = rmsReportMapper.selectByExample(reportExample);
RmsReport report;
List<RmsVo.ReportScore> scores;
if (CollUtil.isNotEmpty(rmsReports)) {
RmsReport rmsReport = new RmsReport();
rmsReport.setDelFlag((byte) 1);
rmsReportMapper.updateByExampleSelective(rmsReport, reportExample);
//删除报告单分数
RmsReportScaleScore reportScaleScore = new RmsReportScaleScore();
reportScaleScore.setDelFlag((byte) 1);
RmsReportScaleScoreExample reportScaleScoreExample = new RmsReportScaleScoreExample();
reportScaleScoreExample.createCriteria().andReportIdEqualTo(dto.getEvaluationId());
rmsReportScaleScoreMapper.updateByExampleSelective(reportScaleScore, reportScaleScoreExample);
}
//查询测评量表及分数
List<RmsVo.ReportScore> scores = rmsDao.queryEmsScaleScore(dto.getEvaluationId(), CollectionUtil.newArrayList());
if (CollUtil.isNotEmpty(scores)) {
//组装成父子级关系
scores = buildReportScoreTree(scores, 0L);
}
Map<String, RmsReportScaleScore> reportScaleScoreMap = new HashMap<>();
if (CollUtil.isEmpty(rmsReports)) {
// RmsReportScaleScoreExample rmsReportScaleScoreExample = new RmsReportScaleScoreExample();
// rmsReportScaleScoreExample.createCriteria().andReportIdEqualTo(dto.getEvaluationId());
//生成报告单
report = new RmsReport();
RmsReport report = new RmsReport();
report.setId(IDGenerator.nextSnowflakeId());
report.setName(GenConstants.Ht.Report.PARENT_NAME + DateUtil.today());
report.setEvaluationId(dto.getEvaluationId());
report.setReportTime(System.currentTimeMillis());
//查找测评信息
EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId());
if (ObjectUtil.isNotNull(emsEvaluation)) {
//查找病人信息
PmsPatient pmsPatient = pmsPatientMapper.selectByPrimaryKey(emsEvaluation.getPatientId());
if (ObjectUtil.isNotNull(pmsPatient)) {
// report.setPatientAge(IdcardUtil.getAgeByIdCard(pmsPatient.getIdcard()));
report.setPatientAge(getAge(pmsPatient));
}
report.setPatientAge(getAge(pmsPatient.getBirthday()));
//修改测评的状态
if (dto.getComplateStatus() != null) {
emsEvaluation.setCompleteStatus(dto.getComplateStatus());
}
emsEvaluationMapper.updateByPrimaryKeySelective(emsEvaluation);
report.setVisitNo(emsEvaluation.getVisitNo());
}
rmsReportMapper.insertSelective(report);
//查询报告单分数
List<RmsVo.ReportScore> reportScore = rmsDao.queryReportScore1(dto.getEvaluationId(), null, dto.getSex());
//重新封装报告单信息
scores = getReportScores(reportScore, dto.getEvaluationId());
if (CollUtil.isNotEmpty(scores)) {
scores.forEach(score -> {
if ("TZBS_LN".equals(score.getCode()) || "TZBS_BZ".equals(score.getCode())) {
@ -174,57 +288,50 @@ public class RmsServiceImpl implements IRmsService {
rmsReportYsjyMapper.insertSelective(reportResult);
});
}
// 获取初步印象
ClientEvaVo.ReportView reportView = reportView(dto.getEvaluationId(), score.getCode());
if (reportView != null) {
score.setImpression(reportView.getResult());
score.setScore(reportView.getTotalScore());
}
}
//添加量表分数统计
RmsReportScaleScore reportScaleScore = new RmsReportScaleScore();
reportScaleScore.setId(IDGenerator.nextSnowflakeId());
reportScaleScore.setReportId(report.getId());
reportScaleScore.setScaleCode(score.getCode());
reportScaleScore.setImpression(score.getImpression());
reportScaleScore.setResult(score.getImpression());
reportScaleScore.setScore(score.getScore());
reportScaleScore.setIsShow((byte) 1);
reportScaleScore.setComboId(score.getComboId());
reportScaleScore.setSort(score.getSort());
rmsReportScaleScoreMapper.insertSelective(reportScaleScore);
reportScaleScoreMap.put(score.getCode(), reportScaleScore);
});
}
} else {
report = rmsReports.get(0);
//查找测评信息
EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId());
if (ObjectUtil.isNotNull(emsEvaluation)) {
//修改测评的状态
if (dto.getComplateStatus() != null) {
emsEvaluation.setCompleteStatus(dto.getComplateStatus());
emsEvaluationMapper.updateByPrimaryKeySelective(emsEvaluation);
}
}
//肌少结论生成
//处理肌少
String jishaoResult = addJs(scores);
if (StrUtil.isNotEmpty(jishaoResult)) {
RmsReportScaleScore reportScaleScore = new RmsReportScaleScore();
reportScaleScore.setId(IDGenerator.nextSnowflakeId());
reportScaleScore.setReportId(report.getId());
reportScaleScore.setScaleCode("JI_SHAO");
reportScaleScore.setImpression(jishaoResult);
reportScaleScore.setSort(scores.size() + 1);
reportScaleScore.setIsShow((byte) 0);
rmsReportScaleScoreMapper.insertSelective(reportScaleScore);
}
//每次查询报告单 都重新生成分数
//查询报告单分数
List<RmsVo.ReportScore> reportScore = rmsDao.queryReportScore3(dto.getEvaluationId(), null, dto.getSex());
//重新封装报告单信息
scores = getReportScores(reportScore, dto.getEvaluationId());
if (CollUtil.isNotEmpty(scores)) {
scores = scores.stream().sorted(Comparator.comparing(RmsVo.ReportScore::getEcrSort)).collect(Collectors.toList());
scores.forEach(score -> {
//查找初步印象
RmsReportScaleScoreExample scoreExample = new RmsReportScaleScoreExample();
scoreExample.createCriteria().andReportIdEqualTo(report.getId()).andScaleCodeEqualTo(score.getCode()).andDelFlagEqualTo((byte) 0);
List<RmsReportScaleScore> rmsReportScaleScores = rmsReportScaleScoreMapper.selectByExample(scoreExample);
if (CollUtil.isNotEmpty(rmsReportScaleScores)) {
score.setImpression(rmsReportScaleScores.get(0).getImpression());
if ("TZBS_LN".equals(score.getCode()) || "TZBS_BZ".equals(score.getCode())) {
score.setScore(rmsReportScaleScores.get(0).getScore());
}
reportScaleScoreMap.put(score.getCode(), rmsReportScaleScores.get(0));
RmsVo.ReportDetail detail = new RmsVo.ReportDetail();
//查找患者做过的测评的最早和最晚的时间
RmsVo.PatientEvaluationTime time = new RmsVo.PatientEvaluationTime();
time = rmsDao.getTimeByPatientId(pmsPatient.getId());
if (ObjectUtil.isNull(time)) {
time = new RmsVo.PatientEvaluationTime();
time.setMinTime(new Date());
time.setMaxTime(new Date());
}
// PmsPatient pmsPatient = pmsPatientMapper.selectByPrimaryKey(emsEvaluation.getPatientId());
if (ObjectUtil.isNotNull(emsEvaluation) && CollUtil.isNotEmpty(scores)) {
for (RmsVo.ReportScore score : scores) {
//查询量表试题
QmsQuestionExample qmsQuestionExample = new QmsQuestionExample();
qmsQuestionExample.createCriteria().andScaleCodeEqualTo(score.getCode()).andDelFlagEqualTo((byte) 0);
@ -239,40 +346,6 @@ public class RmsServiceImpl implements IRmsService {
score.setQuestionDuration(emsEvaluationQuestionDurations.stream().mapToLong(EmsEvaluationQuestionDuration::getDuration).sum());
}
}
});
}
RmsVo.ReportDetail detail = new RmsVo.ReportDetail();
//查询报告单信息和病人信息
RmsVo.ReportPatient reportPatient = rmsDao.queryReportResult(report.getId());
// //查询报告单诊断结果信息
// RmsVo.ReportPatient diagnosis = rmsDao.queryReportDiagnosis(report.getId());
// //查询报告单的关联信息
// HtReportRelevanceExample relevanceExample = new HtReportRelevanceExample();
// relevanceExample.createCriteria().andReportIdEqualTo(queryDetail.getId()).andReportCodeEqualTo(queryDetail.getReport());
// List<HtReportRelevance> reportRelevanceList = reportRelevanceMapper.selectByExample(relevanceExample);
// if(CollectionUtil.isNotEmpty(reportRelevanceList)) {
// reportPatient.setWorkingScore(ObjectUtil.isNull(reportRelevanceList.get(0).getSocre()) ? 0 : reportRelevanceList.get(0).getSocre());
// reportPatient.setInitialImpression(reportRelevanceList.get(0).getImpression());
// }
//查找患者做过的测评的最早和最晚的时间
RmsVo.PatientEvaluationTime time = new RmsVo.PatientEvaluationTime();
if (ObjectUtil.isNotNull(reportPatient)) {
time = rmsDao.getTimeByPatientId(reportPatient.getPatientId());
if (ObjectUtil.isNull(time)) {
time = new RmsVo.PatientEvaluationTime();
time.setMinTime(new Date());
time.setMaxTime(new Date());
}
}
EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId());
PmsPatient pmsPatient = pmsPatientMapper.selectByPrimaryKey(emsEvaluation.getPatientId());
if (ObjectUtil.isNotNull(emsEvaluation) && CollUtil.isNotEmpty(scores)) {
for (RmsVo.ReportScore score : scores) {
//查询量表的总分趋势信息
List<RmsVo.ScoreTrend> scoreTrend = rmsDao.getScoreTrend(emsEvaluation.getPatientId(), score.getCode(), time.getMinTime(), time.getMaxTime());
//折线图上只显示近5条记录
@ -307,9 +380,7 @@ public class RmsServiceImpl implements IRmsService {
rmsReportScaleScore.setNeedPlan(qmsScaleAssConf.getNeedPlan());
rmsReportScaleScore.setResult(qmsScaleAssConf.getResult());
rmsReportScaleScore.setScaleAssConf(qmsScaleAssConf.getId());
// rmsReportScaleScore.setSort();
rmsReportScaleScoreMapper.updateByPrimaryKeySelective(rmsReportScaleScore);
}
}
//查询排序
@ -319,35 +390,120 @@ public class RmsServiceImpl implements IRmsService {
if (CollUtil.isNotEmpty(qmsScales)) {
score.setSort(qmsScales.get(0).getSort());
}
}
}
//查询报告单信息和病人信息
RmsVo.ReportPatient reportPatient = rmsDao.queryReportResult(report.getId());
detail.setPatient(reportPatient);
detail.setScores(scores);
return detail;
}
@Override
public RmsVo.ReportDetail queryReport(RmsDto.QueryDetail dto) {
//根据测评id查找报告单
RmsReportExample reportExample = new RmsReportExample();
reportExample.createCriteria().andEvaluationIdEqualTo(dto.getEvaluationId()).andDelFlagEqualTo((byte) 0);
List<RmsReport> rmsReports = rmsReportMapper.selectByExample(reportExample);
if (CollUtil.isEmpty(rmsReports)) {
return queryReportDetail(dto);
}
RmsReport report = rmsReports.get(0);
RmsVo.ReportDetail detail = new RmsVo.ReportDetail();
//查询报告单信息和病人信息
RmsVo.ReportPatient reportPatient = rmsDao.queryReportResult(report.getId());
//删除延迟回忆
Object objects = redisUtil.get("message_" + dto.getEvaluationId());
if (objects != null) {
Set<MessageDto.QuestionInform> set = (Set<MessageDto.QuestionInform>) objects;
if (CollectionUtil.isNotEmpty(set)) {
MessageDto.QuestionInform questionInform = new MessageDto.QuestionInform();
questionInform.setQuestionId(0L);
boolean remove = set.remove(questionInform);
//查找患者做过的测评的最早和最晚的时间
RmsVo.PatientEvaluationTime time = new RmsVo.PatientEvaluationTime();
if (ObjectUtil.isNotNull(reportPatient)) {
time = rmsDao.getTimeByPatientId(reportPatient.getPatientId());
if (ObjectUtil.isNull(time)) {
time = new RmsVo.PatientEvaluationTime();
time.setMinTime(new Date());
time.setMaxTime(new Date());
}
// if (set.size() > 0) {
//list.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(MessageDto.QuestionInform::getQuestionId))), ArrayList::new));
// redisUtil.set("message_" + score.getPatientReportId(), set, 7200);
redisUtil.deleteObject("message_" + dto.getEvaluationId());
// }
}
// scores = scores.stream().sorted(Comparator.comparing(RmsVo.ReportScore::getSort)).collect(Collectors.toList());
//查询测评量表
List<RmsVo.ReportScore> scores = rmsDao.queryEmsScaleScore(dto.getEvaluationId(), CollectionUtil.newArrayList());
if (CollUtil.isNotEmpty(scores)) {
//组装成父子级关系
scores = buildReportScoreTree(scores, 0L);
}
detail.setPatient(reportPatient);
detail.setScores(scores);
return detail;
}
/**
* 添加肌少套餐结论
* 判断是否添加肌少总结论
* 如果四项测试有一项没做则跳过
*
* @param scores
* @return
*/
//
//
private String addJs(List<RmsVo.ReportScore> scores) {
//指定套餐才会触发,暂定写死套餐id
scores = scores.stream().filter(score -> score.getComboId() != null && score.getComboId() == 1982986055883821056L).collect(Collectors.toList());
if (CollUtil.isEmpty(scores)) {
return null;
}
String str = "";
List<RmsVo.ReportScore> sarcCalf = scores.stream().filter(
score -> score.getCode().equals("SARC-Calf")
).collect(Collectors.toList());
List<RmsVo.ReportScore> wczl = scores.stream().filter(
score -> score.getCode().equals("5CZLSY")
).collect(Collectors.toList());
List<RmsVo.ReportScore> szggj = scores.stream().filter(
score -> score.getCode().equals("SZGGJ")
).collect(Collectors.toList());
List<RmsVo.ReportScore> wlcd = scores.stream().filter(
score -> score.getCode().equals("WLCD")
).collect(Collectors.toList());
List<RmsVo.ReportScore> lmbs = scores.stream().filter(
score -> score.getCode().equals("LMBS")
).collect(Collectors.toList());
if (CollUtil.isNotEmpty(sarcCalf)) {
QmsScaleAssConf sarcCalfConf = amsDao.queryScaleAssConf1(sarcCalf.get(0).getCode(), sarcCalf.get(0).getScore(), null);
if (sarcCalfConf != null) {
str = sarcCalfConf.getResult();
}
}
if (CollUtil.isEmpty(wczl) || CollUtil.isEmpty(szggj) || CollUtil.isEmpty(wlcd) || CollUtil.isEmpty(lmbs)) {
return null;
}
QmsScaleAssConf wczlConf = amsDao.queryScaleAssConf1(wczl.get(0).getCode(), wczl.get(0).getScore(), null);
QmsScaleAssConf szggjConf = amsDao.queryScaleAssConf1(szggj.get(0).getCode(), szggj.get(0).getScore(), null);
QmsScaleAssConf wlcdConf = amsDao.queryScaleAssConf1(wlcd.get(0).getCode(), wlcd.get(0).getScore(), null);
QmsScaleAssConf lmbsConf = amsDao.queryScaleAssConf1(lmbs.get(0).getCode(), lmbs.get(0).getScore(), null);
if (wczlConf != null && szggjConf != null && wlcdConf != null && lmbsConf != null) {
// *四项测试结果都正常,说明没有肌少症风险
// *如果四肢骨骼肌身高质量指数(ASMI)正常,肌肉力量或(及)躯体功能下降,则有肌少症风险;
// *如果四项测试值全部低于标准值,则诊断为严重肌少症。
// *如果四肢骨骼肌身高质量指数(ASMI)低于标准值,肌肉力量或躯体功能其中有一项低于标准值,则诊断为肌少症;
// *否则有肌少症风险
if (!"1".equals(wczlConf.getNeedPlan()) && !"1".equals(szggjConf.getNeedPlan()) && !"1".equals(wlcdConf.getNeedPlan()) && !"1".equals(lmbsConf.getNeedPlan())) {
//没有肌少症风险
return StrUtil.isEmpty(str) ? "没有肌少症风险" : str + "\n" + "没有肌少症风险";
} else if (!"1".equals(szggjConf.getNeedPlan()) && "1".equals(wlcdConf.getNeedPlan()) && "1".equals(lmbsConf.getNeedPlan()) && "1".equals(wczlConf.getNeedPlan())) {
return StrUtil.isEmpty(str) ? "有肌少症风险" : str + "\n" + "有肌少症风险";
} else if ("1".equals(wczlConf.getNeedPlan()) && "1".equals(wlcdConf.getNeedPlan()) && "1".equals(lmbsConf.getNeedPlan()) && "1".equals(szggjConf.getNeedPlan())) {
return StrUtil.isEmpty(str) ? "严重肌少症" : str + "\n" + "严重肌少症";
} else if ("1".equals(szggjConf.getNeedPlan()) && ("1".equals(wlcdConf.getNeedPlan()) || "1".equals(lmbsConf.getNeedPlan()) || "1".equals(wczlConf.getNeedPlan()))) {
return StrUtil.isEmpty(str) ? "肌少症" : str + "\n" + "肌少症";
} else {
return StrUtil.isEmpty(str) ? "有肌少症风险" : str + "\n" + "有肌少症风险";
}
}
return null;
}
@Override
public ClientEvaVo.ReportView reportView(Long evaluationId, String code) {
ClientEvaVo.ReportView vo = clientEvaDao.getTzbsResult(evaluationId, code);
@ -796,9 +952,9 @@ public class RmsServiceImpl implements IRmsService {
// 记忆指数:自由回忆*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));
jiYi = getOrDefaultSafe(sortScoreMap,huiyi, zero).multiply(new BigDecimal(3))
.add(getOrDefaultSafe(sortScoreMap,fenlei, zero).multiply(new BigDecimal(2)))
.add(getOrDefaultSafe(sortScoreMap,duoxuan, zero));
}
RmsVo.ScoreDistribution jiYiScore = new RmsVo.ScoreDistribution("jiYi", "记忆指数", ObjectUtil.isNull(jiYi) ? BigDecimal.ZERO : jiYi);
cognitiveDomainList.add(jiYiScore);
@ -808,26 +964,26 @@ public class RmsServiceImpl implements IRmsService {
|| 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));
zhiXing = getOrDefaultSafe(sortScoreMap,lianxian, zero).add(getOrDefaultSafe(sortScoreMap,huazhong, zero))
.add(getOrDefaultSafe(sortScoreMap,shunbei, zero)).add(getOrDefaultSafe(sortScoreMap,daobei, zero))
.add(getOrDefaultSafe(sortScoreMap,jingjuexing, zero)).add(getOrDefaultSafe(sortScoreMap,jianfa, zero))
.add(getOrDefaultSafe(sortScoreMap,dongwu, zero)).add(getOrDefaultSafe(sortScoreMap,xiangsixing, zero));
}
RmsVo.ScoreDistribution zhiXingScore = new RmsVo.ScoreDistribution("zhiXing", "执行指数", ObjectUtil.isNull(zhiXing) ? BigDecimal.ZERO : zhiXing);
cognitiveDomainList.add(zhiXingScore);
// 视空间指数:立方体+画钟+命名 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));
kongJian = getOrDefaultSafe(sortScoreMap,lifangti, zero).add(getOrDefaultSafe(sortScoreMap,huazhong, zero))
.add(getOrDefaultSafe(sortScoreMap,mingming1, zero)).add(getOrDefaultSafe(sortScoreMap,mingming2, zero)).add(getOrDefaultSafe(sortScoreMap,mingming3, zero));
}
RmsVo.ScoreDistribution kongJianScore = new RmsVo.ScoreDistribution("kongJian", "视空间指数", ObjectUtil.isNull(kongJian) ? BigDecimal.ZERO : kongJian);
cognitiveDomainList.add(kongJianScore);
// 语言指数:命名+句子复述+词语流畅性 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(chongfu1, zero)).add(sortScoreMap.getOrDefault(chongfu2, zero)).add(sortScoreMap.getOrDefault(dongwu, zero));
yuYan = getOrDefaultSafe(sortScoreMap,mingming1, zero).add(getOrDefaultSafe(sortScoreMap,mingming2, zero)).add(getOrDefaultSafe(sortScoreMap,mingming3, zero))
.add(getOrDefaultSafe(sortScoreMap,chongfu1, zero)).add(getOrDefaultSafe(sortScoreMap,chongfu2, zero)).add(getOrDefaultSafe(sortScoreMap,dongwu, zero));
}
RmsVo.ScoreDistribution yuYanScore = new RmsVo.ScoreDistribution("yuYan", "语言指数", ObjectUtil.isNull(yuYan) ? BigDecimal.ZERO : yuYan);
cognitiveDomainList.add(yuYanScore);
@ -835,15 +991,15 @@ public class RmsServiceImpl implements IRmsService {
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));
zhuYi = getOrDefaultSafe(sortScoreMap,shunbei, zero).add(getOrDefaultSafe(sortScoreMap,daobei, zero)).add(getOrDefaultSafe(sortScoreMap,jingjuexing, zero))
.add(getOrDefaultSafe(sortScoreMap,jianfa, zero)).add(getOrDefaultSafe(sortScoreMap,chongfu1, zero)).add(getOrDefaultSafe(sortScoreMap,chongfu2, zero))
.add(getOrDefaultSafe(sortScoreMap,fushu1, zero)).add(getOrDefaultSafe(sortScoreMap,fushu2, zero));
}
RmsVo.ScoreDistribution zhuYiScore = new RmsVo.ScoreDistribution("zhuYi", "注意指数", ObjectUtil.isNull(zhuYi) ? BigDecimal.ZERO : zhuYi);
cognitiveDomainList.add(zhuYiScore);
// 定向指数:定向 0-6分
if (sortScoreMap.containsKey(shijian) || sortScoreMap.containsKey(didian)) {
dingXiang = sortScoreMap.getOrDefault(shijian, zero).add(sortScoreMap.getOrDefault(didian, zero));
dingXiang = getOrDefaultSafe(sortScoreMap,shijian, zero).add(getOrDefaultSafe(sortScoreMap,didian, zero));
}
RmsVo.ScoreDistribution dingXiangScore = new RmsVo.ScoreDistribution("dingXiang", "定向指数", ObjectUtil.isNull(dingXiang) ? BigDecimal.ZERO : dingXiang);
cognitiveDomainList.add(dingXiangScore);
@ -853,6 +1009,10 @@ public class RmsServiceImpl implements IRmsService {
return scoreDistributions;
}
public static <K, V> V getOrDefaultSafe(Map<K, V> map, K key, V defaultValue) {
return map.containsKey(key) && map.get(key) != null ? map.get(key) : defaultValue;
}
/**
* @param score
* @param educationalStatus 教育程度1文盲 2小学 3初中 4高中 5大学 6大学以上 7其他
@ -1050,6 +1210,11 @@ public class RmsServiceImpl implements IRmsService {
if ("TZBS_LN".equals(score.getCode()) || "TZBS_BZ".equals(score.getCode())) {
score.setSubReport(new ArrayList<>());
zytzbs(evaluationId, score);
ClientEvaVo.ReportView reportView = reportView(evaluationId, score.getCode());
if (reportView != null) {
score.setImpression(reportView.getResult());
score.setScore(reportView.getTotalScore());
}
}
});
return scores;
@ -2453,43 +2618,43 @@ public class RmsServiceImpl implements IRmsService {
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));
jiYi = getOrDefaultSafe(sortScoreMap,huiyi, zero).multiply(new BigDecimal(3))
.add(getOrDefaultSafe(sortScoreMap,fenlei, zero).multiply(new BigDecimal(2)))
.add(getOrDefaultSafe(sortScoreMap,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));
zhiXing = getOrDefaultSafe(sortScoreMap,lianxian, zero).add(getOrDefaultSafe(sortScoreMap,huazhong, zero))
.add(getOrDefaultSafe(sortScoreMap,shunbei, zero)).add(getOrDefaultSafe(sortScoreMap,daobei, zero))
.add(getOrDefaultSafe(sortScoreMap,jingjuexing, zero)).add(getOrDefaultSafe(sortScoreMap,jianfa, zero))
.add(getOrDefaultSafe(sortScoreMap,dongwu, zero)).add(getOrDefaultSafe(sortScoreMap,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));
kongJian = getOrDefaultSafe(sortScoreMap,lifangti, zero).add(getOrDefaultSafe(sortScoreMap,huazhong, zero))
.add(getOrDefaultSafe(sortScoreMap,mingming1, zero)).add(getOrDefaultSafe(sortScoreMap,mingming2, zero)).add(getOrDefaultSafe(sortScoreMap,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(chongfu1, zero)).add(sortScoreMap.getOrDefault(chongfu2, zero)).add(sortScoreMap.getOrDefault(dongwu, zero));
yuYan = getOrDefaultSafe(sortScoreMap,mingming1, zero).add(getOrDefaultSafe(sortScoreMap,mingming2, zero)).add(getOrDefaultSafe(sortScoreMap,mingming3, zero))
.add(getOrDefaultSafe(sortScoreMap,chongfu1, zero)).add(getOrDefaultSafe(sortScoreMap,chongfu2, zero)).add(getOrDefaultSafe(sortScoreMap,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));
zhuYi = getOrDefaultSafe(sortScoreMap,shunbei, zero).add(getOrDefaultSafe(sortScoreMap,daobei, zero)).add(getOrDefaultSafe(sortScoreMap,jingjuexing, zero))
.add(getOrDefaultSafe(sortScoreMap,jianfa, zero)).add(getOrDefaultSafe(sortScoreMap,chongfu1, zero)).add(getOrDefaultSafe(sortScoreMap,chongfu2, zero))
.add(getOrDefaultSafe(sortScoreMap,fushu1, zero)).add(getOrDefaultSafe(sortScoreMap,fushu2, zero));
}
// 定向指数:定向 0-6分
if (sortScoreMap.containsKey(shijian) || sortScoreMap.containsKey(didian)) {
dingXiang = sortScoreMap.getOrDefault(shijian, zero).add(sortScoreMap.getOrDefault(didian, zero));
dingXiang = getOrDefaultSafe(sortScoreMap,shijian, zero).add(getOrDefaultSafe(sortScoreMap,didian, zero));
}
PdfUtil.Row titleRow = new PdfUtil.Row();

5
ruisi_java/ruisi-web-client/src/main/resources/application-dev.yml

@ -11,7 +11,7 @@ spring:
# password: po3OynBO[M3579p6L7)o
url: jdbc:mysql://127.0.0.1:3306/ruisi_cga?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
password: q7510327
# 从库数据源
slave:
# 从数据源开关/默认关闭
@ -126,6 +126,5 @@ informed:
clientVersion: v1.8.3.0
# 医院id,不同医院部署的时候需要修改
hospitalId: 178
hospitalId: 174
generalPassword: cga123#

6
ruisi_java/ruisi-web-client/src/main/resources/application-prod.yml

@ -62,13 +62,13 @@ spring:
# redis 配置
redis:
# 地址
host: 172.16.21.24
host: localhost
# 端口,默认为6379
port: 26379
port: 6379
# 数据库索引
database: 1
# 密码
password: redis111^#
password: 123456
# 连接超时时间
timeout: 10s
lettuce:

5
ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/AmsDao.xml

@ -27,7 +27,9 @@
SELECT
qs.`code` AS scaleCode,
qs.`name` AS scaleName,
qs.total_score AS totalScore,
sum(q.score) as score,
esr.sort,
count( DISTINCT q.questionId ) AS totalNum,
count( DISTINCT q.answerQuestionId ) AS completedNum
FROM
@ -109,7 +111,8 @@
GROUP BY q.id
)qq
LEFT JOIN ams_patient_answer_score pas on (pas.question_id = qq.id or FIND_IN_SET(pas.question_id, qq.subList))
and pas.type IN ( 0, 2 ) and pas.del_flag = 0 and pas.evaluation_id = #{evaluationId}
and pas.type IN ( 0, 2 ) and pas.del_flag = 0 and score is not null and pas.evaluation_id = #{evaluationId}
-- 2026年3月2日09:56:55修改:score为空,不是已做的题目
WHERE
qq.scale_code = #{scaleCode}

98
ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/RmsDao.xml

@ -24,10 +24,10 @@
rr.remark,
rr.working_score as workingScore,
rr.initial_impression as initialImpression,
b.diagnosis_name as clinicalDiagnosis,
IFNULL(rr.clinical_diagnosis, b.diagnosis_name) as clinicalDiagnosis,
rr.pasi,
-- rr.department,
b.bed_number as bedNumber,
ifnull(rr.bed_number, b.bed_number) as bedNumber,
pp.`name` as patientName,
pp.patient_number as patientNumber,
b.outpatient_no as hospitalNumber,
@ -40,10 +40,11 @@
ee.hospital,
d.dept_name as hospitalName,
b.outpatient_no as outpatientNo,
b.department,
IFNULL(rr.department, b.department) as department,
b.doctor,
ee.version,
h.version AS versionName
h.version AS versionName,
pp.birthday
FROM
ems_evaluation ee
LEFT JOIN rms_report rr on ee.id = rr.evaluation_id
@ -86,7 +87,8 @@ group by ee.id
qs.remark,
qs.type AS type,
qs.parent_code,
qs.sort
qs.sort,
ecr.combo_id AS comboId
FROM qms_scale qs LEFT JOIN ems_evaluation_scale_relevance ecr ON ecr.scale_code = qs.`code`
WHERE
ecr.evaluation_id = #{evaluationId}
@ -105,7 +107,8 @@ group by ee.id
qcd.remark,
qcd.type,
qcd.parent_code,
qcd.sort
qcd.sort,
null as comboId
FROM t LEFT JOIN qms_cognitive_domain qcd on qcd.parent_code = t.CODE
WHERE
qcd.is_show = 1
@ -1743,4 +1746,87 @@ group by ee.id
group by code
order by sort
</select>
<select id="queryEmsScaleScore" resultType="com.ccsens.system.domain.vo.RmsVo$ReportScore">
WITH RECURSIVE cognitive_relevance_tree AS (
SELECT
r.id AS scale_id,
r.evaluation_id,
r.scale_code AS scale_code,
q.name as name,
q.description,
r.score AS level_score,
q.total_score AS total_score,
r.parent_id,
r.sort,
1 AS level
FROM ems_evaluation_scale_cognitive_relevance r
LEFT JOIN qms_scale q on r.scale_code = q.code
WHERE r.parent_id = 0 and r.del_flag = 0 and r.evaluation_id = #{evaluationId}
<if test="scaleCodeList != null and scaleCodeList.size()>0">
and scale_code in (
<foreach item="item" collection="scaleCodeList" index="index" open="(" separator="," close=")">
#{item}
</foreach>
)
</if>
UNION ALL
SELECT
child.id AS scale_id,
child.evaluation_id,
child.cognitive_code AS scale_code,
c.name,
c.description,
child.score AS level_score,
child.total_score AS total_score,
child.parent_id,
child.sort,
2 AS level
FROM ems_evaluation_scale_cognitive_relevance child
INNER JOIN cognitive_relevance_tree parent
ON child.parent_id = parent.scale_id
left join qms_cognitive_domain c on c.code = child.cognitive_code and c.parent_code = parent.scale_code
WHERE child.del_flag = 0
)
SELECT
rt.scale_id as scaleId,
rt.parent_id as parentId,
rt.name AS name,
rt.evaluation_id AS evaluationId,
rt.scale_code AS code,
rt.level_score AS score,
rt.sort as sort,
rt.total_score as totalScore,
r.combo_id as comboId
FROM cognitive_relevance_tree rt
left join ems_evaluation_scale_relevance r on r.evaluation_id = rt.evaluation_id and r.scale_code = rt.scale_code
group by rt.scale_code
ORDER BY rt.evaluation_id, rt.level, rt.sort
</select>
<select id="queryReportExportInfo" resultType="com.ccsens.system.domain.vo.RmsVo$ExportInfo">
SELECT
r.report_id as reportId,
r.scale_code as scaleCode,
r.score as score,
r.combo_id as comboId,
r.impression as impression,
r.need_plan as needPlan,
r.plan as plan,
r.sort as sort,
r.result as result,
r.scale_ass_conf as scaleAssConf,
q.name as scaleName,
h.`name` as comboName,
h1.name as comboParentName
FROM
rms_report rr
LEFT JOIN rms_report_scale_score r on rr.id = r.report_id and r.del_flag = 0
LEFT JOIN qms_scale q on r.scale_code = q.`code`
LEFT JOIN hms_combo h on h.id = r.combo_id
LEFT JOIN hms_combo h1 on h.parent_id = h1.id
WHERE
rr.del_flag = 0 and rr.evaluation_id = #{evaluationId}
</select>
</mapper>

338
web_admin/src/views/his/Evaluation/index.vue

@ -15,65 +15,73 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="测评师" prop="param.testerName">
<div style="width: 215px">
<el-input
v-model="queryParams.param.testerName"
placeholder="测评师"
clearable
<el-form-item label="评估师" prop="param.testerId">
<el-select
v-model="queryParams.param.testerId"
placeholder="请选择"
size="small"
@keyup.enter.native="handleQuery"
/>
</div>
clearable
filterable
>
<el-option
v-for="item in workloadList"
:key="item.userId"
:label="item.nickName"
:value="item.userId"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="医院" prop="param.hospitalId">
<el-form-item label="量表" prop="param.code">
<el-select
v-model="queryParams.hospitalId"
placeholder="请选择医院"
v-model="queryParams.param.code"
placeholder="请选择"
size="small"
clearable
filterable
>
<el-option label="医院1" value="0"></el-option>
<el-option label="医院2" value="1"></el-option>
<el-option label="医院3" value="2"></el-option>
<el-option
v-for="item in scaleList"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="科室" prop="departmentsId">
<div style="width: 215px">
<el-input
v-model="queryParams.departmentsId"
placeholder="科室"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</div>
</el-form-item> -->
<el-form-item label="测评状态" prop="param.completeStatus">
<el-form-item label="评估状态" prop="param.needPlan">
<el-select
v-model="queryParams.param.completeStatus"
placeholder="请选择测评状态"
v-model="queryParams.param.needPlan"
placeholder="请选择"
size="small"
clearable
>
<el-option label="未完成" :value="0"></el-option>
<el-option label="完成" :value="1"></el-option>
<el-option label="终止" :value="2"></el-option>
<el-option label="正常" value="0"></el-option>
<el-option label="异常" value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item label="测评时间" prop="param.beginTime">
<el-form-item label="科室" prop="param.deptId">
<treeselect
v-model="queryParams.param.deptId"
:options="deptOptions"
:show-count="true"
placeholder="请选择"
style="width: 220px"
/>
</el-form-item>
<el-form-item label="时间范围" prop="param.time">
<el-date-picker
v-model="queryParams.param.time"
type="datetimerange"
type="daterange"
size="small"
value-format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@ -88,39 +96,6 @@
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5" v-hasPermi="['tms:evaluation:remove']">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除
</el-button>
</el-col> -->
<el-col :span="1.5" v-hasPermi="['tms:evaluation:report']">
<el-button
type="primary"
plain
icon="el-icon-document"
:disabled="single"
size="mini"
@click="handleReport"
>查看测评报告
</el-button>
</el-col>
<el-col :span="1.5" v-hasPermi="['tms:evaluation:import']">
<el-button
type="warning"
plain
icon="el-icon-upload2"
size="mini"
:loading="exportLoading"
@click="handleImport"
>导入
</el-button>
</el-col>
<el-col :span="1.5" v-hasPermi="['tms:evaluation:export']">
<el-button
type="warning"
@ -132,17 +107,6 @@
>导出
</el-button>
</el-col>
<el-col :span="1.5" v-hasPermi="['tms:evaluation:export']">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExportCode"
>导出(指定量表)
</el-button>
</el-col>
</el-row>
<el-table
v-loading="loading"
@ -159,120 +123,64 @@
/>
<el-table-column label="序号" align="center" key="index" type="index" />
<el-table-column
label="评ID"
label="评ID"
align="center"
prop="evaluationId"
key="evaluationId"
minWidth="200"
></el-table-column>
<!-- <el-table-column
label="医院名称"
align="center"
prop="evaluationId"
key="evaluationId"
width="300"
></el-table-column> -->
<!-- <el-table-column
label="科室"
align="center"
prop="evaluationId"
key="evaluationId"
width="100"
></el-table-column> -->
<el-table-column
label="开单医生"
align="center"
prop="doctorName"
key="doctorName"
width="120"
></el-table-column>
<el-table-column
label="评师"
label="评估师"
align="center"
prop="testerName"
key="testerName"
width="120"
minWidth="120"
></el-table-column>
<el-table-column
label="患者姓名"
align="center"
prop="name"
key="name"
width="100"
minWidth="100"
></el-table-column>
<el-table-column
label="性别"
align="center"
prop="sex"
key="sex"
width="80"
minWidth="80"
>
<template slot-scope="scope">
{{ scope.row.sex == 0 ? "男" : "女" }}
</template>
</el-table-column>
<!-- <el-table-column
label="身份证"
<el-table-column
label="评估量表"
align="center"
prop="idCard"
key="idCard"
width="280"
></el-table-column> -->
prop="scaleName"
key="scaleName"
minWidth="150"
></el-table-column>
<el-table-column
label="评状态"
label="评状态"
align="center"
prop="completeStatus"
key="completeStatus"
prop="needPlan"
key="needPlan"
minWidth="120"
>
<template slot-scope="scope">
<el-tag v-if="scope.row.completeStatus == 0" type="info"
>未完成</el-tag
>
<el-tag v-if="scope.row.completeStatus == 1" type="success"
>完成</el-tag
>
<el-tag v-if="scope.row.completeStatus == 2" type="danger"
>中止</el-tag
>
<el-tag v-if="scope.row.needPlan == 0" type="success">正常</el-tag>
<el-tag v-if="scope.row.needPlan == 1" type="info">异常</el-tag>
</template>
</el-table-column>
<el-table-column
label="评时间"
label="评估时间"
align="center"
prop="evaluationTime"
key="evaluationTime"
width="200"
minWidth="200"
></el-table-column>
<el-table-column label="操作" align="center" width="280">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit-outline"
@click="handleInformed(scope.row)"
v-hasPermi="['tms:evaluation:informed']"
>
查看知情同意
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-document"
@click="handleReport(scope.row)"
v-hasPermi="['tms:evaluation:report']"
>
查看测评报告
</el-button>
<!-- <el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['tms:evaluation:remove']"
>
删除
</el-button> -->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
@ -326,16 +234,21 @@
let { apiUrl, proxyUrl } = require("@/config/settings");
import { careers, pasis } from "./ReportDetail/config.js";
import {
queryReportList,
queryReport,
queryReportDetail,
updateScaleInitialImpression,
exportReport,
} from "@/api/his/evaluation";
import scaleTable from "./ReportDetail/scaleTable.vue";
import { getScaleList } from "@/api/his/scale";
import { deptTreeSelect } from "@/api/system/user";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { userStatistics } from "@/views/index.js";
export default {
name: "Evaluation",
components: { scaleTable },
components: { scaleTable, Treeselect },
data() {
return {
//
@ -354,15 +267,13 @@ export default {
//
queryParams: {
param: {
searchValue: "",
testerId: "",
needPlan: "",
beginTime: "",
// departmentsId: null,
endTime: "",
// hospitalId: null,
scaleCode: "",
searchValue: "",
testerName: "",
patientId: "",
completeStatus: "",
code: "",
deptId: undefined,
},
pageNum: 1,
pageSize: 10,
@ -380,19 +291,43 @@ export default {
multiple: true,
//
exportLoading: false,
//
//
reportHistoryShow: false,
//
//
reportDetail: null,
isEdit: false,
scaleList: [],
deptOptions: [], //
workloadList: [], //
};
},
created() {
this.getList();
this.queryParams.param = {
...this.queryParams.param,
...this.$route.query,
};
this.getScaleLists();
this.getDeptTree();
this.getuserStatistics();
this.getList();
},
methods: {
//
getuserStatistics() {
userStatistics({}).then((res) => {
this.workloadList = res.data;
});
},
/** 获取科室数据 */
getDeptTree() {
deptTreeSelect().then((response) => {
this.deptOptions = response.data;
});
},
//
getScaleLists() {
getScaleList({}).then((res) => {
@ -406,11 +341,9 @@ export default {
},
/** 查询列表 */
getList() {
console.log("查询数据");
this.loading = true;
this.queryParams.param.patientId = "";
const query = this.$route.query;
console.log("query: ", query);
if (query && query.patientId) {
this.queryParams.param.patientId = query.patientId;
}
@ -418,7 +351,7 @@ export default {
this.queryParams.param.beginTime = this.queryParams.param.time[0];
this.queryParams.param.endTime = this.queryParams.param.time[1];
}
queryReportList(this.queryParams).then((res) => {
queryReport(this.queryParams).then((res) => {
console.log("res: ", res);
this.loading = false;
this.evaluationList = [...res.data.list];
@ -430,14 +363,13 @@ export default {
this.resetForm("queryForm");
this.queryParams = {
param: {
searchValue: "",
testerId: "",
needPlan: "",
beginTime: "",
// departmentsId: null,
endTime: "",
// hospitalId: null,
scaleCode: "",
searchValue: "",
testerName: "",
patientId: "",
code: "",
deptId: undefined,
},
};
this.handleQuery();
@ -456,14 +388,14 @@ export default {
window.open(apiUrl + proxyUrl + informedUrl);
this.$message.success("打开知情同意.pdf文件");
} else {
this.$message.warning("当前评报告暂无知情同意信息");
this.$message.warning("当前评报告暂无知情同意信息");
}
},
//
//
handleReport(row) {
this.getQueryReportDetail(row.evaluationId);
},
//
//
getQueryReportDetail(evaluationId) {
const param = {
evaluationId: evaluationId || this.ids[0],
@ -480,7 +412,7 @@ export default {
// this.$message.warning("");
// const ids = row.id || this.ids;
// this.$modal
// .confirm("")
// .confirm("")
// .then(function () {
// // return delReceivegoods(goodsIds);
// return true;
@ -534,10 +466,10 @@ export default {
this.queryParams.param;
let exportParam = {
param: {
beginTime, //
endTime, //
beginTime, //
endTime, //
searchValue, //
testerName, //
testerName, //
completeStatus,
evaluationIds: this.ids,
scaleCodes: this.codeForm.scaleCodes,
@ -549,47 +481,19 @@ export default {
{
...exportParam,
},
`评记录.xlsx`
`记录.xlsx`
);
}
});
},
//
handleExport() {
// const data = this.chooseData[0];
// const param = {
// evaluationId: data.evaluationId,
// reportId: data.reportId,
// scaleCode: data.scaleCode,
// signId: null,
// };
// exportReport(param).then((res) => {
// console.log("res: ", res);
// if (res.data.path) {
// window.open(apiUrl + proxyUrl + res.data.path);
// } else {
// this.$message.error("");
// }
// });
let { beginTime, endTime, searchValue, testerName, completeStatus } =
this.queryParams.param;
let exportParam = {
param: {
beginTime, //
endTime, //
searchValue, //
testerName, //
completeStatus,
},
};
this.download1(
"export/exportLdPatient",
"/rms/exportEvaluation",
{
...exportParam,
...this.queryParams,
},
`测评记录.xlsx`
`测评管理_${new Date().getTime()}.xlsx`
);
},
},

Loading…
Cancel
Save