Browse Source

修改测评列表和评估量表统计

master-admin
zhangye 2 weeks ago
parent
commit
1fa7cc2891
  1. 10
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/dto/RmsDto.java
  2. 5
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/vo/RmsVo.java
  3. 11
      ruisi_java/ruisi-system/src/main/resources/mapper/dao/StatisticsDao.xml
  4. 107
      ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/PmsPatientServiceImpl.java
  5. 2
      ruisi_java/ruisi-web-admin/src/main/resources/application-dev.yml
  6. 34
      ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/RmsDao.xml
  7. 6
      ruisi_java/ruisi-web-client/src/main/resources/application-dev.yml
  8. 6
      ruisi_java/ruisi-web-client/src/main/resources/application-prod.yml
  9. 3
      web_admin/vue.config.js

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

@ -270,12 +270,20 @@ public class RmsDto {
@Data
public static class ReportQuery {
@ApiModelProperty("量表code")
private String code;
private Long version;
@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;
}
}

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

@ -141,8 +141,9 @@ public class RmsVo {
@Data
public static class Report{
private Long id;
private String doctorName;
@ApiModelProperty("测评ID")
private Long evaluationId;
private String testerName;
private Long patientId;

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

@ -337,12 +337,13 @@
qs.code AS code,
qs.name AS name,
IFNULL(COUNT(ees.evaluation_id), 0) AS num
FROM qms_scale qs
LEFT JOIN ems_evaluation_scale_relevance ees ON qs.code = ees.scale_code AND ees.del_flag = 0
LEFT JOIN ums_user u ON ees.create_by = u.user_name AND u.del_flag = 0
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
<if test="dto.deptId != null">
AND u.dept_id = #{dto.deptId}
</if>
@ -352,7 +353,7 @@
<if test="dto.endTime != null">
AND ees.create_time &lt;= #{dto.endTime}
</if>
GROUP BY qs.code, qs.name
GROUP BY ees.scale_code
ORDER BY num DESC
</select>

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

@ -213,7 +213,6 @@ public class PmsPatientServiceImpl implements IPmsPatientService {
// // Map转JSONObject
// jsonObject = (JSONObject) JSON.toJSON(model);
// }
<<<<<<< HEAD
//
// //验证就诊号是否为空
// String visitNo = jsonObject.getString("outpatientNo");
@ -221,112 +220,6 @@ public class PmsPatientServiceImpl implements IPmsPatientService {
// visitNo = jsonObject.getString("visitNo");
// if (StrUtil.isEmpty(visitNo)) {
// throw new ServiceException("就诊号不能为空");
=======
//验证就诊号是否为空
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);
}
}
// 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());
>>>>>>> 7f1337fe87bf2c423681022fdc02c6f2c702adc1
// }
// }
// //验证患者id是否为空

2
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

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

@ -1448,13 +1448,15 @@ d.dept_name as hospitalName
<select id="queryReport" resultType="com.ccsens.system.domain.vo.RmsVo$Report">
select
e.id,
e.doctor_name as doctorName,
e.id as evaluationId,
e.doctor_name as testerName,
e.patient_id as patientId,
pp.name as name,
e.patient_idcard as patientIdcard,
e.patient_age as patientAge,
e.tester_id as testerId,
e.serial_number as serialNumber,
e.check_time as checkTime,
e.check_time as evaluationTime,
e.remark,
e.hospital,
e.complete_status as completeStatus,
@ -1471,24 +1473,40 @@ d.dept_name as hospitalName
ud.dept_name as deptName
from
ems_evaluation e
left join ems_evaluation_scale_relevance r on e.id = r.evaluation_id
left join ems_evaluation_scale_relevance r on e.id = r.evaluation_id AND e.del_flag = 0
left join qms_scale s on r.scale_code = s.code
left join rms_report rr on rr.evaluation_id = e.id
left join rms_report_scale_score rs on rs.report_id = rr.id
left join ums_user u on u.user_id = e.tester_id
left join ums_user u on u.user_id = e.tester_id AND u.del_flag = 0
left join ums_dept ud on ud.dept_id = u.dept_id
left join pms_patient pp on pp.id = e.patient_id
where e.del_flag = 0
<if test="dto.code != null and dto.code != ''">
and r.scale_code = #{dto.code}
</if>
<if test="dto.beginTime != null and dto.beginTime != ''">
and e.create_time between #{dto.beginTime} and #{dto.endTime}
AND e.create_time >= #{dto.beginTime}
</if>
<if test="dto.endTime != null and dto.endTime != ''">
AND e.create_time &lt;= #{dto.endTime}
</if>
<if test="dto.deptId != null">
and ud.dept_Id = #{dto.deptId}
AND u.dept_id = #{dto.deptId}
</if>
<if test="dto.version != null">
and rr.version = #{dto.version}
<if test="dto.needPlan != null">
and rs.need_plan = #{dto.needPlan}
</if>
<if test="dto.testerId != null">
and ee.tester_id = #{dto.testerId}
</if>
<if test="dto.searchValue != null and dto.searchValue != ''">
and (
pp.name like CONCAT('%',#{dto.searchValue},'%')
or
pp.phone like CONCAT('%',LOWER(#{dto.searchValue}),'%')
or
pp.idcard like CONCAT('%',#{dto.searchValue},'%')
)
</if>
group by r.id
</select>

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

@ -123,4 +123,8 @@ informed:
#clientVersion: v1.1.0
#clientVersion: v1.8.1.0
#clientVersion: v1.8.2.0
clientVersion: v1.8.3.0
clientVersion: v1.8.3.0
# 医院id,不同医院部署的时候需要修改
hospitalId: 174
generalPassword: cga123#

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

@ -114,4 +114,8 @@ informed:
#clientVersion: v1.6.8
#clientVersion: v1.8.1.0
#clientVersion: v1.8.2.0
clientVersion: v1.8.3.0
clientVersion: v1.8.3.0
# 医院id,不同医院部署的时候需要修改
hospitalId: 174
generalPassword: cga123#

3
web_admin/vue.config.js

@ -36,10 +36,9 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// target: `http://localhost:8080`,
target: `http://localhost:19330`,
// target: "https://nnzjpt.ylinno.com/ruisiCgaAdmin/",
// target: "https://www.ylinno.com/cga/v2/api/admin/",
target: "http://113.45.159.249:59001/cga/v2/api/admin/",
changeOrigin: true,
pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "",

Loading…
Cancel
Save