Browse Source

cdss对应接口异常统一处理,病历数据块对比接口优化

songxinlu 3 years ago
parent
commit
93181b6bc4

+ 15 - 9
daqe-center/src/main/java/com/lantone/daqe/facade/BlockLossManagementFacade.java

@@ -275,7 +275,6 @@ public class BlockLossManagementFacade {
             compareHisWithLog(medicalRecords, behospitalCodeLogs, LossTypeEnum.CODE_LOSS.getKey(), outAuditedResultCodes, outInserts, hisMedicalRecordMap, hospitalId, principleId, dataUps);
 
             flag = blocklossResultServiceImpl.saveBatch(outInserts);
-            System.out.println("...");
         }
 
         //日志与入库数据对比
@@ -295,16 +294,23 @@ public class BlockLossManagementFacade {
             Long finalPrincipleId = principleId;
             Long finalHospitalId = hospitalId;
             dataUps.stream().forEach(data -> {
-                blocklossResultFacade.update(new UpdateWrapper<BlocklossResult>()
-                        .set("gmt_modified", DateUtil.now())
+                UpdateWrapper<BlocklossResult> updateWrapper = new UpdateWrapper<>();
+                updateWrapper.set("gmt_modified", DateUtil.now())
                         .set("modifier", finalPrincipleId != null ? finalPrincipleId + "" : "0")
-                        .eq(StringUtil.isNotBlank(data.getRecId()), "rec_id", data.getRecId())
                         .notIn("is_audited", LossIsAuditedEnum.NOT_AUDITED.getKey())
-                        .eq("behospital_code", data.getBehospitalCode())
+                        .eq(StringUtil.isNotBlank(data.getRecId()),"rec_id",data.getRecId())
                         .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .ge(dataCompareVO.getStartDate() != null, "behospital_date", dataCompareVO.getStartDate())
-                        .le(dataCompareVO.getEndDate() != null, "behospital_date", dataCompareVO.getEndDate())
-                        .eq(finalHospitalId != null, "hospital_id", finalHospitalId));
+                        .eq("behospital_code",data.getBehospitalCode())
+                        .ge(dataCompareVO.getStartDate() != null && StringUtil.isBlank(dataCompareVO.getBehospitalCode()), "behospital_date", dataCompareVO.getStartDate())
+                        .le(dataCompareVO.getEndDate() != null && StringUtil.isBlank(dataCompareVO.getBehospitalCode()), "behospital_date", dataCompareVO.getEndDate())
+                        .eq(finalHospitalId != null, "hospital_id", finalHospitalId);
+                //更新病案首页或文书
+                if(StringUtil.isNotBlank(data.getRecId())){
+                    updateWrapper.notIn("loss_type", LossTypeEnum.CODE_LOSS.getKey());
+                }else {//更新病历
+                    updateWrapper.eq("loss_type",LossTypeEnum.CODE_LOSS.getKey());
+                }
+                blocklossResultFacade.update(updateWrapper);
             });
         }
 
@@ -648,7 +654,7 @@ public class BlockLossManagementFacade {
                             //更新人工操作记录(核查的)的时间
                             GetOperationLogDTO temp = new GetOperationLogDTO();
                             temp.setBehospitalCode(medicalRecord.getBehospitalCode());
-                            temp.setHomePageId(medicalRecord.getHomePageId());
+                            temp.setRecId(medicalRecord.getHomePageId());
                             dataUps.add(temp);
                         }
                     }

+ 26 - 0
mdsp-service/src/main/java/com/lantone/exception/MdspExceptionHandler.java

@@ -0,0 +1,26 @@
+package com.lantone.exception;
+
+import com.diagbot.exception.CommonException;
+import com.lantone.common.api.CommonResult;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+/**
+ * @Description: mdsp全局异常处理
+ * @author: rengb
+ * @time: 2021/1/5 18:27
+ */
+@ControllerAdvice
+public class MdspExceptionHandler {
+
+    @ResponseBody
+    @ExceptionHandler(value = CommonException.class)
+    public CommonResult handleValidException(CommonException e) {
+        if (e.getErrorCode() != null) {
+            return CommonResult.failed(e.getMessage());
+        }
+        return CommonResult.failed(e.getMessage());
+    }
+
+}

+ 11 - 0
security-center/src/main/resources/upgrade/V3__emrais_字典表添加cdss和质控医院映射关系.sql

@@ -0,0 +1,11 @@
+-- ----------------------------
+-- Table structure for sys_notice
+-- ----------------------------
+use `emrais`;
+
+INSERT INTO `sys_dictionary_info` (`group_type`, `name`, `val`, `status`, `return_type`, `order_no`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `remark`) VALUES ('53', '1', '1', '1', '0', NULL, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', NULL);
+INSERT INTO `sys_dictionary_info` (`group_type`, `name`, `val`, `status`, `return_type`, `order_no`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `remark`) VALUES ('53', '2', '2', '1', '0', NULL, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', NULL);
+INSERT INTO `sys_dictionary_info` (`group_type`, `name`, `val`, `status`, `return_type`, `order_no`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `remark`) VALUES ('53', '3', '3', '1', '0', NULL, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', NULL);
+INSERT INTO `sys_dictionary_info` (`group_type`, `name`, `val`, `status`, `return_type`, `order_no`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `remark`) VALUES ('53', '4', '4', '1', '0', NULL, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', NULL);
+INSERT INTO `sys_dictionary_info` (`group_type`, `name`, `val`, `status`, `return_type`, `order_no`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `remark`) VALUES ('53', '5', '5', '1', '0', NULL, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', NULL);
+INSERT INTO `sys_dictionary_info` (`group_type`, `name`, `val`, `status`, `return_type`, `order_no`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `remark`) VALUES ('53', '14', '6', '1', '0', NULL, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', NULL);