浏览代码

1、术语关联映射-非标准词包含禁用词
2、术语关联映射-国药准字匹配

zhaops 3 年之前
父节点
当前提交
10ecc8e251

+ 14 - 0
cdssman-service/src/main/java/com/diagbot/client/CdssClient.java

@@ -70,6 +70,20 @@ public interface CdssClient {
     RespDTO<List<MappingConfigWrapper>> precDataMatch_remote(@RequestPart("file") MultipartFile file,
                                                              @RequestParam("type") Integer type);
 
+    /**
+     * 数据导入校验
+     *
+     * @param file
+     * @param hospitalId
+     * @param type
+     * @param userId
+     */
+    @PostMapping(value = "/tran/mappingConfig/importExcelDataVerify", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    RespDTO<Boolean> importExcelDataVerify(@RequestPart("file") MultipartFile file,
+                                 @RequestParam("hospitalId") Long hospitalId,
+                                 @RequestParam("type") Integer type,
+                                 @RequestParam("uesrId") String userId);
+
     /**
      * 数据导入
      *

+ 9 - 0
cdssman-service/src/main/java/com/diagbot/client/hystrix/CdssHystrix.java

@@ -53,6 +53,15 @@ public class CdssHystrix implements CdssClient {
         return null;
     }
 
+    @Override
+    public RespDTO<Boolean> importExcelDataVerify(@RequestPart("file") MultipartFile file,
+                                           @RequestParam("hospitalId") Long hospitalId,
+                                           @RequestParam("type") Integer type,
+                                           @RequestParam("uesrId") String userId){
+        log.error("【hystrix】调用{}异常", "importExcelDataVerify");
+        return null;
+    }
+
     @Override
     public RespDTO<Boolean> importExcel(@RequestPart("file") MultipartFile file,
                                         @RequestParam("hospitalId") Long hospitalId,

+ 12 - 0
cdssman-service/src/main/java/com/diagbot/dto/IndexBatchDTO.java

@@ -16,4 +16,16 @@ public class IndexBatchDTO {
     private String code;
     private String synonyms;
     private Integer type;
+    /**
+     * 国药准字
+     */
+    private String approval;
+    /**
+     * 药品剂型
+     */
+    private String form;
+    /**
+     * 药品剂型id
+     */
+    private Long formConceptId;
 }

+ 6 - 60
cdssman-service/src/main/java/com/diagbot/entity/DrugConfig.java

@@ -1,15 +1,10 @@
 package com.diagbot.entity;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
-import com.baomidou.mybatisplus.annotation.FieldStrategy;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.diagbot.util.StringUtil;
-import lombok.Getter;
-import lombok.Setter;
+import lombok.Data;
 
 import javax.validation.constraints.NotBlank;
 import java.util.Date;
-import java.util.Objects;
 
 /**
  * <p>
@@ -19,8 +14,7 @@ import java.util.Objects;
  * @author zhaops
  * @since 2020-07-28
  */
-@Getter
-@Setter
+@Data
 public class DrugConfig {
     /**
      * 主键
@@ -80,68 +74,20 @@ public class DrugConfig {
      * 剂型
      */
     @Excel(name = "药品剂型", width = 60, orderNum = "3", isImportField = "true")
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
     private String form;
 
+    @Excel(name = "国药准字", width = 40, orderNum = "4", isImportField = "true")
+    private String approval;
 
     /**
      * 是否匹配(0-未匹配、1-已匹配)
      */
-    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "5", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
     private Integer isMatch;
 
     /**
      * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
      */
-    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词】", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
+    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词】", width = 20, orderNum = "6", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "国药准字_6", "数据迁移_99", "_null" }, isImportField = "true")
     private Integer source;
-
-    @Override
-    public String toString() {
-        return "DrugConfig{" +
-                "id=" + id +
-                ", isDeleted=" + isDeleted +
-                ", gmtCreate=" + gmtCreate +
-                ", gmtModified=" + gmtModified +
-                ", creator=" + creator +
-                ", modifier=" + modifier +
-                ", hospitalId=" + hospitalId +
-                ", hisName=" + hisName +
-                ", uniqueName=" + uniqueName +
-                ", code=" + code +
-                ", form=" + form +
-                "}";
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) {
-            return true;
-        }
-        if (o == null || getClass() != o.getClass()) {
-            return false;
-        }
-        DrugConfig drugConfig = (DrugConfig) o;
-        return Objects.equals(id, drugConfig.id)
-                && Objects.equals(isDeleted, drugConfig.isDeleted)
-                && Objects.equals(hospitalId, drugConfig.hospitalId)
-                && Objects.equals(hisName, drugConfig.hisName)
-                && Objects.equals(form, drugConfig.form)
-                && Objects.equals(uniqueName, drugConfig.uniqueName)
-                && Objects.equals(code, drugConfig.code);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(id, isDeleted, hospitalId, hisName, form, uniqueName, code);
-    }
-
-    public static boolean nonNull(DrugConfig o) {
-        return !(o == null
-                || (o.hospitalId == null
-                && StringUtil.isBlank(o.hisName)
-                && StringUtil.isBlank(o.uniqueName)
-                && StringUtil.isBlank(o.code)
-                && StringUtil.isBlank(o.form)));
-    }
 }

+ 6 - 21
cdssman-service/src/main/java/com/diagbot/entity/wrapper/MappingConfigWrapper.java

@@ -18,32 +18,17 @@ public class MappingConfigWrapper extends MappingConfig {
     private String uniqueName;
     private String form;
     private String code;
-
-   /* @Override
-    public boolean equals(Object o) {
-        if (this == o) {
-            return true;
-        }
-        if (o == null || getClass() != o.getClass()) {
-            return false;
-        }
-        MappingConfigWrapper mappingConfigWrapper = (MappingConfigWrapper) o;
-        return super.equals(o)
-                && Objects.equals(uniqueName, mappingConfigWrapper.uniqueName)
-                && Objects.equals(form, mappingConfigWrapper.form)
-                && Objects.equals(code, mappingConfigWrapper.code);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(uniqueName, form, code) + super.hashCode();
-    }*/
+    /**
+     * 国药准字
+     */
+    private String approval;
 
     public static boolean nonNull(MappingConfigWrapper o) {
         return !(o == null
                 || (StringUtil.isBlank(o.uniqueName)
                 && StringUtil.isBlank(o.form)
-                && StringUtil.isBlank(o.code)))
+                && StringUtil.isBlank(o.code)
+                && StringUtil.isBlank(o.approval)))
                 || MappingConfig.nonNull(o);
     }
 }

+ 18 - 0
cdssman-service/src/main/java/com/diagbot/facade/MappingConfigFacade.java

@@ -238,6 +238,24 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
         }
     }
 
+    /**
+     * 数据导入校验
+     *
+     * @param file
+     * @param hospitalId
+     * @param type
+     */
+    public Boolean importExcelDataVerify(MultipartFile file, Long hospitalId, Integer type, String userId) {
+        if (StringUtil.isBlank(userId)) {
+            userId = UserUtils.getCurrentPrincipleID();
+        }
+        RespDTO<Boolean> respDTO = cdssClient.importExcelDataVerify(file, hospitalId, type, userId);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            return respDTO.data;
+        } else {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
+        }
+    }
 
     /**
      * 数据导入

+ 15 - 0
cdssman-service/src/main/java/com/diagbot/web/MappingConfigController.java

@@ -72,6 +72,21 @@ public class MappingConfigController {
         mappingConfigFacade.precDataMatch(file, type, response);
     }
 
+    @ApiOperation(value = "数据导入校验[by:zhaops]",
+            notes = "file(必填):导入文件 <br>" +
+                    "hospitalId(必填):医院id <br>" +
+                    "uesrId(必填):操作人id <br>" +
+                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉 <br>")
+    @PostMapping(value = "/importExcelDataVerify", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    @SysLogger("importExcelDataVerify")
+    public RespDTO<Boolean> importExcelDataVerify(@RequestParam("file") MultipartFile file,
+                                        @RequestParam("hospitalId") Long hospitalId,
+                                        @RequestParam("type") Integer type,
+                                        @RequestParam("uesrId") String userId) {
+        Boolean data = mappingConfigFacade.importExcelDataVerify(file, hospitalId, type, userId);
+        return RespDTO.onSuc(data);
+    }
+
     @ApiOperation(value = "数据导入[by:zhaops]",
             notes = "file(必填):导入文件 <br>" +
                     "hospitalId(必填):医院id <br>" +