chengyao 3 лет назад
Родитель
Сommit
6d422b5560

+ 26 - 6
doc/037.20211117_2.1.3/qc_initv2.1.3.sql

@@ -1,6 +1,7 @@
 
 use `qc`;
 -- 执行前请看注意事项!
+DROP TABLE IF EXISTS `med_qcresult_click`;
 CREATE TABLE `med_click_info` (
   `id` int(20) NOT NULL AUTO_INCREMENT,
   `hospital_id` tinyint(5) DEFAULT '0' COMMENT '医院ID',
@@ -20,9 +21,32 @@ CREATE TABLE `med_click_info` (
   KEY `qcresult_info_id` (`qcresult_info_id`) USING BTREE
 ) ENGINE=InnoDB AUTO_INCREMENT=37918 DEFAULT CHARSET=utf8 COMMENT='临床医生点击质控病历次数基本表';
 
+DROP TABLE IF EXISTS `med_qcresult_click`;
+CREATE TABLE `med_qcresult_click` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `hospital_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '医院ID',
+  `behospital_code` varchar(16) NOT NULL COMMENT '病人住院ID',
+  `dept_id` varchar(16) DEFAULT NULL COMMENT '住院科室ID',
+  `dept_name` varchar(64) DEFAULT NULL COMMENT '住院科室名称',
+  `doctor_id` varchar(16) DEFAULT '' COMMENT '主治医生ID',
+  `doctor_name` varchar(50) DEFAULT '' COMMENT '主治医生姓名',
+  `qcresult_info_id` bigint(20) NOT NULL COMMENT '评分结果id',
+  `cases_entry_ids` varchar(1024) DEFAULT '0' COMMENT '触发埋点病历质控缺陷id集',
+  `is_deleted` char(3) DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime DEFAULT '1970-01-01 12:00:00' COMMENT ' 记录创建时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=8586 DEFAULT CHARSET=utf8 COMMENT='全病历质控、单模块质控(触发埋点)缺陷详情';
+
+
+/**
+med_qcresult_detail表新增评分结果主表id字段
+ */
+ALTER TABLE `med_qcresult_detail` ADD COLUMN qcresult_info_id BIGINT (20) DEFAULT NULL COMMENT '评分结果id' AFTER `behospital_code`;
 
-ALTER TABLE `med_qcresult_cases` ADD   `qcresult_info_id`  bigint(20) DEFAULT NULL COMMENT '评分结果id' AFTER `hospital_id`;
-ALTER TABLE `med_qcresult_detail` ADD   `qcresult_info_id`  bigint(20) DEFAULT NULL COMMENT '评分结果id' AFTER `hospital_id`;
+/**
+med_qcresult_cases表新增评分结果主表id字段
+ */
+ALTER TABLE `med_qcresult_cases` ADD COLUMN qcresult_info_id BIGINT (20) DEFAULT NULL COMMENT '评分结果id' AFTER `behospital_code`;
 
 --全院
 INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '数据分析', '-1', 'YH-SJFX', '1', '1', '12', '用户-数据分析');
@@ -48,16 +72,12 @@ INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creat
 INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '数据分析(科室)', '-1', 'YH-SJFXKS', '1', '1', '13', '用户-数据分析(科室)');
 SET @idks =@@identity;
 
-INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '临床质控使用统计', @idks , 'YH-KSZR-LCZKSYTJ', '1', '1', '1', '用户-质控科-临床质控使用统计(科室)');
-SET @idksSec =@@identity;
 INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '条目缺陷改善统计', @idks , 'YH-KSZR-TMQXGSTJ', '1', '1', '2', '用户-质控科-条目缺陷改善统计(科室)');
 SET @idksThr =@@identity;
 
 INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @idks, NULL);
 INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '2', @idks, NULL);
 
-INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @idksSec, NULL);
-INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '2', @idksSec, NULL);
 
 INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @idksThr, NULL);
 INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '2', @idksThr, NULL);

+ 1 - 1
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -1734,7 +1734,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
             algorithmDTO = (AlgorithmDTO) resMap.get("algorithmDTO");
         }
 
-        List<MsgDTO> msgDTOList = getMsg(analyzeVO);
+        List<MsgDTO> msgDTOList = this.getBaseMapper().getForeignMsg(analyzeVO);
         if (ListUtil.isNotEmpty(msgDTOList)) {
             msgDTOList.forEach(msgDTO -> {
                 if (StringUtils.isNotEmpty(msgDTO.getInfo()) && StringUtils.isNotEmpty(msgDTO.getInfo().trim()) &&

+ 1 - 0
src/main/java/com/diagbot/facade/DataAnalysisFacade.java

@@ -134,6 +134,7 @@ public class DataAnalysisFacade {
             }
             medQcresultClick.setQcresultInfoId(qcresultInfo.getId());
             medQcresultClick.setCasesEntryIds(sbFir.toString());
+            medQcresultClick.setGmtCreate(new Date());
             medQcresultClickService.save(medQcresultClick);
         }
         return true;

+ 1 - 0
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -24,6 +24,7 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
     public IPage<BehospitalInfoDTO> getPage(BehospitalPageVO behospitalPageVO);
 
     public List<MsgDTO> getMsg(AnalyzeVO analyzeVO);
+    public List<MsgDTO> getForeignMsg(AnalyzeVO analyzeVO);
 
     public List<MsgDTO> getMsgByEntryCode(AnalyzeCodeVO analyzeCodeVO);
 

+ 20 - 0
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -698,6 +698,26 @@
         LEFT JOIN sys_user u  on u.id = a.modifier  and u.is_deleted = 'N'
     </select>
 
+    <select id="getForeignMsg" resultType="com.diagbot.dto.MsgDTO">
+        SELECT a.*, u.linkman
+        FROM
+        (
+        SELECT DISTINCT b.`name` model_name,c.score,c.msg,c.cases_entry_id,c.is_reject,c.id id,c.info, a.cases_id cases_id, d.score cases_score,
+        b.id model_id, a.name standard_msg, c.opt_type, c.grade_type,
+         c.gmt_create, c.gmt_modified, c.modifier,c.is_deleted,c.explain_info as explainInfo,
+        a.type, a.drgs
+        FROM
+        `qc_cases_entry` a, qc_mode b, med_qcresult_detail c, qc_cases_hospital d
+        where a.is_deleted = 'N' and b.is_deleted = 'N' and c.is_deleted = 'N' and d.is_deleted = 'N'
+        and a.id = c.cases_entry_id and a.mode_id = b.id
+        AND c.cases_id = d.cases_id and c.hospital_id = d.hospital_id
+        and c.hospital_id = #{hospitalId}
+        and c.behospital_code = #{behospitalCode}
+        order by b.order_no, c.grade_type desc, a.order_no) a
+        LEFT JOIN sys_user u  on u.id = a.modifier  and u.is_deleted = 'N'
+    </select>
+
+