Procházet zdrojové kódy

Merge remote-tracking branch 'origin/dev/20200522temp' into dev/20200522temp

gaodm před 5 roky
rodič
revize
f4e3dc18d0

+ 59 - 1
doc/005.20200528v1.2.x/qc_init.sql

@@ -5,4 +5,62 @@ use `qc`;
 ALTER TABLE `med_qcresult_detail` ADD COLUMN `grade_type` tinyint(4) DEFAULT '1' COMMENT '初始类型(1:机器,2:人工)' AFTER `is_reject`;
 ALTER TABLE `med_qcresult_detail` ADD COLUMN `opt_type` tinyint(4) DEFAULT '1' COMMENT '操作类型(1:新增,2:删除,3:修改)' AFTER `grade_type`;
 
-UPDATE `sys_permission` SET `is_deleted` = 'Y' WHERE `id` = '10';
+UPDATE `sys_permission` SET `is_deleted` = 'Y' WHERE `id` = '10';
+
+update `sys_dictionary_info` set is_deleted = 'N' where group_type = 12 and `name` = '病案首页';
+DROP TABLE IF EXISTS `qc_mode`;
+CREATE TABLE `qc_mode` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `name` varchar(128) DEFAULT NULL COMMENT '数据模块名称',
+  `order_no` int(11) DEFAULT '1' COMMENT '排序号',
+  `parent_id` bigint(20) DEFAULT NULL COMMENT '上级模块',
+  `is_deleted` char(3) DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+  `gmt_modified` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(60) DEFAULT '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(60) DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8 COMMENT='数据模块表';
+
+INSERT INTO `qc_mode` VALUES ('1', '入院记录', '2', '-1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('2', '首次病程录', '10', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('3', '死亡病例讨论记录', '40', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('4', '查房记录', '20', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('5', '出院小结', '800', '-1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('6', '病案首页', '1', '-1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('7', '会诊记录', '170', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('8', '医嘱信息', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('9', '交接班记录', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('10', '输血/血制品病程记录', '130', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('11', '术前讨论、术前小结', '50', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('12', '麻醉记录', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('13', '麻醉知情同意书', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('14', '麻醉术前访视记录', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('15', '麻醉术后访视记录', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('16', '手术知情同意书', '80', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('17', '手术记录', '60', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('18', '术后首次病程及谈话记录', '70', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('19', '疑难病例讨论记录', '30', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('20', '手术风险评估表', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('21', '手术安全核查表', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('22', '抢救记录', '90', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('23', '危急值记录', '100', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('24', '死亡记录', '250', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('25', '病危通知书', '120', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('26', '转入记录', '190', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('27', '转出记录', '200', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('28', '阶段小结', '110', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('29', '病重通知书', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('30', '会诊申请单', '150', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('31', '会诊结果单', '160', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('32', '输血后效果评价', '140', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('33', '专科交接单', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('34', '转科记录', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('35', '病理检验送检单', '180', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('36', '自定义病程记录', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('37', '病程信息', '3', '-1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('52', '授权知情同意书', '500', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('53', '知情同意书', '260', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('54', '谈话告知书', '270', '37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);
+INSERT INTO `qc_mode` VALUES ('55', '其他', '999', '-1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', null);

+ 34 - 0
src/main/java/com/diagbot/dto/MedicalRecordDTO.java

@@ -0,0 +1,34 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-04-13
+ */
+@Data
+public class MedicalRecordDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 模块id
+     */
+    private Long modeId;
+
+    /**
+     * 病历标题
+     */
+    private String recTitle;
+
+    /**
+     * 病历日期
+     */
+    private String recDate;
+}

+ 4 - 0
src/main/java/com/diagbot/dto/MsgDTO.java

@@ -27,6 +27,10 @@ public class MsgDTO {
     private String info;
     //标准提示信息
     private String standardMsg;
+    // 操作类型(1:新增,2:删除,3:修改)
+    private Integer optType;
+    // 初始类型(1:机器,2:人工)
+    private Integer gradeType;
     //单项否决
     private String isReject;
     //模块名称

+ 5 - 0
src/main/java/com/diagbot/entity/MedicalRecord.java

@@ -45,6 +45,11 @@ public class MedicalRecord implements Serializable {
      */
     private String recTypeId;
 
+    /**
+     * 模块id
+     */
+    private Long modeId;
+
     /**
      * 病历日期
      */

+ 15 - 0
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -10,6 +10,7 @@ import com.diagbot.dto.AnalyzeDTO;
 import com.diagbot.dto.AnalyzeRunDTO;
 import com.diagbot.dto.BehosDTO;
 import com.diagbot.dto.BehospitalInfoDTO;
+import com.diagbot.dto.MedicalRecordDTO;
 import com.diagbot.dto.MsgApiDTO;
 import com.diagbot.dto.MsgDTO;
 import com.diagbot.dto.OutputInfo;
@@ -25,6 +26,7 @@ import com.diagbot.entity.DoctorAdvice;
 import com.diagbot.entity.HomeDiagnoseInfo;
 import com.diagbot.entity.HomeOperationInfo;
 import com.diagbot.entity.HomePage;
+import com.diagbot.entity.MedicalRecord;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
@@ -372,6 +374,19 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
         //保存
         Map<String, Object> pageMap = outputInfo.getPageData();
+        // 手动拼接数据【知情同意书】【谈话告知书】
+        List<MedicalRecord> recordList = medicalRecordFacade.list(new QueryWrapper<MedicalRecord>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("behospital_code", analyzeVO.getBehospitalCode())
+                .eq("hospital_id", hospitalId)
+                .in("mode_id", Arrays.asList(53, 54))
+                .orderByAsc("rec_date")
+        );
+        List<MedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(recordList, MedicalRecordDTO.class);
+        Map<Long, List<MedicalRecordDTO>> recordMap = EntityUtil.makeEntityListMap(medicalRecordDTOList, "modeId");
+        pageMap.put("知情同意书", recordMap.get(53L));
+        pageMap.put("谈话告知书", recordMap.get(54L));
+
         String pageData = JSON.toJSONString(pageMap);
         // 获取菜单信息
         List<QcModeDTO> qcModeDTOList = qcModeFacade.getMenu(pageMap);

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

@@ -36,7 +36,7 @@ public class QcModeFacade extends QcModeServiceImpl {
 
         for (int i = 0; i < qcModeList.size(); i++) {
             String key = qcModeList.get(i).getName();
-            if (!pageData.containsKey(qcModeList.get(i).getName()) && !"病程信息".equals(key)) {
+            if (!pageData.containsKey(key) && !"病程信息".equals(key)) {
                 qcModeList.remove(i--);
             }
         }

+ 2 - 1
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -92,7 +92,8 @@
 
     <select id="getMsg" resultType="com.diagbot.dto.MsgDTO">
         SELECT 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
+        a.cases_id cases_id, d.score cases_score,b.id model_id, a.name standard_msg,
+        c.opt_type, c.grade_type
         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